/* =============================================================================
   eR33t / AlexAI — core stylesheet
   -----------------------------------------------------------------------------
   One system: one accent, one type ramp, one spacing scale, one set of
   breakpoints. Replaces the accreted rules in /style.css for the public site.
   /style.css is still loaded by the dashboards and is deliberately untouched.

   Contents
     01  Tokens
     02  Reset + base
     03  Typography
     04  Layout primitives
     05  Shell — skip link, header, nav, drawer, footer
     06  Components
     07  Utilities
     08  Motion
   ========================================================================== */

/* -----------------------------------------------------------------------------
   01  TOKENS
   Colour: ONE accent (signal green) over a neutral ramp. No cyan, no amber,
   no violet — the old palette had six accents, three of which were the same
   cyan at different hex values. Red exists only for genuine error states.
   -------------------------------------------------------------------------- */
:root {
    /* Surfaces — cool near-black, three depths only */
    --bg: #08090b;
    --bg-raised: #0e1014;
    --bg-sunken: #050608;
    --bg-inset: #101319;

    /* Text ramp — measured, worst case across all four surfaces:
       fg 16.9:1 · muted 7.5:1 · subtle 4.8:1. All clear AA for body text. */
    --fg: #e8edf2;
    --fg-muted: #9aa4b0;
    --fg-subtle: #79838f;

    /* The signal. 14.6:1 on --bg. Used small and sparingly — it is a
       highlight, not a body colour. */
    --signal: #00ff41;
    --signal-deep: #00c132;
    --signal-ink: #04140a;
    --signal-a08: rgba(0, 255, 65, 0.08);
    --signal-a16: rgba(0, 255, 65, 0.16);
    --signal-a32: rgba(0, 255, 65, 0.32);

    /* Error only. Not decoration. */
    --danger: #ff5c6b;
    --danger-a12: rgba(255, 92, 107, 0.12);

    /* Lines + fills. --line and --line-strong are DECORATIVE separators and
       are deliberately faint (1.3:1 and 1.7:1) — WCAG has no contrast
       requirement for them. */
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.16);
    --fill: rgba(255, 255, 255, 0.035);
    --fill-hover: rgba(255, 255, 255, 0.06);

    /* The boundary of a form control is NOT decorative — WCAG 1.4.11 requires
       3:1 for anything that identifies an interactive element. Measured at
       0.38 alpha: 3.8:1 over the field fill, 3.6:1 over a panel. Using --line
       here measured 1.34:1, which is the exact failure the old stylesheet had. */
    --control-border: rgba(255, 255, 255, 0.38);

    /* Type — two families. Outfit dropped: Inter at 700 with tight tracking
       reads sharper at display sizes and saves a whole font family. */
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    /* Fluid type ramp, 1.25 minor third, clamped 390px -> 1400px */
    --t--1: 0.8125rem;
    --t-0: 1rem;
    --t-1: clamp(1.0625rem, 0.99rem + 0.31vw, 1.25rem);
    --t-2: clamp(1.25rem, 1.13rem + 0.5vw, 1.5625rem);
    --t-3: clamp(1.5rem, 1.29rem + 0.86vw, 1.953rem);
    --t-4: clamp(1.875rem, 1.47rem + 1.66vw, 2.75rem);
    --t-5: clamp(2.25rem, 1.5rem + 3.07vw, 3.75rem);
    --t-6: clamp(2.75rem, 1.4rem + 5.53vw, 5.5rem);

    /* Spacing — 4px base, 8pt rhythm */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 24px;
    --s-6: 32px;
    --s-7: 48px;
    --s-8: 64px;
    --s-9: 96px;
    --s-10: 128px;

    /* Section rhythm */
    --section-y: clamp(48px, 5.4vw, 84px);
    --container: 1200px;
    --measure: 68ch;

    /* Radii */
    --r-1: 6px;
    --r-2: 10px;
    --r-3: 16px;
    --r-full: 999px;

    /* Elevation — used on exactly two things: the drawer and sticky header */
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);

    --header-h: 68px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);

    /* --- Legacy token bridge ---
       blog.html and login.html carry their own page-local <style> blocks that
       reference the old style.css variable names. Rather than rewrite several
       hundred lines of page CSS, those five names are re-pointed at the new
       palette. The effect is that legacy pages adopt the new colours instead
       of resurrecting the old ones — note --accent-glow lands on the signal
       alpha, not on the old 0.6-opacity bloom.
       Nothing new should use these. */
    --accent-primary: var(--signal);
    --accent-glow: var(--signal-a32);
    --text-primary: var(--fg);
    --text-secondary: var(--fg-muted);
    --card-border: var(--line);
}

/* -----------------------------------------------------------------------------
   02  RESET + BASE
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + var(--s-4));
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font);
    font-size: var(--t-0);
    line-height: 1.65;
    min-height: 100svh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-synthesis-weight: none;
}

img,
svg,
video,
canvas {
    display: block;
    max-width: 100%;
}

img,
video {
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    background: none;
    border: 0;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

hr {
    border: 0;
    border-top: 1px solid var(--line);
}

/* One focus style, everywhere, always visible. */
:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 2px;
    border-radius: var(--r-1);
}

::selection {
    background: var(--signal-a32);
    color: var(--fg);
}

/* Scrollbars, so the browser default light track does not punch a bright
   strip through a dark page. */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: var(--r-full);
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--fg-subtle);
}

/* -----------------------------------------------------------------------------
   03  TYPOGRAPHY
   Headings are SOLID. The old .section-title painted through
   -webkit-text-fill-color: transparent over a #fff -> #8b949e gradient, so
   every heading on the site faded to grey at its right edge.
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.022em;
    text-wrap: balance;
    color: var(--fg);
}

h1 {
    font-size: var(--t-5);
}

h2 {
    font-size: var(--t-4);
}

h3 {
    font-size: var(--t-2);
    letter-spacing: -0.014em;
}

h4 {
    font-size: var(--t-1);
    letter-spacing: -0.01em;
}

p {
    text-wrap: pretty;
}

strong {
    font-weight: 600;
    color: var(--fg);
}

code,
kbd,
samp {
    font-family: var(--mono);
    font-size: 0.9em;
}

/* The mono kicker — the site's signature label. Terminal DNA, kept. */
.kicker {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-family: var(--mono);
    font-size: var(--t--1);
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--signal);
}

.kicker::before {
    content: '';
    width: 18px;
    height: 1px;
    background: var(--signal);
    opacity: 0.7;
}

.kicker--plain::before {
    display: none;
}

.kicker--muted {
    color: var(--fg-subtle);
}

.kicker--muted::before {
    background: var(--fg-subtle);
}

/* Numbered section rubric.
   The counter is CSS, not markup, so the numbers cannot drift out of order
   when a section is added, moved or removed. Counted per top-level section
   rather than per .section-head, because not every section uses one — the
   split layouts put their kicker directly in a column.
   .kicker--plain opts out: it is the panel-label variant, and a numbered
   "Live origin snapshot" would be nonsense. */
main {
    counter-reset: section-rubric;
}

main > section {
    counter-increment: section-rubric;
}

main > section .kicker:not(.kicker--plain)::after {
    content: '// ' counter(section-rubric, decimal-leading-zero);
    margin-left: var(--s-2);
    color: var(--fg-subtle);
    letter-spacing: 0.08em;
}

.lede {
    font-size: var(--t-1);
    color: var(--fg-muted);
    max-width: var(--measure);
}

.muted {
    color: var(--fg-muted);
}

