/* Docket landing page. Tokens come from tokens.css. */

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.px.eyebrow { color: var(--ink-dim); margin: 0 0 0.875rem; }
code { font-family: var(--font-mono); background: var(--raise-2); padding: 1px 0.375rem; }
h2 {
  margin: 0 0 1.125rem; font-family: var(--font-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(2rem, 1.1rem + 3.4vw, 3.8rem); line-height: 1; letter-spacing: 0.01em;
}
section { padding-left: var(--gutter); padding-right: var(--gutter); max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 40; height: var(--nav-h);
  display: flex; align-items: center; gap: 1.5rem; padding: 0 var(--gutter);
  background: var(--field); border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 0.02em; text-decoration: none; line-height: 1; }
.brand span { color: var(--stop); }
.nav nav { display: flex; gap: 2px; margin-left: auto; }
.nav nav a {
  min-height: max(44px, 2.75rem); padding: 0 0.75rem; display: inline-flex; align-items: center; text-decoration: none; color: var(--ink-dim);
  font-family: var(--font-pixel); font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase;
}
.nav nav a:hover { color: var(--ink); }
.nav-cta { min-height: 2.5rem; }

/* hero: the whole fold is a budget. nav + copy row + rail must fit 100svh. */
.hero {
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.3fr); column-gap: 2.5rem; align-content: start;
  padding-top: clamp(1.25rem, 4.5vh, 4rem); padding-bottom: 0;
}
.hero-copy { align-self: center; }
.h1-word {
  margin: 0; display: block; font-family: var(--font-display); font-weight: 400; text-transform: uppercase;
  font-size: min(clamp(5rem, 3rem + 9.5vw, 11.5rem), 18svh); line-height: 0.86; letter-spacing: 0.005em; color: var(--ink);
}
.lede { margin: 1rem 0 1.25rem; max-width: 46ch; font-size: var(--step-1); color: var(--ink-dim); line-height: 1.5; }
.lede em { font-style: normal; font-weight: 700; color: var(--ink); background: linear-gradient(transparent 58%, rgba(255, 90, 54, 0.42) 58%); padding: 0 0.15em; }
.cta { display: flex; gap: 0.875rem; flex-wrap: wrap; }
.nosign { margin-left: 0.25rem; padding: 2px 0.5rem; background: var(--field); color: var(--go); font-size: var(--step--2); }
.copy .copy-label { font-family: var(--font-mono); text-transform: none; letter-spacing: 0; font-weight: 500; font-size: var(--step--1); }
.hero-line { margin: 0; align-self: center; min-width: 0; }
#hero-line { width: 100%; image-rendering: pixelated; border: 1px solid var(--line); background: var(--field); }
.hero-line figcaption { margin-top: 0.75rem; color: var(--ink-dim); max-width: 64ch; text-transform: none; letter-spacing: 0.02em; }
.rail {
  grid-column: 1 / -1; list-style: none; margin: 1.75rem 0 0; padding: 0.875rem 0; display: flex; gap: 0.75rem 2.5rem; flex-wrap: wrap;
  border-top: 1px solid var(--line); color: var(--ink-dim); font-size: var(--step--1);
}
.rail b { color: var(--ink); margin-right: 0.375rem; font-weight: 700; }

section:not(.hero) { padding-top: clamp(3.5rem, 8vw, 6.5rem); padding-bottom: 0.5rem; border-top: 1px solid var(--line); margin-top: clamp(2rem, 5vw, 4rem); }

