/* The Two Meanings of 26¢ — stylesheet
 * Tokens per design/design-plan.md. Dual register: serif = the event world,
 * mono = the market world, grotesque = the page's own voice. */

@font-face {
  font-family: 'Archivo';
  src: url('../assets/fonts/archivo-normal-100-900-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('../assets/fonts/newsreader-normal-200-800-latin.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('../assets/fonts/newsreader-italic-200-800-latin.woff2') format('woff2');
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../assets/fonts/ibm-plex-mono-normal-400-latin.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../assets/fonts/ibm-plex-mono-normal-500-latin.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../assets/fonts/ibm-plex-mono-normal-600-latin.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  --pitch: #101913;
  --pitch-raise: #16221b;
  --chalk: #e8e4d8;
  --chalk-dim: #98a092;
  --model: #7bc8e8;
  --heat: #f2a03d;
  --alarm: #e4572e;
  --card-bg: rgba(13, 20, 15, 0.88);
  --hair: rgba(232, 228, 216, 0.14);

  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --grot: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
}

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

html { scroll-behavior: auto; }

body {
  background: var(--pitch);
  color: var(--chalk);
  font-family: var(--serif);
  font-weight: 380;
  font-size: 19px;
  line-height: 1.55;
  overflow-x: hidden;
}

::selection { background: rgba(242, 160, 61, 0.35); }

a { color: var(--model); text-decoration-color: rgba(123, 200, 232, 0.4); }
a:hover { text-decoration-color: var(--model); }
:focus-visible { outline: 2px solid var(--heat); outline-offset: 2px; }

/* ---------- HUD scoreboard strip ---------- */
.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.55rem 1.1rem;
  background: linear-gradient(to bottom, rgba(9, 13, 10, 0.92), rgba(9, 13, 10, 0.78));
  border-bottom: 1px solid var(--hair);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--grot);
  font-stretch: 72%;
  font-weight: 640;
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  transition: opacity 0.4s;
}
.hud .hud-title { color: var(--chalk); white-space: nowrap; }
.hud .hud-clock, .hud .hud-price { font-family: var(--mono); font-weight: 600; letter-spacing: 0.02em; text-transform: none; }
.hud .hud-clock { color: var(--chalk); min-width: 11ch; }
.hud .hud-price { color: var(--model); margin-left: auto; text-align: right; }
.hud .hud-price .hot { color: var(--heat); }
.hud .hud-beat { white-space: nowrap; }
@media (max-width: 720px) {
  .hud { gap: 0.7rem; font-size: 0.68rem; }
  .hud .hud-beat { display: none; }
}

/* ---------- scrolly armature ---------- */
.scrolly { position: relative; }

.stage-wrap {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}
.stage-wrap canvas, .stage-wrap svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.stage-wrap svg { pointer-events: none; }

.cards {
  position: relative;
  z-index: 10;
  margin-top: -100vh;
  margin-top: -100dvh;
  padding-bottom: 20vh;
}