.subtle {
    color: var(--fg-subtle);
}

.mono {
    font-family: var(--mono);
}

/* -----------------------------------------------------------------------------
   04  LAYOUT PRIMITIVES
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--s-5);
}

@media (max-width: 640px) {
    .container {
        padding-inline: var(--s-4);
    }
}

.section {
    padding-block: var(--section-y);
    position: relative;
}

/* Alternating depth. Two surfaces, not five gradients. */
.section--raised {
    background: var(--bg-raised);
}

.section--sunken {
    background: var(--bg-sunken);
}

.section--hairline {
    border-top: 1px solid var(--line);
}

.section-head {
    max-width: 760px;
    margin-bottom: var(--s-6);
}

.section-head > * + * {
    margin-top: var(--s-4);
}

.section-head--center {
    margin-inline: auto;
    text-align: center;
}

.section-head--center .kicker {
    justify-content: center;
}

/* Generic stack + cluster + grid */
.stack > * + * {
    margin-top: var(--s-4);
}

.stack-lg > * + * {
    margin-top: var(--s-6);
}

.cluster {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    align-items: center;
}

.grid {
    display: grid;
    gap: var(--s-5);
}

/* Explicit column counts, not auto-fit. auto-fit resolves against whatever
   space happens to be available, which is how a 4-item grid ended up as
   3 + 1 orphan and a 6-item grid as 4 + 2. */
.grid--2,
.grid--3,
.grid--4 {
    grid-template-columns: 1fr;
}

@media (min-width: 620px) {
    .grid--2,
    .grid--3,
    .grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 940px) {
    .grid--3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid--4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Asymmetric split used by the hero and feature blocks */
.split {
    display: grid;
    gap: clamp(var(--s-6), 4vw, var(--s-8));
    align-items: start;
}

@media (min-width: 900px) {
    .split {
        grid-template-columns: 1.15fr 0.85fr;
    }

    .split--even {
        grid-template-columns: 1fr 1fr;
    }

    .split--reverse > :first-child {
        order: 2;
    }
}

/* -----------------------------------------------------------------------------
   05  SHELL
   -------------------------------------------------------------------------- */
.skip-link {
    position: absolute;
    left: var(--s-4);
    top: var(--s-4);
    z-index: 200;
    padding: var(--s-3) var(--s-4);
    background: var(--signal);
    color: var(--signal-ink);
    font-weight: 600;
    border-radius: var(--r-1);
    transform: translateY(-200%);
    transition: transform 0.2s var(--ease);
}

.skip-link:focus-visible {
    transform: translateY(0);
}

/* --- Header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    /* NO backdrop-filter here, deliberately.
       Per Filter Effects 2, a backdrop-filter other than `none` makes the
       element a containing block for FIXED descendants — and the drawer below
       is one. That took the drawer off the viewport and pinned it to the
       header, so its off-canvas 340px counted as ordinary document overflow:
       documentElement.scrollWidth measured viewport+340 on every page, which
       under mobile emulation inflates the layout viewport and drags every
       other fixed element — the gallery lightbox, the back-to-top button —
       partly off-screen. body{overflow-x:hidden} hid the symptom and kept the
       cause. At 82-94% opacity the blur was barely perceptible anyway. */
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.site-header[data-scrolled='true'] {
    border-bottom-color: var(--line);
    background: var(--bg);
}

.site-header .container {
    display: flex;
    align-items: center;
    gap: var(--s-5);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
    font-family: var(--mono);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--fg);
    margin-right: auto;
    padding: var(--s-2) 0;
}

.brand img {
    width: 28px;
    height: 28px;
    border-radius: var(--r-full);
}

.brand b {
    font-weight: 700;
}

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

.nav a {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    min-height: 40px;
    padding: 0 var(--s-3);
    border-radius: var(--r-full);
    border: 1px solid transparent;
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fg-muted);
    white-space: nowrap;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.nav a svg {
    width: 16px;
    height: 16px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: none;
}

.nav a:hover {
    color: var(--fg);
    background: var(--fill-hover);
}

.nav a[aria-current='page'] {
    color: var(--fg);
    background: var(--fill);
}

.nav a.is-cta {
    color: var(--signal);
    border-color: var(--signal-a32);
    background: var(--signal-a08);
}

.nav a.is-cta:hover {
    background: var(--signal-a16);
    color: var(--signal);
}

/* Nav toggle — hidden on desktop, drawer trigger below the breakpoint */
.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-1);
    border: 1px solid var(--control-border);
    color: var(--fg);
}

.nav-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
}

.nav-toggle .bar {
    transition: transform 0.25s var(--ease), opacity 0.2s ease;
    transform-origin: center;
}

.nav-toggle[aria-expanded='true'] .bar-1 {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded='true'] .bar-2 {
    opacity: 0;
}

.nav-toggle[aria-expanded='true'] .bar-3 {
    transform: translateY(-6px) rotate(-45deg);
}

/* ONE breakpoint for the shell. The old sheet switched the nav at 1200px
   while sizing it at 1340, 1100 and 950 — three chances to disagree. */
@media (max-width: 1080px) {
    .nav-toggle {
        display: inline-flex;
    }

    .nav {
        position: fixed;
        inset: var(--header-h) 0 auto auto;
        width: min(100%, 340px);
        height: calc(100svh - var(--header-h));
        flex-direction: column;
        align-items: stretch;
        gap: var(--s-1);
        padding: var(--s-4);
        overflow-y: auto;
        background: var(--bg-raised);
        border-left: 1px solid var(--line);
        box-shadow: var(--shadow);
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.3s var(--ease), visibility 0.3s;
    }

    .nav[data-open='true'] {
        transform: translateX(0);
        visibility: visible;
    }

    .nav a {
        min-height: 48px;
        padding-inline: var(--s-4);
        border-radius: var(--r-2);
        border-color: var(--line);
        background: var(--fill);
        font-size: 0.8rem;
    }

    .nav a svg {
        display: block;
    }

    body[data-nav-open='true'] {
        overflow: hidden;
    }

    .nav-scrim {
        position: fixed;
        inset: var(--header-h) 0 0;
        z-index: 99;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s;
    }

    body[data-nav-open='true'] .nav-scrim {
        opacity: 1;
        visibility: visible;
    }
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--bg-sunken);
    padding-block: var(--s-8) var(--s-6);
    margin-top: var(--s-9);
}

.footer-top {
    display: grid;
    gap: var(--s-7);
    grid-template-columns: minmax(240px, 1.1fr) 2fr;
    align-items: start;
    margin-bottom: var(--s-7);
}

.footer-links {
    display: grid;
    gap: var(--s-6);
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

@media (max-width: 760px) {
    .footer-top {
        grid-template-columns: 1fr;
        gap: var(--s-6);
    }
}

.footer-brand p {
    color: var(--fg-muted);
    font-size: var(--t--1);
    max-width: 34ch;
    margin-top: var(--s-3);
}

.footer-col h3 {
    font-family: var(--mono);
    font-size: var(--t--1);
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-subtle);
    margin-bottom: var(--s-4);
}

.footer-col ul {
    list-style: none;
    padding: 0;
    display: grid;
    gap: var(--s-2);
}

.footer-col a {
    display: inline-block;
    padding-block: var(--s-1);
    font-size: 0.9rem;
    color: var(--fg-muted);
    transition: color 0.18s ease;
}

.footer-col a:hover {
    color: var(--signal);
}