/* evidence */
.evidence { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(1.75rem, 5vw, 4.5rem); align-items: start; }
.fails { margin: 0; padding: 0; list-style: none; display: grid; gap: 1.125rem; counter-reset: f; }
.fails li { counter-increment: f; padding-left: 3.25rem; position: relative; max-width: 54ch; }
.fails li::before { content: counter(f, decimal-leading-zero); position: absolute; left: 0; top: 0; font-family: var(--font-pixel); color: var(--stop); font-size: var(--step-0); }
.fails b { color: var(--ink); }
.src { margin: 1.375rem 0 0; font-size: var(--step--1); color: var(--ink-faint); max-width: 54ch; }
.ev-panel { border: 1px solid var(--line-strong); background: var(--raise); min-width: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs [role="tab"] {
  appearance: none; background: transparent; border: 0; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap;
  min-height: 3rem; padding: 0 1.125rem; color: var(--ink-dim);
  font-family: var(--font-pixel); font-size: var(--step--1); letter-spacing: 0.06em; text-transform: uppercase;
}
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.ev-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 1rem 1.125rem 0; flex-wrap: wrap; }
.ev-head h3 { margin: 0; font-size: var(--step-1); }
pre.ascii { margin: 0.875rem 1.125rem 0; padding: 0.875rem 1rem; background: var(--field); border: 1px solid var(--line); font-family: var(--font-mono); font-size: var(--step--1); line-height: 1.5; overflow-x: auto; white-space: pre; }
.t-go { color: var(--go); } .t-stop { color: var(--stop); } .t-warn { color: var(--warn); } .t-dim { color: var(--ink-faint); }
.ev-foot { margin: 0; padding: 0.875rem 1.125rem 1.125rem; color: var(--ink-dim); font-size: var(--step--1); }

/* states */
.states { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(1.75rem, 5vw, 4.5rem); align-items: start; }
.st-head p { max-width: 50ch; color: var(--ink-dim); }
.st-table { width: 100%; border-collapse: collapse; }
.st-table th, .st-table td { text-align: left; padding: 0.875rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.st-table thead th { font-family: var(--font-pixel); font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); font-weight: 400; }
.st-table td:last-child { font-family: var(--font-pixel); width: 3.5rem; }
.st-table .is-yes { background: var(--raise); }
.st-table .is-yes td:last-child { color: var(--go); }

/* record */
.record { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(1.75rem, 5vw, 4.5rem); align-items: start; }
.rec-copy p { max-width: 52ch; color: var(--ink-dim); }
.hint { font-size: var(--step--1); }
.tamper { display: flex; flex-wrap: wrap; gap: 0.625rem; margin: 1.125rem 0 0.75rem; }
.tamper input { flex: 1 1 100%; min-width: 0; min-height: max(44px, 2.75rem); padding: 0 0.75rem; border: 1px solid var(--line-strong); background: var(--field); color: var(--ink); border-radius: 0; font-family: var(--font-mono); }
.verdict-out { min-height: 2.6em; margin: 0; font-family: var(--font-pixel); letter-spacing: 0.04em; text-transform: uppercase; font-size: var(--step--1); }
.verdict-out.is-go { color: var(--go); } .verdict-out.is-stop { color: var(--stop); }
.rec-box { display: block; }
.rec-box textarea { width: 100%; padding: 0.875rem; border: 1px solid var(--line-strong); background: var(--field); color: var(--ink); border-radius: 0; font-family: var(--font-mono); font-size: var(--step--1); line-height: 1.5; resize: vertical; white-space: pre; overflow: auto; }

/* install */
.in-head h2 { max-width: 20ch; }
.in-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.125rem; }
.in-grid article { border: 1px solid var(--line); background: var(--raise); padding: 1.125rem; display: grid; gap: 0.875rem; align-content: start; min-width: 0; }
.in-grid h3, .demo h3 { margin: 0; color: var(--ink-dim); }
.in-grid p { margin: 0; }
.note { color: var(--ink-dim); font-size: var(--step--1); }
pre.term { margin: 0; padding: 0.875rem; background: var(--field); border: 1px solid var(--line); font-size: var(--step--1); line-height: 1.55; overflow-x: auto; }
.demo { margin-top: 1.125rem; display: grid; gap: 0.75rem; }

.foot { display: flex; flex-wrap: wrap; gap: 0.875rem 2rem; align-items: center; justify-content: space-between; padding: 2.5rem var(--gutter) 3.5rem; margin-top: clamp(3rem, 7vw, 6rem); border-top: 1px solid var(--line); }
.foot p { margin: 0; color: var(--ink-dim); }
.foot a { color: var(--ink); }

