/* ================================================================
   prototype.nomenon.io — one stylesheet.
   Tokens and type are nomenon.io's (css/sitewide.css): the same steel
   ramp, the one reserved cyan, the one red, Oxanium / IBM Plex / Horizon.
   ================================================================ */

@font-face { font-family: "Horizon"; font-weight: 100 900; font-display: swap; src: url(/fonts/Horizon-v1.woff2) format("woff2"); }
@font-face { font-family: "Oxanium"; font-weight: 300; font-display: swap; src: url(/fonts/oxanium-v21-latin-300.woff2) format("woff2"); }
@font-face { font-family: "Oxanium"; font-weight: 400; font-display: swap; src: url(/fonts/oxanium-v21-latin-regular.woff2) format("woff2"); }
@font-face { font-family: "Oxanium"; font-weight: 500; font-display: swap; src: url(/fonts/oxanium-v21-latin-500.woff2) format("woff2"); }
@font-face { font-family: "Oxanium"; font-weight: 600; font-display: swap; src: url(/fonts/oxanium-v21-latin-600.woff2) format("woff2"); }
@font-face { font-family: "Oxanium"; font-weight: 700; font-display: swap; src: url(/fonts/oxanium-v21-latin-700.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 300; font-display: swap; src: url(/fonts/ibm-plex-sans-v23-latin-300.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-v23-latin-regular.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-v23-latin-500.woff2) format("woff2"); }

:root {
    color-scheme: only dark;
    --accent: #00c2ff;
    --accent-hov: #00d4ff;
    --red: rgb(205, 96, 88);
    --shadow: #0a0a0a;
    --umber: #1a1a1a;
    --graphite: #01010f;
    --hairline: #1e2a38;
    --slate: #2c3b5f;
    --muted: #90a0bf;
    --soft: #c8d2fb;
    --ice: #e6f1fb;
    --nav-h: 3.5rem;
    --footer-height: 15px;
    --gutter: clamp(16px, 4vw, 48px);
    --fs-body: clamp(1rem, 0.114vw + 0.977rem, 1.25rem);
    --fs-sm: 0.875rem;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* No browser-default margins anywhere: every gap on the page is one we set. */
*, *::before, *::after { box-sizing: border-box; margin: 0; }

html, body { margin: 0; height: 100%; }

body {
    background: #000;
    color: var(--ice);
    font-family: "IBM Plex Sans", system-ui, sans-serif;
    font-weight: 300;
    font-size: var(--fs-body);
    line-height: 1.3;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ── plate: the photographic room behind everything ── */
.plate {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: url("/img/arch_bg_8.webp") center / cover no-repeat;
}
.plate::after {
    content: "";
    position: absolute;
    inset: 0;
}
.plate--run { background: url("/img/arch_bg_9.webp") center / cover no-repeat; }
body.is-running .plate { opacity: 0.35; }
/* the documents page: the room recedes further, so the files and table read first */
body.is-reports .plate { opacity: 0.15; }

/* ── nav ── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--gutter);
    background: transparent;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.brand {
    font-family: "Horizon", sans-serif;
    font-size: 1.35rem;
    letter-spacing: 0.02em;
    text-decoration: none;
    background: linear-gradient(175deg, var(--umber) 1%, var(--hairline) 5%, var(--slate) 10%, var(--muted) 25%,
        var(--soft) 40%, var(--ice) 50%, var(--soft) 60%, var(--muted) 75%, var(--slate) 90%, var(--hairline) 95%, var(--umber) 99%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.headlink {
    text-transform: none;
    text-decoration: none;
}

.nav-tag {
    margin-left: 1rem;
    font-family: "Oxanium", sans-serif;
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ice);
}
/* nomenon.io's wordmark (css/sitewide.css .wordmark-mark): the animated mark,
   sized by height; the 375x54 on the <img> reserves the box. */
.wordmark-mark {
    display: block;
    height: clamp(1.25rem, calc(0.9vw + 1rem), 1.75rem);
    width: auto;
}
.nav-left { display: flex; align-items: center; }
.nav-right { display: flex; align-items: center; gap: 1.25rem; }
.nav-user {
    font-family: "Oxanium", sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    color: var(--muted);
    max-width: 40vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── type ── */
.eyebrow {
    margin: 0;
    font-family: "Oxanium", sans-serif;
    font-weight: 300;
    font-size: clamp(0.8rem, 0.72rem + 0.3vw, 1.05rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}
.product {
    margin: 0;
    font-family: "Oxanium", sans-serif;
    font-weight: 600;
    font-size: clamp(2.2rem, 1.4rem + 3vw, 4.5rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
    color: var(--ice);
}

.lede { margin: 0; color: var(--ice); }
.lede strong { font-weight: 500; color: var(--soft); }

/* ── buttons (nomenon.io .btn1/.btn2/.btn3) ── */
.btn {
    display: inline-flex;
    max-width: 50vw;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    white-space: nowrap;
    font-family: "Oxanium", sans-serif;
    font-size: clamp(1rem, 0.208vw + 0.951rem, 1.2rem);
    font-weight: 400;
    line-height: 1;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition:
        background 120ms linear 0s,
        color 120ms linear 0s,
        backdrop-filter 600ms ease 120ms,
        -webkite-backdrop-filter 600ms ease 120ms,
        border-color 800ms ease 500ms;
}

.btn {
    background: var(--soft);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--hairline);
    color: var(--shadow);
}

.btn:hover {
    background: transparent;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: var(--soft);
    color: var(--soft);
}

.btn:disabled { opacity: 0.45; cursor: progress; }

.btn--text {
    display: inline-flex;
    max-width: 50vw;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0;
    border: none;
    background: transparent;
    font-family: "Oxanium", sans-serif;
    font-size: clamp(1rem, 0.208vw + 0.951rem, 1.2rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: normal;
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
    transition: letter-spacing 0.12s linear, color 0.12s linear;
}
.btn--text:hover, .btn--text:focus-visible { color: var(--accent-hov); letter-spacing: 0.12em; }
.btn--text:focus-visible { outline: 1px solid var(--accent); outline-offset: 5px; }

/* START is the page's one call to action: larger, and it breathes. */
.btn--start {
    display: inline-flex;
    max-width: 50vw;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    white-space: nowrap;
    font-family: "Oxanium", sans-serif;
    font-size: clamp(1rem, 0.208vw + 0.951rem, 1.2rem);
    font-weight: 400;
    line-height: 1;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition:
        background 120ms linear 0s,
        color 120ms linear 0s,
        backdrop-filter 600ms ease 120ms,
        -webkite-backdrop-filter 600ms ease 120ms,
        border-color 800ms ease 500ms;
}

.btn--start {
    background: var(--soft);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--hairline);
    color: var(--shadow);
}

.btn--start:hover {
    background: transparent;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: var(--soft);
    color: var(--soft);
}

/* ── screens: one page, three states ── */
main { position: relative; z-index: 3; background: transparent;}
.screen {
    min-height: 100dvh;
    /* exactly clear of the fixed nav and footer; nothing extra */
    padding: var(--nav-h) var(--gutter) var(--footer-height);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.screen[hidden] { display: none; }
.screen.is-leaving { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.screen.is-entering { opacity: 0; transform: translateY(12px); }

/* ── intro ── */
.intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
    margin: 0;
}

.intro .teaser {
    margin: 0 0 1.5rem 0;
    font-family: "Oxanium", sans-serif;
    font-size: clamp(2.2rem, 1.045vw + 1.991rem, 4.5rem);
    font-weight: 400;
    color: var(--soft);
    letter-spacing: -0.03em;
    line-height: 1;
}

.intro-row {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
    gap: 3rem;
    /* matches the teaser's extra 1rem so the centred block gives up space
       above the eyebrow, not below the row */
    margin: 0 var(--gutter) 1.5rem var(--gutter);
}
.intro-copy {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 1rem;
}

.intro-copy .lede {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: clamp(0.9rem, 0.091vw + 0.882rem, 1.1rem);
    font-weight: 200;
    line-height: 1.1;
    text-align: left;
    color: var(--ice);
}

.intro-copy .smack {
    font-size: clamp(1rem, 0.091vw + 0.982rem, 1.2rem);
    font-weight: 500;
}

.closer {
    margin: 0;
    font-family: "Oxanium", sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 0.114vw + 0.977rem, 1.25rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}

.intro-dash {
    min-width: 38vw;
    display: flex;
    flex-direction: column;
    justify-content: flex-starqt;
    align-items: center;
}

.card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--muted);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.intro-interior {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin: 2rem 1.5rem;
}

.intro-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
    border: 0.5px solid var(--slate);
    padding: 0.5rem;
    background: var(--graphite);
}
.intro-facts div { background: transparent; text-align: left; padding: 0.75rem;
}
.intro-facts dt {
    font-family: "Oxanium", sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--soft);
}
.intro-facts dd { margin: 0.2rem 0 0; font-family: "Oxanium", sans-serif; font-size: 1.05rem; color: var(--ice); }
.intro-note { margin: 0; font-size: clamp(0.75rem, 0.114vw + 0.727rem, 1rem); color: var(--ice); }
.history { width: min(44rem, 100%); text-align: left; }
.history h2 {
    font-family: "Oxanium", sans-serif;
    font-weight: 400;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--soft);
}
.history ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.history li { display: flex; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--ice); gap: 0}
.history a { font-family: "Oxanium", sans-serif; color: var(--accent); text-decoration: none; }
.history a:hover { text-decoration: underline; }

/* ── run ──
   Three regions that never share space: the narration (all the words),
   the diagram (no sentences, fixed labels), and the list of tests.
   Colours follow nomenon.io: luminance carries hierarchy (ice, then
   soft, then muted); the reserved cyan is spent on the eyebrow and on
   paths an identity built; red appears only where something is stopped
   or cut off. */
.run {
    display: grid;
    /* words on the left, read first; the picture they describe on the right */
    grid-template-columns: minmax(19rem, 1fr) minmax(0, 1.75fr);
    grid-template-rows: auto auto minmax(0, 1fr) max-content;
    grid-template-areas:
        "head  head"
        "narr  stage"
        "tests stage"
        "tests legend";
    gap: 1rem 2rem;
    height: 100dvh;
    padding-top: calc(var(--nav-h) + 0.5rem);
    padding-bottom: calc(var(--footer-height) + 1rem);
}
.run[hidden] { display: none; }
.run-head {
    grid-area: head;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
}
.chapters { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0; padding: 0; list-style: none; }
.chapters li {
    font-family: "Oxanium", sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: var(--muted);
    border-top: 1px solid var(--slate);
    padding-top: 0.35rem;
    min-width: 7rem;
    transition: color 0.6s linear, border-color 0.6s linear;
}
.chapters li.is-done { color: var(--soft); border-top-color: var(--soft); }
.chapters li.is-active { color: var(--ice); border-top-color: var(--ice); border-top-width: 2px; padding-top: calc(0.35rem - 1px); }
.run-meta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-family: "Oxanium", sans-serif;
    font-size: 1rem;
    color: var(--soft);
}
.run-meta .clock { color: var(--muted); font-variant-numeric: tabular-nums; }
.run-meta .btn--text { font-size: 1rem; }
.run-meta .btn--text[hidden] { display: none; }

