/* Moments: one stylesheet for every moment.
   Everything here is the homepage's section two (landing/src/liveframe.html), copied value for
   value: tokens, drafting grid, nav, thesis column, and the live stage (stage bar with tabs and
   an action button, the sheet with corner marks, title block, result switch and hint, the status
   bar). The drawing on the sheet is made by kit.js with the same pens.
   Light only. No CSS animation that keeps running (an idle moment should cost nothing). */

:root {
  --bg: #f5f8fd;
  --white: #ffffff;
  --navy: #0b2550;
  --ink: #0b2550;
  --ink-2: #4a5a6e;
  --ink-3: #5b6b7e;
  --rule: rgba(91, 107, 126, .2);
  --rule-hi: rgba(91, 107, 126, .42);
  --slate: #5b6b7e;
  --navy-hi: #1a3d7c;
  --gold: #d4a25a;
  --gold-ink: #a06b1c;
  --load: #c08a3a;
  --needle: #d4a25a;
  --focus: #2563eb;
  --pos: #2563eb;
  --neg: #dc2626;
  --defl: #7c3aed;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #dc2626;

  --display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(91, 107, 126, .1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 107, 126, .1) 1px, transparent 1px),
    linear-gradient(rgba(91, 107, 126, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 107, 126, .045) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── brand lockup (injected by build.py) + nav ─────────────────────────── */
.brand { display: flex; align-items: flex-start; text-decoration: none; flex: none; }
.mark { width: 34px; height: 34px; flex: none; overflow: visible; }
.needle { fill: var(--needle); }
.wordmark { height: 25.5px; width: auto; margin: 8.4px 0 0 1.7px; }
.nav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.nav-in { display: flex; align-items: center; gap: 28px; height: 64px; }
.nav .brand { margin-right: auto; }
.links { display: flex; gap: 26px; }
.links a {
  font: 500 12px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  transition: color .2s;
}
.links a:hover { color: var(--ink); }

/* ── the moment: thesis left, live stage right (as section two) ────────── */
.moment { padding-block: clamp(28px, 5vw, 64px) clamp(36px, 5vw, 64px); }
/* thesis (words) and panel (controls, readout) on the left, the stage on the right;
   when stacked: words, stage, panel, so the drawing comes before the numbers */
.moment-grid {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.2fr);
  grid-template-areas: "thesis stage" "panel stage";
  grid-template-rows: auto 1fr;
  column-gap: clamp(28px, 4.5vw, 64px);
  align-items: start;
}
.thesis { grid-area: thesis; min-width: 0; }
/* the panel and the sheet are solid paper: the page grid stops at their edges, so only the
   sheet's own drawing grid shows inside (same paper colour, so label halos still match) */
