:root {
    --nav-text: #1d2838;
    --nav-text-soft: rgba(29, 40, 56, 0.78);
    --nav-text-dim: rgba(29, 40, 56, 0.58);

    --nav-bg: rgba(255, 255, 255, 0.34);
    --nav-bg-strong: rgba(255, 255, 255, 0.42);
    --nav-stroke: rgba(255, 255, 255, 0.55);
    --nav-stroke-soft: rgba(255, 255, 255, 0.36);
    --nav-shadow: 0 24px 48px -34px rgba(24, 34, 52, 0.35);
    --brand-blue: #163b8c;
    --brand-blue-deep: #102b68;
    --brand-blue-glow: rgba(22, 59, 140, 0.35);

}

.nav-header {
    position: sticky;
    top: 12px;
    z-index: 60;
    margin-bottom: 18px;
    transition: transform 0.32s ease, opacity 0.26s ease;
    will-change: transform;
}

.nav-header.is-hidden {
    transform: translateY(calc(-100% - 16px));
    opacity: 0.98;
    pointer-events: none;
}

.nav-shell {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 16px;
    min-height: 68px;
    padding: 8px 12px 8px 14px;
    border-radius: 24px;
    border: 1px solid var(--nav-stroke-soft);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.18) 44%, rgba(255, 255, 255, 0.08) 100%),
        linear-gradient(180deg, rgba(246, 249, 255, 0.24) 0%, rgba(232, 238, 248, 0.16) 100%),
        var(--nav-bg);
    backdrop-filter: blur(30px) saturate(140%) contrast(108%);
    -webkit-backdrop-filter: blur(30px) saturate(140%) contrast(108%);
    box-shadow:
        var(--nav-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.25);
    overflow: hidden;
    isolation: isolate;
}

.nav-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background:
        linear-gradient(112deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.3) 42%, rgba(255, 255, 255, 0.07) 72%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.05));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.nav-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.06) 30%, transparent 48%),
        radial-gradient(72% 90% at 12% -14%, rgba(255, 255, 255, 0.32), transparent 62%),
        radial-gradient(54% 70% at 88% 118%, rgba(255, 255, 255, 0.2), transparent 64%);
    pointer-events: none;
}

.brand-block {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;
    padding-right: 4px;
    z-index: 1;
}

.logo {
    width: clamp(88px, 7vw, 116px);
    height: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 8px 14px rgba(20, 29, 44, 0.16));
    transition: transform 0.22s ease, opacity 0.22s ease, filter 0.22s ease;
}

.brand-block:hover .logo,
.brand-block:focus-visible .logo {
    transform: translateY(-1px);
    filter: drop-shadow(0 10px 16px rgba(20, 29, 44, 0.22));
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.44);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.34);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.22s ease, background 0.22s ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.64);
    background: rgba(255, 255, 255, 0.5);
}

.nav-toggle span {
    width: 17px;
    height: 2px;
    border-radius: 999px;
    background: #1f2938;
    transition: transform 0.24s ease, opacity 0.22s ease;
}

.nav-panel {
    min-width: 0;
}

.nav-panel-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.nav-main {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: 5px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.26);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(255, 255, 255, 0.3);
    flex-wrap: wrap;
}

.nav-main a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--nav-text-soft);
    font-size: 14px;
    font-weight: 620;
    letter-spacing: -0.01em;
    transition:
        color 0.22s ease,
        transform 0.22s ease,
        background 0.22s ease,
        box-shadow 0.22s ease;
    isolation: isolate;
    overflow: hidden;
}

.nav-main a:hover,
.nav-main a:focus-visible {
    color: #0f1d32;
    transform: translateY(-1px);
}

.nav-main a.is-active {
    color: #0f1e34;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 255, 0.9));
    box-shadow:
        0 10px 18px -14px rgba(51, 65, 89, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.nav-main a:not(.is-active)::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.45);
    opacity: 0;
    transform: scale(0.985);
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: -1;
}

.nav-main a:not(.is-active):hover::before,
.nav-main a:not(.is-active):focus-visible::before {
    opacity: 1;
    transform: scale(1);
}