/* the narration: the one place words appear while the run plays */
.narration {
    grid-area: narr;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    min-height: 15rem;
    padding: 1.25rem 1.4rem 1rem;
    border: 0.5px solid var(--slate);
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.narration.is-new > :not(.n-pace) { animation: narrate-in 0.7s var(--ease) both; }
@keyframes narrate-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.narration .eyebrow { font-size: 0.85rem; line-height: 1.4; }
.n-title {
    margin: 0;
    font-family: "Oxanium", sans-serif;
    font-weight: 500;
    font-size: clamp(1.35rem, 1rem + 0.9vw, 1.9rem);
    line-height: 1.15;
    color: var(--ice);
}
.n-body { margin: 0; font-size: clamp(1rem, 0.95rem + 0.2vw, 1.15rem); line-height: 1.5; color: var(--soft); }
.n-result {
    margin: 0;
    padding-top: 0.7rem;
    border-top: 0.5px solid var(--slate);
    font-size: clamp(1rem, 0.95rem + 0.2vw, 1.15rem);
    line-height: 1.5;
    color: var(--ice);
}
.n-result.is-none { display: none; }
.n-result.is-pending { visibility: hidden; }
.n-result:not(.is-pending) { animation: narrate-in 0.7s var(--ease) both; }
.n-result-text { font-weight: 500; }
.n-verdict { display: block; margin-top: 0.2rem; font-family: "Oxanium", sans-serif; font-size: 0.95rem; color: var(--muted); }
.n-pace { margin-top: auto; display: flex; align-items: center; gap: 0.75rem; min-height: 1.2rem; }
.n-bar { flex: 1; height: 1px; background: var(--hairline); overflow: hidden; }
.n-bar span { display: block; height: 100%; background: var(--muted); transform-origin: left; transform: scaleX(0); }
.n-wait { flex: none; font-family: "Oxanium", sans-serif; font-size: 0.8rem; color: var(--muted); }
.n-wait[hidden] { display: none; }

/* the diagram */
.stage-panel {
    grid-area: stage;
    position: relative;
    min-height: 0;
    border: 0.5px solid var(--hairline);
    background: rgba(0, 0, 0, 0.55);
}
.dia { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dia-frame { fill: none; stroke: var(--slate); stroke-width: 1.5; transition: stroke 0.6s linear; }
.dia-frame.is-on { stroke: var(--muted); }
.dia-title { font-family: "Oxanium", sans-serif; font-weight: 500; fill: var(--ice); }
.dia-sub { font-family: "Oxanium", sans-serif; font-weight: 400; fill: var(--muted); }
.dia-label { font-family: "Oxanium", sans-serif; font-weight: 500; fill: var(--ice); transition: fill 0.5s linear; }
.dia-label.is-idle { fill: var(--muted); }
.dia-ent { transition: opacity 0.6s linear; }
.dia-idle { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-dasharray: 4 3; }
.dia-solid { fill: var(--ice); }
.dia-hollow { fill: none; stroke: var(--ice); stroke-width: 2; }
.dia-path { stroke: var(--accent); stroke-width: 3; stroke-linecap: square; opacity: 0; }
.dia-path.is-cut { stroke: var(--red); }
.dia-permit { stroke: var(--muted); stroke-width: 1.6; stroke-dasharray: 6 5; opacity: 0; }
.dia-ghost { stroke: var(--muted); stroke-width: 1.6; stroke-dasharray: 6 5; opacity: 0; }
.dia-halt { stroke: var(--red); stroke-width: 4; stroke-linecap: square; opacity: 0; }
.dia-ring { fill: none; stroke: var(--ice); stroke-width: 2; opacity: 0; }
.dia-dot { fill: var(--ice); opacity: 0; }

/* the tests, and how to read the picture */
.tests {
    grid-area: tests;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.tests-title { margin: 0; font-family: "Oxanium", sans-serif; font-weight: 500; font-size: 1rem; color: var(--soft); }
.tests-list { margin: 0; padding: 0; list-style: none; display: grid; }
/* a gap, not a heading, between rounds: the narration names the round */
.tests-row.is-round-start { margin-top: 0.6rem; }
.tests-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 0 1rem;
    padding: 0.3rem 0;
    border-top: 0.5px solid var(--hairline);
    font-size: 0.92rem;
    line-height: 1.35;
    color: var(--muted);
    transition: color 0.5s linear;
}
.tests-row.is-current, .tests-row.is-done { color: var(--ice); }
.tests-row.is-current .tests-name { font-weight: 500; }
.tests-status { font-family: "Oxanium", sans-serif; text-align: right; white-space: nowrap; }
.tests-verdict { font-family: "Oxanium", sans-serif; font-size: 0.78rem; color: var(--muted); }
.tests-verdict:not(:empty)::before { content: " · "; }
.tests-row.is-off .tests-verdict { color: var(--ice); }
.legend {
    grid-area: legend;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 2rem;
    font-size: 0.85rem;
    color: var(--muted);
    transition: color 0.6s linear;
}
.legend.is-lit { color: var(--ice); }
.legend li { display: flex; align-items: center; gap: 0.75rem; }
.legend svg { flex: none; width: 2.5rem; height: 0.75rem; overflow: visible; }
.lg-path { stroke: var(--accent); stroke-width: 3; }
.lg-ghost { stroke: var(--muted); stroke-width: 1.6; stroke-dasharray: 5 4; }
.lg-halt { stroke: var(--red); stroke-width: 4; }

.run-error {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    padding: 1.5rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.82);
}
.run-error[hidden] { display: none; }
.run-error p { margin: 0; max-width: 32rem; color: var(--soft); }

/* ── reports ── */
.reports { display: flex; flex-direction: column; align-items: center; gap: 1.6rem; }
.reports-inner { width: min(60rem, 100%); display: grid; gap: 1.6rem; }
.reports-head { display: grid; gap: 0.8rem; }
.verdict { font-size: clamp(1.8rem, 1.2rem + 2.2vw, 3.2rem); }
.docs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--graphite); gap: 1px; border: 1px solid var(--slate); }
.doc {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.2rem 1.2rem 1.3rem;
}
.doc h3 { margin: 0; font-family: "Oxanium", sans-serif; font-weight: 500; font-size: 1.05rem; color: var(--soft); word-break: break-all; }
.doc p { margin: 0; flex: 1; font-size: var(--fs-sm); color: var(--ice); }
.doc .doc-size { font-family: "Oxanium", sans-serif; font-size: 0.75rem; letter-spacing: 0.08em; color: var(--muted); }
.doc .btn { align-self: flex-start; font-size: 0.9rem; padding: 0.55rem 1rem; }
.attempts-wrap { overflow-x: auto; border: 1px solid var(--hairline); }
table.attempts { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.attempts caption {
    caption-side: top;
    text-align: left;
    padding: 0.9rem 1rem 0.4rem;
    font-family: "Oxanium", sans-serif;
    font-weight: 500;
    font-size: 1.05rem;
    color: var(--soft);
}
.attempts th, .attempts td { padding: 0.55rem 1rem; text-align: left; border-top: 0.5px solid var(--hairline); vertical-align: top; }
.attempts thead th {
    font-family: "Oxanium", sans-serif;
    font-weight: 400;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--soft);
}
.attempts .group th {
    padding-top: 0.9rem;
    font-family: "Oxanium", sans-serif;
    font-weight: 400;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: var(--accent);
}
.attempts td.route { white-space: nowrap; }
.attempts td.name { font-family: "Oxanium", sans-serif; color: var(--ice); }
.attempts .pass { color: var(--accent); font-family: "Oxanium", sans-serif; text-transform: uppercase; letter-spacing: 0.08em; }
.attempts .fail { color: var(--red); font-family: "Oxanium", sans-serif; text-transform: uppercase; letter-spacing: 0.08em; }
.attempts .muted { color: var(--soft); }
.reports-actions { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; }

