/* ============================================================
   TRAJECTORY v2 - visual system
   ============================================================ */

/* ---------- vendored fonts (no CDN, works offline) ---------- */
@font-face { font-family: "Space Grotesk"; font-weight: 300; src: url("../assets/fonts/space-grotesk-latin-300-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Space Grotesk"; font-weight: 400; src: url("../assets/fonts/space-grotesk-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Space Grotesk"; font-weight: 500; src: url("../assets/fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Space Grotesk"; font-weight: 600; src: url("../assets/fonts/space-grotesk-latin-600-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Space Grotesk"; font-weight: 700; src: url("../assets/fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 300; src: url("../assets/fonts/inter-latin-300-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 400; src: url("../assets/fonts/inter-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 500; src: url("../assets/fonts/inter-latin-500-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 600; src: url("../assets/fonts/inter-latin-600-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "JetBrains Mono"; font-weight: 300; src: url("../assets/fonts/jetbrains-mono-latin-300-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; src: url("../assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; src: url("../assets/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; src: url("../assets/fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #04060d;
  --bg2: #080c18;
  --ink: #e8ecf6;
  --ink-dim: #8b94ab;
  --ink-faint: #525b72;
  --line: rgba(140, 160, 210, 0.13);
  --cyan: #22d3ee;
  --violet: #c084fc;
  --amber: #fbbf24;
  --rose: #fb7185;
  --emerald: #34d399;
  --glass: rgba(13, 18, 34, 0.62);
  --font-d: "Space Grotesk", sans-serif;
  --font-b: "Inter", sans-serif;
  --font-m: "JetBrains Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-b);
  font-weight: 300;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(34, 211, 238, 0.3); }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--font-m); letter-spacing: 0.04em; }
.dim { color: var(--ink-dim); }
.accent { color: var(--cyan); }
.kbd { font-family: var(--font-m); font-size: 0.85em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--ink-dim); }

/* custom scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1a2440; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #28365c; }

/* ---------- backdrop ---------- */
#starfield { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.nebula { position: fixed; border-radius: 50%; filter: blur(140px); opacity: 0.15; pointer-events: none; z-index: 0; }
.nebula-a { width: 60vw; height: 60vw; top: -22vw; right: -18vw; background: radial-gradient(circle, #2563eb, #7c3aed 60%, transparent 75%); animation: drift 26s ease-in-out infinite alternate; }
.nebula-b { width: 50vw; height: 50vw; bottom: -20vw; left: -15vw; background: radial-gradient(circle, #0e7490, #22d3ee 55%, transparent 75%); animation: drift 32s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(4vw, 3vw) scale(1.12); } }

#progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 60; background: linear-gradient(90deg, var(--cyan), var(--violet)); box-shadow: 0 0 10px rgba(34,211,238,.7); transition: width .1s linear; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
  html { scroll-behavior: auto; }
  .nebula { animation: none; }
}

/* ---------- nav ---------- */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 32px;
  background: linear-gradient(to bottom, rgba(4,6,13,0.92), rgba(4,6,13,0.55) 75%, transparent);
  backdrop-filter: blur(10px);
}
.nav-brand { font-family: var(--font-m); font-weight: 700; font-size: 15px; letter-spacing: 0.22em; }
.nav-cursor { color: var(--cyan); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav-links { display: flex; gap: 22px; }
.nav-links a { font-family: var(--font-m); font-size: 10.5px; letter-spacing: 0.12em; color: var(--ink-dim); text-transform: uppercase; }
.nav-links a:hover { color: var(--cyan); text-decoration: none; }
@media (max-width: 960px) { .nav-links { display: none; } }

/* ---------- hero ---------- */
#hero {
  position: relative; z-index: 1; min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 120px 24px 60px;
}
.hero-eyebrow { font-size: 10.5px; color: var(--cyan); letter-spacing: 0.26em; margin-bottom: 28px; opacity: 0.9; }
.hero-title { font-family: var(--font-d); font-weight: 700; font-size: clamp(50px, 10.5vw, 144px); line-height: 0.96; letter-spacing: -0.02em; }
.hero-title .line { display: block; opacity: 0; transform: translateY(36px); animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.hero-title .line:nth-child(2) { animation-delay: 0.14s; }
.hero-title .line:nth-child(3) { animation-delay: 0.28s; }
@keyframes rise { to { opacity: 1; transform: none; } }
.grad {
  background: linear-gradient(92deg, #22d3ee 0%, #818cf8 45%, #c084fc 75%, #f0abfc 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 38px rgba(129, 140, 248, 0.35));
}
.hero-sub { max-width: 680px; margin: 30px auto 0; color: var(--ink-dim); font-size: 16.5px; opacity: 0; animation: rise 0.9s 0.5s forwards; }
.hero-sub strong { color: var(--ink); font-weight: 500; }

.ticker {
  margin-top: 40px; padding: 18px 34px 16px; border-radius: 18px; text-align: center;
  opacity: 0; animation: rise 0.9s 0.62s forwards;
  border: 1px solid rgba(34, 211, 238, 0.25);
  box-shadow: 0 0 50px rgba(34, 211, 238, 0.07), inset 0 0 40px rgba(34, 211, 238, 0.03);
}
.ticker-label { font-size: 9.5px; letter-spacing: 0.3em; color: var(--cyan); }
.ticker-value { font-size: clamp(34px, 5vw, 54px); font-weight: 700; color: var(--ink); margin: 4px 0 2px; text-shadow: 0 0 30px rgba(34,211,238,.4); font-variant-numeric: tabular-nums; }
.ticker-sub { font-size: 9.5px; color: var(--ink-faint); letter-spacing: 0.06em; }
.ticker-sub b { color: var(--ink-dim); }

.hero-dials { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 38px; opacity: 0; animation: rise 0.9s 0.75s forwards; }
.dial { width: 164px; padding: 17px 13px 15px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px); }
.dial svg { display: block; margin: 0 auto 8px; }
.dial-label { font-family: var(--font-m); font-size: 9.5px; letter-spacing: 0.1em; color: var(--ink-dim); text-transform: uppercase; line-height: 1.5; }
.dial-src { font-family: var(--font-m); font-size: 8.5px; color: var(--ink-faint); margin-top: 5px; }
.hero-scroll { margin-top: 56px; font-size: 10px; letter-spacing: 0.3em; color: var(--ink-faint); animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(7px); } }

/* ---------- sections ---------- */
main { position: relative; z-index: 1; }
.section { max-width: 1120px; margin: 0 auto; padding: 110px 28px 30px; }
.section.wide { max-width: 1340px; }
.sec-head { margin-bottom: 44px; }
.sec-kicker { font-size: 11px; color: var(--cyan); letter-spacing: 0.3em; margin-bottom: 14px; }
.sec-head h2 { font-family: var(--font-d); font-weight: 600; font-size: clamp(30px, 4.6vw, 52px); letter-spacing: -0.01em; line-height: 1.06; }
.sec-sub { max-width: 760px; color: var(--ink-dim); margin-top: 14px; font-size: 15.5px; }
.h3 { font-family: var(--font-d); font-weight: 600; font-size: 24px; }
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: 20px; backdrop-filter: blur(16px); }
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- world state ---------- */
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 14px; }
.state-card {
  padding: 22px 20px 18px; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.state-card:hover { transform: translateY(-4px); border-color: rgba(34, 211, 238, 0.4); box-shadow: 0 14px 44px rgba(0, 0, 0, 0.45); }
.state-k { font-family: var(--font-m); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); }
.state-v { font-family: var(--font-d); font-weight: 700; font-size: 31px; margin: 7px 0 9px; }
.state-v.glow { color: var(--cyan); text-shadow: 0 0 26px rgba(34, 211, 238, 0.45); }
.state-sub { font-size: 12.5px; color: var(--ink-dim); line-height: 1.55; }
.state-src { display: inline-block; margin-top: 11px; font-family: var(--font-m); font-size: 9.5px; letter-spacing: 0.06em; color: var(--ink-faint); border: 1px solid var(--line); border-radius: 99px; padding: 3px 9px; }
.state-src:hover { color: var(--cyan); border-color: var(--cyan); text-decoration: none; }

/* ---------- scenarios ---------- */
.scen-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 16px; }
.scen-card {
  position: relative; padding: 26px 22px; border-radius: 18px; cursor: pointer;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px);
  transition: transform 0.25s ease, border-color 0.25s, box-shadow 0.25s;
  overflow: hidden;
}
.scen-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--sc, var(--cyan)); opacity: 0.85; }
.scen-card:hover { transform: translateY(-5px); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5); }
.scen-card.active { border-color: var(--sc, var(--cyan)); box-shadow: 0 0 0 1px var(--sc), 0 14px 48px rgba(0, 0, 0, 0.5); }
.scen-p { font-family: var(--font-d); font-weight: 700; font-size: 46px; color: var(--sc, var(--cyan)); line-height: 1; }
.scen-p small { font-size: 20px; opacity: 0.75; }
.scen-name { font-family: var(--font-m); font-weight: 700; font-size: 14px; letter-spacing: 0.18em; margin-top: 8px; }
.scen-tag { font-size: 12.5px; color: var(--ink-dim); font-style: italic; margin: 4px 0 12px; }
.scen-sum { font-size: 12.5px; color: var(--ink-dim); line-height: 1.6; }
.scen-end { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--ink-faint); }
.scen-end b { color: var(--ink-dim); font-weight: 500; font-family: var(--font-m); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; display: block; margin-bottom: 4px; }

