/* _track.css — the ONE stylesheet behind every /track/<product>/ status page.
 *
 * Unification plan (jobhost-ops/lifecycle/DESIGN/08), phase 3. Before this file
 * there were six ~160-line near-copies of one page, differing in a noun and a fetch URL — so a
 * fix to the checklist, or a new thing to show, had to be made six times and never was.
 *
 * TWO THEMES, ONE PAGE. Everything structural lives here once; a theme is a block of custom
 * properties plus a handful of overrides:
 *
 *   research   the house look — cream, teal, quiet. Dossier / TEB / CEB / EB.
 *   play       kid-facing — dark, bright, big buttons. Gamewright.
 *
 * The theme is chosen by the SHELL (`<body data-theme="play">`) and not by the API, because it
 * has to be right on the very first paint: a dark page that arrives white and then flips is
 * worse than either.
 *
 * No product names appear in this file. If a rule needs to know which product it is styling,
 * that is the signal that something belongs in the table instead (_lifecycle.json).
 */

:root {
  --teal: #01696F;
  --dark-teal: #0C4E54;
  --text: #28251D;
  --muted: #7A7974;
  --border: #D4D1CA;
  --bg: #F9F8F5;
  --card: #FFFFFF;
  --accent: var(--teal);
  --gap: #6B4316;
  --gap-bg: #FBF3E7;
  --ok-bg: #EAF2F0;
  --fail-bg: #F7ECEC;
  --fail: #B05A5A;
  --ring: rgba(1, 105, 111, .15);
  --ring-wide: rgba(1, 105, 111, .05);
  --body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 12px;
  --measure: 560px;
}