/* ── login ── */

.login {
    display: flex;
    flex-direction: row;
    min-height: calc(100dvh - var(--nav-h) - 4rem);
    z-index: 100;
    background: transparent;
    align-items: center;
    justify-content: space-between;
    margin-left: 8vw;
    margin-right: 8vw;
}

/* The row holding the hero and the card. It fills .login's full height, so
   the hero column is as tall as the page and can spread its items. */

.login-hero {
    display: flex;
    flex-direction: column;
    max-width: 40vw;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    gap: 2.5rem;
}

/* Hero column at full screen height (100dvh less .screen's top and bottom
   padding) so its items spread; the card keeps .login's centring. */
.login {
    min-height: calc(100dvh - var(--nav-h) - 4rem);
}

.login-hero .product {
    font-family: "Oxanium", sans-serif;
    font-weight: 600;
    font-size: clamp(3rem, 1.149vw + 2.741rem, 5.5rem);
    color: var(--ice);
    letter-spacing: -0.05em;
    line-height: 1.2;
    align-self: flex-start;
    text-align: left;
}

.trade {
    font-size: clamp(1rem, 0.455vw + 0.909rem, 2rem);
}
.login-hero .eyebrow,
.login-hero .teaser {
    line-height: 1.5;
    align-self: flex-start;
    text-align: left;
}

