/* AI OR DIE: the flow's own pieces (the flow's repair, 2026-11-12, D-128; docs/process/briefs/site-flow.md).
   The title's promise and its doors, So far's foot and its action row, the place in the story beside the seat line,
   the way back from an ending, the trailer's player. Everything here uses the type direction's tokens by name
   (docs/design/TYPE.md; css/site.css) and its two buttons (.btn, .btn.quiet): no new size, face or button is drawn. */

/* ---------- the title: what this is, in one plain line above the paper's line (the story's voice at the lede's size) ---------- */
.title-lines .lede.title-promise { max-width: 31em; font-family: var(--serif); font-size: var(--fs-lede); font-weight: 420; font-variation-settings: var(--fv-lede); letter-spacing: 0; line-height: 1.3; text-wrap: pretty; }
/* its doors: the paper button first, the quiet ones after it; on a phone each takes the row, so a thumb finds them */
.title-doors { gap: 12px 14px; }
html.narrow .title-doors .btn { flex: 1 1 100%; }

/* ---------- the trailer: a plain player over the scene (js/trailer.js) ---------- */
.trailer { width: min(1080px, calc(100vw - 24px)); max-width: none; max-height: calc(100vh - 24px); margin: auto; padding: 0; border: 0; background: transparent; color: var(--text); overflow: visible; }
.trailer::backdrop { background: rgba(8, 6, 4, 0.86); }
.trailer-box { display: flex; flex-direction: column; gap: 12px; }
.trailer-h { margin: 0; font-family: var(--serif); font-size: var(--fs-card); font-weight: 600; font-variation-settings: var(--fv-card); line-height: 1.15; color: var(--text); }
/* the film at its own 16:9, never taller than the window leaves it (the heading and the Close row stay in view) */
.trailer-video { display: block; width: 100%; height: auto; max-height: calc(100vh - 150px); aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); box-shadow: var(--paper-shadow); }
.trailer-video::cue { font-family: var(--sans); }
.trailer-row { justify-content: flex-end; }
/* when it ends (the site build of 2026-11-15, D-134): the title's own first door and Close, real buttons, over the
   film's last picture, which is dimmed under them (its own end card shows doors that are only a picture) */
.trailer-stage { position: relative; }
.trailer-end { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; border-radius: var(--radius); background: rgba(8, 6, 4, 0.8); }
.trailer-end-row { justify-content: center; gap: 14px; }
@supports (height: 100dvh) { .trailer { max-height: calc(100dvh - 24px); } .trailer-video { max-height: calc(100dvh - 150px); } }

/* ---------- where you are in the story: "Stop 3 of about 9", beside the seat line ---------- */
/* a label of the chrome, small and soft: the record's voice, and the screens' at "the world", as the seat line itself
   (TYPE.md, "the cold takes the interface too"); it gives way with the seat in a wide window that is not wide enough */
.where .stop-count, .where-inline .stop-count { flex: none; font-family: var(--label-font); font-weight: 400; font-size: var(--fs-note); line-height: 1.25; letter-spacing: var(--label-track); text-transform: var(--label-case); white-space: nowrap; color: var(--chrome-soft); }
.where .stop-count { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85); }
@media (max-width: 900px) { html.wide .where .stop-count { display: none; } }

/* ---------- an ending's recap: the way back to the fork, under "The road not taken" ---------- */
.not-taken-way { margin-top: 12px; }
/* a laptop's recap must fit its window (site/qa/walk.mjs, S-14), so there the button stands at the end of the heading's
   line and adds no row of its own; in the page's order it still follows the words it belongs to */
html.wide .not-taken-sec { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: center; }
html.wide .not-taken-sec > h2 { grid-column: 1; grid-row: 1; }
html.wide .not-taken-sec > .not-taken-way { grid-column: 2; grid-row: 1; margin: -8px 0 -6px; } /* it hangs on the heading's line: the line grows by a few px, not by a button's height */
html.wide .not-taken-sec > .not-taken { grid-column: 1 / -1; grid-row: 2; }

/* ---------- So far: the way to the story stands apart from the three guesses; the way on stays in reach ---------- */
/* the asking side: "Skip to the story" at the card's foot, after a rule and a clear space, at its far end: never a
   fourth answer, and never where "Go on" stood a press before */
.sofar-foot { display: flex; justify-content: flex-end; margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--paper-edge); }
/* the record side and the authors' note: "Go on" first, the way to the story at the row's far end */
.sofar-go [data-act="skip"] { margin-left: auto; }
/* the record side: its action row is a band at the card's foot that stays at the window's foot while the record above
   it is read, so "Go on" never needs a scroll (a phone's record card is taller than its window); nothing moves */
.sofar-card .sofar-go { position: sticky; bottom: 0; z-index: 2; margin: 3px -28px -24px; padding: 12px 28px 16px; border-top: 1px solid var(--paper-edge); border-radius: 0 0 var(--radius) var(--radius); background: var(--paper-ground-soft); background-color: var(--paper); box-shadow: 0 -12px 14px -14px rgba(35, 28, 22, 0.42); }
html.narrow .sofar-card .sofar-go { margin: 3px -18px -20px; padding: 10px 18px calc(12px + env(safe-area-inset-bottom, 0px)); }

