:root {
  --ink: #10211c;
  --muted: #53635d;
  --paper: #f5f2e9;
  --white: #fffdf7;
  --acid: #d9ff8f;
  --copper: #c86432;
  --orange: #f2a65a;
  --line: #c9c9ba;
  --wash: #e6ecdf;
  --page: clamp(18px, 4vw, 70px);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
a { color: inherit; }
button { font: inherit; }
section { scroll-margin-top: 90px; }

.skip-link { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 12px 18px; background: var(--acid); color: var(--ink); font-weight: 800; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--copper); outline-offset: 3px; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; min-height: 76px; padding: 12px var(--page); border-bottom: 1px solid var(--ink); background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 850; text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 40px; height: 40px; background: var(--ink); color: var(--acid); font: 800 15px var(--mono); }
.topbar nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 32px); }
.topbar nav a { min-height: 44px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 700; text-underline-offset: 5px; }

.hero { min-height: calc(100vh - 76px); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); border-bottom: 1px solid var(--ink); }
.hero__copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(60px, 9vw, 130px) var(--page); }
.eyebrow { margin: 0 0 18px; color: var(--copper); font: 700 11px var(--mono); letter-spacing: .09em; text-transform: uppercase; }
h1, h2, h3, p { max-width: 72ch; }
h1 { max-width: 900px; margin: 0; font-size: clamp(54px, 8vw, 120px); line-height: .86; letter-spacing: -.075em; }
.hero__lead { max-width: 760px; margin: 34px 0 0; color: var(--muted); font-size: clamp(18px, 2vw, 24px); line-height: 1.55; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button { display: inline-flex; min-height: 50px; align-items: center; justify-content: center; padding: 12px 18px; border: 1px solid var(--ink); color: var(--ink); font-weight: 800; text-decoration: none; }
.button--primary { background: var(--ink); color: var(--white); }
.button:hover { background: var(--acid); color: var(--ink); }
.hero__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 720px; margin: 50px 0 0; border-top: 1px solid var(--line); }
.hero__facts div { padding: 18px 18px 0 0; }
.hero__facts dt { color: var(--muted); font: 10px var(--mono); text-transform: uppercase; }
.hero__facts dd { margin: 7px 0 0; font-size: clamp(20px, 2vw, 28px); font-weight: 850; }

