.site-header {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 50;
    color: var(--brand-navy-deep);
}

.header-topline-bar {
    width: 100%;
    border-bottom: 1px solid rgba(10, 34, 54, 0.08);
    background: rgba(255, 255, 255, 0.98);
}

.header-nav {
    position: fixed;
    top: var(--header-topline-height, 46px);
    right: 0;
    left: 0;
    z-index: 20;
    border-bottom: 1px solid transparent;
    background: transparent;
    box-shadow: none;
    transition: transform 0.28s ease, top 0.28s ease, background-color 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.header-nav.is-hidden {
    transform: translateY(-100%);
}

.header-nav.is-scrolled {
    top: 0;
    border-bottom-color: var(--nav-scrolled-border);
    background: #ffffff;
    box-shadow: 0 16px 34px rgba(9, 25, 43, 0.12);
}

.header-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 52px;
}

.header-contact,
.header-social,
.header-social-links,
.desktop-nav {
    display: flex;
    align-items: center;
}

.header-contact,
.header-social,
.header-social-links {
    flex-wrap: wrap;
    gap: 12px;
}

.header-contact {
    flex: 1 1 auto;
    color: rgba(10, 34, 54, 0.62);
    font-size: 12px;
    font-weight: 600;
}

.header-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.2s ease;
}

.header-contact-link:hover {
    color: var(--brand-navy-deep);
}

.header-contact-icon,
.header-social-icon {
    width: 16px;
    height: 16px;
}

.header-social {
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 14px;
}

.header-social-links {
    gap: 10px;
}

.header-social-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(10, 34, 54, 0.08);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.52);
    color: var(--brand-navy-deep);
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.header-social-item:hover {
    border-color: rgba(10, 34, 54, 0.14);
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-1px);
}

.theme-toggle,
.mobile-nav-toggle {
    border: 1px solid rgba(10, 34, 54, 0.08);
    background: rgba(255, 255, 255, 0.52);
    color: var(--brand-navy-deep);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 36px;
    padding: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
    border-color: rgba(10, 34, 54, 0.14);
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-1px);
}

.theme-toggle-track {
    position: relative;
    width: 34px;
    height: 18px;
    border-radius: 999px;
    background: rgba(10, 34, 54, 0.16);
    transition: background-color 0.2s ease;
}

.theme-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--brand-white);
    color: var(--brand-navy-deep);
    box-shadow: 0 6px 14px rgba(10, 34, 54, 0.18);
    transition: transform 0.22s ease, background-color 0.22s ease, color 0.22s ease;
}

.theme-toggle-thumb-icon {
    position: absolute;
    width: 10px;
    height: 10px;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

:root[data-theme="light"] .theme-toggle-thumb-sun,
:root[data-theme="dark"] .theme-toggle-thumb-moon {
    opacity: 1;
    transform: scale(1);
}

:root[data-theme="dark"] .theme-toggle-track {
    background: rgba(255, 255, 255, 0.28);
}

:root[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(16px);
    background: #ffffff;
    color: #0a2236;
}

.theme-toggle:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(18, 58, 90, 0.18);
}

.header-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 22px;
    min-height: 76px;
}

.brand-block {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    filter:
        drop-shadow(0 0 10px rgba(255, 255, 255, 0.32))
        drop-shadow(0 10px 20px rgba(3, 15, 29, 0.22));
    transition: transform 0.25s ease, filter 0.25s ease;
}

.brand-block:hover .brand-logo {
    transform: translateY(-1px);
}

