.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 20;
    padding: 24px 0;
    transition:
        background 0.3s,
        padding 0.3s,
        border-color 0.3s,
        box-shadow 0.3s;
    border-bottom: 1px solid transparent;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 40px;
}
.nav {
    display: flex;
    gap: 32px;
    align-items: center;
}
.nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 500;
    transition: color 0.2s;
}
.nav a:hover,
.nav a.is-active {
    color: var(--ink);
}
.nav a.is-active {
    text-decoration: underline;
    text-decoration-color: var(--khaki);
    text-underline-offset: 6px;
}
/* Auth links injected by auth.js — sit inline with the rest of the nav,
   separated by a hairline so they read as "you", not "the site". */
.nav-auth {
    display: flex;
    align-items: center;
    gap: 32px;
    padding-left: 32px;
    border-left: 1px solid var(--line);
}
.nav-auth:empty {
    display: none;
}
.menu-toggle {
    display: none;
    background: none;
    border: 0;
    color: var(--ink);
    font: 500 15px var(--sans);
    cursor: pointer;
    padding: 8px 0;
}
.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 14px 0;
    border-color: var(--line);
}

@media (max-width: 900px) {
    .header-right {
        gap: 16px;
    }
    .nav {
        display: none;
    }
    .nav.is-open {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        padding: 20px var(--gutter) 30px;
        gap: 18px;
        border-bottom: 1px solid var(--line);
    }
    .nav.is-open a {
        font-size: 18px;
        color: var(--ink);
    }
    .nav.is-open .nav-auth {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        padding: 18px 0 0;
        border-left: 0;
        border-top: 1px solid var(--line);
        width: 100%;
    }
    .site-header.menu-open {
        background: rgba(255, 255, 255, 0.98);
        border-color: var(--line);
    }
    .menu-toggle {
        display: inline-block;
    }
}
@media (max-width: 1080px) and (min-width: 901px) {
    .nav,
    .nav-auth {
        gap: 22px;
    }
    .nav-auth {
        padding-left: 22px;
    }
    .header-right {
        gap: 24px;
    }
}
@media (max-width: 520px) {
    .header-cta {
        display: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    .site-header {
        transition: none;
    }
}

/* Header over a dark hero: light text until the page scrolls past it */
.has-dark-hero .site-header:not(.is-scrolled) .brand,
.has-dark-hero .site-header:not(.is-scrolled) .nav a,
.has-dark-hero .site-header:not(.is-scrolled) .menu-toggle {
    color: #fff;
}
.has-dark-hero .site-header:not(.is-scrolled) .brand::after {
    color: #efe6d6;
}
.has-dark-hero .site-header:not(.is-scrolled) .nav a:hover {
    color: #efe6d6;
}
.has-dark-hero .site-header:not(.is-scrolled) .nav.is-open a {
    color: var(--ink);
}
.has-dark-hero .site-header.menu-open:not(.is-scrolled) .brand,
.has-dark-hero .site-header.menu-open:not(.is-scrolled) .menu-toggle {
    color: var(--ink);
}
.has-dark-hero .site-header.menu-open:not(.is-scrolled) .brand::after {
    color: var(--khaki);
}
