@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700&family=Newsreader:ital,opsz,wght@1,6..72,500&display=swap');

:root {
  color-scheme: light;
  --ink: #1e201d;
  --muted: #585c54;
  --paper: #f9f8f4;
  --panel: #fffdf8;
  --panel-tint: #f0ede4;
  --line: #d5d1c5;
  --acid: #2a5438;
  --proof-fill: #dce8b2;
  --blue: #3d6277;
  --blue-fill: #dce9ef;
  --coral: #9e3a2b;
  --coral-fill: #e8b2a8;
  --violet: #65569c;
  --violet-fill: #c9c0e7;
  --shell: min(1160px, calc(100vw - 40px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(42,84,56,.07), transparent 28rem),
    var(--paper);
  color: var(--ink);
  font-family: Manrope, system-ui, sans-serif;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.shell { width: var(--shell); margin-inline: auto; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 20; background: var(--acid); color: var(--paper); padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 68px;
  padding: 0 max(20px, calc((100vw - 1160px)/2));
  border-bottom: 1px solid rgba(30,32,29,.12);
  background: rgba(249,248,244,.9);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--acid); border-radius: 50%; color: var(--acid); font: 500 11px/1 DM Mono, monospace; }
.topbar nav { display: flex; gap: 8px; }
.topbar nav a { display: inline-flex; min-height: 44px; align-items: center; padding: 8px 13px; border-radius: 999px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.topbar nav a:hover, .topbar nav a.active { background: #ebe9e1; color: var(--ink); }

.hero { display: grid; grid-template-columns: 1.7fr .8fr; gap: 80px; align-items: end; padding-block: 110px 92px; }
.eyebrow { margin: 0 0 16px; color: var(--acid); font: 500 12px/1.3 DM Mono, monospace; letter-spacing: .11em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 28px; max-width: 820px; font-size: clamp(52px, 7vw, 92px); line-height: .94; letter-spacing: -.065em; }
h1 em { color: var(--acid); font-family: Newsreader, Georgia, serif; font-weight: 500; }
.lede { max-width: 760px; color: #434941; font-size: clamp(18px, 2vw, 23px); line-height: 1.5; }
.result-equation { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-block: 34px; font: 400 clamp(19px, 2.4vw, 30px)/1.2 DM Mono, monospace; }
.result-equation b { color: var(--acid); font-weight: 500; }
.result-equation i { margin-inline: 10px; color: var(--coral); font-style: normal; }
.equation-key { max-width: 660px; margin: -20px 0 34px; color: var(--muted); font-size: 13px; }
.equation-key strong { color: var(--ink); font-family: DM Mono, monospace; font-weight: 500; }
.hero-actions, .next-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-weight: 700; transition: transform .2s, background .2s; }
.button:hover { transform: translateY(-2px); }
.button.primary { border-color: var(--acid); background: var(--acid); color: var(--paper); }
.button.ghost { background: var(--panel); }
.hero-note { padding: 18px 0 18px 30px; border-left: 2px solid var(--acid); background: transparent; }
.note-number { color: var(--acid); font: 500 72px/1 DM Mono, monospace; letter-spacing: -.08em; }
.hero-note p { margin: 14px 0 32px; font-size: 17px; }
.hero-note small { color: var(--muted); }
.interval { position: relative; height: 5px; margin: 0 10px 24px; border-radius: 3px; background: linear-gradient(90deg, var(--coral), var(--acid)); }
.interval span { position: absolute; top: 14px; left: var(--x); transform: translateX(-50%); font: 12px DM Mono, monospace; }

.explorer, .bio-chart { padding-block: 90px; border-top: 1px solid var(--line); }
.section-heading { margin-bottom: 38px; }
.section-heading.narrow { max-width: 760px; }
h2 { margin-bottom: 18px; font-size: clamp(34px, 4.4vw, 56px); line-height: 1.05; letter-spacing: -.045em; }
h3 { margin-bottom: 10px; font-size: 20px; letter-spacing: -.025em; }
.explorer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(310px, .7fr); gap: 24px; }
.graph-stage, .story-panel { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.graph-stage { min-width: 0; padding: 18px; }
.stage-topline { display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--muted); font: 12px DM Mono, monospace; letter-spacing: .04em; text-transform: uppercase; }
.icon-button { border: 1px solid #9da39b; border-radius: 999px; background: transparent; color: var(--ink); padding: 7px 12px; cursor: pointer; }
.icon-button:hover { border-color: var(--acid); color: var(--acid); }
#graph { display: block; width: 100%; max-height: 560px; margin-inline: auto; overflow: visible; }
.graph-edge { stroke: #747c76; stroke-width: 1.7; opacity: .72; transition: stroke .35s, opacity .35s, stroke-width .35s; }
.graph-edge.matching { stroke: var(--coral); stroke-width: 3.5; opacity: .95; }
.graph-edge.dim { opacity: .14; }
.node circle { fill: var(--panel); stroke: #3f4942; stroke-width: 2; transition: fill .35s, stroke .35s, transform .35s; transform-box: fill-box; transform-origin: center; }
.node text { fill: var(--ink); font: 500 13px DM Mono, monospace; pointer-events: none; }
.node.guard circle { fill: var(--proof-fill); stroke: var(--acid); transform: scale(1.16); }
.node.guard text { fill: var(--ink); }
.node.attack circle { fill: var(--coral-fill); stroke: var(--coral); transform: scale(1.18); }
.node.attack text, .node.exposed text { fill: var(--ink); }
.node.exposed circle { fill: var(--violet-fill); stroke: var(--violet); }
.story-arrow { color: var(--coral); stroke: currentColor; stroke-width: 3; fill: none; marker-end: url(#arrow); stroke-dasharray: 8 5; }
.stage-legend { display: flex; flex-wrap: wrap; gap: 14px; min-height: 30px; padding: 8px; color: var(--muted); font-size: 12px; }
.legend-dot { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot:before { content:""; width: 9px; height: 9px; border-radius: 50%; background: var(--dot); }
.story-panel { display: flex; flex-direction: column; padding: 24px; }
.step-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 34px; }
.step-tabs button { border: 0; border-bottom: 2px solid var(--line); background: none; color: var(--muted); padding: 8px 3px 12px; cursor: pointer; font-size: 12px; }
.step-tabs button span { display: block; margin-bottom: 4px; font: 11px DM Mono, monospace; }
.step-tabs button[aria-selected=true] { border-color: var(--acid); color: var(--ink); }
#step-copy h3 { font-size: 28px; }
#step-copy p { color: var(--muted); }
#step-copy .callout { margin-top: 22px; padding: 16px; border-left: 2px solid var(--acid); background: #eef2e6; color: var(--ink); font-size: 14px; }
.live-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: auto 0 0; padding-top: 28px; }
.live-stats div { padding-top: 12px; border-top: 1px solid var(--line); }
.live-stats dt { color: var(--muted); font-size: 11px; }
.live-stats dd { margin: 2px 0 0; font: 500 19px DM Mono, monospace; }

.plain { padding-block: 90px 110px; }
.plain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.plain-grid article { min-height: 230px; padding: 26px 0; border-top: 1px solid var(--ink); }
.plain-grid p { color: var(--muted); }
.plain-number { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-bottom: 42px; border: 1px solid #929a93; border-radius: 50%; font: 11px DM Mono, monospace; }
.plain[aria-labelledby="status-title"] .plain-number { width: auto; padding-inline: 10px; border-color: var(--line); border-radius: 999px; color: var(--acid); }
.evidence { display: grid; grid-template-columns: .8fr 1.2fr; gap: 70px; align-items: center; padding-block: 90px; border-top: 1px solid var(--line); }
.evidence-copy p { color: var(--muted); }
.text-link { color: var(--acid); border-bottom: 1px solid rgba(217,255,111,.5); font-weight: 600; }
.evidence-grid { display: grid; grid-template-columns: repeat(2,1fr); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.evidence-grid div { display: flex; flex-direction: column; min-height: 160px; justify-content: center; padding: 24px; border: .5px solid var(--line); }
.evidence-grid strong { color: var(--acid); font: 500 42px/1 DM Mono, monospace; }
.evidence-grid span { margin-top: 10px; font-size: 14px; }
.evidence-grid small { color: var(--muted); }
.trail { padding-block: 110px; }
.timeline { margin: 0 0 36px; padding: 0; list-style: none; }
.timeline li { display: grid; grid-template-columns: 68px 1fr; gap: 14px; padding: 26px 0; border-top: 1px solid var(--line); }
.timeline li > span { color: var(--acid); font: 12px DM Mono, monospace; }
.timeline p { max-width: 730px; color: var(--muted); }
.open-gap { display: grid; grid-template-columns: 1fr .8fr; gap: 70px; padding: 55px; border: 1px solid var(--line); border-radius: 18px; background: #eef2e6; }
.open-gap h2 span { color: var(--acid); }
.open-gap > p { color: var(--muted); font-size: 17px; }
.other-result { display: grid; grid-template-columns: .9fr .8fr auto; gap: 46px; align-items: center; padding-block: 120px; }
.other-result p { color: var(--muted); }
.mini-bars div { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: center; margin: 9px 0; font-size: 11px; }
.mini-bars i { position: relative; display: block; width: var(--value); min-width: 48px; padding: 5px 7px; border-radius: 3px; background: var(--blue-fill); color: var(--ink); font: normal 10px DM Mono, monospace; }

footer { padding-block: 54px; border-top: 1px solid var(--line); color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 50px; }
.footer-grid > div { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.footer-grid h2 { margin: 0; color: var(--ink); font-size: 13px; letter-spacing: .02em; }
.footer-grid p { max-width: 290px; }
.footer-grid a { font-size: 13px; }

/* Biology report */
.bio-hero { padding-block: 110px 75px; }
.bio-hero h1 { max-width: 1000px; }
.biology-page .bio-hero > .eyebrow, .biology-page .problem-intro .eyebrow { color: var(--blue); }
.caveat { max-width: 940px; margin-top: 32px; padding: 16px 18px; border: 1px solid rgba(158,58,43,.38); border-radius: 8px; background: rgba(158,58,43,.07); color: #653229; font-size: 14px; }
.problem-intro { display: grid; grid-template-columns: .8fr 1fr; gap: 70px; align-items: start; padding-block: 78px; border-top: 1px solid var(--line); }
.problem-intro > p { max-width: 650px; color: var(--muted); font-size: 18px; }
.bar-chart { padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 18px; margin-bottom: 30px; color: var(--muted); font-size: 11px; }
.chart-legend span:before { content:""; display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 2px; background: currentColor; }
.chart-legend .base { color: var(--blue); } .chart-legend .ours { color: var(--acid); } .chart-legend .official { color: var(--violet); }
.chart-row { display: grid; grid-template-columns: 160px 1fr; gap: 20px; align-items: center; padding: 24px 0; border-top: 1px solid var(--line); }
.chart-row > b { font-size: 14px; }
.chart-row small { display: block; color: var(--muted); font-weight: 400; }
.track { display: flex; flex-direction: column; gap: 6px; }
.track i { display: block; width: var(--w); min-width: 52px; height: 26px; padding: 4px 8px; border-radius: 4px; color: var(--ink); font: normal 11px DM Mono, monospace; transition: width .8s ease; }
.track .base { background: var(--blue-fill); } .track .ours { background: var(--proof-fill); } .track .official { background: var(--violet-fill); }
.chart-note, .center-note { margin-top: 16px; color: var(--muted); font-size: 13px; }
.bio-correction { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; padding-block: 100px; }
.correction-card { padding: 34px; border: 1px solid rgba(255,130,110,.4); border-radius: 16px; background: rgba(255,130,110,.05); }
.correction-card p:last-child { color: var(--muted); }
.core-table { align-self: center; border-top: 1px solid var(--line); }
.core-table > div { display: grid; grid-template-columns: 1fr 1fr; padding: 15px 10px; border-bottom: 1px solid var(--line); }
.core-table > div:first-child { color: var(--muted); font: 11px DM Mono, monospace; text-transform: uppercase; }
.core-table code { color: var(--acid); letter-spacing: .18em; }
.signal { padding-block: 100px; border-top: 1px solid var(--line); text-align: center; }
.signal .section-heading { margin-inline: auto; }
.signal-grid { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 880px; margin-inline: auto; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.signal-grid div { display: flex; flex-direction: column; padding: 32px 18px; border: .5px solid var(--line); }
.signal-grid strong { color: var(--acid); font: 500 44px/1 DM Mono, monospace; }
.signal-grid span { margin-top: 12px; }
.signal-grid small { color: var(--muted); }
.method { padding-block: 100px; }
.method > div:first-child { max-width: 760px; }
.method > div:first-child p:last-child { color: var(--muted); }
.method-flow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block: 42px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.method-flow span { padding: 8px 11px; border-radius: 5px; background: #ebe9e1; font: 11px DM Mono, monospace; text-align: center; }
.method-flow b { color: var(--acid); }
blockquote { margin: 0; padding: 22px 25px; border-left: 2px solid var(--coral); background: rgba(158,58,43,.06); color: #42473f; }
.next-study { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; padding: 55px; margin-bottom: 100px; border: 1px solid var(--line); border-radius: 18px; background: #eef2e6; }
.next-study ol { margin: 0; padding: 0; list-style: none; }
.next-study li { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 10px 0; color: var(--muted); border-bottom: 1px solid var(--line); }
.next-study li span { color: var(--acid); font: 11px DM Mono, monospace; }
.next-actions { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .hero, .evidence, .open-gap, .bio-correction, .next-study, .problem-intro { grid-template-columns: 1fr; gap: 35px; }
  .hero { padding-block: 80px 70px; }
  .explorer-grid { grid-template-columns: 1fr; }
  .story-panel { min-height: 440px; }
  .other-result { grid-template-columns: 1fr 1fr; }
  .other-result .button { grid-column: 1 / -1; justify-self: start; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
}

@media (max-width: 650px) {
  :root { --shell: min(100% - 28px, 1160px); }
  .topbar { padding-inline: 14px; }
  .brand > span:last-child { display: none; }
  .topbar nav { gap: 0; }
  .topbar nav a { padding-inline: 8px; font-size: 12px; }
  h1 { font-size: 49px; }
  .hero-note { padding: 25px; }
  .plain-grid, .signal-grid { grid-template-columns: 1fr; }
  .plain-grid article { min-height: 190px; }
  .plain-number { margin-bottom: 26px; }
  .evidence-grid { grid-template-columns: 1fr; }
  .open-gap, .next-study { padding: 30px 24px; }
  .other-result { grid-template-columns: 1fr; padding-block: 85px; }
  .other-result .button { grid-column: auto; }
  .footer-grid { grid-template-columns: 1fr; }
  .chart-row { grid-template-columns: 1fr; }
  .bar-chart { padding: 18px; }
  .chart-legend { justify-content: flex-start; }
  .method-flow { align-items: stretch; flex-direction: column; }
  .method-flow b { transform: rotate(90deg); text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *:before, *:after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