body[data-theme="play"] {
  --bg: #12102A;
  --card: #1E1B3A;
  --surface2: #272348;
  --border: #3A356A;
  --text: #F5F3FF;
  --muted: #B4AEDC;
  --accent: #FF5DA2;
  --mint: #4DE1C1;
  --yellow: #FFD166;
  --dark-teal: #F5F3FF;
  --ok-bg: #1E1B3A;
  --fail-bg: #1E1B3A;
  --fail: #FF8FA3;
  --gap: #FFD166;
  --gap-bg: #272348;
  --ring: rgba(255, 93, 162, .2);
  --ring-wide: rgba(255, 93, 162, .05);
  --radius: 18px;
  --measure: 520px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--body-font);
}
body[data-theme="play"] {
  font-size: 17px;
  font-weight: 500;
  background: radial-gradient(1200px 600px at 50% -10%, #2A2456 0%, var(--bg) 60%);
}

main { max-width: var(--measure); margin: 0 auto; padding: 34px 18px 60px; }

h1 { font-size: 24px; color: var(--dark-teal); margin: 0 0 2px; }
body[data-theme="play"] h1 { font-size: 28px; text-align: center; font-weight: 800; margin: 0 0 4px; }

.topic { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
body[data-theme="play"] .topic { text-align: center; }

.rule { border: 0; border-top: 2px solid var(--accent); margin: 14px 0 22px; }
body[data-theme="play"] .rule { display: none; }

/* ── the clock ──────────────────────────────────────────────────────────────────────────
 * The line doc 08 §D asks for: "Running 47 min · last update 2 min ago". It ticks on its own
 * between polls, so a page left open never looks frozen. `.quiet` is the staleness SIGNAL —
 * surfaced, deliberately never a kill: a Dossier's fact-check panels can run 80 minutes with
 * few ticks, so a long silence is worth showing and not worth acting on. */
.clock {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 6px;
}
.clock b { color: var(--text); font-weight: 600; }
.clock.quiet { color: var(--gap); }
body[data-theme="play"] .clock { text-align: center; color: var(--mint); font-weight: 700; }
body[data-theme="play"] .clock b { color: var(--mint); }

.eta { font-size: 14px; color: var(--muted); margin: 0 0 18px; }
body[data-theme="play"] .eta { text-align: center; color: var(--muted); font-weight: 600; }

/* ── the stage checklist ────────────────────────────────────────────────────────────────── */
ol.stages { list-style: none; margin: 0; padding: 0; }
ol.stages li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
ol.stages li:last-child { border-bottom: 0; }
body[data-theme="play"] ol.stages {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
body[data-theme="play"] ol.stages li { gap: 14px; padding: 15px 18px; }

.dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  color: #fff;
}
body[data-theme="play"] .dot { width: 24px; height: 24px; font-size: 14px; color: #12102A; }

li.done .dot { background: var(--accent); border-color: var(--accent); }
li.done { color: var(--text); }
body[data-theme="play"] li.done .dot { background: var(--mint); border-color: var(--mint); }

li.active .dot { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); animation: pulse 1.4s infinite; }
li.active { color: var(--dark-teal); font-weight: 600; }
body[data-theme="play"] li.active .dot { box-shadow: 0 0 0 4px var(--ring); }
body[data-theme="play"] li.active { color: #fff; font-weight: 700; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px var(--ring-wide); } }

.label { flex: 1 1 auto; min-width: 0; }
.sub { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 2px; }

/* How long each step took — the other half of doc 08's "plus per-stage times as they
 * complete". Right-aligned, tabular, and simply absent when a build emitted no stage ticks. */
.took {
  flex: 0 0 auto;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 400;
}
li.active .took { color: var(--accent); }
body[data-theme="play"] li.active .took { color: var(--mint); }

/* ── banners ────────────────────────────────────────────────────────────────────────────── */
.banner { padding: 16px 18px; border-radius: var(--radius); margin: 0 0 20px; font-size: 15px; }
.banner.ok { background: var(--ok-bg); border: 1px solid var(--accent); }
.banner.gap { background: var(--gap-bg); border: 1px solid var(--gap); color: var(--gap); }
.banner.fail { background: var(--fail-bg); border: 1px solid var(--fail); }
.banner h2 { margin: 0 0 6px; font-size: 17px; color: var(--dark-teal); }
.banner p { margin: 0 0 6px; }
.banner p:last-child { margin-bottom: 0; }
.banner a { color: var(--dark-teal); }

body[data-theme="play"] .banner { padding: 24px; text-align: center; }
body[data-theme="play"] .banner.ok { background: linear-gradient(135deg, #1E1B3A, #2A2456); border: 2px solid var(--mint); }
body[data-theme="play"] .banner.fail { border: 2px solid var(--fail); }
body[data-theme="play"] .banner.gap { border: 2px solid var(--yellow); color: var(--text); }
body[data-theme="play"] .banner h2 { margin: 6px 0 10px; font-size: 24px; color: var(--text); }
body[data-theme="play"] .banner .big { font-size: 46px; }

.slow {
  background: var(--gap-bg);
  border: 1px solid var(--gap);
  color: var(--gap);
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin: 0 0 18px;
}
body[data-theme="play"] .slow { text-align: center; color: var(--yellow); border-radius: var(--radius); }

/* Buttons are a fixed size and never stretch to fit their label (house rule).
 * `a:not(.btn)` below is what keeps the theme's link colour off them — a plain `a` rule is more
 * specific than `.btn` once it is scoped to the theme, which left "PLAY IT" mint-on-mint. */
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 56px;
  margin-top: 14px; padding: 15px;
  font: inherit; font-size: 22px; font-weight: 800;
  color: #12102A;
  background: linear-gradient(90deg, var(--yellow, #FFD166), var(--mint, #4DE1C1));
  border: 0; border-radius: 16px;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(77, 225, 193, .35);
}
.btn.sec {
  background: var(--surface2, var(--card));
  color: var(--text);
  box-shadow: none;
  font-size: 16px;
  min-height: 48px;
  font-weight: 600;
}

/* ── footer ─────────────────────────────────────────────────────────────────────────────── */
.foot { color: var(--muted); font-size: 12px; margin-top: 26px; }
body[data-theme="play"] .foot { text-align: center; }
.job { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
a:not(.btn) { color: var(--accent); }
body[data-theme="play"] a:not(.btn) { color: var(--mint); }

[hidden] { display: none !important; }