.age-warning {
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-2);
    border: 1px solid var(--line);
    background: var(--fill);
    font-family: var(--mono);
    font-size: var(--t--1);
    color: var(--fg-muted);
    text-align: center;
    margin-bottom: var(--s-5);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3) var(--s-5);
    align-items: center;
    justify-content: space-between;
    padding-top: var(--s-5);
    border-top: 1px solid var(--line);
    font-family: var(--mono);
    font-size: var(--t--1);
    color: var(--fg-subtle);
}

/* -----------------------------------------------------------------------------
   06  COMPONENTS
   -------------------------------------------------------------------------- */

/* --- Buttons — three variants, one shape language --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    min-height: 46px;
    padding: 0 var(--s-5);
    border-radius: var(--r-full);
    border: 1px solid transparent;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease,
        transform 0.18s var(--ease);
}

.btn:active {
    transform: translateY(1px);
}

/* Primary uses --signal-deep, not the full-intensity green: a large slab of
   #00ff41 blooms on dark and drags the eye off everything else. */
.btn--primary {
    background: var(--signal-deep);
    color: var(--signal-ink);
    font-weight: 600;
}

.btn--primary:hover {
    background: var(--signal);
}

.btn--ghost {
    border-color: var(--control-border);
    color: var(--fg);
}

.btn--ghost:hover {
    border-color: var(--fg-subtle);
    background: var(--fill-hover);
}

.btn--quiet {
    color: var(--fg-muted);
    padding-inline: var(--s-3);
}

.btn--quiet:hover {
    color: var(--fg);
    background: var(--fill-hover);
}

.btn--block {
    width: 100%;
}

/* Inline text link with an arrow — replaces the "-&gt;" ASCII habit */
.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-family: var(--mono);
    font-size: var(--t--1);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--signal);
    padding-block: var(--s-2);
}

.link-arrow::after {
    content: '→';
    transition: transform 0.18s var(--ease);
}

.link-arrow:hover::after {
    transform: translateX(4px);
}

/* --- Panel: the ONE bordered container. Used where a border means
   something (a form, a terminal, a callout) — not on every paragraph. --- */
.panel {
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--r-3);
    padding: var(--s-5);
}

.panel--inset {
    background: var(--bg-inset);
}

.panel--flush {
    padding: 0;
    overflow: hidden;
}

/* --- Card: borderless by default. Hierarchy comes from type and space. --- */
.card {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    padding: var(--s-5) 0;
    border-top: 1px solid var(--line);
}

.card h3 {
    font-size: var(--t-1);
}

.card p {
    color: var(--fg-muted);
    font-size: 0.95rem;
    margin: 0;
}

.card__index {
    font-family: var(--mono);
    font-size: var(--t--1);
    color: var(--signal);
    letter-spacing: 0.1em;
}

/* Boxed variant, for when a card really is a discrete object */
.card--boxed {
    padding: var(--s-5);
    border: 1px solid var(--line);
    border-radius: var(--r-3);
    background: var(--bg-raised);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.card--boxed:hover {
    border-color: var(--line-strong);
}

a.card--boxed:hover {
    border-color: var(--signal-a32);
    background: var(--signal-a08);
}

/* --- Tag / badge --- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-1) var(--s-3);
    border-radius: var(--r-full);
    border: 1px solid var(--line);
    background: var(--fill);
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fg-muted);
}

.tag--signal {
    border-color: var(--signal-a32);
    background: var(--signal-a08);
    color: var(--signal);
}

/* --- Status dot --- */
.dot {
    width: 7px;
    height: 7px;
    border-radius: var(--r-full);
    background: var(--fg-subtle);
    flex: none;
}

.dot--live {
    background: var(--signal);
    box-shadow: 0 0 0 3px var(--signal-a16);
    animation: pulse 2.4s ease-in-out infinite;
}

.dot--down {
    background: var(--danger);
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.45;
    }
}

/* --- Stat row (status / version / uptime) --- */
/* Explicit tracks, not auto-fit — the same mistake the grid utilities already
   carry a comment about. minmax(96px,1fr) left 70px of content box while
   "Unavailable", which script.js writes into every one of these whenever the
   status fetch fails, measures ~100px in JetBrains Mono. It ran 29px into the
   neighbouring tile at 390-430px and again at 1024. minmax(0,1fr) lets a track
   shrink below its content, and overflow-wrap catches anything longer. */
.stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-2);
    margin: 0;
}

@media (min-width: 420px) {
    .stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.stats > div {
    padding: var(--s-3);
    border-radius: var(--r-2);
    background: var(--bg-inset);
    border: 1px solid var(--line);
}

.stats dt {
    font-family: var(--mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-subtle);
}

.stats dd {
    margin: var(--s-1) 0 0;
    font-family: var(--mono);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--fg);
    overflow-wrap: anywhere;
}

/* --- Terminal / log feed --- */
.terminal {
    font-family: var(--mono);
    font-size: 0.76rem;
    line-height: 1.75;
    background: var(--bg-sunken);
    border: 1px solid var(--line);
    border-radius: var(--r-2);
    padding: var(--s-4);
    max-height: 340px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

/* Block flow, NOT flex. script.js builds each line by appending sibling
   inline spans and bare text nodes; as a flex container every one of those
   becomes its own flex item and a real log message shatters into a row of
   narrow columns. Third time this pattern has bitten — see also .callout and
   the bulleted lists. If a container holds prose or inline children, it is
   not a flex container. */
.terminal .log-entry {
    color: var(--fg-muted);
    overflow-wrap: anywhere;
    padding-block: 1px;
}

.terminal .log-time,
.terminal .log-level {
    display: inline;
    margin-right: var(--s-2);
    white-space: nowrap;
}

.terminal .log-time {
    color: var(--fg-subtle);
}

.terminal .log-level {
    color: var(--signal);
}

/* --- Form result states (script.js sets these class names) --- */
#deploy-status:empty,
#contact-status:empty {
    display: none;
}

.status-success,
.status-error {
    margin-top: var(--s-4);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-2);
    border-left: 2px solid var(--signal);
    background: var(--signal-a08);
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--fg);
    text-align: left;
}

.status-error {
    border-left-color: var(--danger);
    background: var(--danger-a12);
}

/* --- Changelog expand control (script.js appends this) --- */
.changelog-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    min-height: 44px;
    margin-top: var(--s-4);
    padding: 0 var(--s-5);
    border-radius: var(--r-full);
    border: 1px solid var(--control-border);
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg);
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.changelog-expand-btn:hover {
    border-color: var(--signal-a32);
    background: var(--signal-a08);
    color: var(--signal);
}

.expand-icon {
    color: var(--signal);
}

/* --- Forms --- */
.field {
    display: grid;
    gap: var(--s-2);
}

.field label {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-muted);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 46px;
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-2);
    border: 1px solid var(--control-border);
    background: var(--bg-sunken);
    color: var(--fg);
    font-size: 0.95rem;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.field textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.field input::placeholder,
.field textarea::placeholder {
    /* 5.3:1. The old placeholder was rgb(117,117,117) on a composited
       #131315 field = 4.03:1, an AA failure on the one form that matters. */
    color: var(--fg-subtle);
}

.field input:hover,
.field select:hover,
.field textarea:hover {
    border-color: var(--fg-subtle);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
    border-color: var(--signal-a32);
    background: var(--bg-inset);
}

.field[data-invalid='true'] input,
.field[data-invalid='true'] textarea {
    border-color: var(--danger);
}

.field-error {
    font-size: var(--t--1);
    color: var(--danger);
}

