/* Renmara. Ink and paper, maroon for the Renmara series, slate for comparisons.
   DESIGN_SPEC.md is the source of truth for every token and rule below. */

@font-face {
  font-family: "Inter Tight";
  src: url("../fonts/inter-tight-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Tight";
  src: url("../fonts/inter-tight-greek-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-greek-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* paper (version 1 values) */
  --paper: #f5f4ef;
  --paper-raised: #fbfaf7;
  --hair: #dedcd3;
  --rule: #c4c2b8;
  --ink: #161512;
  --text-2: #4a4740;
  --text-3: #67635a;
  --comparator: #8f8a80;

  /* accents */
  --accent: #974753;     /* soft maroon: the Renmara series, labels, cues (5.7:1 on paper) */
  --slate: #4c6b74;      /* comparison series, charts only */

  /* the nadir-curve colors are a continuous ramp set in tools/figures/motif.mjs */

  /* graphite: contact band and footer */
  --g-bg: #151413;
  --g-raised: #1c1b19;
  --g-hair: #2a2927;
  --g-rule: #3a3936;
  --g-text-1: #f1efe9;
  --g-text-2: #b3b0a8;
  --g-text-3: #8f8c84;
  --g-accent: #e58a97;

  --sans: "Inter Tight", Arial, sans-serif;
  --mono: "JetBrains Mono", "Courier New", monospace;
  --serif: "Source Serif 4", Georgia, serif;

  --gutter: clamp(20px, 5vw, 72px);
  --max: 1280px;
  --col-gap: clamp(20px, 2.6vw, 32px);
  --section: clamp(72px, 9vw, 136px);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text-2);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { padding: 0; border: 0; min-width: 0; }
sup { font-size: 0.7em; line-height: 0; vertical-align: 0.45em; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.prose a { text-decoration-color: var(--rule); }
.prose a:hover { color: var(--accent); text-decoration-color: currentColor; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.band-graphite :focus-visible, .site-footer :focus-visible { outline-color: var(--g-text-1); }

::selection { background: var(--ink); color: var(--paper); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Shown only on the draft preview (tools/build.mjs adds it when Netlify's CONTEXT is not production). */
.draft-banner {
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: center;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.875rem;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.hero-grid, .precision-grid, .dose-grid, .research-grid, .contact-grid, .footer-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
}

.section { padding-top: clamp(48px, 6vw, 88px); }

/* ---------- type ---------- */

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 1.3rem + 4.6vw, 5.375rem);
  line-height: 1.02;
  letter-spacing: -0.022em;
  color: var(--ink);
  text-wrap: balance;
}

.h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 1.2rem + 1.7vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

.h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.375rem, 1.2rem + 0.5vw, 1.625rem);
  line-height: 1.2;
  color: var(--ink);
}

.lede {
  font-size: clamp(1.1875rem, 1.06rem + 0.5vw, 1.4375rem);
  line-height: 1.5;
  letter-spacing: -0.006em;
  color: var(--text-2);
  text-wrap: pretty;
}

.kicker {
  margin-bottom: 18px;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--accent);
}

.prose p { max-width: 38em; text-wrap: pretty; }
.prose p + p { margin-top: 1em; }

.note p { font-size: 0.9375rem; line-height: 1.6; color: var(--text-3); }

.caption {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-3);
  text-wrap: pretty;
}

.fig-title {
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--hair);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

/* Logo lockup, as in the decks: nadir-curve mark, 0.54em gap, Inter Tight 500, all in ink */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.54em;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.3125rem;
  letter-spacing: -0.008em;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  padding-block: 6px;
}
.wordmark .mark { flex: none; width: 1.54em; height: 0.77em; overflow: visible; }
.wordmark .mark path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }

.nav { display: flex; align-items: center; gap: clamp(16px, 2.6vw, 36px); }
.nav a { font-size: 0.9375rem; color: var(--text-2); text-decoration: none; padding-block: 8px; }
.nav a:hover { color: var(--ink); text-decoration: underline; }
.nav .nav-cta { color: var(--ink); border-bottom: 1px solid var(--ink); padding-bottom: 2px; }
.nav .nav-cta:hover { text-decoration: none; border-bottom-width: 2px; padding-bottom: 1px; }

