.site-header {
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    width: 100%;
    height: 94px;
    background: transparent;
    transition: background .25s ease, backdrop-filter .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.site-header.scrolled {
    background: rgba(255, 255, 255, .76);
    border-bottom: 1px solid rgba(7, 27, 69, .08);
    box-shadow: 0 10px 34px rgba(7, 27, 69, .08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

html.dark-mode .site-header.scrolled {
    background: rgba(2, 8, 23, .76);
    border-bottom-color: rgba(255, 255, 255, .08);
    box-shadow: 0 10px 34px rgba(0, 0, 0, .34);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-logo {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
}

.site-logo img {
    width: 165px;
    height: auto;
}

.logo-dark {
    display: none;
}

html.dark-mode .logo-light {
    display: none;
}

html.dark-mode .logo-dark {
    display: block;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(12px, 1.5vw, 24px);
}

.main-nav a {
    position: relative;
    padding-bottom: 9px;
    color: var(--blue-dark);
    font-size: 15px;
    line-height: 1.4;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: .92;
    transition: color .25s ease;
}

.main-nav a::after {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    border-radius: 999px;
    background: rgba(80, 170, 255, .95);
    box-shadow: 0 0 6px rgba(80, 170, 255, .45);
    content: "";
    opacity: 0;
    transform: translateX(-50%);
    transition: width .25s ease, opacity .25s ease;
}

.main-nav a.active,
.main-nav a:hover {
    color: var(--blue);
}

.main-nav a.active::after,
.main-nav a:hover::after {
    width: 100%;
    opacity: 1;
}

html.dark-mode .main-nav a {
    color: rgba(255, 255, 255, .82);
}

html.dark-mode .main-nav a.active,
html.dark-mode .main-nav a:hover {
    color: var(--white);
}

.theme-toggle {
    position: relative;
    display: flex;
    flex: 0 0 78px;
    align-items: center;
    justify-content: space-between;
    width: 78px;
    height: 40px;
    padding: 4px;
    border: 1px solid rgba(6, 27, 70, .1);
    border-radius: 999px;
    background: rgba(6, 27, 70, .08);
    cursor: pointer;
}

.toggle-ball {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
    transition: left .28s ease, background .28s ease;
}

.toggle-icon {
    position: relative;
    z-index: 2;
    width: 30px;
    height: 30px;
    padding: 7px;
    object-fit: contain;
    pointer-events: none;
}

.moon {
    transform: translateX(2px);
}

html.dark-mode .theme-toggle {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .12);
}

html.dark-mode .toggle-ball {
    left: 44px;
    background: linear-gradient(135deg, #0b5cff, var(--blue));
}

.menu-toggle,
.mobile-menu {
    display: none;
}

@media (max-width: 1180px) {
    .site-logo img {
        width: 145px;
    }

    .main-nav a {
        font-size: 11px;
    }
}

@media (max-width: 980px) {
    .site-header,
    .header-inner {
        height: 78px;
    }

    .main-nav {
        display: none;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        order: 2;
        width: 44px;
        height: 44px;
        border: 0;
        background: transparent;
        color: var(--blue-dark);
        font-size: 29px;
        line-height: 1;
        cursor: pointer;
    }

    html.dark-mode .menu-toggle {
        color: var(--white);
    }

    .theme-toggle {
        order: 3;
        flex-basis: 68px;
        width: 68px;
        height: 44px;
    }

    .toggle-ball {
        top: 7px;
        width: 28px;
        height: 28px;
    }

    .toggle-icon {
        width: 28px;
        height: 28px;
        padding: 6px;
    }

    html.dark-mode .toggle-ball {
        left: 36px;
    }

    .mobile-menu {
        position: fixed;
        z-index: 99;
        top: 78px;
        left: 0;
        display: block;
        width: 100%;
        height: calc(100dvh - 78px);
        padding: 28px 24px;
        overflow-y: auto;
        visibility: hidden;
        background: rgba(255, 255, 255, .97);
        opacity: 0;
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        transform: translateY(-10px);
        transition: opacity var(--transition-standard), transform var(--transition-standard), visibility var(--transition-standard);
    }

    html.dark-mode .mobile-menu {
        background: rgba(2, 8, 23, .97);
    }

    .mobile-menu.active {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
    }

    .mobile-nav {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .mobile-nav a {
        min-height: 44px;
        padding: 10px 0;
        color: var(--blue-dark);
        font-size: 18px;
        font-weight: 700;
        text-transform: uppercase;
    }

    html.dark-mode .mobile-nav a {
        color: var(--white);
    }

    .mobile-nav a.active {
        color: var(--blue);
    }
}

@media (max-width: 700px) {
    .site-logo img {
        width: 132px;
    }

    .header-inner {
        gap: 10px;
    }
}

@media (max-width: 420px) {
    .site-logo img {
        width: 116px;
    }

    .theme-toggle {
        flex-basis: 62px;
        width: 62px;
    }

    html.dark-mode .toggle-ball {
        left: 30px;
    }
}