.form-grid {
    display: grid;
    gap: var(--s-4);
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.form-note {
    font-size: var(--t--1);
    color: var(--fg-subtle);
}

.form-note a {
    color: var(--fg-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- Media tile (gallery, roster) ---
   The gallery loads ~2,700 artifacts from S3, so individual misses are a
   matter of when, not if. The empty state is therefore designed rather than
   left as a blank box — script.js already swaps in a .home-gallery-missing
   node on image error, and this is what that should look like. */
.tile {
    position: relative;
    display: block;
    aspect-ratio: 1;
    border-radius: var(--r-2);
    overflow: hidden;
    background: var(--bg-inset);
    border: 1px solid var(--line);
}

.tile img,
.tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--ease);
}

.tile:hover img {
    transform: scale(1.04);
}

.tile__fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: var(--s-2);
    text-align: center;
    padding: var(--s-3);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-subtle);
    background: repeating-linear-gradient(
        135deg,
        transparent 0 6px,
        rgba(255, 255, 255, 0.02) 6px 12px
    );
}

.tile__meta {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-2);
    padding: var(--s-4) var(--s-3) var(--s-2);
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--fg);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
}

/* Avatar with initials fallback — the roster currently shows grey squares */
.avatar {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: var(--r-full);
    background: var(--bg-inset);
    border: 1px solid var(--line);
    display: grid;
    place-content: center;
    overflow: hidden;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--signal);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Definition rows (crew, commands) --- */
.rows {
    display: grid;
}

/* Fixed label column, not `auto`. Each .row is its own grid, so `auto` sizes
   to that row's own label and the body text starts at a different x on every
   row — a ragged left edge down the whole list. */
.row {
    display: grid;
    gap: var(--s-4);
    grid-template-columns: 104px 1fr;
    align-items: start;
    padding: var(--s-4) 0;
    border-top: 1px solid var(--line);
}

@media (max-width: 560px) {
    .row {
        grid-template-columns: 1fr;
        gap: var(--s-2);
    }
}

.row:last-child {
    border-bottom: 1px solid var(--line);
}

.row__body h4 {
    margin-bottom: var(--s-1);
}

.row__body p {
    color: var(--fg-muted);
    font-size: 0.92rem;
    margin: 0;
}

/* --- Callout ---
   Deliberately NOT display:grid. Inline children (a link mid-sentence) become
   grid items and break onto their own row. */
.callout {
    padding: var(--s-4) var(--s-5);
    border-radius: var(--r-2);
    border-left: 2px solid var(--signal);
    background: var(--signal-a08);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--fg-muted);
}

.callout a {
    color: var(--signal);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.callout--quiet {
    border-left-color: var(--line-strong);
    background: var(--fill);
}

/* --- Back to top ---
   script.js appends this button to <body> on every page it runs on, with no
   markup of its own to hook. It was styled only in style.css, so a page that
   loads the new system and not the old one would show a bare unstyled button
   pinned to the end of the document. Styled here for that reason. */
#back-to-top {
    position: fixed;
    right: var(--s-5);
    bottom: var(--s-5);
    z-index: 90;
    width: 44px;
    height: 44px;
    display: grid;
    place-content: center;
    border-radius: var(--r-full);
    border: 1px solid var(--control-border);
    background: color-mix(in srgb, var(--bg-raised) 88%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--fg-muted);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.24s ease, visibility 0.24s, transform 0.24s var(--ease),
        color 0.18s ease, border-color 0.18s ease;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

#back-to-top:hover {
    color: var(--signal);
    border-color: var(--signal-a32);
}

/* --- Filter bar --- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    align-items: center;
}

.filter-btn {
    min-height: 40px;
    padding: 0 var(--s-4);
    border-radius: var(--r-full);
    border: 1px solid var(--control-border);
    background: transparent;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-muted);
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.filter-btn:hover {
    color: var(--fg);
    border-color: var(--line-strong);
}

.filter-btn.active,
.filter-btn[aria-pressed='true'] {
    color: var(--signal);
    border-color: var(--signal-a32);
    background: var(--signal-a08);
}

/* -----------------------------------------------------------------------------
   06b  HOMEPAGE
   -------------------------------------------------------------------------- */

/* Anchor targets kept for old inbound links (#team, #gallery, #commands,
   #changelog). They must occupy no space. */
.section-anchor {
    display: block;
    height: 0;
    scroll-margin-top: calc(var(--header-h) + var(--s-5));
}

.hero {
    position: relative;
    padding-block: clamp(56px, 9vw, 112px) var(--section-y);
    /* One soft wash instead of the four stacked radial gradients the old
       hero layered on top of a particle canvas. */
    background:
        radial-gradient(120% 90% at 12% 0%, var(--signal-a08), transparent 55%),
        var(--bg);
    isolation: isolate;
}

/* A faint terminal grid — the one piece of texture on the site. Two 1px
   lines at 3% white on a 64px pitch, faded out before it reaches the copy.
   It should read as a surface, not as a pattern; if you can name the grid
   spacing while reading the headline, it is too strong. */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(120% 100% at 0% 0%, #000 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(120% 100% at 0% 0%, #000 0%, transparent 70%);
    pointer-events: none;
}

.hero__title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--s-4);
    font-size: var(--t-6);
    letter-spacing: -0.035em;
}

.version-tag {
    font-family: var(--mono);
    font-size: var(--t--1);
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--fg-subtle);
    white-space: nowrap;
}

.hero__lead {
    font-size: var(--t-3);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--fg);
}

.hero__points {
    list-style: none;
    padding: 0;
    display: grid;
    gap: var(--s-3);
    margin-top: var(--s-5);
    padding-top: var(--s-5);
    border-top: 1px solid var(--line);
    font-size: 0.92rem;
    color: var(--fg-muted);
}

.hero__points strong {
    display: inline-block;
    min-width: 4.5rem;
    margin-right: var(--s-3);
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--signal);
}

@media (min-width: 900px) {
    .hero__proof {
        position: sticky;
        top: calc(var(--header-h) + var(--s-5));
    }
}

/* Sample Discord exchange */
.chat {
    display: grid;
    gap: var(--s-2);
    padding: var(--s-4);
    border-radius: var(--r-2);
    background: var(--bg-sunken);
    border: 1px solid var(--line);
}

.chat__line {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--fg-muted);
}

.chat__line b {
    display: block;
    font-family: var(--mono);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-subtle);
    margin-bottom: 2px;
}

.chat__line--alex {
    color: var(--fg);
}

.chat__line--alex b {
    color: var(--signal);
}

/* Row without the leading column */
.row--plain {
    grid-template-columns: 1fr;
}

/* Command highlights */
.cmds {
    margin: 0 0 var(--s-5);
}

.cmd {
    display: grid;
    gap: var(--s-1) var(--s-5);
    grid-template-columns: minmax(180px, 260px) 1fr;
    padding: var(--s-4) 0;
    border-top: 1px solid var(--line);
}

.cmd:last-child {
    border-bottom: 1px solid var(--line);
}

.cmd dt {
    font-family: var(--mono);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--signal);
    word-break: break-word;
}

.cmd dd {
    margin: 0;
    font-size: 0.92rem;
    color: var(--fg-muted);
}

@media (max-width: 720px) {
    .cmd {
        grid-template-columns: 1fr;
    }
}

/* Spec list under the runtime blueprint */
.spec {
    margin-top: var(--s-8);
    padding-top: var(--s-6);
    border-top: 1px solid var(--line);
}

