/* Header — values transcribed from the designer's export CSS
   (Content/web: #navbar + app_generated_index CSS). Fixed bar, color logo,
   desktop nav ≥992px, burger + green overlay ≤991px.
   State classes (.is-scrolled / .is-menu-open / .is-open) are toggled by
   JS in task 3.1; their CSS lives here already.

   Owner decision 2026-07-18 (deviates from the export, which is frosted at
   rest too): at the top of the page the bar is fully transparent so the
   hero's texture shows through it, and only turns frosted-white once the
   page scrolls. The mobile menu forces the frosted state as well — the
   nav sits above a green overlay there, not above the hero. */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 52;
    padding-top: 20px;
    background: transparent;
    border-bottom: 0 solid var(--neutral-800);
    transition: background-color var(--motion-micro) ease,
                padding-top var(--motion-micro) ease,
                border-bottom-width var(--motion-micro) ease;
}

.header.is-scrolled,
.header.is-menu-open {
    padding-top: 0;
    background: var(--white-transparent);
    -webkit-backdrop-filter: blur(56px);
    backdrop-filter: blur(56px);
}

.header.is-scrolled {
    border-bottom-width: 1px;
}

@media (prefers-reduced-motion: reduce) {
    .header {
        transition: none;
    }
}

.header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--page-max);
    margin-inline: auto;
    padding-inline: var(--space-24);
    height: 80px;
}

.header__logo {
    display: flex;
    justify-content: flex-start;
    width: 200px;
}

.header__logo img {
    width: 200px;
    height: auto;
    max-width: none;
    z-index: 1100;
    transition: all var(--motion-micro) ease;
}

@media (min-width: 992px) {
    .header.is-scrolled .header__logo img {
        width: 160px;
    }
}

/* Desktop nav: 16px/500 secondary, hover → green + 4px downward nudge +
   1px green line growing 0→100% (mockup --menu-line-length). */
.header__nav {
    display: flex;
    align-items: center;
}

.header__nav-item {
    --menu-line-length: 0%;
}

.header__nav-item:hover {
    --menu-line-length: 100%;
}

.header__nav-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    text-decoration: none;
    padding: 28px clamp(12px, 1.4vw, 20px);
    transition: all var(--motion-micro) ease;
}

.header__nav-item a:hover {
    color: var(--green);
    padding-top: 32px;
    padding-bottom: 24px;
}

.header__nav-underline {
    display: block;
    height: 1px;
    margin-top: 1px;
    width: var(--menu-line-length);
    background: var(--green);
    transition: width var(--motion-micro) ease;
}

/* Login pill — transparent bg, 1px neutral border, icon chip 32px;
   hover: neutral-200 bg + green icon (mockup --login-btn-* vars). */
.login-btn {
    --login-icon-color: var(--secondary);
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding-right: 16px;
    border: 1px solid var(--neutral-800);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--secondary);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color var(--motion-micro) ease;
}

.login-btn:hover {
    --login-icon-color: var(--green);
    background: var(--neutral-200);
    color: var(--secondary);
}

.login-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: 4px;
    margin-right: 10px;
    border-radius: var(--radius-pill);
    background: var(--neutral-200);
    color: var(--login-icon-color);
    transition: color var(--motion-micro) ease;
}

.header__mobile {
    display: none;
}

/* ≤991px: bar shrinks to 56px, nav + login hide, burger appears. */
@media (max-width: 991px) {
    .header__container {
        height: 56px;
    }

    .header__logo,
    .header__logo img {
        width: 150px;
    }

    /* Logo stays visible (inverted to white) above the green overlay.
       Must beat .header__mobile — a flex item with z-index creates its own
       stacking context even when static — so mirror the mockup's #logo
       z-index 99999 (> the mobile wrapper's 9999). */
    .header__logo {
        position: relative;
        z-index: 99999;
    }

    .header__nav,
    .header__login {
        display: none;
    }

    .header__mobile {
        display: block;
        z-index: 9999;
    }

    .header.is-menu-open .header__logo img {
        width: 180px;
        transform: translateY(6px);
        filter: brightness(0) invert(1);
    }

    .header__burger {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 56px;
        height: 56px;
        padding: 12px 0;
        border: 0;
        background: transparent;
        cursor: pointer;
        position: relative;
        z-index: 9999;
    }

    .header__burger-line {
        height: 2px;
        border-radius: 2px;
        background: var(--secondary);
        transition: all 0.3s ease;
        transform-origin: 50% 50%;
    }

    .header.is-menu-open .header__burger-line {
        background: var(--white);
    }

    .header.is-menu-open .header__burger-line--top {
        transform: rotate(45deg) translate(7.4px, 7.4px);
    }

    .header.is-menu-open .header__burger-line--middle {
        opacity: 0;
        transform: scaleX(0);
    }

    .header.is-menu-open .header__burger-line--bottom {
        transform: rotate(-45deg) translate(7.4px, -7.4px);
    }

    /* Green full-screen overlay; hidden via opacity/visibility so the
       .3s fade works (mockup .mobile-menu / .active). */
    .mobile-menu {
        position: fixed;
        inset: 0;
        z-index: 50;
        height: 100dvh;
        width: 100%;
        padding-top: 72px;
        background: var(--green);
        display: flex;
        flex-direction: column;
        justify-content: center;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        /* visibility is stepped, not eased: on close it stays `visible` for
           the full fade (delay 0.3s) so the panel doesn't vanish instantly,
           and on open it flips to `visible` immediately. Easing it (as the
           mockup did) left the links computing to `hidden` for the first
           frames of the open transition — a hidden element silently refuses
           focus(), which broke moving keyboard focus into the panel. */
        transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    }

    .mobile-menu.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: opacity 0.3s ease, visibility 0s linear 0s;
    }

    .mobile-menu__inner {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        align-items: stretch;
        height: 100dvh;
        padding-block: 32px;
        overflow-y: auto;
    }

    .mobile-menu__separator {
        display: block;
        height: 1px;
        background: #ffffff21;
    }

    .mobile-menu__item a {
        display: block;
        color: var(--white);
        font-size: var(--text-menu);
        font-weight: 600;
        text-align: center;
        text-decoration: none;
        padding: 16px 0;
        white-space: nowrap;
        transform: translateX(100%);
        /* Deliberately NOT `all` (the mockup's value): `all` also transitions
           the `visibility` these links inherit from the panel, so each link
           stayed computed-hidden for the whole 0.3s open — and a hidden
           element silently refuses focus(), breaking keyboard entry into the
           menu. Only the two properties that actually animate are listed. */
        transition: transform 0.3s ease, padding-left 0.3s ease;
    }

    .mobile-menu.is-open .mobile-menu__item a {
        transform: translateX(0);
    }

    .mobile-menu__item a:hover {
        padding-left: 16px;
    }

    .mobile-menu__login {
        align-self: center;
        height: 48px;
    }

    .login-btn--solid {
        background: var(--white);
        border: 0;
    }
}

/* Fixed header offset for page content — temporary global rule; the hero
   section (task 2.2) brings its own top spacing per the mockup. */
main {
    padding-top: 100px;
}
