/* =======================================================================
   LLM Modularity — project page
   Palette mirrors docs/figure.md
   Language #C0392B · Formal #2471A3 · Physical #E67E22 · Social #27AE60
   ======================================================================= */

:root {
  --c-lan: #C0392B;
  --c-md:  #2471A3;
  --c-phy: #E67E22;
  --c-tom: #27AE60;
  --c-shared: #9B59B6;

  --bg: #0c0d12;
  --bg-soft: #14161d;
  --bg-card: #1a1c25;
  --line: rgba(255,255,255,.08);
  --line-strong: rgba(255,255,255,.18);
  --ink: #ECECF1;
  --ink-mute: #9298A6;
  --ink-faint: #5d6371;
  --accent: #FFD27A;

  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --maxw: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
img { max-width: 100%; height: auto; display: block; }

/* ---------- shared section scaffolding ---------- */
section {
  padding: 110px 32px;
  max-width: var(--maxw);
  margin: 0 auto;
  position: relative;
}
.section-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 18px;
  font-weight: 500;
}
.section-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.15;
  letter-spacing: -.015em;
  margin: 0 0 18px;
  color: var(--ink);
  max-width: 900px;
}
.section-lede {
  font-size: 18px;
  color: var(--ink-mute);
  max-width: 740px;
  margin: 0;
}
.section-head { margin-bottom: 64px; max-width: 1000px; }


/* ============================================================ HERO */
.hero {
  min-height: 100vh;
  max-width: none;
  padding: 0;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, #1c1e2a 0%, #0c0d12 60%);
  border-bottom: 1px solid var(--line);
}
#neurons-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 90px 32px 60px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  text-align: center;
}
.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: .85;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(36px, 6.4vw, 88px);
  line-height: 1.04;
  letter-spacing: -.022em;
  margin: 6px 0 0;
}
.title-accent {
  background: linear-gradient(90deg, var(--c-lan) 0%, var(--c-md) 33%, var(--c-phy) 66%, var(--c-tom) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  max-width: 720px;
  margin: 14px auto 0;
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--ink-mute);
}
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  margin-top: 6px;
}
.meta-pill {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  color: var(--ink-mute);
  background: rgba(255,255,255,.02);
}
/* hero — left: prompt; right (stacked): brain on top, LLM on bottom */
.hero-stage {
  margin: 28px auto 0;
  width: 100%;
  max-width: 1180px;
  display: grid;
  gap: 24px;
}
.stage-row {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  align-items: stretch;
}
.stage-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stage-right {
  display: grid;
  grid-template-rows: 360px 240px;   /* fixed → SVG can never push pills */
  gap: 18px;
}
.stage-pills {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

/* small uppercase column labels */
.prompt-tag,
.stage-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}
.tag-sub {
  text-transform: none;
  letter-spacing: .04em;
  color: var(--ink-faint);
  opacity: .7;
}