/* ---------- buttons and links ---------- */

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 30px; margin-top: 34px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 450;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease;
}
.button:hover { background: #000; }

.text-link {
  font-size: 1rem;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.3em;
}
.text-link:hover { text-decoration-color: var(--ink); }

/* ---------- opening ---------- */

.hero { padding-top: clamp(48px, 7vw, 104px); }
.hero h1 { grid-column: 1 / span 10; }
.hero-body { grid-column: 1 / span 6; margin-top: clamp(28px, 3.5vw, 48px); }
.hero-body .lede { max-width: 31em; }
.cta-note { margin-top: 14px; max-width: 30em; font-size: 0.9375rem; line-height: 1.5; color: var(--text-3); }

.apps { grid-column: 8 / -1; margin-top: clamp(28px, 3.5vw, 48px); }
.apps-label { font-size: 0.875rem; color: var(--text-3); margin-bottom: 10px; }
.apps li { border-top: 1px solid var(--rule); }
.apps li:last-child { border-bottom: 1px solid var(--rule); }
.apps a { display: grid; gap: 3px; padding-block: 16px 18px; text-decoration: none; }
.app-label { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 500; color: var(--accent); }
.app-slate .app-label { color: var(--slate); }
.app-title { font-family: var(--serif); font-size: 1.375rem; line-height: 1.25; color: var(--ink); }
.app-text { font-size: 0.9375rem; line-height: 1.5; color: var(--text-2); max-width: 30em; }
.app-audience { font-size: 0.8125rem; color: var(--text-3); }
.apps a:hover .app-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

.mini-mark { flex: none; width: 22px; height: 11px; overflow: visible; }
.mini-mark path { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }

/* the motif: nadir curves, colored by depth from slate to soft maroon (inline, from motif.mjs) */
/* Each band takes its drawing's aspect ratio (1440 x 220 hero, 1440 x 160 contact), so nothing is cropped. */
.hero-field { margin-top: clamp(40px, 5vw, 72px); height: clamp(110px, 15.3vw, 260px); }
.motif { display: block; width: 100%; height: 100%; overflow: visible; }
.motif-compact { display: none; }
.m-line { fill: none; stroke-width: 1.15; stroke-linecap: round; opacity: 0.82; }
.m-line.m-key { stroke: var(--ink) !important; stroke-width: 2.2; opacity: 1; }
.motif-dark .m-line { opacity: 0.5; }
.motif-dark .m-line.m-key { stroke: var(--g-text-1) !important; opacity: 0.9; }

/* section dividers: a hairline with a shallow nadir */
.section-rule { height: 30px; margin-bottom: clamp(36px, 4.5vw, 64px); }
.divider { display: block; width: 100%; height: 100%; overflow: visible; }
.divider path { fill: none; stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }

/* ---------- trial precision ---------- */

.precision { padding-top: clamp(40px, 5vw, 72px); }
.precision-grid { align-items: start; row-gap: 28px; }
.precision-head { grid-column: 1 / span 6; }
.precision-head .h2 { max-width: 13em; }
.precision-text { grid-column: 8 / -1; padding-top: 34px; }
.precision-text .note { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hair); }
.kicker { display: inline-flex; align-items: center; gap: 8px; }
.kicker-slate { color: var(--slate); }

.levers { margin-top: clamp(40px, 5vw, 72px); }
.levers-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; margin-bottom: 18px; }
.levers-title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.375rem, 1.15rem + 0.8vw, 1.875rem); line-height: 1.2; color: var(--ink); }
.levers-hint { margin-top: 6px; font-size: 0.9375rem; color: var(--text-3); }