/* ====================================================================================================================
   The repairs after the independent check (the CD, 2026-11-12, D-128; the findings are in the check seat's scratch folder, SC-01 to SC-23).
   ==================================================================================================================== */

/* ---------- SC-08, the title: the words had covered the lower two fifths of the street, people and dog included.
   One strong line, the promise; under it the paper's line in the record's voice and the handover in the story's, both
   quiet; then the doors. No word is changed. ---------- */
.title-lines { gap: 8px; }
.title-lines .lede.title-promise { max-width: 25em; margin-bottom: 4px; font-family: var(--story); font-size: clamp(1.5rem, 1rem + 1.45vw, 2.15rem); font-weight: 560; font-variation-settings: var(--fv-title); letter-spacing: -0.008em; line-height: 1.12; text-wrap: balance; }
.title-lines .lede:not(.title-promise):not(:has(.tag)) { max-width: 34em; font-size: var(--fs-lede); font-weight: 460; font-variation-settings: var(--fv-lede); letter-spacing: 0; line-height: 1.25; text-wrap: pretty; }
html.wide .title-lines .lede:not(.title-promise):not(:has(.tag)) { max-width: 34em; }
html.wide .title-lines .lede.title-promise { max-width: 25em; }
.title-left { gap: 16px; }

/* ---------- SC-02: the punctuation that closes a marked word stays on the word's line. A mark is a button, one box
   that a line may break after; a full stop once began the next line (js/terms.js wraps the two). ---------- */
.term-keep { white-space: nowrap; }
/* (the word itself still wraps inside its own box: a long marked phrase on a phone once ran off the page, 2026-11-13) */
.term-keep .term { white-space: normal; }

/* ---------- SC-03, the phone: a step's own way on stays in reach of a thumb. "Go on" stood under the fold when a stop
   opened; now its row keeps to the window's foot while its step is longer than the window. ---------- */
html.narrow .panel:not(.center) .row:has(> [data-act="next"]) { position: sticky; bottom: 0; z-index: 3; margin: 0 -16px; padding: 14px 16px max(12px, env(safe-area-inset-bottom, 0px)); background: linear-gradient(to bottom, rgba(var(--chrome-rgb), 0) 0, rgba(var(--chrome-rgb), 0.93) 14px, rgba(var(--chrome-rgb), 0.97) 100%); }

/* ---------- SC-04, So far: a card longer than the window scrolls under its foot, and nothing said so. The foot now
   fades what passes beneath it, and stands clear of the card's last line when the card is at its end. ---------- */
.sofar-card .sofar-go { margin-top: 30px; }
.sofar-card .sofar-go::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 30px; pointer-events: none; background: linear-gradient(to bottom, rgba(239, 228, 204, 0), var(--paper) 92%); }

/* ---------- SC-06, the phone: the three calls on one row ---------- */
html.narrow .guesses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
html.narrow .guesses .btn { padding-left: 6px; padding-right: 6px; }

/* ---------- SC-10, the phone: a dial's longest word ("everyone's") keeps a margin ---------- */
html.narrow .dial { padding-left: 5px; padding-right: 5px; }
html.narrow .dial .dw { font-size: 0.82rem; }

/* ---------- SC-20: the bar's paper tabs under the keyboard: the lamp ring, and a dark line inside it ---------- */
.tool:not(.toggle):focus-visible::before { box-shadow: 0 0 0 3px var(--focus), inset 0 0 0 2px #8f2d14, 0 9px 18px rgba(0, 0, 0, 0.42); }
/* the promise's question keeps its own line where there is room for it, and its answer the next */
html.wide .title-promise .promise-q { display: block; }
html.wide .title-lines .lede.title-promise { max-width: none; text-wrap: pretty; }

/* ---------- a phone held sideways ("side", the held items of 2026-11-15, D-135; js/main.js): the trailer's player as
   large as the window allows, its heading and Close on one row above it (the film had stood in a band between black) */
html.side .trailer { width: calc(100vw - 16px); max-height: calc(100vh - 12px); }
html.side .trailer-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "h row" "stage stage"; gap: 6px 12px; align-items: center; }
html.side .trailer-h { grid-area: h; }
html.side .trailer-row { grid-area: row; }
html.side .trailer-row .btn { min-height: 42px; padding-top: 4px; padding-bottom: 4px; }
html.side .trailer-stage { grid-area: stage; justify-self: center; max-width: 100%; }
html.side .trailer-video { width: auto; max-width: 100%; height: calc(100vh - 66px); max-height: none; }
@supports (height: 100dvh) { html.side .trailer { max-height: calc(100dvh - 12px); } html.side .trailer-video { height: calc(100dvh - 66px); max-height: none; } }