.brand-name {
    color: var(--brand-navy-deep);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.brand-subtitle {
    margin-top: 4px;
    color: rgba(10, 34, 54, 0.56);
    font-size: 12px;
    font-weight: 500;
}

.desktop-nav {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 2px;
}

.nav-link {
    padding: 10px 13px;
    border-radius: 999px;
    color: rgba(10, 34, 54, 0.82);
    font-size: 12px;
    font-weight: 650;
    text-transform: uppercase;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.header-nav.is-scrolled .nav-link:hover {
    background: rgba(10, 34, 54, 0.06);
    color: var(--brand-navy-deep);
    transform: translateY(-1px);
}

.nav-login-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: 6px;
    border: 1px solid rgba(10, 34, 54, 0.08);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.52);
    color: var(--brand-navy-deep);
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.nav-login-link:hover,
.header-nav.is-scrolled .nav-login-link:hover {
    border-color: rgba(10, 34, 54, 0.14);
    background: rgba(255, 255, 255, 0.92);
    color: var(--brand-navy-deep);
    transform: translateY(-1px);
}

.nav-login-icon {
    width: 18px;
    height: 18px;
}

.nav-link.is-active {
    position: relative;
    color: var(--brand-navy-deep);
}

.nav-link.is-active::after {
    content: "";
    position: absolute;
    right: 14px;
    bottom: 6px;
    left: 14px;
    height: 2px;
    border-radius: 999px;
    background: var(--brand-gold);
}

.nav-link-accent {
    border: 1px solid rgba(10, 34, 54, 0.08);
    background: rgba(255, 255, 255, 0.42);
}

.mobile-nav {
    display: none;
    position: relative;
}

.mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    min-width: 118px;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 999px;
    font-weight: 650;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.mobile-nav-toggle::-webkit-details-marker {
    display: none;
}

.mobile-nav-text {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mobile-nav-icon {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 18px;
    height: 18px;
}

.mobile-nav-icon span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease, width 0.2s ease;
}

.mobile-nav[open] .mobile-nav-toggle {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(10, 34, 54, 0.14);
}

.mobile-nav[open] .mobile-nav-icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.mobile-nav[open] .mobile-nav-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-nav[open] .mobile-nav-icon span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.mobile-nav-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    width: min(360px, calc(100vw - 24px));
    padding: 18px;
    border: 1px solid rgba(10, 34, 54, 0.08);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 40px rgba(10, 34, 54, 0.12);
    backdrop-filter: blur(16px);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    padding: 0 16px;
    border: 0;
    border-radius: 16px;
    background: rgba(10, 34, 54, 0.03);
    color: rgba(10, 34, 54, 0.82);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.mobile-nav-link:hover {
    background: rgba(10, 34, 54, 0.06);
    transform: translateX(2px);
}

.mobile-nav-link.is-active {
    position: relative;
    color: var(--brand-navy-deep);
}

.mobile-nav-link.is-active::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--brand-gold);
    transform: translateY(-50%);
}

.mobile-nav-link-arrow {
    color: rgba(10, 34, 54, 0.38);
    font-size: 16px;
    line-height: 1;
    transition: transform 0.2s ease, color 0.2s ease;
}

.mobile-nav-link:hover .mobile-nav-link-arrow {
    color: var(--brand-navy-deep);
    transform: rotate(45deg);
}

@media (max-width: 1023px) {
    .site-header {
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        z-index: 30;
    }

    .header-topline-bar {
        background: rgba(255, 255, 255, 0.98);
    }

    .header-nav {
        position: fixed;
        top: var(--header-topline-height, 46px);
        right: 0;
        left: 0;
        z-index: 40;
        background: transparent;
    }

    .header-topline {
        display: grid;
        grid-template-columns: 1fr;
        min-height: auto;
        padding: 10px 0 12px;
        align-items: center;
        justify-items: center;
        gap: 10px;
    }

    .header-contact {
        width: 100%;
        min-width: 0;
        justify-content: center;
        gap: 8px 14px;
        font-size: 11px;
        flex-wrap: wrap;
    }

    .header-contact-link {
        gap: 6px;
        white-space: nowrap;
    }

    .header-contact-icon {
        width: 14px;
        height: 14px;
    }

    .header-social {
        width: 100%;
        align-items: center;
        justify-content: center;
        gap: 10px 12px;
        flex-wrap: wrap;
    }

    .header-social-links {
        justify-content: center;
    }

    .header-social-item {
        width: 32px;
        height: 32px;
    }

    .header-social-icon {
        width: 15px;
        height: 15px;
    }

    .theme-toggle {
        width: 52px;
        height: 32px;
    }

    .theme-toggle-track {
        width: 32px;
        height: 17px;
    }

    .theme-toggle-thumb {
        width: 13px;
        height: 13px;
    }

    :root[data-theme="dark"] .theme-toggle-thumb {
        transform: translateX(15px);
    }

    .header-main {
        min-height: 68px;
        gap: 12px;
    }

    .brand-block {
        gap: 12px;
    }

    .brand-logo {
        width: 38px;
        height: 38px;
    }

    .brand-name {
        font-size: 12px;
    }

    .brand-subtitle {
        margin-top: 2px;
        font-size: 10px;
    }
}