.trial-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.trial-pick legend { float: left; margin-right: 6px; font-size: 0.8125rem; color: var(--text-3); }
.trial-opt { display: inline-flex; align-items: center; gap: 7px; font-size: 0.875rem; color: var(--text-2); cursor: pointer; }
.trial-opt strong { font-weight: 500; color: var(--ink); }
.trial-opt input {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; margin: 0;
  border: 1px solid var(--comparator); border-radius: 50%;
  cursor: pointer;
}
.trial-opt input:checked { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 3.5px var(--paper); }
.trial-opt input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.lever-switch { position: relative; }
.lever-radio { position: absolute; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; margin: 0; }
.lever-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.lever-tab {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  row-gap: 2px;
  align-content: start;
  padding: 16px 18px 16px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  position: relative;
  transition: background-color 160ms ease;
}
.lever-tab + .lever-tab { border-left: 1px solid var(--hair); }
.lever-n { grid-row: 1 / span 3; font-family: var(--mono); font-size: 0.8125rem; line-height: 1.9; color: var(--text-3); }
.lever-tab strong { font-family: var(--serif); font-weight: 400; font-size: 1.375rem; line-height: 1.2; color: var(--text-2); }
.lever-text { font-size: 0.875rem; line-height: 1.45; color: var(--text-3); }
.lever-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: transparent; }
.lever-tab:hover { background: rgba(22, 21, 18, 0.035); }
.lever-tab:hover strong { color: var(--ink); }
.lever-cue { margin-top: 10px; font-size: 0.8125rem; font-weight: 500; line-height: 1.3; color: var(--accent); }
.cue-off::after { content: "→"; display: inline-block; margin-left: 6px; transition: transform 160ms ease; }
.lever-tab:hover .cue-off::after { transform: translateX(3px); }
.cue-on { display: none; font-weight: 400; color: var(--text-3); }
#lm-power:checked ~ .lever-tabs label[for="lm-power"],
#lm-events:checked ~ .lever-tabs label[for="lm-events"],
#lm-patients:checked ~ .lever-tabs label[for="lm-patients"] { background: var(--paper-raised); cursor: default; }
#lm-power:checked ~ .lever-tabs label[for="lm-power"] .cue-off,
#lm-events:checked ~ .lever-tabs label[for="lm-events"] .cue-off,
#lm-patients:checked ~ .lever-tabs label[for="lm-patients"] .cue-off { display: none; }
#lm-power:checked ~ .lever-tabs label[for="lm-power"] .cue-on,
#lm-events:checked ~ .lever-tabs label[for="lm-events"] .cue-on,
#lm-patients:checked ~ .lever-tabs label[for="lm-patients"] .cue-on { display: inline; }
#lm-power:checked ~ .lever-tabs label[for="lm-power"] strong,
#lm-events:checked ~ .lever-tabs label[for="lm-events"] strong,
#lm-patients:checked ~ .lever-tabs label[for="lm-patients"] strong { color: var(--ink); }
#lm-power:checked ~ .lever-tabs label[for="lm-power"]::after,
#lm-events:checked ~ .lever-tabs label[for="lm-events"]::after,
#lm-patients:checked ~ .lever-tabs label[for="lm-patients"]::after { background: var(--accent); }
#lm-power:checked ~ .lever-tabs label[for="lm-power"] .lever-n,
#lm-events:checked ~ .lever-tabs label[for="lm-events"] .lever-n,
#lm-patients:checked ~ .lever-tabs label[for="lm-patients"] .lever-n { color: var(--accent); }
#lm-power:focus-visible ~ .lever-tabs label[for="lm-power"],
#lm-events:focus-visible ~ .lever-tabs label[for="lm-events"],
#lm-patients:focus-visible ~ .lever-tabs label[for="lm-patients"] { outline: 2px solid var(--ink); outline-offset: -2px; }

.lever-state { display: none; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); column-gap: var(--col-gap); align-items: start; padding-top: 26px; }
#lm-power:checked ~ .lever-states [data-mode="power"],
#lm-events:checked ~ .lever-states [data-mode="events"],
#lm-patients:checked ~ .lever-states [data-mode="patients"] { display: grid; }
.lever-plot .lc-svg { width: 100%; height: auto; overflow: visible; }
.lever-plot .lc-compact { display: none; }
.lever-side { padding-top: 6px; }

.ro-list { display: grid; gap: 22px; }
.ro dt { font-size: 0.875rem; line-height: 1.4; color: var(--text-2); }
.ro dd { display: grid; gap: 2px; margin-top: 4px; }
.ro-value { font-family: var(--serif); font-size: clamp(2.25rem, 1.7rem + 1.6vw, 3.25rem); line-height: 1; letter-spacing: -0.02em; color: var(--accent); font-variant-numeric: lining-nums tabular-nums; }
.ro-from { font-size: 0.875rem; color: var(--text-3); }
.ro-base { display: flex; align-items: center; gap: 8px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--hair); font-size: 0.8125rem; line-height: 1.45; color: var(--text-3); }
.lever-legend { display: grid; gap: 6px; margin-top: 18px; font-size: 0.8125rem; color: var(--text-3); }
.lever-legend span { display: inline-flex; align-items: center; gap: 8px; }
.k { display: inline-block; flex: none; width: 18px; height: 0; border-top: 2.5px solid var(--comparator); }
.k-index { border-top-color: var(--accent); }
.k-base { border-top-color: var(--slate); }
.k-none { border-top-color: var(--comparator); border-top-style: solid; }

.levers figcaption { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hair); }
.levers figcaption .caption { max-width: 62em; }
.more { margin-top: 10px; }
.more summary {
  display: inline-flex; gap: 8px; align-items: baseline;
  font-size: 0.875rem; color: var(--ink); cursor: pointer; list-style: none;
  text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 0.3em;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: "+"; text-decoration: none; color: var(--text-3); }
.more[open] summary::after { content: "−"; }
.caption-prose { margin-top: 12px; }
.caption-prose p { font-size: 0.875rem; line-height: 1.6; color: var(--text-3); max-width: 52em; }

.next-step { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; margin-top: 28px; }
.next-step p { font-size: 1.0625rem; color: var(--ink); }