/* "Tiles" on the right — no boxes, just a label + a hairline rule above the viz */
.stage-tile {
  display: flex;
  flex-direction: column;
  padding: 4px 4px 0;
  min-height: 0;
  overflow: hidden;   /* SVG cannot bleed past the tile */
}
.stage-tile .stage-tag {
  font-size: 11.5px;
  letter-spacing: .22em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.stage-tile .stage-tag .tag-sub {
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: none;
}
.stage-tile-brain .stage-brain-wrap {
  flex: 1;
  max-width: none;
  width: 100%;
  aspect-ratio: auto;
  position: relative;
  min-height: 0;
}
.stage-tile-nn .stage-nn {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  height: 100%;          /* fills the tile height regardless of intrinsic */
  margin-top: 4px;
  display: block;
}

/* --- terminal-style prompt panel --- */
.stage-input { text-align: left; }
.prompt-shell {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.6);
  backdrop-filter: blur(6px);
}
.prompt-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 14px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid var(--line);
}
.prompt-bar .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ink-faint); opacity: .6;
}
.prompt-bar .d-r { background: #ED6A5E; }
.prompt-bar .d-y { background: #F4BF50; }
.prompt-bar .d-g { background: #62C554; }
.prompt-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.prompt-body { padding: 22px 20px 14px; }
.prompt-line {
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  letter-spacing: 0;
  min-height: 3em;
}
.prompt-gt { color: var(--accent); margin-right: 8px; }
.prompt-caret {
  display: inline-block;
  width: 8px; height: 1em;
  background: var(--ink);
  vertical-align: -2px;
  animation: blink 1s steps(2,end) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.prompt-ans {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-mute);
  min-height: 1.4em;
  display: flex; align-items: center; gap: 10px;
}
.prompt-ans-lab { color: var(--ink-faint); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
#prompt-answer {
  color: var(--accent);
  font-weight: 600;
  opacity: 0;
  transition: opacity .4s ease;
}
#prompt-answer.show { opacity: 1; }

.prompt-foot {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.prompt-foot-lab {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.prompt-chip {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  padding: 5px 12px;
  border-radius: 100px;
  background: rgba(255,255,255,.04);
  color: var(--ink);
  border: 1px solid var(--chip-c, var(--line-strong));
  box-shadow: 0 0 16px var(--chip-c, transparent);
  transition: all .5s ease;
}

/* --- brain stage: 4 layers, one visible at a time --- */
.stage-brain-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 520px;
  margin: 0 auto;
}
.stage-base {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  opacity: 1;
  filter: drop-shadow(0 18px 40px rgba(0,0,0,.55));
}
.stage-overlay {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .9s cubic-bezier(.2,.7,.2,1),
              transform .9s cubic-bezier(.2,.7,.2,1),
              filter   .9s ease;
  filter: drop-shadow(0 0 18px var(--c, transparent));
  transform: scale(.96);
  pointer-events: none;
}
#stage-brain.is-lang .stage-overlay.stage-lang,
#stage-brain.is-md   .stage-overlay.stage-md,
#stage-brain.is-phys .stage-overlay.stage-phys,
#stage-brain.is-tom  .stage-overlay.stage-tom {
  opacity: 1;
  transform: scale(1);
}
.stage-overlay.stage-lang { --c: rgba(192,57,43,.7); }
.stage-overlay.stage-md   { --c: rgba(36,113,163,.7); }
.stage-overlay.stage-phys { --c: rgba(230,126,34,.7); }
.stage-overlay.stage-tom  { --c: rgba(39,174,96,.7); }

/* --- LLM as a neural-network with lit circuits --- */
.stage-nn {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.nn-label {
  font-family: var(--mono);
  font-size: 10.5px;
  fill: var(--ink-faint);
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 500;
}

/* Faint vertical "wells" behind each layer of nodes */
.nn-layer-well {
  fill: rgba(255,255,255,.018);
}

/* Default state: every edge & node faint */
.nn-edge {
  stroke: rgba(255,255,255,.085);
  stroke-width: 0.55;
  fill: none;
  transition: stroke .6s ease, stroke-width .6s ease, opacity .6s ease, filter .6s ease;
}
.nn-node {
  fill: rgba(255,255,255,.18);
  stroke: rgba(255,255,255,.08);
  stroke-width: 0.4;
  transition: fill .6s ease, opacity .6s ease, filter .6s ease, r .6s ease, stroke .6s ease;
}

/* Active domain rules — applied by JS setting .is-<domain> on #stage-nn.
   Each edge / node can carry one OR multiple .circ-<domain> classes,
   so the same neuron may be lit by more than one domain at different times. */
#stage-nn.is-lang  .nn-edge.circ-lang,
#stage-nn.is-md    .nn-edge.circ-md,
#stage-nn.is-phys  .nn-edge.circ-phys,
#stage-nn.is-tom   .nn-edge.circ-tom {
  stroke: var(--c-on);
  stroke-width: 1.6;
  filter:
    drop-shadow(0 0 2px var(--c-on))
    drop-shadow(0 0 8px var(--c-on));
}
#stage-nn.is-lang  .nn-node.circ-lang,
#stage-nn.is-md    .nn-node.circ-md,
#stage-nn.is-phys  .nn-node.circ-phys,
#stage-nn.is-tom   .nn-node.circ-tom {
  fill: var(--c-on);
  stroke: rgba(255,255,255,.85);
  stroke-width: 1.2;
  filter:
    drop-shadow(0 0 3px var(--c-on))
    drop-shadow(0 0 12px var(--c-on));
}
/* dim everything else when a domain is active */
#stage-nn.is-lang  .nn-edge:not(.circ-lang),
#stage-nn.is-md    .nn-edge:not(.circ-md),
#stage-nn.is-phys  .nn-edge:not(.circ-phys),
#stage-nn.is-tom   .nn-edge:not(.circ-tom) {
  stroke: rgba(255,255,255,.04);
}
#stage-nn.is-lang  .nn-node:not(.circ-lang),
#stage-nn.is-md    .nn-node:not(.circ-md),
#stage-nn.is-phys  .nn-node:not(.circ-phys),
#stage-nn.is-tom   .nn-node:not(.circ-tom) {
  fill: rgba(255,255,255,.08);
  stroke: rgba(255,255,255,.02);
  filter: none;
}

