/* F1 Strategist — full landing page
   F1 palette: Racing Red #e10600 · Black #0a0a0a · White #f0f0f0
   Teal (trained): #00d2be · Orange (untrained): #ef8a17 · Gold (expert): #ffd60a */

:root {
  --bg:        #0a0a0a;
  --bg2:       #0f0f0f;
  --ink:       #f0f0f0;
  --dim:       #666;
  --rule:      #1e1e1e;
  --red:       #e10600;
  --red-dim:   rgba(225,6,0,0.3);
  --gold:      #ffd60a;
  --teal:      #00d2be;
  --orange:    #ef8a17;
  --green:     #1a8754;
  --mono: 'JetBrains Mono', 'IBM Plex Mono', 'Menlo', 'Consolas', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  /* NO overflow:hidden here — let body scroll naturally */
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  /* NO overflow:hidden on body */
}

canvas#bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* ── Topbar ─────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 28px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--rule);
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(8px);
}
.brand { color: var(--ink); font-weight: 600; }
.brand-tick { color: var(--red); margin-right: 4px; }
nav a {
  color: var(--dim);
  text-decoration: none;
  margin-left: 18px;
  transition: color 120ms;
}
nav a:hover { color: var(--red); }

/* ── Screen sections ────────────────────────────────── */
.screen {
  position: relative;
  min-height: 100vh;
  /* Use overflow:clip (no scroll container) instead of overflow:hidden */
  overflow: clip;
}
.screen-half {
  position: relative;
  min-height: 50vh;
  overflow: clip;
}
.screen-dark { background: var(--bg2); }

.section-inner {
  position: relative;
  z-index: 5;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 100px 40px 80px;
}
.section-inner--center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.section-title {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 16px;
  line-height: 1.2;
}
.section-sub {
  color: var(--dim);
  font-size: 12.5px;
  max-width: 680px;
  line-height: 1.8;
  margin-bottom: 48px;
}

/* ── HERO ───────────────────────────────────────────── */
#hero { background: var(--bg); }