@media (max-width: 960px) {
  .nav nav { display: none; }
  .nav-cta { margin-left: auto; }
  .hero { grid-template-columns: minmax(0, 1fr); row-gap: 1.375rem; padding-top: 1.5rem; }
  .h1-word { font-size: clamp(4.4rem, 22vw, 9rem); }
  .evidence, .states, .record { grid-template-columns: minmax(0, 1fr); }
  .in-grid { grid-template-columns: minmax(0, 1fr); }
  .rail { margin-top: 0.5rem; }
}

.nav-cta { min-height: max(44px, 2.75rem); }
.ev-foot a, .foot a { display: inline-flex; align-items: center; min-height: max(44px, 2.75rem); }
.foot p:last-child { display: flex; flex-wrap: wrap; gap: 0 0.875rem; align-items: center; }
pre.ascii .ln { display: block; min-height: 1.5em; }

/* ---------- scroll system ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* progress belt: the page itself is a conveyor */
.belt { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; pointer-events: none; }
.belt-fill { display: block; width: 100%; height: 3px; background: var(--ink-faint); transform-origin: 0 50%; transform: scaleX(0); }
.belt-crate { position: absolute; top: -0.25rem; left: 0; width: 0.625rem; height: 0.625rem; background: var(--ink); will-change: transform; }

/* the gate: a tall wrapper with a sticky stage, driven by scroll */
/* Static by default (no JS, reduced motion). JS adds .is-scrub to turn the section into a tall wrapper with a sticky stage. */
main section.gate { max-width: none; padding: 0; margin: clamp(2rem, 5vw, 4rem) 0 0; border-top: 1px solid var(--line); position: relative; }
main section.gate.is-scrub { height: 190svh; }
.gate-stage {
  padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(1.5rem, 4vw, 3rem);
  display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
  max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter);
}
.is-scrub .gate-stage { position: sticky; top: var(--nav-h); height: calc(100svh - var(--nav-h)); padding-top: 0; padding-bottom: 0; }
.gate-copy h2 { font-size: clamp(1.8rem, 1rem + 2.6vw, 3.2rem); margin-bottom: 0.5rem; }
.steps { list-style: none; margin: 1.125rem 0 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: 0.625rem; padding: 0.875rem 0; border-top: 1px solid var(--line); }
.steps .n { color: var(--ink-faint); padding-top: 3px; }
.steps b { display: block; font-size: var(--step-1); line-height: 1.25; margin-bottom: 0.375rem; }
.steps p { margin: 0; color: var(--ink-dim); font-size: var(--step--1); max-width: 50ch; }
.pw { display: grid; grid-template-rows: 1fr; }
.pw > p { min-height: 0; overflow: hidden; }
.is-live .pw { grid-template-rows: 0fr; transition: grid-template-rows 0.45s var(--ease); }
.is-live li.is-on .pw { grid-template-rows: 1fr; }
.is-live .steps b { margin-bottom: 0; transition: margin-bottom 0.45s var(--ease); }
.is-live li.is-on b { margin-bottom: 0.375rem; }
.is-live .steps li { opacity: 0.34; transition: opacity 0.35s var(--ease); }
.is-live .steps li.is-on { opacity: 1; }
.is-live .steps li.is-on .n { color: var(--stop); }
.is-live .steps li.is-done .n { color: var(--go); }
.gate-view { margin: 0; min-width: 0; }
#gate-canvas { width: 100%; image-rendering: pixelated; border: 1px solid var(--line); background: var(--field); }
.gate-readout { display: flex; justify-content: space-between; gap: 0.75rem; margin-top: 0.75rem; color: var(--ink-dim); }
.gate-readout span:last-child { color: var(--ink); }
.gate-meter { height: 0.375rem; margin-top: 0.625rem; background: var(--raise-2); }
.gate-meter i { display: block; height: 100%; background: var(--ink); transform-origin: 0 50%; transform: scaleX(1); }

/* footer wordmark */
.foot { position: relative; overflow: hidden; }
.foot-big { flex-basis: 100%; display: flex; align-items: baseline; font-family: var(--font-display); text-transform: uppercase; line-height: 0.8; font-size: clamp(5rem, 2rem + 24vw, 22rem); letter-spacing: -0.01em; color: var(--ink); margin: 0 0 1.5rem -0.04em; will-change: transform; }
.foot-big i { color: var(--stop); font-style: normal; }