/* Color is determined by the ACTIVE state (set on #stage-nn) — not by the
   element's own circ-* class. That way a node belonging to multiple circuits
   takes the colour of whatever domain is currently active. */
#stage-nn.is-lang { --c-on: #E94B3D; }
#stage-nn.is-md   { --c-on: #3D8BD1; }
#stage-nn.is-phys { --c-on: #FF9A3F; }
#stage-nn.is-tom  { --c-on: #3FCF7A; }

/* Flowing dash animation on the active circuit edges — sense of signal flow */
@keyframes circuit-flow {
  to { stroke-dashoffset: -28; }
}
#stage-nn.is-lang  .nn-edge.circ-lang,
#stage-nn.is-md    .nn-edge.circ-md,
#stage-nn.is-phys  .nn-edge.circ-phys,
#stage-nn.is-tom   .nn-edge.circ-tom {
  stroke-dasharray: 4 6;
  animation: circuit-flow 1.6s linear infinite;
}

/* gentle node pulse on the lit circuit */
@keyframes circuit-pulse {
  0%, 100% { transform: scale(1);   }
  50%      { transform: scale(1.18); }
}
#stage-nn.is-lang  .nn-node.circ-lang,
#stage-nn.is-md    .nn-node.circ-md,
#stage-nn.is-phys  .nn-node.circ-phys,
#stage-nn.is-tom   .nn-node.circ-tom {
  animation: circuit-pulse 2.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.stage-pulse {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, var(--pulse-c, rgba(255,255,255,.10)) 0%, transparent 60%);
  filter: blur(20px);
  animation: stage-breathe 4s ease-in-out infinite;
  z-index: -1;
}
@keyframes stage-breathe {
  0%, 100% { transform: scale(.95); opacity: .55; }
  50%      { transform: scale(1.08); opacity: 1;   }
}

/* domain pills */
.stage-pill {
  appearance: none;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line-strong);
  color: var(--ink-mute);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 8px 14px 8px 12px;
  border-radius: 100px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all .3s ease;
}
.stage-pill span {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 10px var(--c);
}
.stage-pill:hover { color: var(--ink); border-color: var(--c); }
.stage-pill.active {
  background: rgba(255,255,255,.06);
  border-color: var(--c);
  color: #fff;
  box-shadow: 0 0 22px -2px var(--c);
}


/* ============================================================ FIGURE MOTION
   Subtle, perpetual but tasteful — applies to every .evidence-fig img and
   the chord image. Reveal-on-scroll + slow "shine sweep" on hover + idle
   gentle scale breath on the chord.
*/
.evidence-fig {
  overflow: hidden;
  position: relative;
}
.evidence-fig img {
  transition: transform .8s cubic-bezier(.2,.7,.2,1), filter .4s;
  will-change: transform;
}
.evidence-fig:hover img { transform: scale(1.025); filter: saturate(1.05); }

.evidence-fig::after {
  /* light sweep on hover — gives the figure life */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%);
  transform: translateX(-110%);
  pointer-events: none;
  transition: transform 1.1s ease;
}
.evidence-fig:hover::after { transform: translateX(110%); }

/* chord: subtle perpetual breath */
.chord-fig img { animation: chord-breath 9s ease-in-out infinite; }
@keyframes chord-breath {
  0%, 100% { transform: scale(1);     }
  50%      { transform: scale(1.012); }
}