.panel { grid-area: panel; min-width: 0; background: var(--bg); }
.moment-grid > .stage { grid-area: stage; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  font: 500 12px/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow .glyph { width: 26px; height: 9px; flex: none; }
h1 {
  margin: 0;
  font: 400 clamp(38px, 4.6vw, 62px)/.98 var(--display);
  letter-spacing: -.018em;
  text-wrap: balance;
  max-width: 9.6em;
  color: var(--ink);
}
.lede {
  margin: 26px 0 30px;
  max-width: 40ch;
  font-size: clamp(16px, 1.35vw, 18px);
  color: var(--ink-2);
}

/* controls in the thesis column, in the status-bar voice */
.ctrl { display: flex; align-items: center; gap: 14px; min-height: 48px; border-top: 1px solid var(--rule); }
.ctrl:last-of-type { border-bottom: 1px solid var(--rule); }
.ctrl label { min-width: 74px; font: 500 12px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
/* Greek symbols keep their case (uppercase would turn θ into Θ, σ into Σ) */
.ctrl label .sym, .foot-h .sym { text-transform: none; letter-spacing: 0; }
.ctrl input[type=range] { flex: 1 1 140px; min-width: 0; accent-color: var(--navy); }
.ctrl output { min-width: 52px; text-align: right; font: 500 15px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.ctrl input[type=number] {
  width: 92px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--rule-hi);
  border-radius: 3px;
  background: var(--white);
  color: var(--ink);
  font: 500 14px/1 var(--mono);
}
.err { font: 500 12px/1.3 var(--mono); color: var(--bad); }
/* a list of cases wears the number field's dress */
.ctrl select {
  flex: 1 1 auto; min-width: 0; height: 34px; padding: 0 8px;
  border: 1px solid var(--rule-hi); border-radius: 3px; background: var(--white);
  color: var(--ink); font: 500 13px/1 var(--mono);
}

/* readouts: key left, value right, one rule per row */
.readout { margin: 26px 0 0; padding: 0; }
.readout div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .05em;
  font-variant-numeric: tabular-nums;
}
.readout div:first-child { border-top: 1px solid var(--rule); }
.readout dt { color: var(--ink-3); }
.readout dd { margin: 0; color: var(--ink); white-space: nowrap; }
.readout dd.pos { color: var(--pos); }
.readout dd.neg { color: var(--neg); }
/* verdicts: pass / warn / fail, the only use of these colours */
.readout dd.ok { color: var(--ok); }
.readout dd.warn { color: var(--warn); }
.readout dd.bad { color: var(--bad); }

/* ── the live stage ────────────────────────────────────────────────────── */
.stage { margin: 0; min-width: 0; }
.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--rule);
}
.tabs { position: relative; display: flex; align-items: center; min-width: 0; }
.tab {
  appearance: none;
  background: none;
  border: 0;
  margin: 0;
  padding: 15px 9px 14px;
  font: 500 14px/1 var(--sans);
  color: var(--ink-3);
  cursor: pointer;
  transition: color .2s;
}
.tab:hover { color: var(--ink-2); }
.tab[aria-pressed="true"] { color: var(--ink); }
.chev { color: var(--ink-3); font-size: 15px; line-height: 1; user-select: none; }
.tab-ink {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--load);
  transition: transform .4s cubic-bezier(.2, .8, .2, 1), width .4s cubic-bezier(.2, .8, .2, 1);
}
.act {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  height: 34px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--rule-hi);
  border-radius: 3px;
  font: 500 12px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--white);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.act:hover { border-color: var(--load); background: #fbf5ea; }
.act svg { width: 30px; height: 14px; overflow: visible; }
.act path, .act polyline { fill: none; stroke: var(--load); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.act[aria-pressed="true"] { border-color: var(--load); background: #fbf5ea; }

.sheet { position: relative; aspect-ratio: 5 / 4; max-width: 100%; background: var(--bg); }
.sheet canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.cm { position: absolute; width: 14px; height: 14px; border-color: var(--rule-hi); border-style: solid; border-width: 0; pointer-events: none; }
.cm.tl { top: 8px; left: 0; border-top-width: 1px; border-left-width: 1px; }
.cm.tr { top: 8px; right: 0; border-top-width: 1px; border-right-width: 1px; }
.cm.bl { bottom: 8px; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.cm.br { bottom: 8px; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
.tblock {
  position: absolute;
  left: 22px;
  top: 20px;
  display: grid;
  gap: 2px;
  font: 500 10.5px/1.45 var(--mono);
  letter-spacing: .07em;
  color: var(--ink-3);
  pointer-events: none;
}
.tblock b { color: var(--ink); font-weight: 500; }
.subs {
  position: absolute;
  right: 22px;
  top: 18px;
  display: flex;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--rule-hi);
  border-radius: 3px;
  overflow: hidden;
  transition: opacity .3s, transform .3s;
}
.subs.off { opacity: 0; transform: translateY(-4px); pointer-events: none; }
.sub {
  appearance: none;
  margin: 0;
  width: 34px;
  height: 30px;
  border: 0;
  border-left: 1px solid var(--rule);
  background: none;
  font: 500 13px/1 var(--mono);
  color: var(--ink-2);
  cursor: pointer;
}
.sub:first-child { border-left: 0; }
.sub:hover { color: var(--ink); background: var(--bg); }
.sub[aria-pressed="true"] { background: var(--navy); color: var(--white); }
.hint {
  position: absolute;
  left: 0;
  top: 0;
  padding: 7px 10px;
  font: 500 11px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-ink);
  background: var(--white);
  border: 1px solid var(--gold);
  box-shadow: 0 8px 18px -10px rgba(160, 107, 28, .35);
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s;
}
.hint.on { opacity: 1; }
.status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px 16px;
  flex-wrap: wrap;
  min-height: 40px;
  padding: 9px 0;
  border-top: 1px solid var(--rule);
  font: 500 11.5px/1.4 var(--mono);
  letter-spacing: .05em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.status b { color: var(--ink); font-weight: 500; }
.status .ok { color: var(--ok); }
.status .warn { color: var(--warn); }
.status .bad { color: var(--bad); }
.st-l { display: flex; gap: 14px; }
.st-r { display: flex; gap: 6px 14px; flex-wrap: wrap; justify-content: flex-end; }
.verdict { padding: 2px 7px; border-radius: 2px; border: 1px solid currentColor; background: var(--white); }

/* ── footnote ──────────────────────────────────────────────────────────── */
.foot { padding-block: 0 48px; font-size: 13px; color: var(--ink-3); }
.foot p { margin: 0 0 6px; max-width: 86ch; }
/* heading in the title-block voice (the sheet's "DWG OA-M01") */
.foot-h { margin: 0 0 8px; font: 500 10.5px/1.45 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink); }
/* one sentence per bullet, four at most; the gold diamond is the homepage's list mark */
.notes { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; max-width: 86ch; }
.notes li { display: flex; align-items: baseline; gap: 10px; }
.notes li::before { content: ''; flex: none; width: 5px; height: 5px; background: var(--gold); transform: translateY(-2px) rotate(45deg); }

@media (max-width: 980px) {
  .moment-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "thesis" "stage" "panel"; grid-template-rows: auto; }
  .panel { margin-top: 28px; }
  h1 { max-width: none; }
}
@media (max-width: 720px) {
  .st-l .nm { display: none; }
}
@media (max-width: 560px) {
  .sheet { aspect-ratio: 1 / 1; }
  .tblock { display: none; }
}
@media (max-width: 440px) {
  .tab { padding-inline: 6px; font-size: 13px; }
  .act span { display: none; }
  .act { padding: 0 9px; }
  .subs { right: 14px; top: 14px; }
  .sub { width: 30px; height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .tab-ink, .subs, .hint { transition: none; }
}

/* ── the index (/moments/): a drawing set, one sheet per moment ─────────
   Cards are the homepage's "Drawing set" sheets: white paper, a hairline, a soft shadow,
   the picture of the moment's own sheet, and a mono title strip. Words kept to the title. */
.shelf {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.4vw, 32px);
  margin: 0;
  padding: 8px 0 clamp(48px, 6vw, 80px);
  list-style: none;
}
.mcard {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--white);
  border-radius: 2px;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 24px 44px -24px rgba(11, 37, 80, .45), 0 0 0 1px rgba(11, 37, 80, .09);
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), box-shadow .5s;
}
.mcard:hover, .mcard:focus-visible {
  transform: translateY(-8px);
  box-shadow: 0 36px 64px -26px rgba(11, 37, 80, .55), 0 0 0 1px rgba(11, 37, 80, .09);
}
.mcard .pic { display: block; width: 100%; height: auto; aspect-ratio: 5 / 4; object-fit: cover; background: var(--bg); border-radius: 2px 2px 0 0; }
.mcard .name { margin: 0; padding: 14px 16px 16px; font: 400 clamp(20px, 1.7vw, 24px)/1.15 var(--display); letter-spacing: -.01em; text-wrap: balance; flex: 1; }
.mcard .tb {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 11px;
  border-top: 1px solid var(--rule);
  font: 500 10.5px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.mcard .tb span { opacity: .6; }
.mcard .tb .go { opacity: 1; color: var(--gold-ink); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.mcard:hover .tb .go { transform: translateX(4px); }
@media (max-width: 980px) { .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .shelf { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .mcard, .mcard .tb .go { transition: none; } }