.reaction-stage { position: relative; display: grid; grid-template-columns: 1fr .9fr 1fr; place-items: center; align-content: center; gap: 12px; min-height: 580px; overflow: hidden; padding: 50px 34px; border-left: 1px solid var(--ink); background: var(--ink); color: var(--white); }
.reaction-stage::before { content: ""; position: absolute; inset: 0; opacity: .1; background-image: linear-gradient(var(--acid) 1px, transparent 1px), linear-gradient(90deg, var(--acid) 1px, transparent 1px); background-size: 32px 32px; }
.reaction-stage__label { position: absolute; inset: 28px 28px auto; display: flex; justify-content: space-between; color: var(--acid); font: 10px var(--mono); letter-spacing: .06em; }
.reaction-stage > p { position: absolute; bottom: 28px; left: 28px; right: 28px; margin: 0; color: #b8c7c0; font: 11px/1.5 var(--mono); }
.molecule { position: relative; width: 130px; height: 130px; animation: float 5s ease-in-out infinite; }
.molecule--right { animation-delay: -2.3s; }
.molecule i { position: absolute; width: 29px; height: 29px; border: 4px solid var(--acid); border-radius: 50%; background: var(--ink); }
.molecule i::after { content: ""; position: absolute; left: 20px; top: 10px; width: 44px; height: 3px; background: var(--acid); transform-origin: left; }
.molecule i:nth-child(1) { left: 8px; top: 48px; }
.molecule i:nth-child(2) { left: 54px; top: 15px; }
.molecule i:nth-child(3) { left: 94px; top: 52px; }
.molecule i:nth-child(4) { left: 62px; top: 96px; }
.molecule i:nth-child(5) { left: 28px; top: 88px; }
.molecule i:nth-child(1)::after { transform: rotate(-36deg); }
.molecule i:nth-child(2)::after { transform: rotate(42deg); }
.molecule i:nth-child(3)::after { transform: rotate(126deg); }
.molecule i:nth-child(4)::after { transform: rotate(190deg); }
.molecule i:nth-child(5)::after { transform: rotate(223deg); }
.molecule i:nth-child(6) { display: none; }
.molecule--right { transform: scale(.85); }
.molecule--right i { border-color: var(--orange); }
.molecule--right i::after { background: var(--orange); }
.reaction-arrow { position: relative; display: grid; place-items: center; min-width: 100px; font: 11px var(--mono); }
.reaction-arrow b { color: var(--white); font-size: 76px; font-weight: 300; animation: pulse 2.8s ease-in-out infinite; }
.reaction-arrow span { position: absolute; color: var(--acid); }
.reaction-arrow__agent { top: 2px; }
.reaction-arrow__solvent { bottom: 0; }

.status-note { padding: 42px var(--page); border-bottom: 1px solid var(--ink); background: var(--acid); }
.status-note h2 { margin: 0; font-size: clamp(27px, 4vw, 48px); line-height: 1.05; }
.status-note p:last-child { margin: 18px 0 0; font-size: 16px; line-height: 1.6; }
.section-heading { max-width: 1050px; margin-bottom: 44px; }
.section-heading h2 { margin: 0; font-size: clamp(38px, 6vw, 76px); line-height: .95; letter-spacing: -.055em; }
.section-heading > p:last-child { margin: 20px 0 0; color: var(--muted); font-size: 18px; line-height: 1.55; }

.microscope, .similarity, .pipeline, .definitions, .boundaries, .sources { padding: clamp(72px, 10vw, 140px) var(--page); border-bottom: 1px solid var(--ink); }
.microscope__body { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr); border: 1px solid var(--ink); }
.controls { border-right: 1px solid var(--ink); background: var(--wash); }
.controls fieldset { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 22px; border: 0; }
.controls fieldset + fieldset { border-top: 1px solid var(--ink); }
.controls legend { padding: 22px 0 0; font: 700 11px var(--mono); text-transform: uppercase; }
.controls button { min-height: 90px; padding: 14px; border: 1px solid var(--ink); background: var(--white); color: var(--ink); cursor: pointer; text-align: left; font-weight: 800; }
.controls button small { display: block; margin-top: 8px; color: var(--muted); font-weight: 500; line-height: 1.35; }
.controls button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.controls button[aria-pressed="true"] small { color: var(--acid); }
.score-panel { padding: clamp(26px, 5vw, 70px); background: var(--white); }
.score-panel__status { display: flex; justify-content: space-between; align-items: center; color: var(--copper); font: 700 11px var(--mono); text-transform: uppercase; }
.score-panel__status b { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--copper); font-size: 19px; }
.score-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 36px; }
.score-comparison > div { padding-top: 12px; border-top: 1px solid var(--line); }
.score-comparison span { color: var(--muted); font-size: 12px; }
.score-comparison strong { display: block; margin-top: 5px; font-size: clamp(54px, 8vw, 100px); line-height: 1; letter-spacing: -.07em; }
.score-comparison__model strong { color: var(--copper); }
.score-bar { position: relative; height: 20px; margin-top: 30px; border: 1px solid var(--ink); background: var(--paper); }
.score-bar span { position: absolute; inset: 0 auto 0 0; transition: width .25s ease; }
.score-bar__model { background: var(--copper); }
.score-bar__baseline { z-index: 2; border-right: 3px solid var(--ink); background: repeating-linear-gradient(45deg, transparent 0 5px, var(--ink) 5px 7px); }
.score-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 30px 0 0; }
.score-meta div { padding-top: 10px; border-top: 1px solid var(--line); }
.score-meta dt { color: var(--muted); font: 10px var(--mono); text-transform: uppercase; }
.score-meta dd { margin: 7px 0 0; font-weight: 800; }
.score-panel > p { margin: 34px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.four-cell { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--ink); border-top: 0; }
.four-cell button { min-height: 112px; padding: 16px; border: 0; border-right: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; text-align: left; }
.four-cell button:last-child { border-right: 0; }
.four-cell button[data-selected] { background: var(--acid); }
.four-cell span, .four-cell small { display: block; font: 10px var(--mono); text-transform: uppercase; }
.four-cell strong { display: block; margin: 5px 0; font-size: 31px; }