/* ---------- river ---------- */
.river-wrap { position: relative; padding: 8px 6px 2px; overflow: hidden; }
#river-container svg { display: block; }
#river-particles { position: absolute; inset: 0; pointer-events: none; }
.tooltip {
  position: absolute; pointer-events: none; z-index: 10;
  background: rgba(8, 12, 24, 0.95); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 13px; font-size: 11px; line-height: 1.6; color: var(--ink);
  opacity: 0; transition: opacity 0.15s; max-width: 280px; backdrop-filter: blur(8px);
}
.tooltip.show { opacity: 1; }
.river-month-tick:hover text { fill: var(--cyan) !important; }
.fork-marker { cursor: pointer; }

/* ---------- simulator ---------- */
.sim-wrap { padding: 26px 26px 20px; }
.sim-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; padding-bottom: 22px; border-bottom: 1px dashed var(--line); margin-bottom: 22px; }
.sim-ctl label { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: 0.14em; color: var(--ink-dim); margin-bottom: 9px; }
.sim-ctl input[type="range"] { width: 100%; accent-color: var(--cyan); height: 4px; cursor: pointer; }
.sim-hints { display: flex; justify-content: space-between; font-size: 8.5px; color: var(--ink-faint); margin-top: 5px; }
.sim-ctl-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toggle { display: flex !important; align-items: center; gap: 7px; cursor: pointer; margin-bottom: 0 !important; }
.toggle input { accent-color: var(--cyan); }
#sim-runs { background: var(--bg2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 11px; }
#sim-run {
  background: linear-gradient(90deg, var(--cyan), #818cf8); color: #04060d; font-weight: 700;
  border: none; border-radius: 10px; padding: 10px 20px; font-size: 11.5px; letter-spacing: 0.1em; cursor: pointer;
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.35); transition: transform 0.15s, box-shadow 0.2s;
}
#sim-run:hover { transform: translateY(-2px); box-shadow: 0 0 38px rgba(34, 211, 238, 0.55); }
button.ghost { background: transparent; color: var(--ink-dim); border: 1px solid var(--line); border-radius: 10px; padding: 9px 16px; font-size: 11px; cursor: pointer; }
button.ghost:hover { color: var(--ink); border-color: var(--ink-dim); }
.sim-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; }
@media (max-width: 1020px) { .sim-grid { grid-template-columns: 1fr; } }
.sim-panel { padding: 14px 14px 10px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.015); margin-bottom: 0; }
.sim-side { display: flex; flex-direction: column; gap: 14px; }
#sim-fan { width: 100%; height: auto; display: block; }
.sim-cdf-panel { margin-top: 20px; }
#sim-cdf svg { width: 100%; height: auto; display: block; }
.share-row { display: grid; grid-template-columns: 110px 1fr 88px; align-items: center; gap: 10px; margin: 9px 0; }
.share-name { font-family: var(--font-m); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; }
.share-bar { height: 14px; border-radius: 4px; background: rgba(255, 255, 255, 0.05); position: relative; overflow: hidden; }
.share-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; transition: width 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.share-bar .prior { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #fff; opacity: 0.65; }
.share-val { font-family: var(--font-m); font-size: 10.5px; color: var(--ink-dim); text-align: right; }
.agi-hist { display: flex; align-items: flex-end; gap: 8px; height: 110px; padding-top: 8px; }
.agi-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; }
.agi-col i { width: 100%; border-radius: 5px 5px 0 0; background: linear-gradient(to top, rgba(34, 211, 238, 0.25), var(--cyan)); transition: height 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); box-shadow: 0 0 14px rgba(34, 211, 238, 0.25); min-height: 2px; }
.agi-col.never i { background: linear-gradient(to top, rgba(82, 91, 114, 0.3), #525b72); box-shadow: none; }
.agi-col span { font-family: var(--font-m); font-size: 9px; color: var(--ink-faint); }
.agi-col b { font-family: var(--font-m); font-size: 10px; color: var(--ink); font-weight: 500; }
.ev-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; padding: 5px 0; border-bottom: 1px dotted rgba(140, 160, 210, 0.08); }
.ev-row:last-child { border-bottom: none; }
.ev-name { color: var(--ink-dim); font-family: var(--font-m); font-size: 10px; letter-spacing: 0.06em; }
.ev-val { font-family: var(--font-m); font-weight: 700; }

/* ---------- feed ---------- */
.feed-controls { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; position: sticky; top: 58px; z-index: 30; }
.scen-switch {
  display: flex; gap: 8px; flex-wrap: wrap;
  background: rgba(6, 9, 18, 0.88); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 99px; padding: 7px; width: fit-content;
}
.sw-btn { border: none; cursor: pointer; border-radius: 99px; padding: 8px 16px; font-family: var(--font-m); font-size: 10.5px; letter-spacing: 0.1em; background: transparent; color: var(--ink-dim); transition: all 0.2s; }
.sw-btn:hover { color: var(--ink); }
.sw-btn.active { background: var(--sc, var(--cyan)); color: #04060d; font-weight: 700; }
.play-btn {
  background: rgba(52, 211, 153, 0.12); color: var(--emerald); border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: 99px; padding: 10px 20px; font-size: 11px; letter-spacing: 0.12em; cursor: pointer; transition: all 0.2s;
}
.play-btn:hover { background: rgba(52, 211, 153, 0.22); box-shadow: 0 0 22px rgba(52, 211, 153, 0.25); }
.tag-filter { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 30px; }
.tf-btn { border: 1px solid var(--line); background: transparent; color: var(--ink-faint); border-radius: 99px; padding: 4px 12px; font-size: 9.5px; letter-spacing: 0.1em; cursor: pointer; text-transform: uppercase; font-family: var(--font-m); transition: all 0.18s; }
.tf-btn:hover { color: var(--ink-dim); }
.tf-btn.active { color: var(--cyan); border-color: var(--cyan); }

.feed { position: relative; padding-left: 38px; }
.feed::before {
  content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(to bottom, var(--cyan), #818cf8 30%, var(--violet) 55%, var(--amber) 80%, var(--rose));
  opacity: 0.32; border-radius: 2px;
}
.feed-item { position: relative; margin-bottom: 26px; }
.feed-item.tag-hidden { display: none; }
.feed-dot {
  position: absolute; left: -36px; top: 24px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2.5px solid var(--cyan); box-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
}
.feed-item.is-fork .feed-dot { width: 17px; height: 17px; left: -38px; border-color: var(--violet); box-shadow: 0 0 20px rgba(192, 132, 252, 0.7); animation: pulse 2s infinite; }
.feed-item.is-now .feed-dot { border-color: var(--emerald); box-shadow: 0 0 16px rgba(52, 211, 153, 0.8); }
@keyframes pulse { 50% { box-shadow: 0 0 34px rgba(192, 132, 252, 0.95); } }
.feed-card {
  padding: 22px 26px 18px; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(12px);
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.4s;
}
.feed-card:hover { border-color: rgba(140, 160, 210, 0.3); transform: translateX(4px); }
.feed-item.playing .feed-card { border-color: var(--emerald); box-shadow: 0 0 40px rgba(52, 211, 153, 0.15); }
.feed-item.is-fork .feed-card { border-color: rgba(192, 132, 252, 0.4); background: linear-gradient(135deg, rgba(192, 132, 252, 0.07), var(--glass)); }
.feed-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.feed-date { font-family: var(--font-m); font-weight: 700; font-size: 13px; letter-spacing: 0.16em; color: var(--cyan); }
.feed-item.is-fork .feed-date { color: var(--violet); }
.chip { font-family: var(--font-m); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; border-radius: 99px; padding: 3px 9px; border: 1px solid var(--line); color: var(--ink-dim); }
.chip.conf { border-color: rgba(52, 211, 153, 0.4); color: var(--emerald); }
.chip.conf.mid { border-color: rgba(251, 191, 36, 0.4); color: var(--amber); }
.chip.conf.low { border-color: rgba(251, 113, 133, 0.4); color: var(--rose); }
.chip.now { background: var(--emerald); color: #04060d; border-color: var(--emerald); font-weight: 700; }
.chip.q { border-color: rgba(129, 140, 248, 0.45); color: #a5b4fc; }
.feed-head { font-family: var(--font-d); font-weight: 600; font-size: 19.5px; line-height: 1.25; margin-bottom: 8px; }
.feed-body { font-size: 13.8px; color: #b6bed2; }
.feed-branch { margin-top: 12px; padding: 12px 15px; border-radius: 11px; font-size: 13px; background: rgba(255, 255, 255, 0.025); border-left: 3px solid var(--sc, var(--cyan)); color: #b6bed2; }
.feed-branch b { font-family: var(--font-m); font-size: 9.5px; letter-spacing: 0.14em; color: var(--sc, var(--cyan)); display: block; margin-bottom: 4px; }
.feed-metrics { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.fm { font-family: var(--font-m); font-size: 9.5px; letter-spacing: 0.05em; color: var(--ink-dim); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; }
.fm b { color: var(--ink); font-weight: 500; }
.feed-signals { margin-top: 11px; font-size: 11px; color: var(--ink-faint); }
.feed-signals span { font-family: var(--font-m); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; }

/* ---------- forks / wildcards ---------- */
.fork-stack { display: flex; flex-direction: column; gap: 22px; }
.fork-card { padding: 30px 32px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px); }
.fork-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.fork-label { font-family: var(--font-m); font-weight: 700; font-size: 12px; letter-spacing: 0.2em; color: var(--violet); }
.fork-name { font-family: var(--font-d); font-weight: 600; font-size: 26px; }
.fork-date { font-family: var(--font-m); font-size: 11px; color: var(--ink-faint); letter-spacing: 0.12em; }
.fork-q { font-size: 16px; color: var(--ink); font-weight: 400; margin: 12px 0 10px; font-style: italic; }
.fork-ctx { font-size: 13.5px; color: var(--ink-dim); max-width: 900px; }
.fork-branches { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 12px; margin-top: 22px; }
.fb { border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 14px; background: rgba(255, 255, 255, 0.02); }
.fb-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.fb-label { font-family: var(--font-m); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; }
.fb-p { font-family: var(--font-d); font-weight: 700; font-size: 26px; color: var(--cyan); }
.fb-bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); overflow: hidden; margin-bottom: 10px; }
.fb-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--cyan), var(--violet)); }
.fb-detail { font-size: 12px; color: var(--ink-dim); line-height: 1.55; }
.fork-watch { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); }
.fork-watch b { font-family: var(--font-m); font-size: 9.5px; letter-spacing: 0.18em; color: var(--emerald); text-transform: uppercase; }
.fork-watch ul { margin: 8px 0 0 18px; font-size: 12.5px; color: var(--ink-dim); }
.fork-watch li { margin-bottom: 4px; }
.wild-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(252px, 1fr)); gap: 14px; }
.wild-card { padding: 22px 20px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); border-top: 3px solid var(--wc, var(--rose)); backdrop-filter: blur(12px); }
.wild-name { font-family: var(--font-d); font-weight: 600; font-size: 17px; }
.wild-p { font-family: var(--font-m); font-size: 11px; color: var(--wc, var(--rose)); margin: 5px 0 10px; letter-spacing: 0.06em; }
.wild-impact { font-size: 12.5px; color: var(--ink-dim); }