.login-hero .eyebrow {
    display: block;
    font-family: "Oxanium", sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, calc(0.797rem + 0.329vw), 1.2rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}

.login-hero .teaser {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: clamp(1.2rem, 0.138vw + 1.169rem, 1.5rem);
    font-weight: 300;
    color: var(--soft);
    letter-spacing: 0.05em;
}

.login-card {
    max-width: 40vw;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1.5rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    background: transparent;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--muted);
}
.login-card .cta {
    font-family: "Oxanium", monospace;
    font-size: clamp(1.3rem, 0.500vw + 1.200rem, 1.8rem);
    font-weight: 400;
    text-align: center;
    color: var(--accent);
    align-self: center;
}
.login-card .lede {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: clamp(1rem, 0.227vw + 0.955rem, 1.5rem);
    font-weight: 200;
    text-align: left;
    color: var(--ice);
}
.login-card form { display: grid; gap: 1.5rem; align-self: stretch; }
.login-card .form-row { margin-top: 1rem; }
/* the status line takes no space until it has something to say */
.login-card .form-msg:empty { display: none; }
.login-card form[hidden] { display: none; }
.field { display: grid; gap: 0.5rem; }
.field label {
    font-family: "Oxanium", sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}
.field input {
    width: 100%;
    padding: 0.75rem 0.9rem;
    font: inherit;
    font-weight: 400;
    color: var(--ice);
    background: #000;
    border: 0.5px solid var(--slate);
    border-radius: 0;
}
.field input:focus { outline: none; border-color: var(--accent); }
.field input.code { font-family: "Oxanium", sans-serif; font-size: 1.6rem; letter-spacing: 0.5em; text-align: center; }
.form-msg { min-height: 1.4em; margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.form-msg.is-error { color: var(--red); }
.form-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }

.foot {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 4;
    display: flex;
    justify-content: space-between;
    padding: 0.5rem var(--gutter);
    font-family: "Oxanium", sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--slate);
    pointer-events: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ================================================================
   Phones. Everything below sits behind queries a desktop never matches
   (≤760px wide, a touch screen held sideways, or no hover), so the
   desktop layout above is untouched. One column; full-width tap
   targets; the safe-area insets that viewport-fit=cover hands us.
   ================================================================ */
@media (max-width: 760px) {
    :root {
        --gutter: 20px;
        --safe-l: max(var(--gutter), env(safe-area-inset-left));
        --safe-r: max(var(--gutter), env(safe-area-inset-right));
    }

    /* nav: a solid-enough bar, since long screens now scroll under it */
    .nav {
        height: calc(var(--nav-h) + env(safe-area-inset-top));
        padding: env(safe-area-inset-top) var(--safe-r) 0 var(--safe-l);
        background: rgba(0, 0, 0, 0.55);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    .nav-tag, .nav-user { display: none; }
    .brand { font-size: 1.1rem; }
    .wordmark-mark { height: 1.15rem; }
    .nav .btn--text { font-size: 0.85rem; padding: 0.75rem 0; }

    .screen {
        min-height: 100svh;
        padding: calc(var(--nav-h) + env(safe-area-inset-top) + 1.75rem) var(--safe-r)
            calc(2.5rem + env(safe-area-inset-bottom)) var(--safe-l);
    }

    /* buttons may use the whole column, and wrap rather than spill */
    .btn, .btn--text { max-width: 100%; white-space: normal; text-align: center; }
    .btn { min-height: 44px; }

    /* ── login: hero, then card ── */
    .login {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 2.25rem;
        min-height: 0;
        margin: 0;
    }
    .login-hero { max-width: none; gap: 1rem; }
    .login-hero .product { font-size: clamp(2.5rem, 12vw, 3.6rem); line-height: 1.05; }
    .login-hero .eyebrow { font-size: 0.8rem; }
    .login-hero .teaser { font-size: 1.1rem; }
    .login-card { max-width: none; padding: 1.75rem 1.25rem; gap: 1.25rem; }
    .login-card .cta { font-size: 1.35rem; }
    .login-card .lede { font-size: 1rem; font-weight: 300; }
    .login-card .form-row { margin-top: 0.25rem; }
    .login-card form .btn { flex: 1 1 100%; min-height: 48px; }
    .login-card .btn--text { flex: 1 1 100%; padding: 0.75rem 0; }
    /* 16px+ keeps iOS from zooming into the field */
    .field input { font-size: max(1rem, 16px); padding: 0.85rem 0.9rem; }
    .field input.code { font-size: 1.5rem; letter-spacing: 0.4em; }

    /* ── intro: one column, the START card after the story ── */
    .intro { justify-content: flex-start; gap: 0.5rem; }
    .intro .product { font-size: clamp(2rem, 9.5vw, 2.6rem); line-height: 1.05; }
    .intro .teaser { font-size: clamp(1.7rem, 8vw, 2.2rem); margin-bottom: 1.75rem; }
    .intro-row { display: flex; justify-content: center; align-items: flex-start; gap: 2.25rem; margin: 0; }
    .intro-copy { gap: 1rem; }
    .intro-copy .lede { font-size: 1rem; line-height: 1.5; }
    .intro-copy .closer { font-size: 0.9rem; line-height: 1.5; }
    .intro-dash { min-width: 0; }
    .intro-dash .card { align-items: stretch; }
    .intro-interior { align-items: stretch; gap: 1.75rem; margin: 1.5rem 1.25rem; }
    .intro-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.25rem; }
    .intro-facts div { padding: 0.5rem; }
    .intro-facts dt { font-size: 0.62rem; letter-spacing: 0.1em; }
    .intro-facts dd { font-size: 0.95rem; }
    .btn--start { width: 100%; padding: 1.1rem 1rem; letter-spacing: 0.35em; }
    .intro-note { font-size: 0.85rem; line-height: 1.45; text-align: center; }
    .history { width: 100%; }
    .history li { flex-direction: column; gap: 0.2rem; padding: 0.6rem 0; border-top: 0.5px solid var(--hairline); }
    .history a { padding: 0.25rem 0; overflow-wrap: anywhere; }

    /* ── run: one column — words first, then the picture, then the tests ── */
    .run {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        grid-template-areas: "head" "narr" "stage" "legend" "tests";
        height: auto;
        gap: 0.75rem;
        padding-top: calc(var(--nav-h) + env(safe-area-inset-top) + 0.5rem);
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
    .run-head { gap: 0.5rem; }
    .chapters { width: 100%; flex-wrap: nowrap; gap: 0.5rem; }
    .chapters li { flex: 1; min-width: 0; font-size: 0.8rem; }
    .run-meta { width: 100%; flex-wrap: wrap; justify-content: flex-start; min-width: 0; gap: 0 1.25rem; font-size: 0.9rem; }
    .run-meta #run-id { flex: 1 1 100%; }
    .run-meta .clock { flex: none; margin-right: auto; }
    .run-meta .btn--text { font-size: 0.9rem; padding: 0.6rem 0; }
    .narration { min-height: 13rem; padding: 0.9rem 1rem 0.7rem; gap: 0.55rem; }
    .n-title { font-size: 1.3rem; }
    .n-body, .n-result { font-size: 0.98rem; line-height: 1.45; }
    .stage-panel { width: 100%; aspect-ratio: 600 / 660; max-height: 62svh; }
    .tests { overflow: visible; }

    /* ── documents ── */
    .reports { align-items: stretch; }
    .reports-inner { gap: 1.75rem; }
    .reports-head .eyebrow { font-size: 0.72rem; overflow-wrap: anywhere; }
    .verdict { font-size: clamp(1.6rem, 7.5vw, 2.1rem); }
    .reports-head .lede { font-size: 1rem; line-height: 1.5; }
    .docs { grid-template-columns: 1fr; }
    .doc { padding: 1.1rem 1.1rem 1.2rem; }
    .doc + .doc { border-top: 0.5px solid var(--hairline); }
    .doc .form-row { flex-wrap: nowrap; }
    .doc .btn { flex: 1; min-height: 44px; }
    .doc .btn--text { flex: none; padding: 0.75rem 0.5rem; }

    /* attempts: each row becomes a small card; labels come from data-label */
    .attempts-wrap { overflow: visible; }
    table.attempts, .attempts tbody, .attempts caption { display: block; width: 100%; }
    .attempts caption { padding: 0.9rem 1rem 0.6rem; line-height: 1.5; }
    .attempts thead { display: none; }
    .attempts tr.group { display: block; }
    .attempts .group th { display: block; padding: 1rem 1rem 0.5rem; line-height: 1.45; }
    .attempts tbody tr:not(.group) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.35rem 0.75rem;
        padding: 0.75rem 1rem;
        border-top: 0.5px solid var(--hairline);
    }
    .attempts tbody td { padding: 0; border: 0; }
    .attempts tbody td.route { grid-column: 1 / -1; white-space: normal; color: var(--soft); }
    .attempts tbody td:nth-child(n + 2):nth-child(-n + 5) {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 8.5rem minmax(0, 1fr);
        gap: 0.75rem;
        font-size: 0.8rem;
        color: var(--soft);
    }
    .attempts tbody td[data-label]:nth-child(n + 2):nth-child(-n + 5)::before {
        content: attr(data-label);
        font-family: "Oxanium", sans-serif;
        font-size: 0.66rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--muted);
        padding-top: 0.12rem;
    }
    .attempts tbody td:nth-child(6) { grid-column: 2; grid-row: 1; text-align: right; }

    .reports-actions { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .reports-actions .btn { width: 100%; min-height: 48px; }
    .reports-actions .btn--text { align-self: center; padding: 0.85rem 0; }

    .foot { display: none; }
}