svg#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
svg path, svg line, svg polyline {
  fill: none;
  stroke: #c8c8c8;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
svg .opponent { stroke: #3a3a3a; stroke-width: 0.8; }
svg .telemetry { stroke: #2e2e2e; stroke-width: 0.7; opacity: 0.8; }
svg .pit-pulse  { fill: var(--red); }

.hud {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  display: grid;
  grid-template-rows: 1fr auto auto;
  grid-template-columns: 1fr 340px;
  grid-template-areas:
    "lede     timeline"
    "readout  timeline"
    "footer   footer";
  padding: 80px 32px 24px;
  gap: 14px;
}
.scenario-tag {
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.lede { grid-area: lede; align-self: end; max-width: 560px; pointer-events: auto; }
.lede h1 {
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 14px;
  white-space: pre-wrap;
  min-height: 36px;
}
.lede h1::after {
  content: "▍";
  margin-left: 2px;
  color: var(--red);
  animation: blink 900ms steps(1) infinite;
}
.lede h1.done::after { content: ""; animation: none; }
.lede p { color: var(--dim); font-size: 12.5px; line-height: 1.75; max-width: 500px; white-space: pre-wrap; min-height: 20px; }
@keyframes blink { 50% { opacity: 0; } }

.timeline {
  grid-area: timeline;
  align-self: end;
  border-left: 1px solid var(--rule);
  padding: 14px 0 14px 18px;
  pointer-events: auto;
  max-height: 58vh;
  overflow: hidden;
}
.timeline-header { font-size: 9px; letter-spacing: 0.28em; color: var(--red); text-transform: uppercase; margin-bottom: 12px; }
.timeline ol { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.timeline li {
  font-size: 11px; color: var(--dim); letter-spacing: 0.02em;
  display: grid; grid-template-columns: 52px 1fr; gap: 10px;
  opacity: 0; transform: translateX(-8px);
  transition: opacity 200ms, transform 200ms, color 200ms;
}
.timeline li.in { opacity: 1; transform: translateX(0); }
.timeline li.key { color: var(--ink); }
.timeline li.key .cmd { color: var(--red); }
.timeline li .lap { color: var(--red); font-variant-numeric: tabular-nums; }

.readout {
  grid-area: readout; align-self: end; display: grid; gap: 5px;
  max-width: 360px; padding: 12px 0 0; border-top: 1px solid var(--rule);
  pointer-events: auto;
}
.readout .row { display: grid; grid-template-columns: 84px 1fr; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.readout .k { color: var(--dim); }
.readout .v { color: var(--ink); font-variant-numeric: tabular-nums; }
.readout .v.red { color: var(--red); }
.badge-trained { background: var(--green); color: #fff; font-size: 8px; letter-spacing: 0.12em; padding: 1px 5px; border-radius: 2px; margin-left: 5px; }

.footer {
  grid-area: footer;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px; color: var(--dim); letter-spacing: 0.14em; text-transform: uppercase;
  padding-top: 12px; border-top: 1px solid var(--rule); pointer-events: auto;
}
.footer .dot { padding: 0 10px; }

.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--dim); text-decoration: none; font-size: 9px; letter-spacing: 0.2em;
  text-transform: uppercase; animation: bounce 2s ease-in-out infinite; pointer-events: auto;
}
.scroll-hint:hover { color: var(--red); }
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ── PIPELINE ───────────────────────────────────────── */
.pipe-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 36px; }
.pipe-card {
  border: 1px solid var(--rule); padding: 26px 22px;
  background: rgba(255,255,255,0.015);
  opacity: 0; transform: translateY(20px);
  transition: opacity 500ms, transform 500ms, border-color 200ms;
}
.pipe-card.revealed { opacity: 1; transform: translateY(0); }
.pipe-card:hover { border-color: var(--red-dim); }
.pipe-num { font-size: 9px; letter-spacing: 0.28em; color: var(--red); margin-bottom: 16px; }
.pipe-icon { width: 44px; height: 44px; color: var(--dim); margin-bottom: 14px; }
.pipe-icon svg { width: 100%; height: 100%; }
.pipe-card h3 { font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); margin-bottom: 10px; }
.pipe-card p { color: var(--dim); font-size: 11.5px; line-height: 1.75; margin-bottom: 12px; }
.pipe-bullets { list-style: none; display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.pipe-bullets li { font-size: 11px; color: var(--dim); padding-left: 12px; position: relative; }
.pipe-bullets li::before { content: "·"; position: absolute; left: 0; color: var(--red); }
.pipe-api { border-top: 1px solid var(--rule); padding-top: 10px; font-size: 10px; color: var(--dim); }
.pipe-api code { color: var(--teal); }
.reward-dims {
  border: 1px solid var(--rule); padding: 18px 22px;
  opacity: 0; transform: translateY(14px);
  transition: opacity 500ms 200ms, transform 500ms 200ms;
}
.reward-dims.revealed { opacity: 1; transform: translateY(0); }
.dims-title { font-size: 9px; letter-spacing: 0.26em; color: var(--dim); text-transform: uppercase; margin-bottom: 12px; }
.dims-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dim-item { display: flex; align-items: center; gap: 6px; border: 1px solid var(--rule); padding: 5px 10px; font-size: 10.5px; }
.dim-w { color: var(--red); font-weight: 600; min-width: 28px; }
.dim-n { color: var(--dim); }

/* ── CIRCUITS ───────────────────────────────────────── */
.track-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.track-cell {
  border: 1px solid var(--rule); background: #0c0c0c; overflow: hidden;
  opacity: 0; transform: scale(0.97);
  transition: opacity 400ms, transform 400ms, border-color 200ms;
}
.track-cell.revealed { opacity: 1; transform: scale(1); }
.track-cell:hover { border-color: var(--red-dim); }
.track-canvas-wrap { position: relative; height: 160px; overflow: hidden; }
.track-canvas-wrap canvas { width: 100%; height: 100%; display: block; }
.track-info { padding: 12px 14px; border-top: 1px solid var(--rule); }
.track-name { font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); margin-bottom: 4px; }
.track-char { font-size: 10px; color: var(--dim); margin-bottom: 8px; }
.track-badge { display: inline-block; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; padding: 3px 7px; border-radius: 2px; }
.badge-red   { background: var(--red);   color: #fff; }
.badge-teal  { background: #003d3a;      color: var(--teal); }
.badge-gold  { background: #3a2e00;      color: var(--gold); }
.badge-blue  { background: #001e3a;      color: #5bc0f8; }
.badge-green { background: #0a2418;      color: var(--teal); }
.badge-white { background: #1a1a1a;      color: var(--ink); }

/* ── EVIDENCE / GALLERY ─────────────────────────────── */
.evidence-sub-label { font-size: 9px; letter-spacing: 0.26em; color: var(--dim); text-transform: uppercase; margin-bottom: 10px; }

/* Story block */
.story-block {
  border: 1px solid var(--rule); padding: 22px;
  margin-bottom: 36px;
  opacity: 0; transform: translateY(16px);
  transition: opacity 500ms, transform 500ms;
}
.story-block.revealed { opacity: 1; transform: translateY(0); }
.story-title { font-size: 9px; letter-spacing: 0.28em; color: var(--red); text-transform: uppercase; margin-bottom: 18px; }
.story-cols {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  align-items: center;
  gap: 0;
}
.story-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.story-arrow-line { width: 1px; height: 40px; background: var(--rule); }
.story-arrow-icon { font-size: 18px; color: var(--red); line-height: 1; }
.story-badge { font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; padding: 4px 8px; display: inline-block; margin-bottom: 12px; }
.story-badge.bad  { background: #1a0000; color: var(--red); }
.story-badge.good { background: #0a2418; color: var(--teal); }
.story-log { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.slog-line { font-size: 11px; color: var(--dim); }
.slog-line.bad  { color: #b03030; }
.slog-line.good { color: var(--dim); }
.slog-lap { color: var(--red); margin-right: 8px; font-variant-numeric: tabular-nums; }
.slog-cmd { color: var(--ink); }
.slog-note { font-size: 10px; margin-left: 6px; }
.slog-note.bad  { color: var(--red); }
.slog-note.good { color: var(--teal); }
.red   { color: var(--red)  !important; }
.green { color: var(--teal) !important; }
.dim   { color: var(--dim)  !important; }

/* Evidence table + curve */
.evidence-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-bottom: 40px; }
.score-table-wrap { opacity: 0; transform: translateX(-16px); transition: opacity 500ms, transform 500ms; }
.score-table-wrap.revealed { opacity: 1; transform: translateX(0); }
.score-table { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-bottom: 12px; }
.score-table th { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.score-table td { padding: 9px 10px; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.score-table tr:last-child td { border-bottom: none; }
.score-table td:first-child { color: var(--ink); }
.col-random    { color: #555; }
.col-untrained { color: var(--orange); }
.col-trained   { color: var(--teal); font-weight: 600; }
.col-expert    { color: var(--gold); }
.table-legend { display: flex; gap: 14px; font-size: 10px; color: var(--dim); flex-wrap: wrap; }
.leg-dot { margin-right: 2px; }
.leg-dot.col-random    { color: #555; }
.leg-dot.col-untrained { color: var(--orange); }
.leg-dot.col-trained   { color: var(--teal); }
.leg-dot.col-expert    { color: var(--gold); }

.curve-wrap { opacity: 0; transform: translateX(16px); transition: opacity 500ms, transform 500ms; }
.curve-wrap.revealed { opacity: 1; transform: translateX(0); }
.curve-label { font-size: 9px; letter-spacing: 0.25em; color: var(--dim); text-transform: uppercase; margin-bottom: 10px; }
#reward-curve { width: 100%; height: auto; border: 1px solid var(--rule); display: block; background: #0c0c0c; }
.curve-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 10px; }
.cl-trained { color: var(--teal); }
.cl-expert  { color: var(--gold); }
.cl-untrained{ color: var(--orange); }
.curve-caption { font-size: 10px; color: var(--dim); margin-top: 6px; letter-spacing: 0.05em; }

/* PNG gallery — stacked: hero full-width, then two side-by-side below */
.png-gallery {
  display: flex;
  flex-direction: column;
  gap: 16px;
  opacity: 0; transform: translateY(14px);
  transition: opacity 500ms, transform 500ms;
}
.png-gallery.revealed { opacity: 1; transform: translateY(0); }
/* Hero image (race story) — full width */
.png-fig-hero { border: 1px solid var(--rule); overflow: hidden; }
.png-fig-hero img {
  width: 100%; height: auto;
  display: block; background: #0c0c0c;
}
/* Bottom row: training curve + track grid side by side */
.png-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.png-fig { border: 1px solid var(--rule); overflow: hidden; }
.png-fig img {
  width: 100%; height: auto;
  display: block; background: #0c0c0c;
}
.png-fig img:not([src]), .png-fig-hero img:not([src]) { min-height: 120px; }
.png-caption {
  display: block; padding: 8px 12px;
  font-size: 10px; color: var(--dim); letter-spacing: 0.05em;
  border-top: 1px solid var(--rule);
}
.png-fig figcaption { padding: 8px 12px; font-size: 10px; color: var(--dim); letter-spacing: 0.05em; border-top: 1px solid var(--rule); }

/* ── MEDIA section ──────────────────────────────────── */
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.media-card {
  border: 1px solid var(--rule); padding: 26px 22px;
  background: rgba(255,255,255,0.015);
  opacity: 0; transform: translateY(16px);
  transition: opacity 500ms, transform 500ms, border-color 200ms;
  display: flex; flex-direction: column;
}
.media-card.revealed { opacity: 1; transform: translateY(0); }
.media-card:hover { border-color: var(--red-dim); }
.media-icon { width: 44px; height: 44px; color: var(--dim); margin-bottom: 14px; }
.media-icon svg { width: 100%; height: 100%; }
.media-card-label { font-size: 9px; letter-spacing: 0.28em; color: var(--red); text-transform: uppercase; margin-bottom: 10px; }
.media-card-title { font-size: 13px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); margin-bottom: 10px; }
.media-card-desc { font-size: 11.5px; color: var(--dim); line-height: 1.7; margin-bottom: 20px; flex: 1; }
.media-card-desc code { color: var(--teal); }
.media-btn {
  display: inline-block; padding: 9px 16px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: none; background: var(--red); color: #fff;
  transition: background 150ms; align-self: flex-start;
}
.media-btn:hover { background: #ff2010; }
.media-btn--ghost { background: transparent; border: 1px solid var(--rule); color: var(--dim); }
.media-btn--ghost:hover { border-color: var(--red); color: var(--red); background: transparent; }

/* ── API / TRY IT ───────────────────────────────────── */
/* Interactive sim widget */
.sim-widget {
  border: 1px solid var(--rule); padding: 22px;
  margin-bottom: 32px;
  opacity: 0; transform: translateY(14px);
  transition: opacity 500ms, transform 500ms;
  position: relative;
}
.sim-widget.revealed { opacity: 1; transform: translateY(0); }
.sim-widget-label { font-size: 9px; letter-spacing: 0.28em; color: var(--red); text-transform: uppercase; margin-bottom: 16px; }
.sim-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
}
.sim-field { display: flex; flex-direction: column; gap: 5px; }
.sim-field-label { font-size: 9px; letter-spacing: 0.2em; color: var(--dim); text-transform: uppercase; }
.sim-field select {
  background: #111; color: var(--ink);
  border: 1px solid var(--rule); padding: 8px 12px;
  font-family: var(--mono); font-size: 11px;
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0 L5 6 L10 0' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  min-width: 220px;
  transition: border-color 150ms;
}
.sim-field select:focus { outline: none; border-color: var(--red); }
.sim-launch-btn {
  padding: 9px 20px;
  background: var(--red); color: #fff;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  text-decoration: none; border: none; cursor: pointer;
  transition: background 150ms;
  align-self: flex-end;
}
.sim-launch-btn:hover { background: #ff2010; }
.sim-cmd-wrap, .sim-api-wrap { position: relative; margin-bottom: 12px; }
.sim-cmd-label { font-size: 9px; letter-spacing: 0.18em; color: var(--dim); text-transform: uppercase; margin-bottom: 6px; }
.sim-cmd-pre {
  background: #0a0a0a; border: 1px solid var(--rule);
  padding: 12px 14px; font-size: 11px; line-height: 1.6;
  white-space: pre; overflow-x: auto; color: var(--teal);
  font-family: var(--mono);
}
.sim-copy-btn {
  position: absolute; top: 8px; right: 8px;
  background: transparent; border: 1px solid var(--rule); color: var(--dim);
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 3px 8px; cursor: pointer; transition: color 120ms, border-color 120ms;
}
.sim-copy-btn:hover { color: var(--teal); border-color: var(--teal); }
.sim-copy-btn.copied { color: var(--green); border-color: var(--green); }

/* ── Live sim widget ─────────────────────────────────── */
.sim-run-btn {
  padding: 9px 24px;
  background: var(--red); color: #fff;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase;
  border: none; cursor: pointer; align-self: flex-end;
  transition: background 150ms, transform 80ms;
}
.sim-run-btn:hover  { background: #ff2010; }
.sim-run-btn:active { transform: scale(0.97); }
.sim-run-btn:disabled { background: #333; color: #555; cursor: not-allowed; }

.sim-output {
  border: 1px solid var(--rule); margin: 20px 0 16px;
  background: #090909;
  transition: opacity 300ms;
}
.sim-output.hidden { display: none; }

.sim-output-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--rule);
  font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase;
}
.sim-out-scenario { color: var(--red); }
.sim-out-status   { color: var(--dim); }
.sim-out-status.running { color: var(--gold); }
.sim-out-status.done    { color: var(--teal); }

.sim-telem {
  display: flex; flex-wrap: wrap; gap: 0;
  border-bottom: 1px solid var(--rule);
}
.telem-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-right: 1px solid var(--rule);
  font-size: 10.5px;
}
.telem-item:last-child { border-right: none; }
.telem-k { color: var(--dim); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; }
.telem-v { color: var(--ink); font-variant-numeric: tabular-nums; min-width: 40px; }
.telem-v.red { color: var(--red); }
.telem-health { gap: 8px; }
.health-bar-wrap {
  width: 60px; height: 6px;
  background: #1a1a1a; border-radius: 3px; overflow: hidden;
}
.health-bar {
  height: 100%; width: 100%; border-radius: 3px;
  background: var(--teal); transition: width 300ms ease, background 300ms;
}

/* two-column layout: decision log on left, race map on right */
.sim-output-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
@media (max-width: 680px) { .sim-output-body { grid-template-columns: 1fr; } }
.sim-track-wrap { padding: 12px 14px; border-left: 1px solid var(--border); display: flex; flex-direction: column; }
.sim-track-svg { flex: 1; min-height: 220px; max-height: 300px; width: 100%; background: #0a0a0a; border-radius: 4px; }
.sim-log-wrap { padding: 12px 14px; max-height: 280px; overflow-y: auto; }
.sim-log-label { font-size: 9px; letter-spacing: 0.2em; color: var(--dim); text-transform: uppercase; margin-bottom: 8px; }
.sim-log { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.sim-log li {
  font-size: 11px; font-family: var(--mono);
  display: grid; grid-template-columns: 44px 44px 120px 1fr;
  gap: 8px; align-items: baseline;
  opacity: 0; transform: translateX(-6px);
  animation: lapIn 180ms forwards;
}
.sim-log li.key-action { color: var(--ink); }
.sim-log li.key-action .lap-action { color: var(--red); }
.sl-lap  { color: var(--red); font-variant-numeric: tabular-nums; }
.sl-pos  { color: var(--dim); }
.sl-act  { color: var(--ink); }
.sl-note { color: #444; font-size: 10px; }
@keyframes lapIn {
  to { opacity: 1; transform: translateX(0); }
}

.sim-result {
  border-top: 1px solid var(--rule); padding: 16px 14px;
}
.sim-result.hidden { display: none; }
.sim-result-row { display: flex; gap: 28px; margin-bottom: 14px; }
.sim-result-item { display: flex; flex-direction: column; gap: 4px; }
.sr-k { font-size: 9px; letter-spacing: 0.2em; color: var(--dim); text-transform: uppercase; }
.sr-v { font-size: 20px; color: var(--ink); }
.sr-v.red { color: var(--teal); }
.sim-dims { display: flex; flex-wrap: wrap; gap: 8px; }
.dim-chip {
  font-size: 9.5px; padding: 4px 10px;
  border: 1px solid var(--rule); color: var(--dim);
  display: flex; gap: 6px;
}
.dim-chip-val { color: var(--teal); }

.sim-footer-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-top: 4px;
}
.sim-playground-link {
  font-size: 10.5px; color: var(--dim); text-decoration: none; letter-spacing: 0.04em;
  transition: color 120ms;
}
.sim-playground-link:hover { color: var(--red); }
.sim-cmd-mini {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.sim-cmd-mini-label { font-size: 9px; color: var(--dim); letter-spacing: 0.12em; text-transform: uppercase; }
.sim-cmd-inline {
  background: #0c0c0c; border: 1px solid var(--rule);
  padding: 5px 10px; font-size: 10px; color: var(--teal);
  font-family: var(--mono); white-space: nowrap; overflow-x: auto; max-width: 380px;
}

/* Code cards */
.try-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.try-card {
  border: 1px solid var(--rule); background: rgba(255,255,255,0.01); overflow: hidden;
  opacity: 0; transform: translateY(14px);
  transition: opacity 400ms, transform 400ms, border-color 200ms;
}
.try-card.revealed { opacity: 1; transform: translateY(0); }
.try-card:hover { border-color: var(--red-dim); }
.try-card-label { padding: 9px 13px; font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); border-bottom: 1px solid var(--rule); background: rgba(255,255,255,0.015); }
.code-block { padding: 14px 13px; font-size: 10.5px; line-height: 1.7; white-space: pre; overflow-x: auto; tab-size: 2; }
.code-block .c { color: #3e3e3e; }
.code-block .k { color: #8888ee; }
.code-block .s { color: var(--teal); }

.links-row { display: flex; gap: 12px; flex-wrap: wrap; opacity: 0; transform: translateY(10px); transition: opacity 400ms 200ms, transform 400ms 200ms; }
.links-row.revealed { opacity: 1; transform: translateY(0); }
.link-btn { display: inline-block; padding: 10px 20px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease; cursor: pointer; border: 1px solid transparent; }
.link-btn { background: var(--red); color: #fff; }
/* Solid (red) variant: subtle lift + slight brighten, not a flat color flip */
.link-btn:not(.link-btn--ghost):hover {
  background: #ff2010;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(225,6,0,0.35);
}
.link-btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
/* Ghost variant: keep transparent, accent the border + text in red, faint red glow.
   Explicit `background` override prevents inheriting the solid red flood from the base rule. */
.link-btn--ghost:hover {
  background: rgba(225,6,0,0.06);
  border-color: var(--red);
  color: var(--red);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(225,6,0,0.18) inset;
}

/* ── TEAM ───────────────────────────────────────────── */
/* team section — names only, no cards */
.org-row { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 11px; color: var(--dim); margin-bottom: 32px; flex-wrap: wrap; }
.org-link { color: var(--dim); text-decoration: none; }
.org-link:hover { color: var(--red); }
.dot { color: var(--rule); }
.footer-strip { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); padding-top: 22px; border-top: 1px solid var(--rule); width: 100%; text-align: center; }
.footer-strip .brand-tick { color: var(--red); }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
  .hud {
    grid-template-rows: auto auto auto auto;
    grid-template-columns: 1fr;
    grid-template-areas: "lede" "readout" "timeline" "footer";
    padding: 70px 18px 18px;
  }
  .timeline { max-height: 26vh; border-left: none; border-top: 1px solid var(--rule); padding: 12px 0 0; }
  .lede h1 { font-size: 20px; }
  .pipe-grid, .try-grid, .media-grid { grid-template-columns: 1fr; }
  .track-grid { grid-template-columns: repeat(2, 1fr); }
  .evidence-layout, .png-gallery, .story-cols { grid-template-columns: 1fr; }
  .story-divider { flex-direction: row; height: auto; }
  .story-arrow-line { width: 40px; height: 1px; }
  .section-inner { padding: 80px 20px 60px; }
  nav a:nth-child(-n+3) { display: none; }
  .sim-controls { flex-direction: column; align-items: stretch; }
  .sim-field select { min-width: 100%; }
}
@media (max-width: 540px) {
  .track-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 20px; }
  .png-gallery { grid-template-columns: 1fr; }
}