/* number card: gentle highlight pulse on the value once revealed */
.num-card .num-value {
  position: relative;
}
.num-card.in-view .num-value::after {
  content: "";
  position: absolute;
  left: -6px; right: -6px; top: -6px; bottom: -6px;
  border-radius: 8px;
  background: radial-gradient(circle, rgba(255,210,122,.18), transparent 60%);
  z-index: -1;
  animation: ncard-shine 2.4s ease-out 1;
}
@keyframes ncard-shine {
  0%   { opacity: 0; transform: scale(.7); }
  40%  { opacity: 1; transform: scale(1);  }
  100% { opacity: 0; transform: scale(1.4);}
}
.scroll-cue {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  width: 22px; height: 36px; border: 1px solid var(--line-strong); border-radius: 14px;
  display: grid; place-items: start center; padding-top: 8px;
  opacity: .6;
}
.scroll-cue span {
  display: block; width: 2px; height: 8px; background: var(--ink-mute);
  border-radius: 2px; animation: scrollblip 1.6s ease-in-out infinite;
}
@keyframes scrollblip {
  0%, 100% { transform: translateY(0); opacity: .5; }
  50%      { transform: translateY(8px); opacity: 1; }
}


/* ============================================================ NUMBERS */
.numbers {
  padding-top: 130px;
  padding-bottom: 100px;
}
.numbers .section-eyebrow { text-align: center; margin-bottom: 36px; }
.numbers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.num-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 36px 26px 30px;
  text-align: left;
  position: relative;
  transition: transform .4s ease, border-color .4s;
}
.num-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.num-value {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 64px;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--ink);
}
.num-suffix { font-size: 36px; color: var(--ink-mute); margin-left: 2px; }
.num-label {
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}
.num-versus {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-faint);
}
.num-versus strong { color: var(--ink-mute); }
.num-versus em { color: var(--accent); font-style: normal; font-family: var(--mono); }


/* ============================================================ CHORD */
.chord-section {
  padding: 130px 32px;
  position: relative;
}
.chord-section::before {
  /* subtle vignette to lift the dark chord */
  content: "";
  position: absolute; inset: 60px 0;
  background: radial-gradient(ellipse at center, rgba(192,57,43,.06), rgba(36,113,163,.05) 25%, rgba(230,126,34,.05) 50%, rgba(39,174,96,.05) 75%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}
.chord-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 56px;
  align-items: center;
}
.chord-text .section-eyebrow { margin-bottom: 14px; }
.chord-text .section-lede { margin-bottom: 26px; }
.chord-key {
  list-style: none;
  padding: 0; margin: 0 0 26px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 22px;
}
.chord-key li {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--ink-mute);
}
.chord-key li span {
  width: 14px; height: 14px;
  border-radius: 3px;
  background: var(--c);
  box-shadow: 0 0 10px var(--c);
  flex-shrink: 0;
}
.chord-cap {
  font-size: 12.5px;
  color: var(--ink-faint);
  font-style: italic;
}
.chord-cap .muted { color: rgba(255,255,255,.25); font-style: normal; font-family: var(--mono); font-size: 11px; }

.chord-fig {
  position: relative;
  background: #fafafc;
  border-radius: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  box-shadow:
    0 40px 90px -30px rgba(0,0,0,.65),
    0 0 0 1px rgba(255,255,255,.04) inset;
  overflow: visible;   /* allow the colored halo to escape */
}
.chord-fig::before {
  /* slow conic halo OUTSIDE the white panel, framing the chord */
  content: "";
  position: absolute;
  inset: -22px;
  border-radius: 26px;
  background: conic-gradient(from 0deg,
              rgba(192,57,43,.35),
              rgba(36,113,163,.35),
              rgba(230,126,34,.35),
              rgba(39,174,96,.35),
              rgba(192,57,43,.35));
  filter: blur(28px);
  animation: chord-glow 22s linear infinite;
  pointer-events: none;
  z-index: -1;
  opacity: .9;
}
@keyframes chord-glow {
  to { transform: rotate(360deg); }
}
.chord-fig img {
  position: relative;
  z-index: 1;
  width: 100%;
  display: block;
  border-radius: 8px;
}