@media (min-width: 961px) { .foot-big { font-size: min(29rem, 31.5vw); } }

@media (max-width: 960px) {
  main section.gate.is-scrub { height: 175svh; }
  .gate-stage { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 0.75rem; }
  .is-scrub .gate-stage { padding-top: 0.875rem; }
  .gate-view { order: -1; }
  .gate-copy h2 { font-size: clamp(1.5rem, 6vw, 2rem); }
  .steps { margin-top: 0.625rem; }
  .steps li { padding: 0.5rem 0; }
  .steps b { font-size: var(--step-0); }
}

/* ---------- fullness: structure, not ornament ---------- */
/* A fixed graph-paper grid that fades toward the edges. The page reads as a ruled docket sheet. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 4rem 4rem; background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 85%); mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 85%);
}
main, .foot { position: relative; z-index: 1; }
.nav { z-index: 40; }

/* Two soft pools of colour behind the hero: the stop red under the scene, a cold blue at the corner. */
.hero { isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: -4rem 0 0; z-index: -1; pointer-events: none; overflow: hidden;
  background: radial-gradient(42rem 26rem at 76% 42%, rgba(255, 90, 54, 0.12), transparent 70%), radial-gradient(36rem 24rem at 6% 4%, rgba(101, 120, 181, 0.16), transparent 70%);
}

/* Ghost section numerals behind each heading. Outline only, so they never compete with text. */
main section[data-n] { position: relative; isolation: isolate; }
main section[data-n]::before {
  content: attr(data-n); position: absolute; z-index: -1; right: var(--gutter); top: clamp(1rem, 3vw, 2.5rem); pointer-events: none;
  font-family: var(--font-display); font-size: clamp(7rem, 3rem + 14vw, 20rem); line-height: 0.8; color: transparent;
  -webkit-text-stroke: 1px var(--line); letter-spacing: 0.02em;
}
main section.gate[data-n]::before { right: calc(var(--gutter) + 1rem); top: 2rem; }

/* Hero readouts: large numerals in ruled cells, so the fold is full and every number means something. */
.rail { gap: 0; padding: 0; margin-top: 1.4rem; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); }
.rail li { flex: 1 1 11rem; padding: 0.7rem 1.5rem 0.6rem 0; margin-right: 1.5rem; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.1rem; line-height: 1.35; }
.rail li:last-child { border-right: 0; margin-right: 0; }
.rail b { font-family: var(--font-display); font-weight: 400; text-transform: none; letter-spacing: 0.01em; font-size: clamp(2.1rem, 1.2rem + 1.9vw, 3.2rem); line-height: 1; color: var(--ink); margin: 0 0 0.2rem; }

/* ---------- the docket slip: paper on the night field ----------
 * Re-pointing the tokens inside .slip flips every rule below it (ink, rules, chips, evidence colours,
 * buttons, the textarea) to ink on paper with no extra rules. */
.slip {
  --field: var(--paper-2); --raise: var(--paper); --raise-2: var(--paper-2);
  --line: var(--paper-line); --line-strong: var(--paper-faint);
  --ink: var(--paper-ink); --ink-dim: var(--paper-dim); --ink-faint: var(--paper-faint);
  --stop: var(--paper-stop); --go: var(--paper-go); --warn: var(--paper-warn);
  position: relative; background: var(--paper); color: var(--paper-ink); border: 0; padding-bottom: 0.7rem;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 1.1rem 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 1.1rem 100%;
}
.slip::before {
  content: ""; display: block; height: 1.2rem; margin-bottom: 0.15rem; border-bottom: 1px dashed var(--paper-line);
  background: radial-gradient(circle at 50% 50%, var(--page) 0.24rem, transparent 0.26rem) 0 0 / 1.5rem 100% repeat-x;
}
.slip a { color: var(--paper-ink); text-decoration-color: var(--paper-faint); }
.ev-panel.slip .ev-foot { padding-bottom: 1.1rem; }
.rec-box.slip { padding-bottom: 1.4rem; }
.rec-box.slip textarea { width: calc(100% - 2rem); margin: 0.9rem 1rem 0; display: block; }

