/* Desktop center navbar — slide menu remains for tablet/mobile (max-width: 1023px) */
:root {
    --funnel-topbar-h: 56px;
}

.site-nav {
    display: none;
}

.site-nav-items {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 6px;
}

.site-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.92);
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.site-nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.18);
}

.site-nav-link:focus-visible {
    outline: 2px solid #e6d4a8;
    outline-offset: 2px;
}

.site-nav-link--prominent {
    color: #faf6ee;
    background: rgba(196, 163, 90, 0.22);
    border: 1px solid rgba(196, 163, 90, 0.45);
}

.site-nav-link--prominent:hover {
    color: #ffffff;
    background: rgba(196, 163, 90, 0.32);
    border-color: rgba(230, 212, 168, 0.55);
}

/* Cover page — nav lives inside sticky header (dark bar already behind links) */
body.cover-page .site-nav {
    min-width: 0;
    width: 100%;
}

body.cover-page .site-nav-items {
    flex-wrap: wrap;
}

body.cover-page .site-nav-link {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.06);
}

/* Homepage desktop nav — rich gold + shimmer on hover */
@media (min-width: 1024px) {
    body.cover-page .site-nav-items .site-nav-link {
        position: relative;
        overflow: hidden;
        isolation: isolate;
        transition:
            color 0.22s ease,
            background 0.22s ease,
            border-color 0.22s ease,
            box-shadow 0.22s ease,
            transform 0.22s ease;
    }

    body.cover-page .site-nav-items .site-nav-link__label {
        position: relative;
        z-index: 1;
    }

    body.cover-page .site-nav-items .site-nav-link::before {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 0;
        opacity: 0;
        background: linear-gradient(
            145deg,
            #fff9ee 0%,
            #f5e6b8 18%,
            #e8c96a 42%,
            #d4af37 68%,
            #c4a35a 100%
        );
        transition: opacity 0.22s ease;
    }

    body.cover-page .site-nav-items .site-nav-link::after {
        content: '';
        position: absolute;
        inset: -20%;
        z-index: 1;
        background: linear-gradient(
            105deg,
            transparent 28%,
            rgba(255, 255, 255, 0.05) 40%,
            rgba(255, 255, 255, 0.95) 50%,
            rgba(255, 252, 235, 0.75) 52%,
            rgba(255, 255, 255, 0.05) 62%,
            transparent 72%
        );
        transform: translateX(-140%) skewX(-12deg);
        opacity: 0;
        pointer-events: none;
        mix-blend-mode: soft-light;
    }

    body.cover-page .site-nav-items .site-nav-link:hover,
    body.cover-page .site-nav-items .site-nav-link:focus-visible {
        color: #0a0e27;
        background: transparent;
        border-color: rgba(255, 249, 238, 0.85);
        box-shadow:
            0 6px 22px rgba(212, 175, 55, 0.5),
            0 0 28px rgba(230, 200, 120, 0.35),
            inset 0 1px 0 rgba(255, 255, 255, 0.65),
            inset 0 -1px 0 rgba(168, 130, 40, 0.25);
        text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
        transform: translateY(-1px);
    }

    body.cover-page .site-nav-items .site-nav-link:hover::before,
    body.cover-page .site-nav-items .site-nav-link:focus-visible::before {
        opacity: 1;
    }

    body.cover-page .site-nav-items .site-nav-link:hover::after,
    body.cover-page .site-nav-items .site-nav-link:focus-visible::after {
        opacity: 1;
        animation: siteNavGoldShimmer 0.75s ease-in-out;
    }
}

@keyframes siteNavGoldShimmer {
    0% {
        transform: translateX(-140%) skewX(-12deg);
    }
    100% {
        transform: translateX(140%) skewX(-12deg);
    }
}

/* Funnel progress trail — breadcrumb navigation on desktop */
.funnel-trail-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.funnel-trail-items::-webkit-scrollbar {
    display: none;
}

.funnel-trail__item {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.funnel-trail__sep {
    display: inline-flex;
    align-items: center;
    color: rgba(196, 163, 90, 0.55);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0 4px;
    user-select: none;
    flex-shrink: 0;
}

.funnel-trail__link {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 5px 8px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.funnel-trail__link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
}

.funnel-trail__link:focus-visible {
    outline: 2px solid #e6d4a8;
    outline-offset: 2px;
}

.funnel-trail__item--home .funnel-trail__link {
    color: #e6d4a8;
    background: rgba(196, 163, 90, 0.16);
    border: 1px solid rgba(196, 163, 90, 0.32);
}

.funnel-trail__item--home .funnel-trail__link:hover {
    color: #faf6ee;
    background: rgba(196, 163, 90, 0.26);
}

.funnel-trail__current {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    white-space: nowrap;
}

.funnel-trail__item--current .funnel-trail__current {
    box-shadow: 0 0 0 1px rgba(196, 163, 90, 0.25);
}

/* Funnel topbar — invisible wrapper on tablet/mobile; unified bar on desktop */
.funnel-topbar {
    display: contents;
}

.site-nav--funnel {
    width: auto;
}

@media (min-width: 1024px) {
    .site-nav {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-menu-toggle {
        display: none !important;
    }

    /* Unified funnel header: logo | nav | lang */
    .funnel-topbar {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px 16px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 5000;
        height: var(--funnel-topbar-h);
        padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
        background: rgba(10, 14, 39, 0.94);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid rgba(196, 163, 90, 0.28);
        box-shadow: 0 4px 24px rgba(10, 14, 39, 0.45);
    }

    .funnel-topbar .site-logo {
        position: relative;
        top: auto;
        left: auto;
        grid-column: 1;
        justify-self: start;
        transform: none;
    }

    .funnel-topbar .site-logo:hover {
        transform: translateY(-1px);
    }

    .funnel-topbar .logo-image {
        width: clamp(120px, 13vw, 170px);
        max-height: 38px;
    }

    .funnel-topbar .site-nav--funnel {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        grid-column: 2;
        justify-self: center;
        width: 100%;
        min-width: 0;
        max-width: none;
        height: auto;
        padding: 0;
        pointer-events: auto;
    }

    .funnel-topbar .funnel-trail-items {
        flex-wrap: nowrap;
        justify-content: center;
        padding: 2px 0;
    }

    .funnel-topbar .lang-toggle {
        position: relative;
        top: auto;
        right: auto;
        grid-column: 3;
        justify-self: end;
        flex-shrink: 0;
    }

    .funnel-container > .progress-bar {
        top: calc(var(--funnel-topbar-h) - 4px);
        z-index: 5010;
    }

    .go-to-next-container {
        top: calc(var(--funnel-topbar-h) + 8px);
    }
}

@media (max-width: 1023px) {
    .site-nav {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-nav-link {
        transition: none;
    }

    body.cover-page .site-nav-items .site-nav-link::after {
        display: none;
    }

    body.cover-page .site-nav-items .site-nav-link::before {
        transition: none;
    }

    body.cover-page .site-nav-items .site-nav-link:hover,
    body.cover-page .site-nav-items .site-nav-link:focus-visible {
        animation: none;
    }
}
