/* Load validation simulator — chrome and layout.
 *
 * Palette lifted from the diagram-lab "03 Continuous flow" concept so this reads as the
 * same family: ink, one panel step lighter, gold as the only accent, green and amber
 * reserved for verdicts. Nothing else gets a colour.
 */

:root {
  --ink:        #2C2B2A;   /* Venatrust page */
  --panel:      #232221;
  --panel-2:    #373635;   /* Venatrust card */
  /* Legibility black, for strokes and shadows over the film. Deliberately NOT --ink:
   * the page colour is a warm grey and makes a weak outline. */
  --stroke:     #14130f;
  --gold:       #c9a53f;
  --gold-dim:   rgba(201, 165, 63, 0.45);
  --gold-wash:  rgba(201, 165, 63, 0.09);
  --green:      #7fd08c;
  --amber:      #e0a24a;
  --hair:       rgba(255, 255, 255, 0.14);
  --hair-soft:  rgba(255, 255, 255, 0.07);
  --text:       rgba(255, 255, 255, 0.92);
  --text-2:     rgba(255, 255, 255, 0.58);
  --text-3:     rgba(255, 255, 255, 0.34);

  --rail-w:     332px;
  /* One number governs how much wheel it takes to run the film. The scroll curve is
   * normalised, so changing this changes pace and nothing else. */
  --track-scroll: 700vh;

  --sans: "Montserrat", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

/* ─────────────────────────────────────────────────────────── intro/outro ── */

.intro, .outro {
  max-width: 62rem;
  margin: 0 auto;
  padding: 16vh 1.75rem 12vh;
}

.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.intro h1 {
  margin: 1.1rem 0 1.5rem;
  font-size: clamp(1.9rem, 5vw, 3.1rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.lede {
  max-width: 42rem;
  margin: 0 0 1rem;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--text-2);
}
.lede.dim { color: var(--text-3); font-size: 0.92rem; }

.scroll-hint {
  margin: 3.5rem 0 0;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-3);
}
.scroll-hint .arrow {
  display: inline-block;
  margin-left: 0.6rem;
  animation: nudge 2.1s ease-in-out infinite;
}
@keyframes nudge {
  0%, 100% { transform: translateY(0);   opacity: 0.45; }
  50%      { transform: translateY(5px); opacity: 1; }
}

.outro { border-top: 1px solid var(--hair-soft); }
.outro h2 {
  margin: 0 0 2.4rem;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 300;
  letter-spacing: -0.01em;
}
.outro-grid {
  display: grid;
  gap: 2rem 3rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}
.outro-grid p {
  margin: 0 0 0.5rem;
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--text-2);
}
.outro-k {
  font-family: var(--mono);
  font-size: 0.62rem !important;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold) !important;
}
.outro-note {
  margin: 3.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hair-soft);
  max-width: 46rem;
  font-size: 0.76rem;
  line-height: 1.75;
  color: var(--text-3);
}

/* ─────────────────────────────────────────────────────────────── track ── */

/* The mechanism: a tall track, a sticky stage inside it. Scroll position within the
 * track is the only input; everything else is derived from it. */
.track {
  position: relative;
  height: calc(100vh + var(--track-scroll));
}

.stage {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--panel);
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}

/* ─────────────────────────────────────────────────────────────── chrome ── */

.chrome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--hair);
  flex: none;
}
.chrome-title {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
.chrome-right { display: flex; align-items: center; gap: 0.6rem; margin: 0; }

.chip-warn {
  margin: 0;
  padding: 0.28rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.toggle {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--hair);
  border-radius: 2px;
  background: transparent;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  cursor: pointer;
  transition: color 160ms, border-color 160ms, background 160ms;
}
.toggle:hover { color: var(--text); border-color: var(--gold-dim); }
.toggle[aria-pressed="true"] {
  color: var(--gold);
  border-color: var(--gold-dim);
  background: var(--gold-wash);
}

/* ────────────────────────────────────────────────────────────── transport ── */

.transport {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  margin-right: 0.25rem;
}

.play {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--gold-dim);
  border-radius: 2px;
  background: var(--gold-wash);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  cursor: pointer;
  transition: color 160ms, border-color 160ms, background 160ms;
}
.play:hover { background: rgba(201, 165, 63, 0.18); border-color: var(--gold); }

