/* ===== Homepage (see .design/DESIGN.md) =====
   Loaded only by index.html. Shared tokens, nav, buttons and footer live in styles.css. */

.home {
  --gutter: var(--home-gutter, 32px);
  --nav-h: 88px;
  --ease: var(--ease-ledger);
  overflow-x: clip;
}

.h-container {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Align the shared nav and footer with the wider homepage grid */
body:has(.home) { --home-gutter: 32px; }
body:has(.home) .nav .container,
body:has(.home) .footer .container { max-width: 1240px; padding-inline: var(--home-gutter); }
@media (max-width: 960px) { body:has(.home) { --home-gutter: 24px; } }
@media (max-width: 600px) { body:has(.home) { --home-gutter: 20px; } }

/* ----- Type ----- */
.h-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12.5px;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.h-label--green { color: var(--accent); }
.h-label--mint { color: var(--accent-tint); }

.h-display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(46px, 6.4vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.h-accent { color: var(--accent); }

.h-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.032em;
  text-wrap: balance;
}

.h-lede {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(21px, 2vw, 25px);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

.h-body {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 60ch;
}

.h-link {
  font-weight: 500;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  transition: text-decoration-color 200ms var(--ease);
}
.h-link::after { content: " \2192"; }
.h-link:hover { text-decoration-color: var(--accent); }
.h-link--light { color: #FFFFFF; text-decoration-color: rgba(255, 255, 255, 0.35); }
.h-link--light:hover { text-decoration-color: var(--accent-tint); }

.h-badge {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--tag-bg);
  border-radius: 999px;
  padding: 4px 9px;
  white-space: nowrap;
}
.h-badge--dark { background: rgba(255, 255, 255, 0.12); color: var(--accent-tint); }

.button--large { padding: 16px 26px; font-size: 17px; }

.h-button-ghost {
  display: inline-block;
  font-weight: 500;
  font-size: 17px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 15px 26px;
  transition: background 200ms var(--ease), color 200ms var(--ease);
}
.h-button-ghost:hover { background: var(--ink); color: var(--paper); }

/* ----- Sections ----- */
.h-section { padding-block: 120px; }
.h-section--tight { padding-block: 96px; }
.h-section__head {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 780px;
  margin-bottom: 48px;
}
.h-section__head--row {
  max-width: none;
  flex-direction: row;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}
.h-section__head--row > div { display: flex; flex-direction: column; gap: 18px; }

.h-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 72px;
  align-items: start;
}
.h-split__head { display: flex; flex-direction: column; gap: 20px; }

/* ===== Hero ===== */
.h-hero { padding-block: 72px 104px; }
.h-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px;
  align-items: center;
}
.h-hero__copy { display: flex; flex-direction: column; gap: 26px; }
.h-hero__copy .h-body { font-size: 17px; }
.h-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.h-hero__caption { font-size: 12px; }

