.os-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.os-header.is-scrolled,
body:not(.home) .os-header {
    background: rgba(255, 255, 255, 0.96);
    border-bottom-color: rgba(23, 36, 43, 0.08);
    box-shadow: 0 10px 28px rgba(23, 36, 43, 0.07);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.os-header__inner {
    width: min(1472px, calc(100% - 80px));
    min-height: 96px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.os-brand {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    color: var(--os-text);
    text-decoration: none;
}

.os-brand__text {
    display: block;
    font-family: var(--os-font-primary);
    font-size: clamp(21px, 1.7vw, 30px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.3em;
    white-space: nowrap;
}

.os-brand__logo {
    display: block;
    width: auto;
    max-width: 320px;
    max-height: 58px;
    object-fit: contain;
}

.os-nav {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.os-menu {
    display: flex;
    align-items: center;
    gap: clamp(25px, 2.1vw, 42px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.os-menu > li {
    position: relative;
    margin: 0;
    padding: 0;
}

.os-menu > li > a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--os-text);
    font-family: var(--os-font-primary);
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.os-menu > li:not(:last-child) > a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -13px;
    left: 0;
    height: 1px;
    background: currentColor;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: center;
    transition: opacity 160ms ease, transform 160ms ease;
}

.os-menu > li:not(:last-child) > a:hover::after,
.os-menu > li:not(:last-child) > a:focus-visible::after,
.os-menu > li.current-menu-item:not(:last-child) > a::after,
.os-menu > li.current_page_item:not(:last-child) > a::after,
.os-menu > li.current-menu-ancestor:not(:last-child) > a::after {
    opacity: 1;
    transform: scaleX(1);
}

.os-menu > li:last-child {
    margin-left: 4px;
}

.os-menu > li:last-child > a {
    min-width: 126px;
    min-height: 54px;
    padding: 16px 25px;
    color: #ffffff;
    background: var(--os-blue);
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.os-menu > li:last-child > a:hover,
.os-menu > li:last-child > a:focus-visible {
    color: #ffffff;
    background: var(--os-blue-dark);
    border-color: rgba(255, 255, 255, 0.65);
}

.os-nav-toggle {
    display: none;
    width: 46px;
    height: 46px;
    padding: 10px;
    color: var(--os-text);
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 0;
    cursor: pointer;
}

.os-nav-toggle__line {
    display: block;
    width: 100%;
    height: 2px;
    margin: 5px 0;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
}

@media (max-width: 1100px) {
    .os-header__inner {
        width: calc(100% - 48px);
        min-height: 88px;
        gap: 24px;
    }

    .os-brand__text {
        font-size: 22px;
    }

    .os-menu {
        gap: 24px;
    }

    .os-menu > li > a {
        font-size: 14px;
    }

    .os-menu > li:last-child > a {
        min-width: 112px;
        min-height: 50px;
        padding: 14px 20px;
    }
}

@media (max-width: 860px) {
    .os-header,
    .home .os-header:not(.is-scrolled) {
        background: rgba(255, 255, 255, 0.96);
        border-bottom-color: rgba(23, 36, 43, 0.08);
        box-shadow: 0 10px 28px rgba(23, 36, 43, 0.07);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .os-header__inner {
        position: relative;
        width: calc(100% - 32px);
        min-height: 78px;
    }

    .os-brand__text {
        font-size: 18px;
        letter-spacing: 0.24em;
    }

    .os-brand__logo {
        max-width: 220px;
        max-height: 44px;
    }

    .os-nav-toggle {
        display: block;
        flex: 0 0 auto;
        position: relative;
        z-index: 1002;
    }

    .os-nav {
        position: fixed;
        inset: 0;
        z-index: 1001;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 110px 28px 40px;
        background: var(--os-soft-2);
    }

    .os-nav.is-open {
        display: flex;
    }

    .os-menu {
        width: min(420px, 100%);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .os-menu > li {
        width: 100%;
        border-bottom: 1px solid rgba(23, 36, 43, 0.1);
    }

    .os-menu > li > a {
        width: 100%;
        min-height: 58px;
        justify-content: flex-start;
        padding: 16px 4px;
        color: var(--os-text);
        font-size: 19px;
    }

    .os-menu > li:not(:last-child) > a::after {
        display: none;
    }

    .os-menu > li:last-child {
        margin: 24px 0 0;
        border-bottom: 0;
    }

    .os-menu > li:last-child > a {
        min-height: 58px;
        justify-content: center;
        color: #ffffff;
        font-size: 16px;
    }

    .os-nav-toggle[aria-expanded="true"] .os-nav-toggle__line:nth-of-type(2) {
        transform: translateY(7px) rotate(45deg);
    }

    .os-nav-toggle[aria-expanded="true"] .os-nav-toggle__line:nth-of-type(3) {
        opacity: 0;
    }

    .os-nav-toggle[aria-expanded="true"] .os-nav-toggle__line:nth-of-type(4) {
        transform: translateY(-7px) rotate(-45deg);
    }
}
