/* Layout: a full-bleed miniature estate as the hero with the headline low on the left; then one calm reading column
   (about 68 characters) with wide figures, a white funding band, and a dark band for the testing promise.
   Signature device: the relative risk scale (teal, sand, amber, coral), used only where it means risk. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-variable.woff2") format("woff2-variations"), url("fonts/archivo-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}

:root {
  /* page */
  --sky: #eef2f5;
  --surface: #ffffff;
  --ink: #132032;
  --muted: #4b596a;
  --line: #cdd6df;
  --strip-body: #c3ccd6;
  --link: #1c4f8c;
  /* fixed bands, the same in both themes */
  --night: #14213a;
  --night-ink: #eef3f9;
  --night-muted: #b3c1d3;
  --band: #ffffff;
  --band-ink: #14213a;
  --band-muted: #4b596a;
  /* relative risk scale */
  --teal: #3aa39f;
  --sand: #e7c873;
  --amber: #f29e3d;
  --coral: #e2502c;
  --ramp: linear-gradient(90deg, var(--teal) 0%, var(--sand) 40%, var(--amber) 70%, var(--coral) 100%);
  --ramp-down: linear-gradient(90deg, var(--coral) 0%, var(--amber) 30%, var(--sand) 60%, var(--teal) 100%);
  /* type */
  --display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", Verdana, sans-serif;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sky: #0e1727; --surface: #15223a; --ink: #e8eef5; --muted: #a6b4c6;
    --line: #2a3a55; --strip-body: #3b4b66; --link: #92c2ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sky: #0e1727; --surface: #15223a; --ink: #e8eef5; --muted: #a6b4c6;
  --line: #2a3a55; --strip-body: #3b4b66; --link: #92c2ff;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1160px; margin-inline: auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 20; background: var(--band); color: var(--band-ink); padding: 8px 14px; border-radius: 6px; }
.skip:focus { top: 12px; }