/* chart marks (SVG) */
.lc-grid { stroke: var(--hair); stroke-width: 1; fill: none; }
.lc-axis { stroke: var(--rule); stroke-width: 1; fill: none; }
.lc-tick { font-family: var(--mono); font-size: 13px; fill: var(--text-3); }
.lc-tick-c { font-size: 13.5px; }
.lc-axis-title { font-family: var(--sans); font-size: 13px; fill: var(--text-2); }
.lc-tick-c.lc-axis-title { font-size: 13.5px; }
.lc-ref { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 4; fill: none; }
.lc-ref-label { fill: var(--text-3); font-family: var(--sans); }
.lc-line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.lc-line.s-none { stroke: var(--comparator); stroke-width: 2; }
.lc-line.s-base { stroke: var(--slate); stroke-width: 2; }
.lc-line.s-index { stroke: var(--accent); stroke-width: 3; }
.lc-curve { fill: none; stroke: var(--ink); stroke-width: 2; }
.lc-accrual { fill: var(--hair); }
.lc-accrual-label { font-family: var(--sans); fill: var(--text-3); }
.lc-target { fill: none; stroke-width: 1.4; stroke-dasharray: 5 4; }
.lc-drop { fill: none; stroke-width: 1.4; }
.lc-target.s-none, .lc-drop.s-none { stroke: var(--comparator); }
.lc-target.s-base, .lc-drop.s-base { stroke: var(--slate); opacity: 0.7; }
.lc-target.s-index, .lc-drop.s-index { stroke: var(--accent); stroke-width: 1.8; }
.lc-dot { stroke: var(--paper); stroke-width: 2; }
.lc-dot.s-none { fill: var(--comparator); }
.lc-dot.s-base { fill: var(--slate); }
.lc-dot.s-index { fill: var(--accent); }
.lc-value { font-weight: 400; }
.s-none-text { fill: var(--text-3); }
.s-base-text { fill: var(--slate); }
.s-index-text { fill: var(--accent); }
.lc-bar.s-none { fill: var(--comparator); }
.lc-bar.s-base { fill: var(--slate); }
.lc-bar.s-index { fill: var(--accent); }
.lc-bar-ctl { fill-opacity: 0.42; }
.lc-row-label { font-family: var(--sans); font-size: 14px; fill: var(--ink); }
.lc-compact .lc-row-label { font-size: 13.5px; }

/* ---------- dose selection ---------- */

.dose-grid { align-items: start; row-gap: 28px; }
.dose-head { grid-column: 1 / span 6; }
.dose-head .h2 { max-width: 12em; }
.dose-text { grid-column: 8 / -1; padding-top: 34px; }

.stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: clamp(40px, 5vw, 64px); border-top: 1px solid var(--rule); }
.stage { position: relative; display: grid; gap: 3px; align-content: start; padding: 16px 22px 18px 0; }
.stage + .stage { padding-left: 22px; }
.stage + .stage::before {
  content: "";
  position: absolute;
  left: -7px; top: -6px;
  width: 11px; height: 11px;
  border-top: 1px solid var(--rule); border-right: 1px solid var(--rule);
  transform: rotate(45deg);
  background: var(--paper);
}
.stage-n { font-family: var(--mono); font-size: 0.8125rem; color: var(--text-3); }
.stage strong { font-family: var(--serif); font-weight: 400; font-size: 1.25rem; line-height: 1.25; color: var(--ink); }
.stage > span:not(.stage-n) { font-size: 0.875rem; line-height: 1.45; color: var(--text-3); }
.stage-key { box-shadow: inset 0 3px 0 var(--accent); }
.stage-key .stage-n, .stage-tag { color: var(--accent); }
.stage-tag { font-style: normal; font-size: 0.8125rem; font-weight: 500; margin-top: 4px; }

.dose-fig { margin-top: clamp(36px, 4.5vw, 56px); }
.dose-fig-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); row-gap: 6px; margin-bottom: 16px; }
.dose-fig-head .fig-title { grid-column: 1 / span 7; font-family: var(--serif); font-weight: 400; font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem); }
.dose-fig-head .fig-intro { grid-column: 1 / span 7; }
.dose-fig { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: end; }
.dose-fig-head { grid-column: 1 / -1; }
.dose-plot { grid-column: 1 / span 9; }
.dose-svg { width: 100%; height: auto; overflow: visible; }
.dose-svg-compact { display: none; }
.dose-fig figcaption { grid-column: 10 / -1; display: grid; row-gap: 14px; padding: 14px 0 34px; border-top: 1px solid var(--hair); }
.fig-intro { font-size: 0.9375rem; line-height: 1.55; color: var(--text-2); max-width: 40em; }

.f-grid { stroke: var(--hair); stroke-width: 1; fill: none; }
.f-axis { stroke: var(--rule); stroke-width: 1; fill: none; }
.f-band90 { fill: var(--slate); fill-opacity: 0.14; }
.f-band50 { fill: var(--slate); fill-opacity: 0.26; }
.f-tox { fill: var(--accent); fill-opacity: 0.62; }
.f-median { fill: none; stroke: var(--slate); stroke-width: 2.2; stroke-linejoin: round; }
.f-threshold { fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 4 3; }
.f-title { font-family: var(--serif); font-size: 17px; fill: var(--ink); }
.f-metric { font-family: var(--sans); font-size: 13px; font-weight: 500; fill: var(--accent); }
.f-tick, .f-label { font-family: var(--mono); font-size: 12.5px; fill: var(--text-3); }
.f-label-tox { fill: var(--accent); }
.f-sup { font-size: 8px; }
.dose-svg-compact .f-tick, .dose-svg-compact .f-label { font-size: 14px; }
.dose-svg-compact .f-title { font-size: 17px; }
.dose-svg-compact .f-metric { font-size: 14px; }
.dose-svg-compact .f-sup { font-size: 9px; }