@media (max-width: 767px) {
    .header-topline {
        display: grid;
        grid-template-columns: 1fr;
        align-items: center;
        justify-items: center;
        gap: 10px;
        padding: 10px 0 12px;
    }

    .header-contact {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 8px 14px;
        font-size: 10px;
        text-align: center;
    }

    .header-contact-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.3;
    }

    .mobile-nav-toggle {
        min-width: 104px;
        min-height: 42px;
        padding: 0 14px;
    }

    .mobile-nav-text {
        font-size: 11px;
    }

    .header-social {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 12px;
    }

    .header-social-links {
        gap: 10px;
    }

    .header-social-item,
    .theme-toggle {
        margin: 0;
    }

    .theme-toggle {
        width: 74px;
    }

    .header-main {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        min-height: 72px;
    }

    .brand-block {
        min-width: 0;
        gap: 10px;
    }

    .brand-logo {
        width: 44px;
        height: 44px;
        flex: 0 0 auto;
    }

    .brand-block > div {
        min-width: 0;
    }

    .brand-name {
        font-size: 11px;
        line-height: 1.2;
    }

    .brand-subtitle {
        margin-top: 4px;
        font-size: 10px;
        line-height: 1.25;
    }

    .mobile-nav-panel {
        right: 0;
        left: auto;
        top: calc(100% + 10px);
        padding: 14px;
        border-radius: 18px;
    }
}

@media (max-width: 479px) {
    .theme-toggle {
        width: 52px;
    }

    .header-main {
        gap: 8px;
    }

    .brand-name {
        font-size: 10px;
    }

    .brand-subtitle {
        font-size: 9px;
    }
}

:root[data-theme="dark"] .mobile-nav-panel {
    border-color: rgba(159, 209, 235, 0.14);
    background: rgba(7, 21, 33, 0.96);
    box-shadow: var(--shadow-strong);
}

:root[data-theme="dark"] .header-contact {
    color: rgba(236, 244, 249, 0.82);
}

:root[data-theme="dark"] .header-contact-link:hover {
    color: #ffffff;
}

:root[data-theme="dark"] .header-social-item,
:root[data-theme="dark"] .theme-toggle {
    border-color: rgba(159, 209, 235, 0.18);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .header-social-item:hover,
:root[data-theme="dark"] .theme-toggle:hover {
    border-color: rgba(159, 209, 235, 0.28);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

:root[data-theme="dark"] .mobile-nav[open] .mobile-nav-toggle {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(159, 209, 235, 0.14);
}

:root[data-theme="dark"] .header-topline {
    background: transparent;
}

:root[data-theme="dark"] .header-topline-bar {
    border-bottom-color: rgba(159, 209, 235, 0.12);
    background: rgba(7, 21, 33, 0.98);
}

:root[data-theme="dark"] .header-nav {
    border-bottom-color: transparent;
    background: transparent;
    box-shadow: none;
}

@media (max-width: 1023px) {
    :root[data-theme="dark"] .header-nav {
        background: transparent;
    }
}

:root[data-theme="dark"] .header-nav.is-scrolled {
    background: rgba(7, 21, 33, 0.98);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .mobile-nav-link {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.86);
}

:root[data-theme="dark"] .mobile-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .mobile-nav-link.is-active {
    color: #ffffff;
}

:root[data-theme="dark"] .mobile-nav-link-arrow {
    color: rgba(255, 255, 255, 0.4);
}

:root[data-theme="dark"] .mobile-nav-link:hover .mobile-nav-link-arrow {
    color: #ffffff;
}