.card {
  max-width: 25.5rem;
  margin: 0 0 88vh 5vw;
  padding: 1.35rem 1.5rem 1.45rem;
  background: var(--card-bg);
  border: 1px solid var(--hair);
  border-radius: 3px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.card:first-child { margin-top: 14vh; }
.card:last-child { margin-bottom: 60vh; }

.card .eyebrow {
  font-family: var(--grot);
  font-stretch: 70%;
  font-weight: 680;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  display: block;
  margin-bottom: 0.55rem;
}
.card h2 {
  font-family: var(--grot);
  font-stretch: 108%;
  font-weight: 760;
  font-size: 1.5rem;
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin-bottom: 0.7rem;
  color: var(--chalk);
}
.card p { margin-bottom: 0.75rem; }
.card p:last-child { margin-bottom: 0; }
.card .price, .card .num {
  font-family: var(--mono);
  font-size: 0.92em;
  font-weight: 500;
  color: var(--chalk);
  white-space: nowrap;
}
.card .price.cold { color: var(--model); }
.card .price.hot { color: var(--heat); }
.card .price.alarm { color: var(--alarm); }
.card em { font-style: italic; }
.card .aside {
  font-size: 0.85rem;
  color: var(--chalk-dim);
  border-top: 1px solid var(--hair);
  padding-top: 0.65rem;
  margin-top: 0.9rem;
}

/* data-provenance chips */
.chip {
  display: inline-block;
  font-family: var(--grot);
  font-stretch: 75%;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem 0.08rem;
  border-radius: 2px;
  vertical-align: 0.14em;
  margin-left: 0.3rem;
}
.chip.real { color: #0e1512; background: var(--chalk); }
.chip.model { color: var(--model); background: transparent; border: 1px dashed rgba(123, 200, 232, 0.55); }
.chip.infer { color: var(--chalk-dim); background: transparent; border: 1px dotted rgba(152, 160, 146, 0.6); }

/* ---------- hero ---------- */
.card.hero {
  max-width: 46rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 96vh;
  background: transparent;
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  text-align: center;
  padding-top: 16vh;
}
.card.hero .kicker {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--chalk-dim);
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 1.6rem;
}
.card.hero h1 {
  font-family: var(--grot);
  font-stretch: 122%;
  font-weight: 850;
  font-size: clamp(2.6rem, 7.2vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}
.card.hero h1 .cents { color: var(--heat); }
.card.hero .dek {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 350;
  color: var(--chalk);
  max-width: 34rem;
  margin: 0 auto 1.2rem;
}
.card.hero .scroll-hint {
  font-family: var(--grot);
  font-stretch: 75%;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  margin-top: 3.2rem;
}

/* ---------- SVG annotation layer ---------- */
/* Fades and the chart reveal are CSS transitions, not d3 timers: they run on
 * the compositor, survive hidden-tab suspension by snapping to their end
 * state, and natively retarget from current value when interrupted. */
.anno .layer, .anno .chart-layer { transition: opacity 0.45s ease; }
.anno .ev { transition: opacity 0.4s ease; }
#reveal rect { transition: width 0.75s cubic-bezier(0.215, 0.61, 0.355, 1); }

.anno text {
  font-family: var(--grot);
  font-stretch: 78%;
  font-weight: 640;
  letter-spacing: 0.06em;
  fill: var(--chalk-dim);
}
.anno .callout { font-size: 13px; fill: var(--chalk); }
.anno .callout.mono { font-family: var(--mono); font-weight: 500; letter-spacing: 0; }
.anno .axis text { font-family: var(--mono); font-size: 10.5px; font-weight: 400; fill: var(--chalk-dim); letter-spacing: 0; }
.anno .axis line, .anno .axis path { stroke: rgba(152, 160, 146, 0.35); }
.anno .stamp {
  font-size: 10.5px;
  letter-spacing: 0.12em;
}
.anno .stamp.real { fill: #0e1512; }
.anno .stamp.model { fill: var(--model); }

/* ---------- footer / methodology ---------- */
.tail {
  position: relative;
  z-index: 10;
  background: linear-gradient(to bottom, transparent, var(--pitch) 8%);
  padding: 4rem 5vw 5rem;
  max-width: 50rem;
}
.tail h2 {
  font-family: var(--grot);
  font-stretch: 110%;
  font-weight: 780;
  font-size: 1.35rem;
  margin-bottom: 1rem;
}
.tail h3 {
  font-family: var(--grot);
  font-stretch: 80%;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  margin: 1.6rem 0 0.5rem;
}
.tail p, .tail li { font-size: 0.95rem; color: var(--chalk); }
.tail ul { list-style: none; }
.tail li { margin-bottom: 0.4rem; padding-left: 1rem; text-indent: -1rem; }
.tail li::before { content: '·'; color: var(--heat); margin-right: 0.55rem; }
.tail .src { font-family: var(--mono); font-size: 0.78rem; word-break: break-all; color: var(--chalk-dim); }

/* ---------- no-WebGL / reduced-motion fallbacks ---------- */
.nogl-note {
  display: none;
  position: fixed;
  bottom: 1rem; left: 1rem; right: 1rem;
  z-index: 50;
  background: var(--pitch-raise);
  border: 1px solid var(--hair);
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  color: var(--chalk-dim);
}
body.no-webgl .nogl-note { display: block; }

@media (max-width: 900px) {
  body { font-size: 17px; }
  .card { margin-left: 4vw; margin-right: 4vw; max-width: none; margin-bottom: 78vh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .anno .layer, .anno .chart-layer, .anno .ev, #reveal rect { transition: none; }
}