/* Same report, two routes */
.routes {
  justify-self: end;
  width: 100%;
  max-width: 470px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.routes__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.routes__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.routes__toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.routes__toggle:hover { border-color: var(--ink); }
.routes__toggle svg { width: 11px; height: 11px; fill: currentColor; }
.routes__toggle .routes__icon-play { display: none; }
.routes__toggle[aria-pressed="true"] .routes__icon-play { display: block; }
.routes__toggle[aria-pressed="true"] .routes__icon-pause { display: none; }

.lane { display: flex; flex-direction: column; gap: 8px; }
.lane + .lane { padding-top: 14px; border-top: 2px dotted var(--line); }
.lane__row { display: flex; justify-content: space-between; align-items: baseline; }
.lane__clock {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  transition: color 300ms var(--ease);
}
.lane.is-waiting .lane__clock { color: var(--rev); animation: clock-tick 1s steps(2, jump-none) infinite; }
.lane--today.is-done .lane__clock { color: var(--crit); }
.lane--mise.is-done .lane__clock { color: var(--accent); }
@keyframes clock-tick { 50% { opacity: 0.55; } }

.lane__track { position: relative; height: 26px; }
.lane__line,
.lane__fill {
  position: absolute;
  left: 12.5%;
  top: 50%;
  height: 0;
}
.lane__line { right: 12.5%; border-top: 2px dashed #B9B0A0; }
.lane--mise .lane__line { border-top-style: solid; border-top-color: rgba(46, 93, 79, 0.25); }
.lane__fill {
  width: var(--fill, 75%);
  border-top: 2px solid var(--ink-soft);
  margin-top: -2px;
  height: 2px;
  border-top-width: 0;
  background: var(--ink-soft);
}
.lane--mise .lane__fill { background: var(--accent); height: 3px; margin-top: -1.5px; }
.lane__stop {
  position: absolute;
  top: 50%;
  left: calc(12.5% + var(--i) * 25%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid #B9B0A0;
  transform: translate(-50%, -50%);
  transition: background 250ms var(--ease), border-color 250ms var(--ease);
}
.lane--mise .lane__stop { border-color: rgba(46, 93, 79, 0.45); }
.lane__stop.is-reached { background: var(--ink-soft); border-color: var(--ink-soft); }
.lane--mise .lane__stop.is-reached { background: var(--accent); border-color: var(--accent); }
.lane--today.is-done .lane__stop--3 { background: var(--crit); border-color: var(--crit); }
.lane__stop::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
  color: var(--ink-soft);
}
.lane--mise .lane__stop::after { color: var(--accent); }
.routes.is-live .lane__stop.is-reached::after { animation: stop-hit 700ms var(--ease) 1; }
@keyframes stop-hit {
  0% { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0; transform: scale(2.6); }
}

/* The other reports already waiting in the queue */
.lane__pile {
  position: absolute;
  top: 50%;
  left: 62.5%;
  width: 0;
  height: 0;
  opacity: 0;
  transition: opacity 400ms var(--ease);
}
.lane__pile i {
  position: absolute;
  width: 14px;
  height: 18px;
  border-radius: 2px;
  background: #FFFDF8;
  border: 1.5px solid #C9C1B2;
  border-top-width: 3px;
  transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) rotate(var(--dr));
}
.lane__pile i:nth-child(1) { --dx: -12px; --dy: -3px; --dr: -12deg; }
.lane__pile i:nth-child(2) { --dx: 11px; --dy: -4px; --dr: 9deg; }
.lane__pile i:nth-child(3) { --dx: -6px; --dy: 4px; --dr: 6deg; }
.lane__pile i:nth-child(4) { --dx: 8px; --dy: 5px; --dr: -7deg; }
.lane.is-queued .lane__pile { opacity: 1; }

/* Alert ping when the Mise route lands */
.lane__ping {
  position: absolute;
  top: 50%;
  left: 87.5%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.lane.is-pinged .lane__ping { animation: ping 1.4s var(--ease) 2; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(46, 93, 79, 0.45); }
  100% { box-shadow: 0 0 0 18px rgba(46, 93, 79, 0); }
}

.lane__token {
  position: absolute;
  top: 50%;
  left: var(--pos, 87.5%);
  width: 18px;
  height: 22px;
  border-radius: 3px;
  background:
    linear-gradient(#C9C1B2, #C9C1B2) 4px 6px / 8px 2px no-repeat,
    linear-gradient(#C9C1B2, #C9C1B2) 4px 10px / 6px 2px no-repeat,
    linear-gradient(#C9C1B2, #C9C1B2) 4px 14px / 8px 2px no-repeat,
    #FFFDF8;
  border: 1.5px solid #A99F8E;
  border-top-width: 4px;
  transform: translate(-50%, -50%) rotate(var(--tilt, 0deg));
  z-index: 2;
  transition: border-color 250ms var(--ease), background-color 250ms var(--ease);
}
.lane__token.is-crit { border-color: var(--crit); background-color: var(--crit-tint); }
.lane--mise .lane__token.is-read { border-color: var(--accent); }
.lane--mise .lane__token.is-crit { border-color: var(--crit); }

.lane__labels {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  font-size: 11.5px;
  line-height: 1.25;
  text-align: center;
  color: var(--ink-soft);
}
.lane__labels li { transition: color 250ms var(--ease); }
.lane__labels li.is-current { color: var(--ink); font-weight: 600; }
.lane__status { font-size: 13px; line-height: 1.4; color: var(--ink-soft); min-height: 2.8em; }
.lane__status.is-new { animation: status-in 400ms var(--ease) 1; }
@keyframes status-in { from { opacity: 0; transform: translateY(4px); } }

.routes__result { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat {
  border-radius: 16px;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.stat__value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 2.4vw, 30px);
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
.stat__note { font-size: 12px; line-height: 1.35; }
.stat--bad { background: var(--crit-tint); color: var(--ink); }
.stat--bad .stat__value { color: var(--crit); }
.stat--good { background: var(--accent-dark); color: #FFFFFF; }
.routes.is-live .stat { opacity: 0.22; transform: translateY(6px); }
.routes.is-live.is-finished .stat { opacity: 1; transform: none; }
.routes.is-live.is-finished .stat--good { transition-delay: 150ms; }
.routes__foot { font-size: 12px; color: var(--ink-soft); }


/* Per-item positions (kept out of the markup) */
.lane__stop--0 { --i: 0; }
.lane__stop--1 { --i: 1; }
.lane__stop--2 { --i: 2; }
.lane__stop--3 { --i: 3; }
.ticket--1 { --r: -7deg; --x: 18px; --y: calc(2 * var(--row)); --d: 0ms; }
.ticket--2 { --r: 5deg; --x: -26px; --y: var(--row); --d: 90ms; }
.ticket--3 { --r: -2deg; --x: 30px; --y: 6px; --d: 180ms; }
.ticket--4 { --r: 8deg; --x: -12px; --y: calc(-1 * var(--row)); --d: 270ms; }
.ticket--5 { --r: -5deg; --x: 8px; --y: calc(-2 * var(--row)); --d: 360ms; }
.tile--1 { --sx: 14%; --sy: 22%; --sr: -9deg; --gx: 17%; --gy: 15%; }
.tile--2 { --sx: 58%; --sy: 12%; --sr: 7deg; --gx: 50%; --gy: 15%; }
.tile--3 { --sx: 86%; --sy: 30%; --sr: -4deg; --gx: 83%; --gy: 15%; }
.tile--4 { --sx: 70%; --sy: 58%; --sr: 11deg; --gx: 83%; --gy: 45%; }
.tile--5 { --sx: 36%; --sy: 44%; --sr: -6deg; --gx: 50%; --gy: 45%; }
.tile--6 { --sx: 12%; --sy: 64%; --sr: 5deg; --gx: 17%; --gy: 45%; }
.tile--7 { --sx: 30%; --sy: 86%; --sr: -12deg; --gx: 17%; --gy: 75%; }
.tile--8 { --sx: 60%; --sy: 82%; --sr: 8deg; --gx: 50%; --gy: 75%; }
.tile--9 { --sx: 88%; --sy: 78%; --sr: -7deg; --gx: 83%; --gy: 75%; }

/* ===== Problem: a pile of tickets deals out into order ===== */
.h-problem--band { background: var(--tag-bg); }
.h-problem .h-heading { font-size: clamp(36px, 4.6vw, 62px); }
.h-problem__closing {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.015em;
}
.tickets {
  --row: 104px;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.ticket {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "meta stamp" "text stamp";
  gap: 6px 16px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 20px 18px;
  transition:
    transform 900ms var(--ease) var(--d),
    border-color 500ms var(--ease) calc(var(--d) + 500ms);
}
.ticket:hover { border-color: var(--ink-soft); }
.ticket__meta { grid-area: meta; display: flex; gap: 10px; align-items: center; }
.ticket__no {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  color: var(--ink-soft);
}
.ticket__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--rev);
  background: var(--rev-tint);
  border-radius: 999px;
  padding: 3px 9px;
}
.ticket__text {
  grid-area: text;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.012em;
}
.ticket__stamp {
  grid-area: stamp;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  padding: 5px 8px;
  transform: rotate(-8deg);
  transition: opacity 300ms var(--ease) calc(var(--d) + 900ms), transform 400ms cubic-bezier(.3, 1.6, .5, 1) calc(var(--d) + 900ms);
}
.js-motion .h-problem:not(.is-settled) .ticket {
  transform: translate(var(--x), var(--y)) rotate(var(--r));
  border-color: #CDBFA8;
}
.js-motion .h-problem:not(.is-settled) .ticket__stamp { opacity: 0; transform: rotate(-8deg) scale(1.8); }
.js-motion .h-problem.is-settled .ticket { border-color: var(--line); }

/* Generic entry for other sections */
.js-motion [data-settle]:not(.h-problem) .h-container > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.js-motion [data-settle]:not(.h-problem) .h-container > *:nth-child(2) { transition-delay: 120ms; }
.js-motion [data-settle]:not(.h-problem) .h-container > *:nth-child(3) { transition-delay: 220ms; }
.js-motion [data-settle].is-settled .h-container > * { opacity: 1; transform: none; }

/* ===== Pinned four-stage story ===== */
.story { padding-top: 40px; }
.story__intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
.story__heading { font-size: clamp(28px, 2.8vw, 40px); }
.story__lede { font-size: 16px; line-height: 1.55; color: var(--ink-soft); max-width: 44ch; margin-bottom: 28px; }

.story__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 64px;
  align-items: center;
}
.story__rail {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.story__rail li {
  padding-top: 12px;
  border-top: 3px solid var(--line);
  transition: border-color 400ms var(--ease), color 400ms var(--ease);
}
.story__rail span { display: block; font-weight: 700; margin-bottom: 4px; }
.story__rail li.is-done { border-top-color: var(--accent); }
.story__rail li.is-active { border-top-color: var(--ink); color: var(--ink); }

.story__panels { display: grid; gap: 48px; }
.story__panel { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.story__num {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 64px;
  line-height: 1;
  color: var(--accent);
}
.story__panel h3 {
  font-size: clamp(34px, 3.6vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.story__panel p { font-size: 18px; line-height: 1.6; color: var(--ink-soft); max-width: 44ch; }

/* Station visual */
.station {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  /* Cap both axes so the box stays square: tiles are placed in % of the box
     and the SVG route scales to fit, so a non-square box misaligns them. */
  max-height: min(600px, calc(100svh - var(--nav-h) - 190px));
  max-width: min(600px, calc(100svh - var(--nav-h) - 190px));
  margin-inline: auto;
  container: station / inline-size;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
}
.story:not(.story--live) .station { max-width: 560px; max-height: none; }
.station__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(216, 209, 196, 0.7) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(216, 209, 196, 0.7) 1px, transparent 1px);
  background-size: 8.333% 8.333%;
  opacity: 0;
  transition: opacity 700ms var(--ease);
}
.station__lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.station__path,
.station__flow { fill: none; }
.station__path {
  stroke: #B9B0A0;
  stroke-width: 0.35;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 1400ms var(--ease) 300ms, stroke 500ms var(--ease);
}
.station__flow {
  stroke: var(--accent-dark);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-dasharray: 0.01 9.99;
  opacity: 0;
  transition: opacity 500ms var(--ease);
}

.tile {
  --x: var(--gx);
  --y: var(--gy);
  --rot: 0deg;
  --tw: 25%;
  position: absolute;
  /* Keep scattered (rotated) tiles inside the box instead of clipped by it. */
  left: clamp(calc(var(--tw) / 2 + 6px), var(--x), calc(100% - var(--tw) / 2 - 6px));
  top: var(--y);
  width: var(--tw);
  padding: 10px 8px;
  border-radius: 12px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  font-size: clamp(11px, 1.05vw, 13.5px);
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  transform: translate(-50%, -50%) rotate(var(--rot));
  transition:
    left 900ms var(--ease),
    top 900ms var(--ease),
    transform 900ms var(--ease),
    background 500ms var(--ease),
    border-color 500ms var(--ease);
  z-index: 1;
}
.tile:nth-of-type(2) { transition-delay: 40ms; }
.tile:nth-of-type(3) { transition-delay: 80ms; }
.tile:nth-of-type(4) { transition-delay: 120ms; }
.tile:nth-of-type(5) { transition-delay: 160ms; }
.tile:nth-of-type(6) { transition-delay: 200ms; }
.tile:nth-of-type(7) { transition-delay: 240ms; }
.tile:nth-of-type(8) { transition-delay: 280ms; }
.tile:nth-of-type(9) { transition-delay: 320ms; }
.tile__flag {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: opacity 300ms var(--ease), max-height 300ms var(--ease);
}
.tile__flag--crit { color: var(--crit); }
.tile__flag--rev { color: var(--rev); }

.station__caption {
  position: absolute;
  left: 16px;
  top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  z-index: 3;
}
.station__readout {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 3;
  opacity: 0;
  transform: translateY(120%);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
.station__readout dl { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; }
.station__readout dl div { display: flex; gap: 6px; align-items: baseline; }
.station__readout dt,
.station__readout dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.station__readout dt { color: #B9C4BE; }
.station__readout dd { color: var(--accent-tint); font-weight: 600; }

/* Stage states */
.station[data-stage="0"] .tile { --x: var(--sx); --y: var(--sy); --rot: var(--sr); }
.station[data-stage="0"] .tile__flag { max-height: 2em; opacity: 1; }
.station[data-stage="0"] .tile:has(.tile__flag--crit) { border-color: var(--crit); }
.station[data-stage="0"] .tile:has(.tile__flag--rev) { border-color: var(--rev); }
.station:not([data-stage="0"]) .station__grid { opacity: 1; }
.station:not([data-stage="0"]) .station__path { stroke-dashoffset: 0; }
.station[data-stage="2"] .station__path,
.station[data-stage="3"] .station__path { stroke: var(--accent); }
.station[data-stage="2"] .station__flow,
.station[data-stage="3"] .station__flow { opacity: 1; animation: station-flow 3.2s linear infinite; }
.station[data-stage="2"] .tile,
.station[data-stage="3"] .tile { border-color: var(--accent); }
.station[data-stage="3"] .tile { background: var(--green-wash); }
.station[data-stage="3"] .station__readout { opacity: 1; transform: none; }
.station[data-stage="3"] .station__grid { opacity: 0.45; }
@keyframes station-flow { to { stroke-dashoffset: -10; } }

/* Small stations (phones, pinned or static): the 11px type floor no longer
   fits a 25% tile ("Spreadsheet" is about 6.4em wide), so widen the tiles,
   tighten padding and scale type with the box. Compact the readout so it
   clears the bottom row, and drop the caption that would sit on the top row. */
@container station (max-width: 440px) {
  .tile {
    --tw: 30%;
    padding: 8px 4px;
    font-size: min(11px, calc((30cqi - 8px) / 7));
  }
  .tile__flag { font-size: 0.9em; }
  .station__caption { display: none; }
  .station__readout { left: 8px; right: 8px; bottom: 6px; padding: 5px 10px; gap: 8px; border-radius: 10px; }
  .station__readout .h-badge { font-size: 9px; padding: 3px 7px; }
  .station__readout dt,
  .station__readout dd { font-size: 9px; }
  .station__readout dl div:not(:first-child) { display: none; }
}

/* Live (pinned) mode, enabled by home.js */
.story--live .story__track { height: 400vh; }
.story--live .story__sticky {
  position: sticky;
  top: var(--nav-h);
  height: calc(100svh - var(--nav-h));
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 28px;
}
.story--live .story__sticky > .h-container { width: 100%; }
.story--live .story__panels { position: relative; display: block; min-height: 340px; }
.story--live .story__panel {
  position: absolute;
  inset: 0 0 auto 0;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.story--live .story__panel.is-active { opacity: 1; transform: none; }
.story--live .story__panel:not(.is-active) { pointer-events: none; }
.story:not(.story--live) .story__rail { display: none; }
.story:not(.story--live) .story__track { padding-bottom: 32px; }
.story:not(.story--live) .story__intro { margin-bottom: 40px; padding-top: 64px; }

/* ===== Decision statement ===== */
.h-decision { background: var(--accent-tint); padding-block: 104px; }
.h-decision__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
}
.h-decision__main { display: flex; flex-direction: column; gap: 20px; }
.h-decision .h-label { color: var(--accent-dark); }
.h-decision__quote {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(38px, 5vw, 72px);
  line-height: 1;
  letter-spacing: -0.04em;
  text-wrap: balance;
  color: var(--ink);
}
.h-decision__body { display: flex; flex-direction: column; gap: 24px; }
.h-decision .h-body { color: var(--ink); }
.outcomes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.outcomes li {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(36, 73, 62, 0.25);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.015em;
}
.outcomes span { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--accent-dark); }

/* ===== Colour-blocked toolkit ===== */
.blocks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "ai ai wash"
    "ai ai tag"
    "card mint mint";
  gap: 16px;
}
.block {
  border-radius: 26px;
  padding: 28px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 400ms var(--ease);
}
.block:hover { transform: translateY(-4px); }
.block h3 { font-size: 26px; line-height: 1.1; letter-spacing: -0.025em; }
.block p { font-size: 16px; line-height: 1.55; color: var(--ink-soft); max-width: 40ch; }
.block--ai { grid-area: ai; background: var(--accent-dark); color: #FFFFFF; padding: 40px; }
.block--ai .h-label { color: var(--accent-tint); }
.block--ai h3 { color: #FFFFFF; font-size: clamp(32px, 3.4vw, 46px); line-height: 1.02; letter-spacing: -0.035em; max-width: 12em; }
.block--ai p { color: #D5E3DC; font-size: 18px; }
.block--wash { grid-area: wash; background: var(--green-wash); }
.block--tag { grid-area: tag; background: var(--tag-bg); }
.block--card { grid-area: card; background: var(--card); border: 1px solid var(--line); }
.block--mint { grid-area: mint; background: var(--accent-tint); }
.block--mint p { color: var(--ink); }

.pipe {
  position: relative;
  margin-top: auto;
  padding-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pipe span {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
  transition: background 300ms var(--ease), color 300ms var(--ease), border-color 300ms var(--ease);
}
.pipe .pipe__human { background: var(--accent-tint); color: var(--ink); border-color: var(--accent-tint); }
.js-motion #toolkit.is-settled .pipe span:not(.pipe__human) { animation: pipe-lit 2.4s var(--ease) 1 both; }
.js-motion #toolkit.is-settled .pipe span:nth-child(2) { animation-delay: 300ms; }
.js-motion #toolkit.is-settled .pipe span:nth-child(3) { animation-delay: 600ms; }
.js-motion #toolkit.is-settled .pipe span:nth-child(4) { animation-delay: 900ms; }
@keyframes pipe-lit {
  0%, 100% { background: transparent; border-color: rgba(255, 255, 255, 0.28); }
  30% { background: rgba(159, 225, 203, 0.22); border-color: var(--accent-tint); }
}

/* ===== Who we help ===== */
.dotted-list { list-style: none; margin: 0; padding: 0; }
.dotted-list li {
  display: flex;
  gap: 22px;
  align-items: baseline;
  padding-block: 24px;
  border-top: 2px dotted var(--line);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(21px, 2.2vw, 28px);
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.dotted-list li:last-child { border-bottom: 2px dotted var(--line); }
.dotted-list span { font-family: var(--font-mono); font-weight: 700; font-size: 13px; color: var(--accent); letter-spacing: 0.06em; }

/* ===== Governance band ===== */
.h-band { background: var(--accent-dark); color: #FFFFFF; padding-block: 120px; }
.h-band__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 72px;
  align-items: center;
}
.h-band__grid > div { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.h-band .h-heading { color: #FFFFFF; }
.h-band .h-body { color: #D5E3DC; }
.h-band__note { font-size: 14px; color: #B9CEC5; max-width: 60ch; }
.controls { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.controls li {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 24px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.02em;
}
.controls span { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--accent-tint); }
.js-motion .h-band .controls li { opacity: 0; transform: translateX(28px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.js-motion .h-band.is-settled .controls li { opacity: 1; transform: none; }
.js-motion .h-band.is-settled .controls li:nth-child(2) { transition-delay: 110ms; }
.js-motion .h-band.is-settled .controls li:nth-child(3) { transition-delay: 220ms; }
.js-motion .h-band.is-settled .controls li:nth-child(4) { transition-delay: 330ms; }

/* ===== Founders ===== */
.people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.person {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  overflow: hidden;
}
.person img { width: 100%; height: 100%; object-fit: cover; }
.person__body { padding: 28px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.person h3 { font-size: 26px; letter-spacing: -0.025em; }
.person p { font-size: 16px; line-height: 1.55; color: var(--ink-soft); }
.h-honesty {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 2px dotted var(--line);
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 72ch;
}

/* ===== Guides ===== */
.articles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.article {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 280px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--ink);
  text-decoration: none;
  transition: transform 400ms var(--ease), border-color 300ms var(--ease);
}
.article:hover { transform: translateY(-4px); border-color: var(--accent); }
.article h3 { font-size: 22px; line-height: 1.15; letter-spacing: -0.02em; }
.article p { font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.article__more { margin-top: auto; font-weight: 500; }
.article__more::after { content: " \2192"; transition: margin-left 300ms var(--ease); }
.article:hover .article__more::after { margin-left: 4px; }

/* ===== CTA ===== */
.h-cta { padding-block: 128px 144px; }
.h-cta__inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 24px; }
.h-cta__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(46px, 7.4vw, 112px);
  line-height: 0.96;
  letter-spacing: -0.045em;
  max-width: 11em;
}
.h-cta .h-body { margin-inline: auto; }
.h-cta__line { text-transform: none; letter-spacing: 0.02em; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .articles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .person { grid-template-columns: 1fr; }
  .person img { height: 260px; }
}

@media (max-width: 960px) {
  .home { --nav-h: 64px; }
  .h-hero__grid,
  .h-split,
  .h-decision__grid,
  .h-band__grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .h-section { padding-block: 88px; }
  .h-band { padding-block: 88px; }
  .h-hero { padding-block: 48px 80px; }
  .blocks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "ai ai" "wash tag" "card mint";
  }
  .people { grid-template-columns: minmax(0, 1fr); }
  .person { grid-template-columns: 160px minmax(0, 1fr); }
  .person img { height: 100%; }

  .story__grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .story--live .story__grid { gap: 18px; }
  .story--live .station { order: -1; max-height: 40svh; max-width: 40svh; }
  .story--live .story__rail { margin-bottom: 14px; }
  .story--live .story__intro { gap: 6px; }
  .story--live .story__panels { min-height: 0; }
  .story--live .story__num { display: none; }
  .story--live .story__panel { gap: 8px; }
  .story--live .story__panel h3 { font-size: 28px; }
  .story--live .story__panel p { font-size: 15px; line-height: 1.5; }
  .story--live .story__lede { display: none; }
  .story--live .story__sticky { gap: 14px; padding-top: 16px; }
  .story--live .story__heading { font-size: 24px; }
  .story--live .station { max-height: 34svh; max-width: 34svh; }
}

@media (max-width: 600px) {
  .routes { padding: 20px; border-radius: 22px; }
  .lane__labels { font-size: 11px; }
  .routes__result { grid-template-columns: minmax(0, 1fr); }
  .blocks { grid-template-columns: minmax(0, 1fr); grid-template-areas: "ai" "wash" "tag" "card" "mint"; }
  .block--ai { padding: 28px; }
  .articles { grid-template-columns: minmax(0, 1fr); }
  .article { min-height: 0; }
  .person { grid-template-columns: minmax(0, 1fr); }
  .person img { height: 280px; }
  .story__rail { font-size: 9.5px; }
  .story__rail li { padding-top: 8px; }
  .h-section__head--row { flex-direction: column; align-items: flex-start; }
  .tickets { --row: 118px; }
  .ticket { grid-template-areas: "meta stamp" "text text"; padding: 14px 16px 16px; }
  .ticket__text { font-size: 17px; }
  .outcomes li { font-size: 16px; padding: 12px 16px; }
  .controls li { font-size: 18px; padding: 14px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .home *,
  .home *::before,
  .home *::after {
    animation: none !important;
    transition: none !important;
  }
}