/* ---------- header ---------- */
.site-head { position: absolute; inset: 0 0 auto; z-index: 5; color: var(--night-ink); padding-top: env(safe-area-inset-top, 0px); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-family: var(--display); font-stretch: 116%; font-weight: 720; font-size: 1.2rem; letter-spacing: 0.005em; }
.brand svg { width: 34px; height: 34px; flex: none; }
.nav { display: flex; align-items: center; gap: 26px; font-size: 0.97rem; }
.nav a { color: inherit; text-decoration: none; opacity: 0.88; }
.nav a:hover { opacity: 1; text-decoration: underline; }
.nav .talk { opacity: 1; border: 1px solid rgba(238, 243, 249, 0.45); padding: 7px 16px; border-radius: 6px; }
.nav .talk:hover { background: rgba(238, 243, 249, 0.1); text-decoration: none; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: clamp(620px, 92svh, 900px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: var(--night-ink);
  background: radial-gradient(120% 95% at 66% 32%, #27416c 0%, #182a47 46%, #0c1628 100%);
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.6s ease 0.1s; }
.hero.is-live canvas { opacity: 1; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    linear-gradient(to top, rgba(9, 16, 30, 0.92) 0%, rgba(9, 16, 30, 0.6) 26%, rgba(9, 16, 30, 0) 55%),
    linear-gradient(to right, rgba(9, 16, 30, 0.55) 0%, rgba(9, 16, 30, 0) 46%);
}
.hero-inner {
  position: relative; z-index: 2; width: 100%;
  display: grid; grid-template-columns: minmax(0, 40rem) minmax(0, 1fr); align-items: end; gap: 32px;
  padding-block: 120px clamp(32px, 5vw, 60px);
}
.status { display: inline-flex; align-items: center; gap: 10px; font-size: 0.95rem; color: var(--night-muted); margin-bottom: 18px; }
.status i { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(242, 158, 61, 0.22); }
.hero h1 {
  font-stretch: 110%; font-weight: 760;
  font-size: clamp(2.35rem, 1.4rem + 3.2vw, 4.15rem);
  line-height: 1.02; letter-spacing: -0.012em;
  margin-bottom: 22px;
}
.lede { font-size: clamp(1.08rem, 1rem + 0.35vw, 1.24rem); line-height: 1.55; color: #d3dde9; max-width: 35rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 6px; font-weight: 700; text-decoration: none; font-size: 1rem; }
.btn-primary { background: var(--amber); color: #1c1306; }
.btn-primary:hover { background: #f6ad55; }
.btn-ghost { color: var(--night-ink); border: 1px solid rgba(238, 243, 249, 0.45); }
.btn-ghost:hover { background: rgba(238, 243, 249, 0.1); }

.legend { justify-self: end; display: grid; gap: 8px; font-size: 0.86rem; color: var(--night-muted); min-width: 0; }
.legend .scale { display: grid; grid-template-columns: auto 150px auto; align-items: center; gap: 10px; color: var(--night-ink); }
.legend .bar { height: 8px; border-radius: 4px; background: var(--ramp); }

.hero.no-webgl .legend { display: none; }

/* ---------- funding band ---------- */
.funded { background: var(--band); color: var(--band-ink); }
.funded .wrap { display: flex; align-items: center; gap: 40px; padding-block: 26px; }
.funded img { width: 184px; height: auto; flex: none; padding: 10px 0; }
.funded p { font-size: 1.02rem; max-width: 44rem; }
.funded p span { display: block; color: var(--band-muted); font-size: 0.95rem; margin-top: 2px; }

/* ---------- sections ---------- */
.section { padding-block: clamp(64px, 9vw, 116px); }
.section + .section { padding-top: 0; }
.h2 { font-stretch: 106%; font-weight: 720; font-size: clamp(1.85rem, 1.3rem + 1.9vw, 2.7rem); line-height: 1.08; letter-spacing: -0.008em; }
.prose { display: grid; gap: 1em; max-width: 38rem; }
.prose p { color: var(--ink); }
.muted { color: var(--muted); }

/* why now */
.health { font-size: clamp(1.08rem, 1rem + 0.4vw, 1.25rem); line-height: 1.55; max-width: 46rem; padding-bottom: clamp(36px, 5vw, 56px); margin-bottom: clamp(36px, 5vw, 56px); border-bottom: 1px solid var(--line); }
.health a { white-space: nowrap; }
.clocks { margin: 4px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.clocks > div { border-left: 3px solid var(--amber); padding: 4px 0 4px 14px; }
.clocks dt { font-family: var(--display); font-stretch: 112%; font-weight: 760; font-size: clamp(1.35rem, 1.1rem + 0.7vw, 1.6rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.clocks dd { margin: 4px 0 0; color: var(--muted); font-size: 0.97rem; line-height: 1.45; }
.why { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.bigdate { font-stretch: 125%; font-weight: 820; font-size: clamp(2.8rem, 1.6rem + 4.2vw, 5.4rem); line-height: 0.92; letter-spacing: -0.02em; }
.bigdate span { display: block; }
.bigdate::after { content: ""; display: block; width: min(100%, 420px); height: 8px; border-radius: 4px; margin-top: 26px; background: var(--ramp); }
.why .prose { padding-top: 6px; }

/* two ways */
.intro { margin-top: 14px; max-width: 40rem; font-size: 1.1rem; }
.ways { margin-top: 36px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.5vw, 28px); align-items: stretch; }
.way { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: clamp(22px, 3vw, 36px); display: grid; gap: 16px; align-content: start; min-width: 0; }
.way h3 { font-stretch: 106%; font-weight: 720; font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.7rem); line-height: 1.15; }
.way-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.way .note { font-size: 0.95rem; color: var(--muted); border-left: 2px solid var(--line); padding-left: 14px; }
.flow { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; counter-reset: flow; }
.flow li { counter-increment: flow; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: center; }
.flow li::before { content: counter(flow); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 760; font-size: 0.95rem; background: var(--sky); border: 1px solid var(--line); color: var(--ink); }
.flow li:last-child::before { background: var(--coral); border-color: var(--coral); color: #fff; }
.flow li span { padding: 10px 14px; border-radius: 8px; background: var(--sky); line-height: 1.35; }

/* how it works */
.steps { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.steps li { border-top: 2px solid var(--ink); padding-top: 18px; display: grid; gap: 8px; align-content: start; }
.steps .n { font-family: var(--display); font-stretch: 120%; font-weight: 760; font-size: 1.05rem; color: var(--muted); }
.steps h3 { font-stretch: 104%; font-weight: 700; font-size: 1.35rem; line-height: 1.2; }
.steps p { color: var(--muted); }

.strip { display: grid; gap: 10px; margin: 0; }
.strip svg { width: 100%; height: auto; display: block; }
.strip .b { fill: var(--strip-body); }
.strip .ends { display: flex; justify-content: space-between; gap: 16px; font-size: 0.92rem; color: var(--muted); }
.strip .ends b { color: var(--ink); }
.strip .bar { height: 5px; border-radius: 3px; background: var(--ramp-down); }
.strip figcaption { font-size: 0.85rem; color: var(--muted); }

/* tested in the open */
.open { background: var(--night); color: var(--night-ink); }
.open .wrap { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); padding-block: clamp(64px, 9vw, 112px); }
.open .prose p { color: var(--night-ink); }
.open .prose p + p { color: var(--night-muted); }
.open .prose p:first-child { font-size: 1.18rem; line-height: 1.5; }

/* get involved */
.who { margin: 36px 0 0; display: grid; }
.who > div { display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); gap: 8px 40px; padding-block: 22px; border-top: 1px solid var(--line); }
.who > div:last-child { border-bottom: 1px solid var(--line); }
.who dt { font-family: var(--display); font-stretch: 106%; font-weight: 700; font-size: 1.22rem; line-height: 1.3; }
.who dd { margin: 0; max-width: 40rem; color: var(--muted); }

/* contact */
.contact { background: var(--surface); border-top: 1px solid var(--line); }
.contact .wrap { padding-block: clamp(64px, 9vw, 112px); display: grid; gap: 18px; }
.email { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 10px; }
.email a { font-family: var(--display); font-stretch: 108%; font-weight: 720; font-size: clamp(1.45rem, 1rem + 2.2vw, 2.5rem); line-height: 1.1; color: var(--ink); text-decoration-color: var(--amber); text-decoration-thickness: 3px; overflow-wrap: anywhere; min-width: 0; }
.copy { font: inherit; font-size: 0.95rem; font-weight: 700; min-height: 44px; padding: 0 16px; border-radius: 6px; border: 1px solid var(--line); background: var(--sky); color: var(--ink); cursor: pointer; }
.copy:hover { border-color: var(--muted); }

/* footer */
.foot { border-top: 1px solid var(--line); }
.foot .wrap { padding-block: 40px 48px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 18px 28px; font-size: 0.9rem; color: var(--muted); }
.foot .brand { color: var(--ink); font-size: 1.05rem; }
.foot .brand svg { width: 28px; height: 28px; }
.foot .lines { display: grid; gap: 6px; max-width: 46rem; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .nav a:not(.talk) { display: none; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .legend { justify-self: start; }
  .why, .open .wrap { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .ways { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .hero { min-height: clamp(640px, 100svh, 820px); }
  .hero::after { background: linear-gradient(to top, rgba(9, 16, 30, 0.96) 0%, rgba(9, 16, 30, 0.8) 38%, rgba(9, 16, 30, 0) 62%); }
  .hero-inner { padding-top: 300px; }
  .funded .wrap { flex-direction: column; align-items: flex-start; gap: 14px; }
  .funded img { width: 160px; }
  .who > div { grid-template-columns: minmax(0, 1fr); }
  .clocks { grid-template-columns: minmax(0, 1fr); }
  .foot .wrap { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero canvas { transition: none; }
}