.hero-slip { margin: 1.1rem 0 0; max-width: 34rem; padding: 0 0 1.1rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 0.7rem; }
.hero-slip > div:first-of-type { grid-column: span 2; }
.hero-slip::before { grid-column: 1 / -1; margin-bottom: 0.9rem; }
.hero-slip > div { padding: 0 0.9rem; border-right: 1px dashed var(--paper-line); min-width: 0; }
.hero-slip > div:nth-of-type(2), .hero-slip > div:last-of-type { border-right: 0; }
.hero-slip dt { color: var(--paper-faint); font-size: var(--step--2); margin-bottom: 0.2rem; }
.hero-slip dd { margin: 0; font-family: var(--font-mono); font-weight: 700; font-size: var(--step-0); line-height: 1.3; overflow-wrap: anywhere; }
.hero-slip #hs-state { color: var(--paper-stop); }
@media (max-width: 960px) {
  .hero-slip { max-width: none; }
  .rail li { flex-basis: 40%; border-right: 0; }
  main section[data-n]::before { font-size: clamp(5rem, 24vw, 9rem); }
}

/* The key under the scene: the three outcomes, with the exit code each one returns. */
.key { list-style: none; margin: 1.1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); }
.key li { display: grid; grid-template-columns: 0.8rem 1fr; column-gap: 0.7rem; row-gap: 0.1rem; padding: 0.75rem 1rem 0.2rem 0; align-items: center; }
.key i { width: 0.8rem; height: 0.8rem; grid-row: span 2; align-self: start; margin-top: 0.3rem; }
.key .k-go { background: var(--go); } .key .k-warn { background: var(--warn); } .key .k-stop { background: var(--stop); }
.key b { font-family: var(--font-pixel); font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; font-size: var(--step--1); }
.key span { grid-column: 2; color: var(--ink-dim); font-size: var(--step--1); line-height: 1.35; }

/* On tall displays the hero fills the viewport, so the next section starts at the fold instead of
 * leaving an empty band under a hero that only needs two thirds of a 4K screen. */
@media (min-height: 1000px) { .hero { min-height: calc(100svh - var(--nav-h)); align-content: center; } }
@media (max-width: 960px) { .key { grid-template-columns: minmax(0, 1fr); } .key li { padding-bottom: 0.4rem; } }

/* Terminal blocks are not inline code: no per-line highlight band, and a long command wraps instead of clipping. */
pre code { background: none; padding: 0; font-size: inherit; }
pre.term { white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: hidden; }
/* The states table sits on a plate, so the ghost numeral behind it never crosses its text. */
.st-table { background: rgba(11, 16, 32, 0.88); }
@media (max-width: 960px) { .hero-slip > div:last-of-type { grid-column: 1 / -1; border-top: 1px dashed var(--paper-line); padding-top: 0.6rem; } }

/* Short desktop screens (a 1366x768 netbook): same composition, tighter rhythm, so the fold still holds the readouts. */
@media (max-height: 820px) and (min-width: 961px) {
  .hero { padding-top: 0.75rem; }
  .h1-word { font-size: min(clamp(5rem, 3rem + 9.5vw, 11.5rem), 15svh); }
  .lede { margin: 0.7rem 0 0.9rem; }
  .hero-slip { margin-top: 0.8rem; padding-bottom: 0.7rem; row-gap: 0.45rem; }
  .hero-slip::before { height: 1rem; margin-bottom: 0.6rem; }
  .rail { margin-top: 0.9rem; }
  .rail li { padding: 0.5rem 1.2rem 0.4rem 0; }
  .rail b { font-size: clamp(1.7rem, 1rem + 1.4vw, 2.4rem); }
}

/* The terminal UI install is the main way in, so it gets a full-width block above the three smaller ones. */
.in-tui { margin-bottom: 1.125rem; }
.in-tui article { border: 1px solid var(--line); background: var(--raise); padding: 1.25rem; display: grid; gap: 0.875rem; min-width: 0; }
.in-tui h3 { margin: 0; color: var(--ink-dim); }
.in-tui p { margin: 0; }
.in-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