.spec__list {
    display: grid;
    gap: var(--s-5);
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin: var(--s-5) 0 0;
}

.spec__list dt {
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--signal);
    margin-bottom: var(--s-2);
}

.spec__list dd {
    margin: 0;
    font-size: 0.92rem;
    color: var(--fg-muted);
}

/* Closing CTA */
.cta__inner {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-6);
    align-items: center;
    justify-content: space-between;
    padding: clamp(var(--s-6), 4vw, var(--s-8));
    border-radius: var(--r-3);
    border: 1px solid var(--signal-a16);
    background:
        radial-gradient(90% 140% at 0% 0%, var(--signal-a08), transparent 60%),
        var(--bg-raised);
}

.cta__inner > .stack {
    max-width: 56ch;
}

/* -----------------------------------------------------------------------------
   06c  SCRIPT-GENERATED MARKUP
   These class names are written by /script.js, not by our templates. They are
   contracts: renaming them here does nothing, renaming them there breaks the
   live roster and gallery. Styled to match the system.
   -------------------------------------------------------------------------- */
.home-preview-loader {
    padding: var(--s-5) 0;
    color: var(--fg-subtle);
    font-size: 0.9rem;
}

/* Roster preview — .home-team-card is emitted per member */
.home-team-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--s-4);
    align-items: start;
    padding: var(--s-4) 0;
    border-top: 1px solid var(--line);
}

.home-team-card:last-child {
    border-bottom: 1px solid var(--line);
}

.home-team-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--r-full);
    object-fit: cover;
    background: var(--bg-inset);
    border: 1px solid var(--line);
}

.home-team-copy {
    min-width: 0;
}

.home-team-tier {
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg-subtle);
}

.home-team-copy h3 {
    font-size: var(--t-1);
    margin: 2px 0;
}

.home-team-copy strong {
    display: block;
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--signal);
    margin-bottom: var(--s-2);
}

.home-team-copy p {
    font-size: 0.88rem;
    color: var(--fg-muted);
    margin: 0;
}

/* Gallery preview — .home-gallery-tile is emitted per artifact */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: var(--s-2);
}

.home-gallery-tile {
    position: relative;
    display: block;
    aspect-ratio: 1;
    border-radius: var(--r-1);
    overflow: hidden;
    background: var(--bg-inset);
    border: 1px solid var(--line);
}

.home-gallery-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--ease);
}

.home-gallery-tile:hover .home-gallery-media {
    transform: scale(1.06);
}

.home-gallery-meta {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-1);
    padding: var(--s-5) var(--s-2) var(--s-1);
    font-family: var(--mono);
    font-size: 0.55rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.home-gallery-tile:hover .home-gallery-meta,
.home-gallery-tile:focus-visible .home-gallery-meta {
    opacity: 1;
}

.home-gallery-meta em {
    font-style: normal;
    color: var(--fg-muted);
}

/* -----------------------------------------------------------------------------
   06d  INFO PAGES
   about · faq · roadmap · safety · privacy · terms · contact · pilot all share
   one markup pattern (.subpage-hero + .info-layout + .info-block). Styling it
   once converts all eight; their content markup is untouched.
   -------------------------------------------------------------------------- */
.subpage-hero {
    padding-block: clamp(48px, 6vw, 88px) var(--section-y);
    background:
        radial-gradient(110% 80% at 10% 0%, var(--signal-a08), transparent 55%),
        var(--bg);
}

.subpage-hero-shell {
    display: grid;
    gap: clamp(var(--s-6), 4vw, var(--s-8));
    align-items: start;
}

@media (min-width: 900px) {
    .subpage-hero-shell {
        grid-template-columns: 1.15fr 0.85fr;
    }
}

.subpage-hero-copy > * + * {
    margin-top: var(--s-4);
}

.subpage-hero-copy h1 {
    font-size: var(--t-5);
}

.subpage-hero-copy p {
    font-size: var(--t-1);
    color: var(--fg-muted);
    max-width: var(--measure);
}

.subpage-kicker {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-family: var(--mono);
    font-size: var(--t--1);
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--signal);
}

.subpage-kicker::before {
    content: '';
    width: 18px;
    height: 1px;
    background: var(--signal);
    opacity: 0.7;
}

.subpage-meta-card {
    padding: var(--s-5);
    border-radius: var(--r-3);
    border: 1px solid var(--line);
    background: var(--bg-raised);
}

.subpage-meta-card > * + * {
    margin-top: var(--s-4);
}

.subpage-meta-card strong {
    display: block;
    font-family: var(--mono);
    font-size: var(--t--1);
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--signal);
}

.subpage-meta-card ul {
    list-style: none;
    padding: 0;
    display: grid;
    gap: var(--s-2);
    font-size: 0.92rem;
    color: var(--fg-muted);
}

/* Bullet is absolutely positioned, NOT a grid/flex child. A grid bullet
   promotes every inline child of the <li> — a <code> mid-sentence, a link —
   into its own cell, which breaks the sentence across rows. */
.subpage-meta-card li {
    position: relative;
    padding-left: var(--s-4);
}

.subpage-meta-card li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 5px;
    height: 5px;
    border-radius: var(--r-full);
    background: var(--signal);
}

.subpage-meta-card code {
    font-family: var(--mono);
    font-size: 0.86em;
    padding: 1px 5px;
    border-radius: var(--r-1);
    background: var(--fill);
    color: var(--fg);
}

.subpage-meta-card p {
    font-size: 0.9rem;
    color: var(--fg-muted);
}

.info-timestamp {
    display: block;
    font-family: var(--mono);
    font-size: var(--t--1);
    letter-spacing: 0.08em;
    color: var(--fg-subtle);
}

.info-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
}

.info-section {
    padding-block: var(--section-y);
    background: var(--bg-raised);
    border-top: 1px solid var(--line);
}

.info-layout {
    display: grid;
    gap: clamp(var(--s-6), 4vw, var(--s-8));
    align-items: start;
}

@media (min-width: 900px) {
    .info-layout {
        grid-template-columns: 200px 1fr;
    }

    .info-sidebar {
        position: sticky;
        top: calc(var(--header-h) + var(--s-5));
    }
}

.info-sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-1);
}

@media (min-width: 900px) {
    .info-sidebar {
        flex-direction: column;
        flex-wrap: nowrap;
    }
}

.info-sidebar a {
    display: block;
    min-height: 38px;
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-1);
    border-left: 2px solid transparent;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fg-muted);
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.info-sidebar a:hover,
.info-sidebar a.active {
    color: var(--signal);
    border-left-color: var(--signal);
    background: var(--signal-a08);
}

.info-block + .info-block {
    margin-top: var(--s-8);
    padding-top: var(--s-7);
    border-top: 1px solid var(--line);
}

.info-block h2 {
    font-size: var(--t-3);
    margin-bottom: var(--s-4);
}

.info-block h3 {
    font-size: var(--t-1);
    margin-bottom: var(--s-2);
}

.info-block > p {
    color: var(--fg-muted);
    max-width: var(--measure);
    margin-bottom: var(--s-5);
}

.info-block ul,
.info-block ol {
    display: grid;
    gap: var(--s-2);
    padding-left: var(--s-5);
    color: var(--fg-muted);
    font-size: 0.94rem;
}

.info-block li::marker {
    color: var(--signal);
}

.info-grid {
    display: grid;
    gap: var(--s-4);
    grid-template-columns: 1fr;
    margin-bottom: var(--s-5);
}

