/* Layout primitives: container, sections, header, footer */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.container--narrow { max-width: var(--container-narrow); }
.container--wide   { max-width: var(--container-wide); }

.section {
    padding-block: clamp(3rem, 6vw, 6rem);
    position: relative;
}

.section--hero-min {
    padding-block: clamp(5rem, 10vw, 8rem) clamp(2rem, 5vw, 4rem);
}

.section--hero-full {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding-block: clamp(4rem, 8vw, 8rem);
}

.section--alt {
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.015) 30%, transparent);
}

/* Site header */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    background: rgba(6, 8, 15, 0.72);
    border-bottom: 1px solid transparent;
    transition: border-color var(--dur-mid) var(--ease-out), background var(--dur-mid) var(--ease-out);
}

.site-header.is-scrolled {
    background: rgba(6, 8, 15, 0.88);
    border-bottom-color: var(--border-soft);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 96px;
    gap: var(--space-5);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    transition: opacity var(--dur-fast) var(--ease-out);
}
.brand:hover { color: var(--text-primary); opacity: 0.85; }

.brand__mark {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--grad-gold);
    color: var(--bg-deep);
    font-weight: 800;
    font-size: 1rem;
    box-shadow: var(--shadow-gold), var(--shadow-inset);
}

.brand__text { letter-spacing: 0.02em; }

/* New: full lockup logo (1000x200 PNG with transparency, 5:1 ratio).
   Replaces .brand__mark + .brand__text when used as a single image. */
.brand__logo {
    display: block;
    height: 56px;
    width: auto;
    user-select: none;
    -webkit-user-drag: none;
}
@media (min-width: 768px) {
    .brand__logo { height: 72px; }
}

/* In compact contexts (landing pill, admin sidebar) keep the logo smaller. */
.lp-brand .brand__logo,
.admin-brand .brand__logo {
    height: 40px;
}
@media (min-width: 768px) {
    .lp-brand .brand__logo,
    .admin-brand .brand__logo { height: 44px; }
}

/* Primary nav */
.nav {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.nav__link {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.nav__link:hover {
    color: var(--text-primary);
    background: var(--surface-2);
}

.nav__link.is-active {
    color: var(--accent-gold);
}
.nav__link.is-active::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -2px;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--accent-gold);
    box-shadow: 0 0 12px var(--accent-gold-glow);
}

.nav__cta {
    margin-left: var(--space-3);
}

/* Mobile menu button */
.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    border: 1px solid var(--border-soft);
    background: var(--surface-1);
    align-items: center;
    justify-content: center;
    transition: background var(--dur-fast) var(--ease-out);
}
.nav-toggle:hover { background: var(--surface-2); }

.nav-toggle__bars {
    width: 18px;
    height: 12px;
    position: relative;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after,
.nav-toggle__bars span {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform var(--dur-mid) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}
.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars span    { top: 50%; transform: translateY(-50%); }
.nav-toggle__bars::after  { bottom: 0; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span    { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after  { transform: translateY(-5px) rotate(-45deg); }

/* Mobile breakpoint */
@media (max-width: 880px) {
    .nav-toggle { display: inline-flex; }
    /* Dropdown panel anchored under the sticky header. display:none when closed
       is bulletproof (no transform/stacking surprises): the header bar shows only
       the logo + hamburger, and the panel appears on tap. */
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-4) var(--gutter) var(--space-5);
        background: rgba(6, 8, 15, 0.98);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-bottom: 1px solid var(--border-soft);
        box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.75);
        gap: var(--space-1);
        z-index: var(--z-overlay);
    }
    .nav[data-open="true"] { display: flex; }
    .nav__link { padding: 0.9rem 1rem; font-size: 1.05rem; }
    .nav__link.is-active::after { display: none; }
    .nav__link.is-active { background: var(--accent-gold-faint); }
    .nav__cta { margin: var(--space-3) 0 0; }
    .nav__cta .btn { width: 100%; justify-content: center; }
}

/* Site footer */
.site-footer {
    margin-top: var(--space-9);
    padding-block: var(--space-8) var(--space-6);
    border-top: 1px solid var(--border-soft);
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.4));
    color: var(--text-muted);
    font-size: 0.92rem;
}

.site-footer__grid {
    display: grid;
    gap: var(--space-7);
    grid-template-columns: 1.4fr repeat(3, 1fr);
}

@media (max-width: 760px) {
    .site-footer__grid {
        grid-template-columns: 1fr 1fr;
    }
    .site-footer__brand { grid-column: 1 / -1; }
}

.site-footer__brand {
    max-width: 36ch;
}
.site-footer__brand .brand { margin-bottom: var(--space-3); }
.site-footer__tag {
    color: var(--text-muted);
    line-height: 1.55;
}

.site-footer__col h4 {
    font-family: var(--font-display);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
}

.site-footer__col ul { display: grid; gap: var(--space-2); }

.site-footer__col a {
    color: var(--text-muted);
    transition: color var(--dur-fast) var(--ease-out);
}
.site-footer__col a:hover { color: var(--text-primary); }

.site-footer__bottom {
    margin-top: var(--space-7);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
    color: var(--text-faint);
    font-size: 0.85rem;
}

.site-footer__legal {
    display: flex;
    gap: var(--space-5);
    flex-wrap: wrap;
}
.site-footer__legal a { color: var(--text-faint); }
.site-footer__legal a:hover { color: var(--text-secondary); }

/* On phones, stack and center the whole footer for a tidy single column */
@media (max-width: 600px) {
    .site-footer { text-align: center; }
    .site-footer__grid { grid-template-columns: 1fr; justify-items: center; }
    .site-footer__brand { max-width: 42ch; }
    .site-footer__brand .brand { justify-content: center; }
    .site-footer__col ul { justify-items: center; }
    .site-footer__bottom {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
    .site-footer__legal { justify-content: center; }
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: var(--z-modal);
    padding: 0.6rem 1rem;
    background: var(--accent-gold);
    color: var(--bg-deep);
    border-radius: var(--radius-sm);
    font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* Download controls disabled on mobile (Windows-only apps) */
.is-desktop-only {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.3);
}
.desktop-only-note {
    display: block;
    margin-top: var(--space-2);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: var(--accent-gold);
    opacity: 0.9;
}

/* Archive of older Windows launcher builds: hidden on phones, where they are not
   useful and the row layout overflows. Desktop keeps the full archive. */
.is-mobile-device .dl-archive {
    display: none;
}