/* Very narrow phones. */
@media (max-width: 400px) {
    .tests-row { grid-template-columns: minmax(0, 1fr); }
    .tests-status { text-align: left; white-space: normal; }
    .intro-facts { grid-template-columns: 1fr; gap: 0; }
    .intro-facts div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
    .intro-facts dd { margin: 0; }
}

/* Phones held sideways are wider than 760px but only ~400px tall: the
   fixed footer would sit on top of the content, so it goes, and the run
   panel takes the screen's height rather than a desktop minimum. */
@media (pointer: coarse) and (max-height: 500px) {
    body footer, .foot { display: none; }
    .screen { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }
    .run {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        grid-template-areas: "head" "narr" "stage" "legend" "tests";
        height: auto;
        min-height: 100svh;
    }
    .stage-panel { height: calc(100svh - var(--nav-h) - 1.5rem); }
    .narration { min-height: 0; }
    .login { min-height: 0; padding: 1.5rem 0; }
    .login-hero .product { font-size: clamp(2.2rem, 6vw, 3.2rem); line-height: 1.05; }
}

/* Touch screens have no hover: a tapped button must not stay in its
   hover colours, so taps get a brief pressed state instead. */
@media (hover: none) {
    .btn:hover { background: var(--soft); border-color: transparent; color: var(--umber); }
    .btn--start:hover { background: var(--soft); border-color: var(--soft); color: var(--shadow); }
    .btn--text:hover { color: var(--accent); letter-spacing: 0.12em; }
    .btn:active, .btn--start:active { background: transparent; border-color: var(--accent); color: var(--accent); }
    .btn--text:active { color: var(--accent-hov); }
}

@media (prefers-reduced-motion: reduce) {
    .btn--start { animation: none; }
    .screen, .plate { transition: none; }
    .narration.is-new > :not(.n-pace), .n-result:not(.is-pending) { animation: none; }
}

/* ── footer ──
   nomenon.io's site footer (css/sitewide.css), injected by the Worker into
   <div id="site-footer"></div>. One line tall, fixed to the bottom, hidden
   on mobile as on nomenon.io. No fade-in: this is a single page. */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
    z-index: 3;
    max-width: 100%;
    padding: 0 2rem;
    height: var(--footer-height);
    line-height: var(--footer-height);
    background: transparent;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}
footer span {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
footer > span:first-child {
    flex: 1;
}
footer a {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    padding: 0 13px;
    outline: 1px solid transparent;
    background: transparent;
    transition:
        background 0.4s ease,
        outline-color 0.3s ease,
        color 0.2s ease;
}
footer a:hover {
    color: var(--ice);
    outline-color: var(--hairline);
    background: rgba(255, 255, 255, 0.03);
}
.footer-legal {
    flex-shrink: 0;
}
.footer-links {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}
@media screen and (max-width: 769px) {
    body footer {
        display: none;
    }
}