.similarity { background: var(--white); }
.similarity-facts { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--ink); }
.similarity-facts article { min-height: 230px; padding: 28px; border-right: 1px solid var(--ink); }
.similarity-facts article:last-child { border-right: 0; }
.similarity-facts span { color: var(--copper); font: 700 11px var(--mono); text-transform: uppercase; }
.similarity-facts strong { display: block; margin-top: 40px; font-size: clamp(44px, 6vw, 76px); letter-spacing: -.06em; }
.similarity-facts p { color: var(--muted); line-height: 1.5; }
.similarity-explorer { display: grid; grid-template-columns: minmax(240px, .55fr) minmax(0, 1.45fr); border: 1px solid var(--ink); border-top: 0; }
.threshold-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; padding: 24px; border-right: 1px solid var(--ink); background: var(--wash); }
.threshold-controls p { grid-column: 1 / -1; margin: 0 0 10px; font: 700 11px/1.5 var(--mono); text-transform: uppercase; }
.threshold-controls button { min-height: 64px; border: 1px solid var(--ink); background: var(--white); color: var(--ink); cursor: pointer; font-weight: 850; }
.threshold-controls button[aria-pressed="true"] { background: var(--ink); color: var(--acid); }
.similarity-explorer > article { padding: clamp(28px, 5vw, 64px); }
.similarity-explorer > article > strong { display: block; margin-top: 24px; font-size: clamp(60px, 9vw, 110px); letter-spacing: -.07em; }
.similarity-explorer > article > p { margin-top: 28px; color: var(--muted); line-height: 1.6; }
.similarity-bar { height: 20px; margin-top: 22px; border: 1px solid var(--ink); background: var(--paper); }
.similarity-bar span { display: block; height: 100%; background: var(--copper); transition: width .25s ease; }