@media (min-width: 700px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.info-panel {
    padding: var(--s-5);
    border-radius: var(--r-3);
    border: 1px solid var(--line);
    background: var(--bg);
}

.info-panel p {
    color: var(--fg-muted);
    font-size: 0.94rem;
    margin: 0;
}

.info-panel ul {
    margin: 0;
}

.info-table {
    display: grid;
    border-top: 1px solid var(--line);
    margin-bottom: var(--s-5);
}

.info-row {
    display: grid;
    gap: var(--s-2) var(--s-5);
    grid-template-columns: 1fr;
    padding: var(--s-4) 0;
    border-bottom: 1px solid var(--line);
}

@media (min-width: 700px) {
    .info-row {
        grid-template-columns: minmax(160px, 220px) 1fr;
    }
}

.info-row strong {
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--signal);
}

.info-row span {
    color: var(--fg-muted);
    font-size: 0.94rem;
}

.info-callout {
    padding: var(--s-4) var(--s-5);
    border-radius: var(--r-2);
    border-left: 2px solid var(--signal);
    background: var(--signal-a08);
    color: var(--fg-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: var(--s-5);
}

.info-callout a {
    color: var(--signal);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.info-callout p {
    margin: 0;
}

.pilot-snapshot {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: var(--s-2);
    margin: 0;
}

.pilot-snapshot > div {
    padding: var(--s-3);
    border-radius: var(--r-2);
    background: var(--bg-inset);
    border: 1px solid var(--line);
}

.pilot-snapshot dt {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-subtle);
}

.pilot-snapshot dd {
    margin: var(--s-1) 0 0;
    font-size: 0.88rem;
    color: var(--fg);
}

/* The old .btn-secondary maps onto the ghost button */
.btn-secondary {
    border-color: var(--line-strong);
    color: var(--fg);
    background: transparent;
}

.btn-secondary:hover {
    border-color: var(--fg-subtle);
    background: var(--fill-hover);
}

/* Form groups on contact.html */
.form-group {
    display: grid;
    gap: var(--s-2);
    margin-bottom: var(--s-4);
}

.form-group label {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    min-height: 46px;
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-2);
    border: 1px solid var(--control-border);
    background: var(--bg-sunken);
    color: var(--fg);
    font-size: 0.95rem;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--fg-subtle);
}

/* -----------------------------------------------------------------------------
   06e  COMMANDS / LOGS / LORE / LOGIN
   -------------------------------------------------------------------------- */

/* --- Commands reference --- */
.reference-jump-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
}

.reference-jump-links a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 var(--s-4);
    border-radius: var(--r-full);
    border: 1px solid var(--control-border);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fg-muted);
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.reference-jump-links a:hover {
    color: var(--signal);
    border-color: var(--signal-a32);
    background: var(--signal-a08);
}

.reference-section {
    padding-block: var(--section-y);
    border-top: 1px solid var(--line);
}

.reference-section:nth-of-type(even) {
    background: var(--bg-raised);
}

.reference-section-header {
    max-width: 760px;
    margin-bottom: var(--s-6);
}

.reference-section-header h2 {
    font-size: var(--t-3);
    margin-block: var(--s-3);
}

.reference-section-header p {
    color: var(--fg-muted);
}

.reference-section-header code {
    font-family: var(--mono);
    font-size: 0.86em;
    padding: 1px 5px;
    border-radius: var(--r-1);
    background: var(--fill);
    color: var(--fg);
}

.reference-label {
    font-family: var(--mono);
    font-size: var(--t--1);
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--signal);
    display: block;
}

/* The access legend: pill in a fixed column, description beside it */
.reference-legend {
    display: grid;
    gap: var(--s-2);
    margin-bottom: var(--s-5);
}

.reference-legend-row {
    display: grid;
    grid-template-columns: 104px 1fr;
    gap: var(--s-4);
    align-items: baseline;
    padding: var(--s-2) 0;
}

.reference-legend-row p {
    margin: 0;
    color: var(--fg-muted);
    font-size: 0.9rem;
}

@media (max-width: 560px) {
    .reference-legend-row {
        grid-template-columns: 1fr;
        gap: var(--s-1);
    }
}

.reference-grid {
    display: grid;
    gap: var(--s-4);
    grid-template-columns: 1fr;
}

@media (min-width: 820px) {
    .reference-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.command-entry {
    display: grid;
    gap: var(--s-2);
    padding: var(--s-5);
    border: 1px solid var(--line);
    border-radius: var(--r-3);
    background: var(--bg-raised);
    transition: border-color 0.2s ease;
}

.command-entry:hover {
    border-color: var(--line-strong);
}

.command-entry-top {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    align-items: center;
    justify-content: space-between;
}

.command-entry-title {
    font-size: var(--t-0);
    margin: 0;
}

.command-entry-name {
    font-family: var(--mono);
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--signal);
}

.command-entry-desc {
    color: var(--fg-muted);
    font-size: 0.94rem;
    margin: 0;
}

.command-entry-meta {
    font-size: 0.85rem;
    color: var(--fg-subtle);
    margin: 0;
}

.command-entry-meta code,
.command-entry-desc code {
    font-family: var(--mono);
    font-size: 0.86em;
    padding: 1px 5px;
    border-radius: var(--r-1);
    background: var(--fill);
    color: var(--fg-muted);
}

/* Access pills: one shape, tier by colour weight rather than five hues */
.access-pill {
    display: inline-flex;
    align-items: center;
    flex: none;
    padding: 2px var(--s-3);
    border-radius: var(--r-full);
    border: 1px solid var(--line);
    background: var(--fill);
    font-family: var(--mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-subtle);
    white-space: nowrap;
}

.access-pill--open {
    border-color: var(--signal-a32);
    background: var(--signal-a08);
    color: var(--signal);
}

.access-pill--team,
.access-pill--creative {
    color: var(--fg-muted);
    border-color: var(--line-strong);
}

.access-pill--operator {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--danger-a12);
}

.access-pill--experimental {
    color: var(--fg-subtle);
    border-style: dashed;
}

.commands-footer {
    margin-top: var(--s-7);
    padding-top: var(--s-6);
    border-top: 1px solid var(--line);
    color: var(--fg-muted);
    font-size: 0.94rem;
}

/* --- Logs / changelog (markup from script.js loadChangelog) --- */
.changelog-container {
    display: grid;
    gap: var(--s-4);
}

.changelog-entry {
    padding: var(--s-5);
    border: 1px solid var(--line);
    border-radius: var(--r-3);
    background: var(--bg-raised);
}

.changelog-header {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: var(--s-3);
    margin-bottom: var(--s-4);
    border-bottom: 1px solid var(--line);
}

.changelog-version {
    font-family: var(--mono);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--signal);
}

.changelog-date {
    font-family: var(--mono);
    font-size: var(--t--1);
    color: var(--fg-subtle);
}

.changelog-content {
    color: var(--fg-muted);
    font-size: 0.94rem;
}

.changelog-content h1,
.changelog-content h2,
.changelog-content h3 {
    font-size: var(--t-1);
    color: var(--fg);
    margin: var(--s-5) 0 var(--s-2);
}

.changelog-content h1:first-child,
.changelog-content h2:first-child,
.changelog-content h3:first-child {
    margin-top: 0;
}

.changelog-content ul,
.changelog-content ol {
    display: grid;
    gap: var(--s-2);
    padding-left: var(--s-5);
    margin: var(--s-3) 0;
}

.changelog-content li::marker {
    color: var(--signal);
}