/* One element, two glyphs: a triangle when stopped, two bars when playing. Cheaper than
 * swapping icons, and it can never end up showing the wrong one. */
.play-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 4.5px 0 4.5px 7.5px;
  border-color: transparent transparent transparent currentColor;
  transition: border-width 140ms, width 140ms, height 140ms;
}
.play[data-state="playing"] .play-icon {
  width: 7px;
  height: 9px;
  border-width: 0 2.5px;
  border-color: currentColor;
  background: transparent;
}
.play[data-state="playing"] {
  color: var(--green);
  border-color: rgba(127, 208, 140, 0.45);
  background: rgba(127, 208, 140, 0.1);
}
.play[data-state="playing"]:hover { background: rgba(127, 208, 140, 0.18); }

/* Parked in step mode: the button is the only thing that moves the run on, so it should
 * read as the live control rather than as a paused player. */
.play[data-state="waiting"] {
  border-color: var(--gold);
  background: rgba(201, 165, 63, 0.2);
  color: var(--gold);
  animation: continue-pulse 1.9s ease-in-out infinite;
}
.play[data-state="waiting"]:hover { background: rgba(201, 165, 63, 0.32); }
@keyframes continue-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 165, 63, 0.0); }
  50%      { box-shadow: 0 0 0 4px rgba(201, 165, 63, 0.14); }
}
@media (prefers-reduced-motion: reduce) {
  .play[data-state="waiting"] { animation: none; }
}

.chrome-left { display: flex; align-items: center; gap: 0.85rem; min-width: 0; }
.chrome-logo {
  height: 15px;
  width: auto;
  flex: none;
  opacity: 0.92;
}

.speeds { display: flex; }
.speeds button {
  padding: 0.3rem 0.42rem;
  border: 1px solid var(--hair);
  border-left-width: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  color: var(--text-3);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: color 160ms, background 160ms, border-color 160ms;
}
.speeds button:first-child { border-left-width: 1px; border-radius: 2px 0 0 2px; }
.speeds button:last-child { border-radius: 0 2px 2px 0; }
.speeds button:hover { color: var(--text-2); }
.speeds button[aria-pressed="true"] {
  color: var(--gold);
  background: var(--gold-wash);
  border-color: var(--gold-dim);
}

/* ─── the intro's own play button ─── */

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin: 2.6rem 0 0;
}
.play-lg {
  padding: 0.65rem 1.15rem;
  font-size: 0.68rem;
  gap: 0.6rem;
}
.play-lg .play-icon { border-width: 5.5px 0 5.5px 9px; }
.intro-or {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

/* ────────────────────────────────────────────────────────── the film ── */

/* Full bleed. Everything the viewer needs rides on top of the picture — there is
 * no sidebar, because a sidebar makes the film a thumbnail and the film is the
 * argument. */
.film {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #05080b;
}

.film video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Darken only the bands the panels sit in. The middle — the gantry and the
 * pallet — stays untouched. */
.scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(11,15,20,0.82) 0%, rgba(11,15,20,0.46) 16%,
      rgba(11,15,20,0.10) 30%, rgba(11,15,20,0.10) 62%,
      rgba(11,15,20,0.55) 84%, rgba(11,15,20,0.88) 100%);
}

.overlay { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ── the hold countdown ── */

.hold {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 5;
  background: rgba(255, 255, 255, 0.07);
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms;
}
.hold[data-state="run"], .hold[data-state="wait"] { opacity: 1; }
.hold[data-state="off"] { opacity: 0; }

.hold-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(201, 165, 63, 0.6);
}
/* No transition while running — the width is already updated every frame, and easing on
 * top of that makes the bar lag the number beside it. */
.hold[data-state="wait"] .hold-fill { background: var(--gold-dim); box-shadow: none; }

.hold-label {
  position: absolute;
  top: 0.5rem;
  right: 0.9rem;
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 1px 8px rgba(0,0,0,0.9);
}
.hold[data-state="wait"] .hold-label { color: var(--gold-dim); }

/* Type on the film gets its own dark edge rather than a plate behind it. */
.overlay text {
  paint-order: stroke;
  stroke: var(--stroke);
  stroke-width: 5px;
  stroke-linejoin: round;
  font-family: var(--mono);
}
.overlay .plated text { stroke: none; }