/* ---------- research ---------- */

.research-grid { align-items: start; row-gap: 40px; }
.paper { grid-column: 1 / span 7; }
.paper-meta { display: flex; align-items: center; gap: 10px; margin-top: 26px; font-size: 0.875rem; color: var(--text-3); }
.tag { padding: 2px 8px; border: 1px solid var(--accent); border-radius: 2px; font-size: 0.8125rem; font-weight: 500; color: var(--accent); }
.paper-title {
  margin-top: 12px;
  max-width: 30em;
  font-family: var(--serif);
  font-size: clamp(1.1875rem, 1.05rem + 0.45vw, 1.4375rem);
  font-weight: 400;
  line-height: 1.32;
  color: var(--ink);
}
.paper .prose { margin-top: 18px; }

.findings { grid-column: 9 / -1; display: grid; gap: 0; padding-top: 6px; }
.finding { display: grid; gap: 8px; padding-block: 18px 22px; border-top: 1px solid var(--rule); }
.finding-2 { border-top-color: var(--hair); }
.finding dt { font-family: var(--serif); font-size: clamp(2.25rem, 1.7rem + 1.6vw, 3.25rem); line-height: 1; letter-spacing: -0.02em; color: var(--accent); }
.finding-2 dt { color: var(--slate); }
.finding dd { font-size: 0.9375rem; line-height: 1.55; color: var(--text-2); }

.disclosure { margin-top: clamp(36px, 4.5vw, 56px); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--hair); }
.disclosure summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 16px; font-weight: 500; color: var(--ink); cursor: pointer; list-style: none;
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after { content: "+"; font: 400 1.375rem/1 var(--sans); color: var(--text-3); }
.disclosure[open] summary::after { content: "−"; }

.figure { padding-bottom: 28px; }
.figure-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 8px; }

.dotplot { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.dotplot th, .dotplot td { padding: 0; text-align: left; font-weight: 400; vertical-align: middle; }
.dotplot thead th { padding-block: 12px 8px; border-bottom: 1px solid var(--hair); font-size: 0.8125rem; color: var(--text-3); }
.dotplot .col-label { width: 30%; }
.dotplot .col-base { width: 8%; }
.dotplot .col-index { width: 17%; }
.dotplot .group-name { padding-top: 20px; padding-bottom: 4px; font-size: 0.8125rem; font-weight: 500; color: var(--ink); }
.dotplot .row th { padding-block: 8px; padding-right: 16px; font-size: 0.9375rem; line-height: 1.35; color: var(--ink); }
.dotplot .row th small { display: block; margin-top: 2px; font-size: 0.75rem; color: var(--text-3); }
.dotplot td.v { padding-right: 12px; font-family: var(--mono); font-size: 0.8125rem; color: var(--text-3); white-space: nowrap; }
.dotplot td.v-index { color: var(--ink); }
.dotplot td.v-index small { color: var(--text-3); }
.dotplot .row td, .dotplot .row th { border-bottom: 1px solid var(--hair); }

.track { position: relative; height: 36px; }
.track::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(0.18 / var(--axis-max, 0.3) * 100%); border-left: 1px dashed var(--rule); }
.track .band {
  position: absolute; top: 50%; height: 4px; margin-top: -2px;
  left: calc(var(--lo) / var(--axis-max, 0.3) * 100%);
  width: calc((var(--hi) - var(--lo)) / var(--axis-max, 0.3) * 100%);
  background: var(--accent); opacity: 0.3;
}
.track .band-range { background: var(--slate); opacity: 0.35; }
.track .dot { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; left: calc(var(--x) / var(--axis-max, 0.3) * 100%); }
.track .dot-index { background: var(--accent); }
.track .dot-base { background: var(--paper); border: 1.5px solid var(--slate); }
.axis { position: relative; height: 28px; border-top: 1px solid var(--rule); }
.axis span { position: absolute; top: 7px; transform: translateX(-50%); font-family: var(--mono); font-size: 0.6875rem; color: var(--text-3); }
.axis span:first-child { transform: none; }
.axis span:last-child { transform: translateX(-100%); }
.figure figcaption { display: grid; gap: 10px; margin-top: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 0.8125rem; color: var(--text-2); }
.legend > span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { display: inline-block; flex: none; }
.legend .k-index { width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--accent); }
.legend .k-base { width: 10px; height: 10px; border: 1.5px solid var(--slate); border-radius: 50%; }
.legend .k-ref { width: 0; height: 14px; border-left: 1px dashed var(--text-3); }