/* ---------- machine room ---------- */
.cluster-wrap { padding: 28px 30px 22px; }
.cluster-row { display: grid; grid-template-columns: minmax(230px, 320px) 1fr; gap: 18px; align-items: center; padding: 13px 0; border-bottom: 1px dotted rgba(140, 160, 210, 0.09); }
.cluster-row:last-child { border-bottom: none; }
@media (max-width: 760px) { .cluster-row { grid-template-columns: 1fr; gap: 6px; } }
.cluster-info .cl-name { font-family: var(--font-d); font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.cluster-info .cl-name a { color: var(--ink); }
.cluster-info .cl-note { font-size: 10.5px; color: var(--ink-faint); margin-top: 3px; line-height: 1.45; }
.cl-status { font-family: var(--font-m); font-size: 8.5px; letter-spacing: 0.14em; border-radius: 99px; padding: 2px 8px; margin-left: 7px; vertical-align: 2px; }
.cl-status.live { background: rgba(52, 211, 153, 0.14); color: var(--emerald); border: 1px solid rgba(52, 211, 153, 0.4); }
.cl-status.building { background: rgba(251, 191, 36, 0.1); color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.35); }
.cluster-bar-wrap { position: relative; }
.cluster-bar { position: relative; height: 26px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); overflow: hidden; }
.cluster-bar .target { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; background: repeating-linear-gradient(135deg, rgba(140, 160, 210, 0.10) 0 7px, transparent 7px 14px); border: 1px dashed rgba(140, 160, 210, 0.25); }
.cluster-bar .live { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; background: linear-gradient(90deg, rgba(34, 211, 238, 0.5), var(--cyan)); box-shadow: 0 0 18px rgba(34, 211, 238, 0.35); transition: width 1.1s cubic-bezier(0.2, 0.7, 0.2, 1); }
.cluster-gw { position: absolute; right: 0; top: -19px; font-family: var(--font-m); font-size: 10px; color: var(--ink-dim); }
.cluster-gw b { color: var(--ink); }
.cluster-legend { display: flex; gap: 22px; margin-top: 18px; font-size: 10px; color: var(--ink-faint); font-family: var(--font-m); }
.cluster-legend .sw { display: inline-block; width: 16px; height: 9px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }

/* ---------- charts ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 18px; }
@media (max-width: 980px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-card { padding: 20px 18px 10px; }
.chart-title { font-size: 11px; letter-spacing: 0.14em; color: var(--ink); margin-bottom: 6px; }
.chart-title .dim { color: var(--ink-faint); letter-spacing: 0.04em; }
.chart-card svg { display: block; width: 100%; height: auto; }
.chart-legend { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; margin-top: 22px; font-size: 10.5px; color: var(--ink-dim); }
.chart-legend .li { display: flex; align-items: center; gap: 7px; }
.chart-legend .sw { width: 18px; height: 3px; border-radius: 2px; }

/* ---------- board ---------- */
.board { display: flex; flex-direction: column; gap: 8px; }
.board-row {
  display: grid; grid-template-columns: 1fr 105px 175px minmax(140px, 215px); gap: 18px; align-items: center;
  padding: 15px 22px; border-radius: 13px; background: var(--glass); border: 1px solid var(--line);
  transition: border-color 0.2s, transform 0.2s;
}
.board-row:hover { border-color: rgba(34, 211, 238, 0.35); transform: translateX(4px); }
@media (max-width: 820px) { .board-row { grid-template-columns: 1fr 90px; } .board-row .b-when, .board-row .b-src { display: none; } }
.b-name { font-size: 13.5px; }
.b-when { font-family: var(--font-m); font-size: 10.5px; color: var(--ink-dim); letter-spacing: 0.06em; }
.b-p-wrap { display: flex; align-items: center; gap: 10px; }
.b-p { font-family: var(--font-d); font-weight: 700; font-size: 21px; min-width: 52px; text-align: right; }
.b-bar { flex: 1; height: 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.b-bar i { display: block; height: 100%; border-radius: 4px; }
.b-src { font-family: var(--font-m); font-size: 9.5px; color: var(--ink-faint); }
.b-src a { color: var(--ink-faint); border-bottom: 1px dotted var(--ink-faint); }
.b-src a:hover { color: var(--cyan); text-decoration: none; }
.b-basis { font-size: 10.5px; color: var(--ink-faint); display: block; margin-top: 2px; }

/* ---------- method / sources ---------- */
.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.method-card { padding: 24px 24px 20px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); }
.method-card h4 { font-family: var(--font-d); font-weight: 600; font-size: 16.5px; margin-bottom: 10px; color: var(--cyan); }
.method-card p { font-size: 13px; color: var(--ink-dim); }
.src-group { font-family: var(--font-m); font-size: 10px; letter-spacing: 0.2em; color: var(--cyan); text-transform: uppercase; margin: 22px 0 8px; grid-column: 1 / -1; }
.src-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; margin-top: 8px; }
.src-item { padding: 13px 17px; border-radius: 11px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--line); font-size: 12px; }
.src-item a { color: var(--ink); font-weight: 500; }
.src-note { color: var(--ink-faint); font-size: 11px; margin-top: 3px; }