.pipeline { background: var(--ink); color: var(--white); }
.pipeline .section-heading > p:last-child { color: #b8c7c0; }
.pipeline__grid { display: grid; grid-template-columns: minmax(320px, .9fr) minmax(0, 1.1fr); border: 1px solid #66756f; }
.pipeline__steps { margin: 0; padding: 0; list-style: none; border-right: 1px solid #66756f; }
.pipeline__steps li + li { border-top: 1px solid #66756f; }
.pipeline__steps button { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; width: 100%; min-height: 72px; padding: 12px 18px; border: 0; background: transparent; color: var(--white); cursor: pointer; text-align: left; }
.pipeline__steps button[aria-current="step"] { background: var(--acid); color: var(--ink); }
.pipeline__steps span, .pipeline__steps em { font: 10px var(--mono); font-style: normal; }
.pipeline__detail { display: flex; flex-direction: column; justify-content: center; min-height: 470px; padding: clamp(28px, 6vw, 80px); }
.pipeline__detail h3 { margin: 0; font-size: clamp(36px, 5vw, 68px); line-height: 1; }
.pipeline__detail > strong { margin-top: 18px; color: var(--acid); font-size: 22px; }
.pipeline__detail > p:not(.eyebrow):not(.boundary) { color: #c6d2cc; line-height: 1.6; }
.retention { height: 16px; margin-top: 24px; border: 1px solid #829089; }
.retention span { display: block; height: 100%; background: var(--acid); transition: width .25s ease; }
.boundary { margin-top: 28px; padding-top: 18px; border-top: 1px solid #66756f; color: #c6d2cc; font-size: 13px; line-height: 1.55; }
.boundary b { color: var(--orange); }

.definition-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--ink); }
.definition-grid article { min-height: 270px; padding: 28px; border-right: 1px solid var(--ink); }
.definition-grid article:last-child { border-right: 0; }
.definition-grid span { color: var(--copper); font: 700 11px var(--mono); }
.definition-grid h3 { margin: 55px 0 12px; font-size: 28px; }
.definition-grid p { color: var(--muted); line-height: 1.55; }
.boundary-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--ink); }
.boundary-grid article { padding: clamp(26px, 5vw, 64px); }
.boundary-grid article + article { border-left: 1px solid var(--ink); }
.boundary-grid .supports { background: var(--acid); }
.boundary-grid h3 { margin: 0 0 24px; font-size: 30px; }
.boundary-grid ul { margin: 0; padding-left: 22px; }
.boundary-grid li { margin-bottom: 13px; line-height: 1.5; }
.sources ul { margin: 0; padding: 0; border-top: 1px solid var(--ink); list-style: none; }
.sources li { border-bottom: 1px solid var(--ink); }
.sources a { display: grid; grid-template-columns: 120px 1fr 40px; align-items: center; min-height: 82px; padding: 12px 8px; text-decoration: none; }
.sources a:hover { background: var(--acid); }
.sources span { color: var(--copper); font: 10px var(--mono); text-transform: uppercase; }
.sources b { text-align: right; font-size: 22px; }

footer { display: grid; grid-template-columns: 1fr auto auto; gap: 34px; align-items: center; padding: 34px var(--page); background: var(--ink); color: var(--white); }
footer .brand { color: var(--white); }
footer p, footer a { font-size: 12px; }

@keyframes float { 0%, 100% { translate: 0 -7px; rotate: -2deg; } 50% { translate: 0 9px; rotate: 2deg; } }
@keyframes pulse { 0%, 100% { opacity: .45; translate: -5px 0; } 50% { opacity: 1; translate: 5px 0; } }

@media (max-width: 980px) {
  .topbar nav a:not(:last-child) { display: none; }
  .hero { grid-template-columns: 1fr; }
  .reaction-stage { min-height: 430px; border-top: 1px solid var(--ink); border-left: 0; }
  .microscope__body, .similarity-explorer, .pipeline__grid { grid-template-columns: 1fr; }
  .controls, .pipeline__steps { border-right: 0; border-bottom: 1px solid var(--ink); }
  .definition-grid { grid-template-columns: 1fr; }
  .similarity-facts { grid-template-columns: 1fr; }
  .similarity-facts article { min-height: auto; border-right: 0; border-bottom: 1px solid var(--ink); }
  .similarity-facts article:last-child { border-bottom: 0; }
  .threshold-controls { border-right: 0; border-bottom: 1px solid var(--ink); }
  .definition-grid article { min-height: auto; border-right: 0; border-bottom: 1px solid var(--ink); }
  .definition-grid article:last-child { border-bottom: 0; }
  .definition-grid h3 { margin-top: 24px; }
  footer { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { min-height: 68px; }
  .brand > span:last-child { font-size: 13px; }
  h1 { font-size: clamp(50px, 18vw, 78px); }
  .hero__facts, .score-comparison, .score-meta, .boundary-grid { grid-template-columns: 1fr; }
  .hero__facts div { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .reaction-stage { grid-template-columns: 1fr .6fr 1fr; padding-inline: 12px; }
  .molecule { scale: .72; }
  .controls fieldset { grid-template-columns: 1fr; }
  .four-cell { grid-template-columns: repeat(2, 1fr); }
  .four-cell button:nth-child(2) { border-right: 0; }
  .four-cell button:nth-child(-n+2) { border-bottom: 1px solid var(--ink); }
  .pipeline__steps button { grid-template-columns: 30px 1fr; }
  .pipeline__steps em { grid-column: 2; }
  .boundary-grid article + article { border-top: 1px solid var(--ink); border-left: 0; }
  .sources a { grid-template-columns: 84px 1fr 26px; }
}

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

@media (forced-colors: active) {
  .button, button, .score-bar, .retention { border: 1px solid CanvasText; }
}