.nav-main a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.4px;
    opacity: 0;
    background: conic-gradient(from 0deg, rgba(22, 59, 140, 0.85), rgba(86, 132, 238, 0.85), rgba(22, 59, 140, 0.85));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.nav-main a:hover::after,
.nav-main a:focus-visible::after {
    opacity: 1;
    animation: nav-hover-ring 1.05s linear infinite;
}

@keyframes nav-hover-ring {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-secondary,
.nav-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 650;
    letter-spacing: -0.01em;
    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        background 0.22s ease,
        color 0.22s ease,
        box-shadow 0.22s ease;
}

.nav-secondary {
    color: var(--brand-blue);
    border: 1.5px solid rgba(22, 59, 140, 0.62);
    background: rgba(255, 255, 255, 0.64);
}

.nav-secondary:hover,
.nav-secondary:focus-visible {
    transform: translateY(-1px);
    color: var(--brand-blue-deep);
    border-color: rgba(22, 59, 140, 0.86);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 0 0 1px rgba(22, 59, 140, 0.18), 0 0 22px -6px var(--brand-blue-glow);
}

.nav-cta {
    color: #ffffff;
    border: 1.5px solid rgba(22, 59, 140, 0.8);
    background: linear-gradient(180deg, var(--brand-blue), var(--brand-blue-deep));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        0 10px 20px -16px rgba(16, 43, 104, 0.55);
}

.nav-cta:hover,
.nav-cta:focus-visible {
    transform: translateY(-1px);
    color: #ffffff;
    border-color: rgba(22, 59, 140, 1);
    background: linear-gradient(180deg, #1b46a7, #14377f);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 0 0 1px rgba(22, 59, 140, 0.2),
        0 0 28px -6px var(--brand-blue-glow);
}

@media (max-width: 1400px) {
    .nav-main a {
        padding: 0 14px;
        font-size: 13.5px;
    }

    .nav-secondary,
    .nav-cta {
        padding: 0 16px;
        font-size: 13.5px;
    }
}

@media (max-width: 1180px) {
    .nav-shell {
        grid-template-columns: auto 42px;
        min-height: 62px;
        padding: 9px 10px 9px 12px;
        gap: 12px;
        border-radius: 20px;
    }

    .nav-toggle {
        display: inline-flex;
        justify-self: end;
    }

    .nav-panel {
        grid-column: 1 / -1;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transform: translateY(-8px);
        transition: max-height 0.34s ease, opacity 0.24s ease, transform 0.28s ease;
    }

    .nav-header.is-open .nav-panel {
        max-height: 760px;
        opacity: 1;
        transform: translateY(0);
    }

    .nav-header.is-open .nav-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-header.is-open .nav-toggle span:nth-child(2) {
        opacity: 0;
    }

    .nav-header.is-open .nav-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-panel-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding-top: 10px;
    }

    .nav-main {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 7px;
        border-radius: 18px;
    }

    .nav-main a {
        justify-content: flex-start;
        width: 100%;
        min-height: 44px;
        padding: 0 14px;
        border-radius: 13px;
    }

    .nav-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    .nav-secondary,
    .nav-cta {
        width: 100%;
        min-height: 44px;
    }
}

@media (max-width: 820px) {
    .nav-header {
        top: 10px;
    }

    .logo {
        width: 96px;
    }
}

@media (max-width: 640px) {
    .nav-header {
        top: 8px;
        margin-bottom: 14px;
    }

    .nav-shell {
        min-height: 58px;
        padding: 8px 9px 8px 10px;
        gap: 10px;
        border-radius: 18px;
    }

    .logo {
        width: 88px;
    }

    .nav-toggle {
        width: 40px;
        height: 40px;
        border-radius: 13px;
    }

    .nav-actions {
        grid-template-columns: 1fr;
    }

    .nav-main a,
    .nav-secondary,
    .nav-cta {
        min-height: 42px;
        font-size: 13.5px;
    }
}

@media (max-width: 420px) {
    .nav-shell {
        border-radius: 16px;
    }

    .logo {
        width: 80px;
    }
}