/* ---------- modal / HUD ---------- */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(3, 5, 10, 0.78); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal.hidden { display: none; }
.modal-card { max-width: 720px; max-height: 84vh; overflow-y: auto; padding: 34px 36px; width: 100%; }
.modal-close { float: right; cursor: pointer; font-family: var(--font-m); color: var(--ink-dim); font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; }
.modal-close:hover { color: var(--rose); border-color: var(--rose); }

.hud {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 90;
  display: flex; align-items: center; gap: 18px; padding: 13px 22px; border-radius: 99px;
  border-color: rgba(52, 211, 153, 0.4); box-shadow: 0 8px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(52, 211, 153, 0.12);
}
.hud.hidden { display: none; }
.hud-date { font-weight: 700; font-size: 16px; color: var(--emerald); letter-spacing: 0.14em; min-width: 100px; }
.hud-metrics { display: flex; gap: 14px; font-size: 10px; color: var(--ink-dim); }
.hud-metrics b { color: var(--ink); }
#hud-stop { background: transparent; border: 1px solid rgba(251, 113, 133, 0.5); color: var(--rose); border-radius: 99px; padding: 6px 14px; font-size: 10px; letter-spacing: 0.12em; cursor: pointer; }
#hud-stop:hover { background: rgba(251, 113, 133, 0.12); }
@media (max-width: 700px) { .hud-metrics { display: none; } }