.changelog-content p + p {
    margin-top: var(--s-3);
}

.changelog-content code {
    font-family: var(--mono);
    font-size: 0.86em;
    padding: 1px 5px;
    border-radius: var(--r-1);
    background: var(--fill);
    color: var(--fg);
}

.changelog-content pre {
    padding: var(--s-4);
    margin: var(--s-3) 0;
    border-radius: var(--r-2);
    background: var(--bg-sunken);
    border: 1px solid var(--line);
    overflow-x: auto;
}

.changelog-content strong {
    color: var(--fg);
}

.changelog-toggle {
    margin-top: var(--s-4);
}

/* --- Lore deck --- */
.lore-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-4);
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: var(--s-6);
}

.lore-toolbar-controls {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    align-items: center;
}

.lore-search-label {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-subtle);
    display: block;
    margin-bottom: var(--s-2);
}

.lore-search {
    min-height: 44px;
    min-width: 220px;
    padding: 0 var(--s-4);
    border-radius: var(--r-full);
    border: 1px solid var(--control-border);
    background: var(--bg-sunken);
    color: var(--fg);
    font-size: 0.92rem;
}

.lore-search::placeholder {
    color: var(--fg-subtle);
}

.lore-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
}

.lore-filter-btn {
    min-height: 40px;
    padding: 0 var(--s-4);
    border-radius: var(--r-full);
    border: 1px solid var(--control-border);
    background: transparent;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-muted);
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.lore-filter-btn:hover {
    color: var(--fg);
    border-color: var(--line-strong);
}

.lore-filter-btn.active {
    color: var(--signal);
    border-color: var(--signal-a32);
    background: var(--signal-a08);
}

.lore-grid {
    display: grid;
    gap: var(--s-4);
    grid-template-columns: 1fr;
}

@media (min-width: 620px) {
    .lore-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 980px) {
    .lore-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.lore-loader {
    grid-column: 1 / -1;
    padding: var(--s-7) 0;
    text-align: center;
    font-family: var(--mono);
    font-size: var(--t--1);
    color: var(--fg-subtle);
}

.lore-status-grid {
    display: grid;
    gap: var(--s-3);
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.lore-status-tile {
    display: grid;
    gap: 2px;
    padding: var(--s-4);
    border-radius: var(--r-2);
    border: 1px solid var(--line);
    background: var(--bg-raised);
}

.lore-status-tile span {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-subtle);
}

.lore-status-tile strong {
    font-family: var(--mono);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--fg);
}

.lore-status-tile small {
    font-size: 0.78rem;
    color: var(--fg-muted);
}

/* Lore cards — markup from script.js renderLoreCards(). The toolbar was
   styled in the first pass and these were missed; twelve class names were
   emitting completely unstyled. */
.lore-card {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    padding: var(--s-5);
    border: 1px solid var(--line);
    border-radius: var(--r-3);
    background: var(--bg-raised);
    transition: border-color 0.2s ease;
}

.lore-card:hover {
    border-color: var(--line-strong);
}

.lore-card--preview {
    border-style: dashed;
}

.lore-card-head {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    align-items: center;
    justify-content: space-between;
}

.lore-card h3 {
    font-size: var(--t-1);
    margin: 0;
}

.lore-card > p {
    margin: 0;
    font-size: 0.92rem;
    color: var(--fg-muted);
}

.lore-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--s-3);
    border-radius: var(--r-full);
    border: 1px solid var(--signal-a32);
    background: var(--signal-a08);
    font-family: var(--mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--signal);
}

.lore-pill--preview {
    border-color: var(--line-strong);
    background: var(--fill);
    color: var(--fg-subtle);
}

.lore-rarity {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-subtle);
}

.lore-card-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: var(--s-2);
    padding-top: var(--s-3);
    border-top: 1px solid var(--line);
}

.lore-card-meta span {
    display: grid;
    gap: 2px;
    font-size: 0.8rem;
    color: var(--fg-muted);
}

.lore-card-meta strong {
    font-family: var(--mono);
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-subtle);
}

.lore-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
}

.lore-tags span {
    padding: 1px var(--s-2);
    border-radius: var(--r-1);
    background: var(--fill);
    font-family: var(--mono);
    font-size: 0.62rem;
    color: var(--fg-muted);
}

.lore-receipts {
    margin-top: auto;
    padding-top: var(--s-3);
    border-top: 1px solid var(--line);
}

.lore-receipts strong {
    display: block;
    font-family: var(--mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-subtle);
    margin-bottom: var(--s-2);
}

.lore-receipts ul {
    list-style: none;
    padding: 0;
    display: grid;
    gap: var(--s-1);
    font-size: 0.82rem;
    color: var(--fg-muted);
}

.lore-receipts li {
    position: relative;
    padding-left: var(--s-4);
}

.lore-receipts li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 4px;
    height: 4px;
    border-radius: var(--r-full);
    background: var(--signal);
}

.lore-deck-section,
.lore-status-section {
    padding-block: var(--section-y);
}

.lore-toolbar-copy h2 {
    font-size: var(--t-3);
    margin-bottom: var(--s-2);
}

.lore-toolbar-copy p {
    color: var(--fg-muted);
    font-size: 0.94rem;
    max-width: var(--measure);
}

.lore-boundary-card {
    margin-top: var(--s-6);
    padding: var(--s-4) var(--s-5);
    border-radius: var(--r-2);
    border-left: 2px solid var(--signal);
    background: var(--signal-a08);
    color: var(--fg-muted);
    font-size: 0.94rem;
}

/* --- Login --- */
.login-shell {
    min-height: calc(100svh - var(--header-h));
    display: grid;
    place-items: center;
    padding: var(--s-7) var(--s-5);
    background:
        radial-gradient(90% 60% at 50% 0%, var(--signal-a08), transparent 60%),
        var(--bg);
}

.login-card {
    width: min(100%, 420px);
    padding: clamp(var(--s-5), 4vw, var(--s-7));
    border-radius: var(--r-3);
    border: 1px solid var(--line);
    background: var(--bg-raised);
}

.login-header {
    margin-bottom: var(--s-6);
}

.login-header h1 {
    font-size: var(--t-3);
}

.login-header p {
    margin-top: var(--s-2);
    color: var(--fg-muted);
    font-size: 0.94rem;
}

.input-group {
    display: grid;
    gap: var(--s-2);
    margin-bottom: var(--s-4);
}

.input-group label {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-muted);
}

.input-group input {
    width: 100%;
    min-height: 46px;
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-2);
    border: 1px solid var(--control-border);
    background: var(--bg-sunken);
    color: var(--fg);
    font-size: 0.95rem;
}

.btn-login {
    width: 100%;
    min-height: 48px;
    margin-top: var(--s-2);
    border-radius: var(--r-full);
    background: var(--signal-deep);
    color: var(--signal-ink);
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: background 0.18s ease;
}

.btn-login:hover {
    background: var(--signal);
}

.error-msg {
    margin-top: var(--s-4);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-2);
    border: 1px solid var(--danger);
    background: var(--danger-a12);
    color: var(--danger);
    font-size: 0.9rem;
}

.login-note {
    margin-top: var(--s-5);
    padding-top: var(--s-4);
    border-top: 1px solid var(--line);
    font-size: var(--t--1);
    color: var(--fg-subtle);
}