/* ---------- questions ---------- */

.faq, .section-last { padding-bottom: var(--section); }
.faq-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); row-gap: 24px; align-items: start; }
.faq-grid .h2 { grid-column: 1 / span 4; max-width: 8em; }
.qa-list { grid-column: 6 / -1; border-top: 1px solid var(--rule); }
.qa { border-bottom: 1px solid var(--hair); }
.qa summary {
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
  padding-block: 18px; cursor: pointer; list-style: none;
  font-family: var(--serif); font-size: 1.1875rem; line-height: 1.35; color: var(--ink);
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; flex: none; font: 400 1.375rem/1 var(--sans); color: var(--accent); transition: transform 0.2s ease; }
.qa[open] summary::after { transform: rotate(45deg); }
.qa summary:hover { color: var(--accent); }
.qa p { max-width: 40em; padding-bottom: 20px; font-size: 1rem; line-height: 1.6; color: var(--text-2); }

/* ---------- graphite band: contact ---------- */

.band-graphite { position: relative; background: var(--g-bg); color: var(--g-text-2); overflow: hidden; }
.band-graphite .h2, .band-graphite .h3 { color: var(--g-text-1); }
.contact-field { height: clamp(90px, 11.1vw, 190px); }

.contact-grid { padding-block: clamp(40px, 5vw, 72px) clamp(72px, 8vw, 112px); row-gap: 56px; align-items: start; }
.contact-intro { grid-column: 1 / span 5; }
.contact-intro .h2 { max-width: 11em; }
.contact-intro .prose { margin-top: 26px; }
.contact-intro .prose p { color: var(--g-text-2); }

.contact-form-wrap { grid-column: 7 / -1; }
.form-title { margin-bottom: 22px; font-size: 1.0625rem; font-weight: 500; color: var(--g-text-1); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-full { grid-column: 1 / -1; }
.field label, .choices legend { font-size: 0.875rem; color: var(--g-text-1); }
.field label .opt { margin-left: 6px; font-size: 0.8125rem; color: var(--g-text-3); }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  background: var(--g-raised); border: 1px solid var(--g-rule); border-radius: 2px;
  color: var(--g-text-1); font-family: var(--sans); font-size: 1rem; line-height: 1.4;
  transition: border-color 120ms ease;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:hover, .field textarea:hover { border-color: var(--g-text-3); }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--g-text-1); outline-offset: 0; border-color: var(--g-text-1); }
.field input:user-invalid, .field textarea:user-invalid { border-color: var(--g-accent); }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.choices legend { margin-bottom: 8px; padding: 0; }
.choice { display: flex; align-items: flex-start; gap: 10px; padding-block: 7px; font-size: 0.9375rem; line-height: 1.4; color: var(--g-text-2); cursor: pointer; }
.field .choice input {
  flex: none; min-height: 0; padding: 0;
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; margin: 1px 0 0;
  border: 1px solid var(--g-text-3); border-radius: 50%;
  background: transparent; cursor: pointer;
}
.field .choice input:checked { border-color: var(--g-text-1); box-shadow: inset 0 0 0 4px var(--g-bg); background: var(--g-text-1); }
.choice input:focus-visible { outline: 2px solid var(--g-text-1); outline-offset: 2px; }
.choice input:checked + span { color: var(--g-text-1); }

.notice { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--g-hair); font-size: 0.8125rem; line-height: 1.55; color: var(--g-text-2); }
.notice-lead { color: var(--g-text-1); }
.notice a { color: var(--g-text-1); }