footer { position: relative; z-index: 1; text-align: center; padding: 90px 24px 56px; font-size: 11px; color: var(--ink-faint); line-height: 2.1; }

/* ---------- the ladder ---------- */
.ladder-wrap { padding: 10px 26px 22px; }
.lad-cat { display: flex; align-items: baseline; gap: 12px; margin: 26px 0 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.lad-cat:first-child { margin-top: 12px; }
.lad-cat-name { font-family: var(--font-m); font-weight: 700; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; }
.lad-cat-blurb { font-size: 11.5px; color: var(--ink-faint); font-style: italic; }
.lad-axis { display: grid; grid-template-columns: minmax(210px, 300px) 1fr 86px; gap: 16px; padding: 4px 0 2px; }
.lad-axis-strip { position: relative; height: 14px; font-family: var(--font-m); font-size: 9px; color: var(--ink-faint); }
.lad-axis-strip span { position: absolute; transform: translateX(-50%); }
.lad-row {
  display: grid; grid-template-columns: minmax(210px, 300px) 1fr 86px; gap: 16px; align-items: center;
  padding: 8px 0; border-bottom: 1px dotted rgba(140, 160, 210, 0.07); cursor: pointer;
  transition: background 0.15s;
}
.lad-row:hover { background: rgba(255, 255, 255, 0.025); }
.lad-row:last-child { border-bottom: none; }
.lad-name { font-size: 13px; color: var(--ink); line-height: 1.3; }
.lad-name .lad-done-date { font-family: var(--font-m); font-size: 9px; color: var(--emerald); letter-spacing: 0.08em; display: block; margin-top: 1px; }
.lad-row.done .lad-name { color: var(--ink-dim); }
.lad-strip { position: relative; height: 22px; }
.lad-strip::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(140, 160, 210, 0.12); }
.lad-strip .gridline { position: absolute; top: 2px; bottom: 2px; width: 1px; background: rgba(140, 160, 210, 0.08); }
.lad-band { position: absolute; top: 5px; bottom: 5px; border-radius: 6px; opacity: 0.5; }
.lad-median {
  position: absolute; top: 50%; width: 11px; height: 11px; transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 2px; box-shadow: 0 0 12px currentColor; z-index: 2;
}
.lad-tail { position: absolute; top: 50%; transform: translateY(-50%); right: -4px; font-family: var(--font-m); font-size: 9px; color: var(--ink-faint); }
.lad-check { position: absolute; left: 0; top: 50%; transform: translateY(-50%); font-family: var(--font-m); font-size: 11px; color: var(--emerald); }
.lad-p { font-family: var(--font-d); font-weight: 700; font-size: 17px; text-align: right; }
.lad-p small { display: block; font-family: var(--font-m); font-size: 8px; font-weight: 400; color: var(--ink-faint); letter-spacing: 0.1em; }
.lad-now { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(52, 211, 153, 0.4); }
@media (max-width: 760px) {
  .lad-row, .lad-axis { grid-template-columns: 1fr 70px; }
  .lad-row .lad-strip { display: none; } .lad-axis-strip { display: none; }
}
/* milestone modal extras */
.msm-byyear { display: flex; gap: 10px; margin: 16px 0 4px; }
.msm-y { flex: 1; text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 4px 8px; }
.msm-y b { font-family: var(--font-d); font-size: 19px; display: block; }
.msm-y span { font-family: var(--font-m); font-size: 9px; color: var(--ink-faint); letter-spacing: 0.1em; }
.msm-note { font-size: 11px; color: var(--ink-faint); margin-top: 14px; line-height: 1.6; }