/* ============================================================ DOMAINS */
.domains { padding-top: 110px; }
.domain-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.domain-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--c);
  border-radius: 16px;
  padding: 26px 24px 22px;
  position: relative;
  transition: transform .35s ease, border-color .35s;
}
.domain-card:hover { transform: translateY(-3px); border-top-color: var(--c); }
.domain-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--ink-faint);
}
.domain-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 30px;
  line-height: 1;
  margin: 8px 0 6px;
  color: var(--c);
  letter-spacing: -.01em;
}
.domain-net {
  font-size: 12.5px;
  font-style: italic;
  color: var(--ink-mute);
  margin: 0 0 14px;
  letter-spacing: .01em;
}
.domain-tasks {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}
.domain-tasks li {
  font-size: 13px;
  color: var(--ink-mute);
  padding: 4px 0;
  position: relative; padding-left: 14px;
}
.domain-tasks li::before {
  content: ""; position: absolute; left: 0; top: 11px;
  width: 5px; height: 5px; background: var(--c); border-radius: 50%;
}
.domain-count {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--ink-faint);
  text-transform: uppercase;
}


/* ============================================================ METHOD */
.method { padding-top: 110px; }
.method-flow {
  display: grid;
  grid-template-columns: 1fr 36px 1fr 36px 1fr 36px 1fr;
  gap: 0;
  align-items: stretch;
}
.flow-step {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 22px;
  position: relative;
}
.flow-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: .12em;
  border: 1px solid var(--accent);
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 50%;
  margin-bottom: 14px;
}
.flow-step h5 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  margin: 0 0 6px;
  letter-spacing: -.005em;
}
.flow-step p { color: var(--ink-mute); font-size: 13.5px; margin: 0 0 14px; }
.flow-formula {
  font-family: var(--mono);
  font-size: 12.5px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--accent);
}
.flow-formula code { color: var(--accent); }
.flow-formula .muted { color: var(--ink-faint); }
.flow-formula .arrow { color: var(--ink-faint); margin: 0 4px; }
.flow-arrow {
  align-self: center;
  border-top: 1px dashed var(--line-strong);
  height: 0;
  margin: 0 6px;
  position: relative;
}
.flow-arrow::after {
  content: ""; position: absolute; right: -4px; top: -6px;
  border: 6px solid transparent; border-left-color: var(--line-strong);
}