.film-meta { display: none; }
.stage[data-api="open"] .film-meta {
  display: block;
  position: absolute;
  right: 0.8rem;
  bottom: 0.5rem;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.26);
  pointer-events: none;
}

/* ──────────────────────────────────────────────────────────────── hero ── */

/* Sits on the film. The gradient is warm and weighted to the left, so the copy has a
 * solid ground to sit on while the right-hand side of the picture stays legible and the
 * trailer is visible doing something. */
.hero {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(1.75rem, 7vw, 6.5rem);
  background: linear-gradient(100deg,
    rgba(28, 27, 26, 0.90) 0%,
    rgba(28, 27, 26, 0.82) 34%,
    rgba(30, 29, 28, 0.58) 58%,
    rgba(32, 31, 30, 0.20) 82%,
    rgba(32, 31, 30, 0.06) 100%);
  will-change: opacity;
}
.hero-inner { max-width: 40rem; }

.hero-logo {
  height: 30px;
  width: auto;
  display: block;
  margin: 0 0 2.4rem;
}

.hero-eyebrow {
  margin: 0 0 0.9rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero-title {
  margin: 0 0 1.4rem;
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.6);
}

.hero-lede {
  margin: 0;
  max-width: 34rem;
  font-size: clamp(0.9rem, 1.25vw, 1.02rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.7);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin: 2.4rem 0 0;
}
.hero-or {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.hero-hint {
  position: absolute;
  left: clamp(1.75rem, 7vw, 6.5rem);
  bottom: 2.2rem;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-3);
}
.hero-hint .arrow {
  display: inline-block;
  margin-left: 0.5rem;
  animation: hint-drift 2.4s ease-in-out infinite;
}
@keyframes hint-drift {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50%      { transform: translateY(4px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-hint .arrow { animation: none; }
}

/* Once dissolved it must not eat clicks meant for the film. */
.stage[data-hero="gone"] .hero { pointer-events: none; }

/* The film's furniture belongs to the walkthrough, not to the title card -- it fades up
 * as the hero fades out, on the same number, so the two never overlap. */
.side, .beat, .hud, .step-rail { opacity: var(--reveal, 1); }

/* The arrival is an exterior shot at dusk and reads muddy under a scrim. Lift it while
 * the card is up and let it settle back to the graded original as the hero clears. */
.film video { filter: brightness(calc(1 + 0.26 * (1 - var(--reveal, 1)))); }

/* ─────────────────────────────────────────────────── floating panels ── */

/* Smoked glass rather than a solid plate: the picture still reads through, so
 * the panel belongs to the scene instead of covering it. */
.glass {
  position: absolute;
  z-index: 3;
  border: 1px solid var(--hair);
  border-radius: 3px;
  background: rgba(9, 13, 18, 0.72);
  backdrop-filter: blur(9px) saturate(0.9);
  -webkit-backdrop-filter: blur(9px) saturate(0.9);
  box-shadow: 0 8px 34px rgba(0,0,0,0.4);
  pointer-events: none;
}

.glass-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem 0.4rem;
  border-bottom: 1px solid var(--hair-soft);
}
.glass-title {
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.glass-sub {
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

/* One column, inset from the edge rather than pinned to it — panels flush to
 * the corner read as browser chrome, not as part of the picture. */
.side {
  position: absolute;
  top: 1.5rem;
  right: 1.9rem;
  z-index: 3;
  width: 17rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}
.side .glass { position: static; width: auto; }
.verdict-panel { padding: 0.75rem 0.9rem 0.85rem; }

/* ── the delivery note ── */

.manifest { list-style: none; margin: 0; padding: 0.35rem 0.45rem 0.5rem; }

.mrow {
  padding: 0.38rem 0.35rem 0.4rem;
  border-left: 2px solid transparent;
  transition: background 200ms, border-color 200ms;
}
.mrow-top {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.66rem;
}
.mrow-lpn { color: var(--text); letter-spacing: 0.02em; }
.mrow-sku { color: var(--text-3); font-size: 0.6rem; }
.mrow-n   { margin-left: auto; color: var(--text-2); font-variant-numeric: tabular-nums; }
.mrow-state {
  margin-top: 0.2rem;
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  color: var(--text-3);
}
.mbar { height: 2px; margin-top: 0.3rem; background: rgba(255,255,255,0.09); overflow: hidden; }
.mbar span { display: block; height: 100%; width: 0; background: var(--gold); transition: width 90ms linear; }

.mrow[data-state="armed"]    { background: rgba(255,255,255,0.03); border-left-color: var(--gold-dim); }
.mrow[data-state="armed"]    .mrow-state { color: var(--gold-dim); }
.mrow[data-state="reading"]  { background: var(--gold-wash); border-left-color: var(--gold); }
.mrow[data-state="reading"]  .mrow-state,
.mrow[data-state="reading"]  .mrow-n { color: var(--gold); }
.mrow[data-state="complete"] { border-left-color: var(--green); }
.mrow[data-state="complete"] .mrow-state,
.mrow[data-state="complete"] .mrow-n { color: var(--green); }
.mrow[data-state="complete"] .mbar span { background: var(--green); }
.mrow[data-state="short"]    { background: rgba(224,162,74,0.09); border-left-color: var(--amber); }
.mrow[data-state="short"]    .mrow-state,
.mrow[data-state="short"]    .mrow-n { color: var(--amber); }
.mrow[data-state="short"]    .mbar span { background: var(--amber); }

/* ── the running verdict ── */

.v-lede {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.v-big {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0.25rem 0 0.1rem;
}
.v-num {
  font-family: var(--mono);
  font-size: 1.9rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  transition: color 200ms;
}
.v-num[data-tone="green"] { color: var(--green); }
.v-num[data-tone="amber"] { color: var(--amber); }
.v-of { font-family: var(--mono); font-size: 0.68rem; color: var(--text-2); }
.v-cases {
  margin: 0.15rem 0 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}
.v-track { height: 3px; margin: 0.55rem 0 0.45rem; background: rgba(255,255,255,0.1); overflow: hidden; }
.v-track span { display: block; height: 100%; width: 0; background: var(--gold); transition: width 120ms linear, background 200ms; }
.v-track[data-tone="green"] span { background: var(--green); }
.v-track[data-tone="amber"] span { background: var(--amber); }
.v-note {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  color: var(--text-3);
}
.v-note[data-tone="green"] { color: var(--green); }
.v-note[data-tone="amber"] { color: var(--amber); }

/* the counterfactual has to announce itself, or the panel contradicts the film */
.v-flag {
  display: none;
  margin: 0.5rem 0 0;
  padding: 0.3rem 0.4rem;
  border: 1px solid rgba(224,162,74,0.4);
  background: rgba(224,162,74,0.1);
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
}
.stage[data-cf="true"] .v-flag { display: block; }
.stage[data-cf="true"] .film video { filter: grayscale(0.65) brightness(0.45) !important; }

/* ──────────────────────────────────────────────────────────── the beat ── */

.beat {
  position: absolute;
  left: 1.9rem;
  bottom: 1.5rem;
  z-index: 3;
  max-width: 33rem;
  pointer-events: none;
}
.beat-index {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.beat-title {
  margin: 0.25rem 0 0.3rem;
  font-size: 1.35rem;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0,0,0,0.75);
}
.beat-body {
  margin: 0;
  max-width: 30rem;
  font-size: 0.86rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.8);
  text-shadow: 0 1px 10px rgba(0,0,0,0.8);
}

/* ────────────────────────────────────────────────────────── step rail ── */

.step-rail {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  gap: 0.26rem;
}
.step-dot {
  width: 1.5rem;
  padding: 0.3rem 0 0.22rem;
  border: none;
  border-top: 2px solid rgba(255,255,255,0.2);
  background: transparent;
  font-family: var(--mono);
  font-size: 0.48rem;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: color 180ms, border-color 180ms;
  font-variant-numeric: tabular-nums;
}
.step-dot:hover { color: #fff; border-top-color: rgba(255,255,255,0.5); }
.step-dot[aria-current="true"] { color: var(--gold); border-top-color: var(--gold); }
.step-dot[data-kind="counterfactual"][aria-current="true"] { color: var(--amber); border-top-color: var(--amber); }

.progress { flex: none; height: 2px; background: var(--hair-soft); }
.progress span { display: block; height: 100%; width: 0; background: var(--gold); }

/* ─────────────────────────────────────────────────────── API drawer ── */

/* `display: grid` beats the UA sheet's `[hidden] { display: none }`, so without
 * this the drawer's heading leaks onto the page while it is meant to be shut. */
.api[hidden] { display: none; }

.api {
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1rem;
  max-height: 34vh;
  overflow: hidden;
  padding: 0.7rem 1.1rem 0.8rem;
  border-top: 1px solid var(--hair);
  background: var(--ink);
}
.api-col { min-width: 0; overflow: hidden auto; scrollbar-width: thin; }
.api-label {
  margin: 0 0 0.4rem;
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.feed { list-style: none; margin: 0; padding: 0; }
.feed li {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr);
  gap: 0.5rem;
  padding: 0.28rem 0 0.3rem;
  border-top: 1px solid var(--hair-soft);
  font-family: var(--mono);
  font-size: 0.55rem;
  line-height: 1.45;
}
.feed li:first-child { border-top: none; }
.feed-t { color: var(--text-3); font-variant-numeric: tabular-nums; }
.feed-h { color: var(--text); }
.feed-d { color: var(--text-3); overflow-wrap: anywhere; }
.feed li[data-kind="event"]   .feed-h { color: var(--gold); }
.feed li[data-kind="done"]    .feed-h { color: var(--green); }
.feed li[data-kind="anomaly"] .feed-h { color: var(--amber); }

.api-call { display: flex; align-items: baseline; gap: 0.4rem; font-family: var(--mono); font-size: 0.58rem; }
.api-m {
  padding: 0.08rem 0.3rem;
  border: 1px solid var(--gold-dim);
  border-radius: 2px;
  color: var(--gold);
  letter-spacing: 0.08em;
  flex: none;
}
.api-p { color: var(--text); overflow-wrap: anywhere; }
.api-note { margin: 0.45rem 0 0; font-family: var(--sans); font-size: 0.68rem; line-height: 1.6; color: var(--text-2); }
.api-k {
  margin: 0.55rem 0 0.2rem;
  font-family: var(--mono);
  font-size: 0.46rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.api pre {
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--hair-soft);
  border-radius: 2px;
  background: rgba(255,255,255,0.02);
  font-family: var(--mono);
  font-size: 0.52rem;
  line-height: 1.5;
  color: var(--text-2);
  overflow-x: auto;
  white-space: pre;
}

/* ──────────────────────────────────────────────── HUD on the picture ── */

.hud { position: absolute; inset: 0; z-index: 2; pointer-events: none; font-family: var(--mono); }
.hud-bl { position: absolute; left: 1.9rem; top: 1.6rem; max-width: 30%; }
.hud-status { display: flex; flex-wrap: wrap; gap: 0 0.85rem; margin: 0; }
.hud-status div { display: flex; align-items: baseline; gap: 0.3rem; }
.hud-status dt {
  margin: 0; font-size: 0.46rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(255,255,255,0.36);
}
.hud-status dd {
  margin: 0; font-size: 0.52rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.78);
  text-shadow: 0 0 4px var(--stroke);
}
.hud-status dd[data-tone="green"] { color: var(--green); }
.hud-status dd[data-tone="gold"]  { color: var(--gold); }

/* ────────────────────────────────────────────────────────────── narrow ── */

@media (max-width: 1040px) {
  .side { width: 14rem; right: 1.1rem; top: 1.1rem; }
  .speeds:not(.modes) { display: none; }   /* pace matters less than Auto/Step here */
  .beat { max-width: 22rem; }
  .beat-body { display: none; }
}

@media (max-width: 780px) {
  :root { --track-scroll: 560vh; }
  .overlay { display: none; }
  .side { top: 0.6rem; right: 0.6rem; left: 0.6rem; width: auto; }
  .hero { background: linear-gradient(160deg, rgba(28,27,26,0.95) 0%, rgba(28,27,26,0.88) 55%, rgba(30,29,28,0.62) 100%); }
  .hero-logo { height: 24px; margin-bottom: 1.6rem; }
  .chrome-logo { display: none; }
  .beat { left: 0.6rem; right: 0.6rem; bottom: 0.6rem; max-width: none; }
  .beat-body { display: none; }
  .hud-bl { display: none; }
  .step-rail { right: 0.6rem; bottom: 0.4rem; }
  .step-dot { width: 1.15rem; }
  .api { grid-template-columns: minmax(0, 1fr); }
  .api-col:first-child { display: none; }
  .speeds { display: none; }
  .intro, .outro { padding: 10vh 1.25rem 8vh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage *, .overlay * { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  .scroll-hint .arrow { animation: none; }
}