.form-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.band-graphite .button { background: var(--g-text-1); border-color: var(--g-text-1); color: var(--g-bg); }
.band-graphite .button:hover { background: #fff; }
.button[disabled] { cursor: progress; background: var(--g-text-2); border-color: var(--g-text-2); }
.form-status { min-height: 1.4em; font-size: 0.875rem; color: var(--g-text-2); }
.form-status.is-error { color: var(--g-accent); }
.form-success { padding-top: 28px; border-top: 1px solid var(--g-rule); }
.form-success .h3 { margin-bottom: 12px; }
.form-success p { max-width: 32em; color: var(--g-text-2); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- footer ---------- */

.site-footer { background: var(--g-bg); color: var(--g-text-3); border-top: 1px solid var(--g-hair); }
.footer-grid { padding-block: 40px 40px; row-gap: 28px; align-items: start; }
.footer-brand { grid-column: 1 / span 4; }
.footer-brand .wordmark { color: var(--g-text-1); padding: 0; }
.footer-brand p { margin-top: 14px; font-size: 0.875rem; line-height: 1.55; max-width: 24em; }
.footer-nav { grid-column: 6 / span 3; }
.footer-nav li + li { margin-top: 6px; }
.footer-nav a, .footer-legal a { font-size: 0.875rem; color: var(--g-text-2); text-decoration: none; }
.footer-nav a:hover, .footer-legal a:hover { color: var(--g-text-1); text-decoration: underline; }
.footer-legal { grid-column: 9 / -1; font-size: 0.8125rem; line-height: 1.6; }
.footer-legal p + p { margin-top: 10px; }
.footer-legal .footer-email { color: var(--g-text-1); font-size: 0.9375rem; }
.footer-ack { grid-column: 1 / -1; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--g-hair); max-width: 96em; font-size: 0.6875rem; line-height: 1.6; color: var(--g-text-3); }

/* ---------- simple pages (privacy, thanks, 404) ---------- */

.page { padding-block: clamp(56px, 8vw, 112px) var(--section); }
.page-meta { margin-bottom: 18px; font-size: 0.875rem; color: var(--text-3); }
.page h1 { max-width: 16em; }
.page-body { margin-top: 36px; max-width: 42em; }
.page-body h2 { margin-top: 2em; margin-bottom: 0.5em; font-family: var(--serif); font-weight: 400; font-size: 1.375rem; line-height: 1.25; color: var(--ink); }
.page-body ul { margin-top: 0.75em; padding-left: 1.2em; list-style: disc; }
.page-body li + li { margin-top: 0.4em; }

/* ---------- motion: one-time reveals, never for reduced-motion visitors ---------- */

@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: no-preference) {
  /* the hero field draws itself on load, line by line */
  .motif-hero .m-line { stroke-dasharray: 1; animation: draw 2.2s cubic-bezier(0.3, 0.6, 0.15, 1) both; animation-delay: calc(var(--i) * 32ms + 150ms); }

  .reveal-pending { opacity: 0; transform: translateY(18px); }
  .reveal-pending.is-in { opacity: 1; transform: none; transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), transform 1s cubic-bezier(0.2, 0.7, 0.2, 1); }

  /* dividers and the contact field draw instead of rising */
  .section-rule.reveal-pending, .contact-field.reveal-pending { opacity: 1; transform: none; }
  .section-rule.reveal-pending path { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .section-rule.is-in path { stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s cubic-bezier(0.3, 0.6, 0.15, 1); }
  .contact-field.reveal-pending .m-line { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .contact-field.is-in .m-line { stroke-dashoffset: 0; transition: stroke-dashoffset 2s cubic-bezier(0.3, 0.6, 0.15, 1); transition-delay: calc(var(--i) * 30ms); }

  /* chart lines trace on when the figure arrives, and again when a mode is chosen */
  .levers.reveal-pending:not(.is-in) .lc-draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .levers:is(.is-in, :not(.reveal-pending)):not(.drawn) .lc-draw { stroke-dasharray: 1; animation: draw 1.3s cubic-bezier(0.3, 0.6, 0.15, 1) both 0.15s; }
  .levers.reveal-pending:not(.is-in) .lc-grow { transform: scaleX(0); }
  .lc-grow { transform-box: fill-box; transform-origin: left center; }
  .levers:is(.is-in, :not(.reveal-pending)):not(.drawn) .lc-grow { animation: grow 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both 0.15s; }
  .levers:not(.drawn) .lever-state { animation: fade 0.45s ease both; }

  .dose-fig.reveal-pending:not(.is-in) .f-draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .dose-fig.is-in .f-draw { stroke-dasharray: 1; animation: draw 1.6s cubic-bezier(0.3, 0.6, 0.15, 1) both 0.3s; }
  .dose-fig.reveal-pending:not(.is-in) .f-band90, .dose-fig.reveal-pending:not(.is-in) .f-band50, .dose-fig.reveal-pending:not(.is-in) .f-tox { opacity: 0; }
  .dose-fig.is-in .f-band90, .dose-fig.is-in .f-band50, .dose-fig.is-in .f-tox { animation: fade 1.2s ease both 0.5s; }
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .hero h1 { grid-column: 1 / -1; }
  .hero-body { grid-column: 1 / span 7; }
  .apps { grid-column: 9 / -1; }
  .precision-head, .dose-head { grid-column: 1 / -1; }
  .precision-text, .dose-text { grid-column: 1 / span 9; padding-top: 0; }
  .lever-state { grid-template-columns: 1fr; row-gap: 18px; }
  .lever-side { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--col-gap); align-items: start; }
  .lever-side .ro-list { grid-template-columns: 1fr 1fr; grid-column: 1 / -1; column-gap: var(--col-gap); }
  .lever-legend { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 18px; }
  .ro-base { grid-column: 1 / -1; }
  .dose-fig-head .fig-title, .dose-fig-head .fig-intro { grid-column: 1 / span 10; }
  .dose-plot { grid-column: 1 / -1; }
  .dose-fig figcaption { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; column-gap: var(--col-gap); padding-bottom: 0; margin-top: 14px; }
  .paper { grid-column: 1 / span 8; }
  .findings { grid-column: 1 / span 8; grid-template-columns: 1fr 1fr; column-gap: var(--col-gap); }
  .finding-2 { border-top-color: var(--rule); }
  .faq-grid .h2 { grid-column: 1 / -1; max-width: none; }
  .qa-list { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .hero-body { grid-column: 1 / -1; }
  .apps { grid-column: 1 / -1; }
  .apps ol { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--col-gap); }
  .apps li, .apps li:last-child { border-bottom: 0; }
  .precision-text, .dose-text, .paper, .findings { grid-column: 1 / -1; }
  .stages { grid-template-columns: 1fr 1fr; }
  .stage:nth-child(3) { padding-left: 0; }
  .stage:nth-child(3)::before { display: none; }
  .stage:nth-child(n + 3) { border-top: 1px solid var(--hair); }
  .dose-svg-wide { display: none; }
  .dose-svg-compact { display: block; max-width: 480px; }
  .contact-intro, .contact-form-wrap { grid-column: 1 / -1; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-nav { grid-column: 1 / span 5; }
  .footer-legal { grid-column: 7 / -1; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .nav .nav-link { display: none; }
  .site-header .wrap { height: 58px; }
  .wordmark { font-size: 1.1875rem; }
  .hero { padding-top: 40px; }
  .actions { margin-top: 26px; gap: 14px 24px; }
  .apps ol { grid-template-columns: 1fr; }
  .apps li:last-child { border-bottom: 1px solid var(--rule); }
  .apps a { padding-block: 14px 16px; }
  .app-title { font-size: 1.25rem; }
  .hero-field { margin-top: 32px; height: 34.4vw; }
  .contact-field { height: 28.1vw; }
  .motif-wide { display: none; }
  .motif-compact { display: block; }

  .levers-head { display: block; }
  .levers-title { margin-bottom: 14px; }
  .trial-pick { gap: 8px 14px; }
  .trial-pick legend { float: none; width: 100%; margin-bottom: 2px; }
  .lever-tabs { grid-template-columns: 1fr; }
  .lever-tab, .lever-tab + .lever-tab { padding: 12px 14px 13px 10px; border-left: 0; }
  .lever-cue { margin-top: 6px; }
  .lever-tab strong { font-size: 1.1875rem; }
  .lever-tab::after { width: 3px; height: auto; top: 12px; bottom: 12px; left: auto; right: 0; }
  .lever-plot .lc-wide { display: none; }
  .lever-plot .lc-compact { display: block; }
  .lever-side, .lever-side .ro-list { grid-template-columns: 1fr; }
  .ro-list { gap: 16px; }
  .ro-value { font-size: 2.25rem; }
  .ro dt { font-size: 0.875rem; }

  .stages { grid-template-columns: 1fr; }
  .stage, .stage + .stage { padding: 14px 0 14px 34px; border-top: 1px solid var(--hair); }
  .stage:first-child { border-top: 0; }
  .stage::before, .stage + .stage::before, .stage:nth-child(3)::before { display: none; }
  .stage-n { position: absolute; left: 0; top: 16px; }
  .stage-key { box-shadow: inset 0 2px 0 var(--accent); }

  .dose-fig figcaption { grid-template-columns: 1fr; }

  .findings { grid-template-columns: 1fr; }
  .finding-2 { border-top-color: var(--hair); }

  .dotplot, .dotplot tbody { display: block; }
  .dotplot thead, .dotplot colgroup { display: none; }
  .dotplot tr { display: block; }
  .dotplot .row {
    display: grid; grid-template-columns: 1fr auto auto; grid-template-areas: "label base index" "track track track";
    column-gap: 12px; align-items: baseline; padding-top: 8px; border-bottom: 1px solid var(--hair);
  }
  .dotplot .row th, .dotplot .row td { border: 0; padding: 0; }
  .dotplot .row th { grid-area: label; }
  .dotplot .row td.v-base { grid-area: base; }
  .dotplot .row td.v-index { grid-area: index; text-align: right; }
  .dotplot .row td.v-index small { display: none; }
  .dotplot .row td.v-track { grid-area: track; }
  .dotplot .group-name { display: block; }
  .dotplot .axis-row { display: block; }
  .dotplot .axis-row td { display: none; }
  .dotplot .axis-row td.v-track { display: block; }
  .track { height: 26px; }

  .qa summary { font-size: 1.0625rem; padding-block: 15px; }
  .form { grid-template-columns: 1fr; }
  .choices { grid-template-columns: 1fr; }
  .footer-nav, .footer-legal { grid-column: 1 / -1; }
}

@media (max-width: 380px) {
  .nav .nav-cta { font-size: 0.875rem; }
  .ro-value { font-size: 1.75rem; }
}