/* ============================================================ EVIDENCE */
.evidence {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 60px;
  align-items: center;
}
.evidence.flip { grid-template-columns: 1.15fr 1fr; }
.evidence.flip .evidence-text { order: 2; }
.evidence.flip .evidence-fig  { order: 1; }
.ev-label {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.ev-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.18;
  letter-spacing: -.015em;
  margin: 0 0 18px;
}
.evidence-text p { color: var(--ink-mute); font-size: 17px; margin: 0 0 16px; }
.ev-aside {
  font-size: 14.5px !important;
  color: var(--ink-faint) !important;
  border-left: 2px solid var(--line-strong);
  padding-left: 14px;
}
.ev-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin: 22px 0 22px;
}
.ev-stats > div {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 12px;
  text-align: center;
}
.ev-stats strong {
  display: block;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.ev-stats span { font-size: 11.5px; color: var(--ink-faint); letter-spacing: .04em; }
.ev-stats > div:nth-child(1) strong { color: var(--c-md); }
.ev-stats > div:nth-child(2) strong { color: var(--c-lan); }
.ev-stats > div:nth-child(3) strong { color: var(--c-phy); }
.ev-stats > div:nth-child(4) strong { color: var(--c-tom); }

.ev-stat-big {
  margin-top: 24px;
  padding: 22px 26px;
  background: linear-gradient(135deg, rgba(192,57,43,.10), rgba(36,113,163,.10) 33%, rgba(230,126,34,.10) 66%, rgba(39,174,96,.10));
  border: 1px solid var(--line-strong);
  border-radius: 16px;
}
.ev-stat-big-val {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.ev-stat-big-lab {
  font-size: 13px; color: var(--ink-mute); margin-top: 4px;
}

.evidence-fig {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}
.evidence-fig img { border-radius: 8px; }
.fig-cap {
  margin-top: 12px;
  font-size: 12.5px;
  color: #555;
  font-style: italic;
  text-align: center;
}
.fig-cap strong { color: #000; font-style: normal; }

/* ev-bars (interactive replacement display) */
.ev-bars { margin-top: 22px; }
.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.bar-name { font-size: 13.5px; color: var(--ink); font-weight: 500; }
.bar-tracks { display: flex; gap: 6px; height: 30px; }
.bar {
  height: 100%;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255,255,255,.95);
  width: calc(var(--v) * 50%);
  min-width: 38px;
  transform-origin: left;
  animation: barIn 1s cubic-bezier(.2,.7,.2,1) backwards;
}
.bar-w { background: var(--c); }
.bar-c { background: var(--c); opacity: .25; }
@keyframes barIn {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.bar-legend {
  display: flex; gap: 14px; align-items: center;
  font-size: 12px; color: var(--ink-faint);
  margin-top: 8px;
}
.bar-legend .dot {
  width: 12px; height: 12px; border-radius: 3px; background: var(--ink-mute); margin-right: 4px; display: inline-block;
}
.bar-legend .dot.faded { opacity: .25; }


/* ============================================================ MODELS */
.models { padding-top: 80px; padding-bottom: 100px; text-align: center; }
.models .section-lede { margin-left: auto; margin-right: auto; }
.model-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-top: 40px;
}
.model-card {
  padding: 22px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: transform .3s ease, border-color .3s;
}
.model-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.model-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -.005em;
}
.model-size {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  margin: 4px 0 10px;
  letter-spacing: .04em;
}
.model-stat {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: .04em;
}
.model-stat span { color: var(--ink-faint); margin: 0 4px; }
.model-row-caption {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 18px;
}


/* ============================================================ TAKEAWAY */
.takeaway {
  padding: 140px 32px;
  text-align: center;
  position: relative;
}
.ta-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(34px, 5.4vw, 64px);
  letter-spacing: -.02em;
  margin: 0 0 22px;
  background: linear-gradient(90deg, var(--c-lan), var(--c-md) 33%, var(--c-phy) 66%, var(--c-tom));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ta-sub {
  max-width: 760px;
  margin: 0 auto;
  font-size: 18px;
  color: var(--ink-mute);
  line-height: 1.65;
}
.ta-sub strong { color: var(--ink); font-weight: 600; }


/* ============================================================ FOOTER */
.page-foot {
  border-top: 1px solid var(--line);
  padding: 50px 32px 60px;
  max-width: var(--maxw);
  margin: 0 auto;
  color: var(--ink-mute);
  font-size: 13px;
}
.foot-cols {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  margin-bottom: 24px;
}
.foot-lab {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.foot-meta { font-size: 12px; color: var(--ink-faint); }
.foot-meta code { color: var(--accent); font-family: var(--mono); font-size: 11px; }


/* ============================================================ REVEAL ANIMATIONS */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1);
}
.reveal.in {
  opacity: 1;
  transform: none;
}


/* ============================================================ RESPONSIVE */
@media (max-width: 980px) {
  .numbers-grid, .domain-grid { grid-template-columns: repeat(2, 1fr); }
  .method-flow { grid-template-columns: 1fr; gap: 16px; }
  .flow-arrow { display: none; }
  .evidence, .evidence.flip { grid-template-columns: 1fr; gap: 32px; }
  .evidence.flip .evidence-text { order: initial; }
  .evidence.flip .evidence-fig  { order: initial; }
  .model-row { grid-template-columns: repeat(3, 1fr); }
  .foot-cols { grid-template-columns: 1fr; }
  .stage-row { grid-template-columns: 1fr; gap: 32px; }
  .chord-grid { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 540px) {
  .numbers-grid, .domain-grid, .model-row { grid-template-columns: 1fr 1fr; }
  .ev-stats { grid-template-columns: repeat(2, 1fr); }
  section { padding: 80px 22px; }
  .hero-inner { padding: 60px 22px 40px; }
  .chord-key { grid-template-columns: 1fr; }
}