.login-note-link {
    color: var(--fg-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Tick list — used in subpage side panels */
.ticks {
    list-style: none;
    padding: 0;
    display: grid;
    gap: var(--s-2);
    font-size: 0.92rem;
    color: var(--fg-muted);
}

.ticks li {
    position: relative;
    padding-left: var(--s-4);
}

.ticks li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 5px;
    height: 5px;
    border-radius: var(--r-full);
    background: var(--signal);
}

.ticks a {
    color: var(--fg);
    text-decoration: underline;
    text-decoration-color: var(--signal-a32);
    text-underline-offset: 3px;
    transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.ticks a:hover {
    color: var(--signal);
    text-decoration-color: var(--signal);
}

/* Toolbar (gallery filters + sorts) */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-4);
    align-items: center;
    justify-content: space-between;
    padding: var(--s-3) var(--s-4);
    margin-bottom: var(--s-6);
    border: 1px solid var(--line);
    border-radius: var(--r-3);
    background: var(--bg);
}

.toolbar-label {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-subtle);
    margin-right: var(--s-1);
}

/* .sort-btn shares the filter shape */
.sort-btn {
    min-height: 40px;
    padding: 0 var(--s-4);
    border-radius: var(--r-full);
    border: 1px solid transparent;
    background: transparent;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-muted);
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.sort-btn:hover {
    color: var(--fg);
}

.sort-btn.active {
    color: var(--signal);
    border-color: var(--signal-a32);
    background: var(--signal-a08);
}

/* Gallery grid — .gallery-item markup is built by script.js */
.gallery-grid {
    display: grid;
    gap: var(--s-3);
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

@media (min-width: 620px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--r-2);
    overflow: hidden;
    background: var(--bg-inset);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.3s var(--ease);
}

.gallery-item:hover {
    border-color: var(--signal-a32);
}

.gallery-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease);
}

.gallery-item:hover .gallery-media {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    inset-inline: 0;
    top: 0;
    padding: var(--s-2) var(--s-3);
}

.gallery-type {
    font-family: var(--mono);
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-muted);
    padding: 2px var(--s-2);
    border-radius: var(--r-full);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    pointer-events: none;
}

.play-overlay svg {
    width: 44px;
    height: 44px;
    padding: 12px;
    border-radius: var(--r-full);
    background: rgba(0, 0, 0, 0.55);
    fill: var(--fg);
    backdrop-filter: blur(6px);
}

.like-btn {
    position: absolute;
    right: var(--s-2);
    bottom: var(--s-2);
    display: inline-flex;
    align-items: center;
    gap: var(--s-1);
    min-height: 28px;
    padding: 0 var(--s-2);
    border-radius: var(--r-full);
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    font-family: var(--mono);
    font-size: 0.62rem;
    color: var(--fg-muted);
    transition: color 0.18s ease;
}

.like-btn .heart-icon {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.like-btn:hover {
    color: var(--fg);
}

.like-btn.liked {
    color: var(--danger);
}

.like-btn.liked .heart-icon {
    fill: currentColor;
}

/* Lightbox — injected into <body> by script.js */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--s-4);
    padding: var(--s-5);
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: min(1100px, 92vw);
    max-height: 88svh;
}

#lightbox-media img,
#lightbox-media video {
    max-width: 100%;
    max-height: 88svh;
    border-radius: var(--r-2);
}

.lightbox-nav,
.lightbox-close {
    display: grid;
    place-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--r-full);
    border: 1px solid var(--control-border);
    background: var(--bg-raised);
    color: var(--fg);
    font-size: 1.1rem;
    transition: border-color 0.18s ease, color 0.18s ease;
}

.lightbox-nav:hover,
.lightbox-close:hover {
    border-color: var(--signal-a32);
    color: var(--signal);
}

.lightbox-close {
    position: absolute;
    top: calc(-1 * var(--s-6));
    right: 0;
}

/* Footer live status */
.footer-status {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
}

/* Crew page — .team-* markup is built by loadTeamProfiles() */
.team-loader,
.gallery-loader {
    grid-column: 1 / -1;
    padding: var(--s-7) 0;
    text-align: center;
    font-family: var(--mono);
    font-size: var(--t--1);
    letter-spacing: 0.08em;
    color: var(--fg-subtle);
}

.team-card {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    padding: var(--s-5);
    border: 1px solid var(--line);
    border-radius: var(--r-3);
    background: var(--bg-raised);
    border-top: 1px solid var(--line);
    transition: border-color 0.2s ease;
}

.team-card:hover {
    border-color: var(--line-strong);
}

.team-avatar-wrap {
    position: relative;
    width: 64px;
}

.team-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--r-full);
    object-fit: cover;
    background: var(--bg-inset);
    border: 1px solid var(--line);
}

.team-bond-badge {
    position: absolute;
    left: 0;
    bottom: -6px;
    padding: 1px var(--s-2);
    border-radius: var(--r-full);
    border: 1px solid var(--line-strong);
    background: var(--bg-sunken);
    font-family: var(--mono);
    font-size: 0.55rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-muted);
    white-space: nowrap;
}

.team-card h3 {
    font-size: var(--t-1);
    margin: 0;
}

.team-archetype {
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--signal);
}

.team-bio-short,
.team-bio-full {
    font-size: 0.9rem;
    color: var(--fg-muted);
}

.team-learn-more {
    align-self: flex-start;
    padding: var(--s-2) 0;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fg-muted);
    transition: color 0.18s ease;
}

.team-learn-more:hover {
    color: var(--signal);
}

.team-tagline {
    padding-left: var(--s-4);
    border-left: 2px solid var(--signal-a32);
    font-size: 0.9rem;
    font-style: italic;
    color: var(--fg-muted);
}

.team-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2) var(--s-4);
    margin-top: auto;
    padding-top: var(--s-3);
    border-top: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-subtle);
}

/* Tier sections are injected by script.js after #team-grid */
.gs-section,
.friends-section {
    margin-top: var(--s-8);
}

.gs-section h2,
.friends-section h2 {
    font-size: var(--t-3);
    margin-bottom: var(--s-5);
}

.gs-grid,
.friends-grid {
    display: grid;
    gap: var(--s-5);
    grid-template-columns: 1fr;
}

@media (min-width: 620px) {
    .gs-grid,
    .friends-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 940px) {
    .gs-grid,
    .friends-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Shared page hero for subpages */
.page-hero {
    background:
        radial-gradient(110% 80% at 10% 0%, var(--signal-a08), transparent 55%),
        var(--bg);
}

.page-hero h1 {
    font-size: var(--t-5);
}

/* script.js swaps this in when an artifact 404s */
.home-gallery-missing {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    padding: var(--s-2);
    text-align: center;
    font-family: var(--mono);
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fg-subtle);
    background: repeating-linear-gradient(135deg,
            transparent 0 5px,
            rgba(255, 255, 255, 0.02) 5px 10px);
}

/* -----------------------------------------------------------------------------
   07  UTILITIES
   -------------------------------------------------------------------------- */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.center {
    text-align: center;
}

.measure {
    max-width: var(--measure);
}

.full-bleed {
    width: 100vw;
    margin-inline: calc(50% - 50vw);
}

[hidden] {
    display: none !important;
}

/* -----------------------------------------------------------------------------
   08  MOTION
   Reveal-on-scroll defaults to VISIBLE. The old implementation defaulted to
   opacity 0 and relied on JS to reveal it, so a JS failure or an
   IntersectionObserver that never fires left the page permanently blank.
   -------------------------------------------------------------------------- */
.reveal {
    opacity: 1;
}

html.js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

html.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    html.js .reveal {
        opacity: 1;
        transform: none;
    }
}
