/* ===== fonts ===== */
@font-face {
  font-family: "Chivo Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("assets/fonts/chivo-mono-01-9b515b29.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Chivo Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("assets/fonts/chivo-mono-02-42d957b9.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Chivo Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("assets/fonts/chivo-mono-03-201652b5.woff2") format("woff2");
  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: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/source-sans-3-01-561b191c.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/source-sans-3-02-1c61bea7.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/source-sans-3-03-0ea8b042.woff2") format("woff2");
  unicode-range: U+1F00-1FFF;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/source-sans-3-04-d535a919.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/source-sans-3-05-a79b21ca.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/source-sans-3-06-22951375.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/source-sans-3-07-b4d83185.woff2") format("woff2");
  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;
}

/* ===== tokens ===== */
:root { color-scheme: light; }
body {
  --bg: #FEFDFC; --card: #FFFFFF; --well: #F4EEE4; --border: #E5DDD1;
  --ink: #201814; --body: #4A4038; --muted: #8A7E72;
  --accent: #C1502B; --sage: #6E8577;
}
body[data-dark] {
  --bg: #151312; --card: #181614; --well: #282522; --border: #38342F;
  --ink: #FAF7F2; --body: #C9C2B8; --muted: #9A9188;
  --accent: #D45A32; --sage: #8AA894;
  color-scheme: dark;
}

/* ===== base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg); color: var(--body);
  font-family: "Source Sans 3", -apple-system, sans-serif;
  font-size: 17px; line-height: 1.6;
}
h1, h2, h3 { color: var(--ink); line-height: 1.15; font-weight: 700; }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.label-mono {
  font-family: "Chivo Mono", monospace; font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.pill {
  display: inline-block; padding: 4px 12px; border: 1px solid var(--border);
  border-radius: 999px; font-family: "Chivo Mono", monospace; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent);
  background: var(--card);
}
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px;
}
.btn {
  display: inline-block; padding: 12px 24px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card); color: var(--ink);
  font-weight: 600; text-decoration: none; cursor: pointer; font-size: 16px;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #FFF; }
.btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

/* ===== header / footer ===== */
header {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 0; border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.wordmark { font-size: 20px; font-weight: 700; color: var(--ink); }
.wordmark em { color: var(--accent); font-style: normal; }
header .spacer { flex: 1; }
#theme-toggle {
  border: 1px solid var(--border); background: var(--card); color: var(--ink);
  border-radius: 8px; padding: 6px 12px; cursor: pointer;
  font-family: "Chivo Mono", monospace; font-size: 12px;
}
footer {
  border-top: 1px solid var(--border); margin-top: 96px; padding: 32px 0 48px;
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
}

/* theme-dependent asset swap */
body[data-dark] .only-light { display: none; }
body:not([data-dark]) .only-dark { display: none; }

section { margin-top: 96px; }
@media (max-width: 700px) {
  section { margin-top: 64px; }
  body { font-size: 16px; }
  header { flex-wrap: wrap; row-gap: 12px; }
  header .pill { order: 3; }
  header .spacer { flex-basis: 100%; height: 0; }
}

/* ===== hero ===== */
#hero { margin-top: 72px; text-align: left; }
#hero h1 { font-size: clamp(34px, 5vw, 52px); margin: 12px 0 20px; max-width: 20ch; }
.lede { max-width: 62ch; font-size: 19px; }
.hero-actions { display: flex; gap: 12px; margin: 28px 0 40px; }
.shot {
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  background: var(--well); box-shadow: 0 24px 60px -32px rgba(32, 24, 20, 0.35);
}
.shot img { width: 100%; height: auto; }

/* ===== features ===== */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.grid-3 h3 { margin-bottom: 10px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }

/* ===== gallery ===== */
.gallery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.gallery-grid figure:first-child { grid-column: 1 / -1; }
figcaption { padding: 12px 16px; font-size: 14px; color: var(--muted); background: var(--card); }
@media (max-width: 860px) { .gallery-grid { grid-template-columns: 1fr; } }

/* ===== accuracy ===== */
#accuracy h2 { font-size: 30px; margin: 12px 0 20px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-value {
  font-family: "Chivo Mono", monospace; font-size: 40px; font-weight: 700;
  color: var(--accent); line-height: 1;
}
.stat-note { font-size: 14px; color: var(--muted); }
.stat-forthcoming { margin-top: 16px; font-size: 15px; color: var(--muted); }
@media (max-width: 860px) { .stat-row { grid-template-columns: 1fr; } }

/* ===== research ===== */
.research-card h2 { margin: 14px 0 12px; font-size: 28px; }
.research-card > p { max-width: 68ch; }
.citation {
  margin: 20px 0; padding: 16px 20px; background: var(--well);
  border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0;
}
.citation .label-mono { color: var(--accent); margin-bottom: 6px; }

/* ===== download ===== */
#download h2 { font-size: 30px; margin: 12px 0 12px; }
.dl-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 22px; }
.dl-row .label-mono { color: rgba(255, 255, 255, 0.75); }

/* ===== datasets (research) ===== */
.datasets { margin-top: 40px; }
.datasets h3 { margin-bottom: 10px; }
.datasets .card p:last-child { margin-top: 12px; }

/* ===== accuracy results table ===== */
.accuracy-intro { max-width: 62ch; margin-bottom: 24px; }
.table-wrap { overflow-x: auto; margin-top: 28px; }
.results-table {
  width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  font-size: 15px;
}
.results-table caption {
  text-align: left; margin-bottom: 10px; color: var(--muted);
}
.results-table th, .results-table td {
  padding: 10px 16px; border-bottom: 1px solid var(--border); text-align: right;
}
.results-table thead th {
  font-family: "Chivo Mono", monospace; font-size: 11px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  background: var(--well);
}
.results-table th[scope="row"], .results-table thead th:first-child {
  text-align: left; font-weight: 600; color: var(--ink);
}
.results-table td { font-family: "Chivo Mono", monospace; color: var(--body); }
.results-table tbody tr:last-child th,
.results-table tbody tr:last-child td { border-bottom: none; }
.table-note { font-weight: 400; font-size: 13px; color: var(--muted); }
.results-table th, .results-table td { white-space: nowrap; }
.research-card > p + p { margin-top: 12px; }


/* ===== external validation ===== */
.external-validation { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--border); }
.external-validation .accuracy-intro { margin-top: 12px; }

/* ===== local-only callout ===== */
.local-callout {
  margin-top: 24px; padding: 26px 30px; background: var(--well);
  border-left: 3px solid var(--accent); border-radius: 0 14px 14px 0;
}
.local-callout .label-mono { color: var(--accent); }
.local-lead { max-width: 72ch; margin-top: 10px; color: var(--ink); }
.local-list {
  list-style: none; margin-top: 18px; display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 32px;
}
.local-list li { position: relative; padding-left: 18px; font-size: 15px; }
.local-list li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
@media (max-width: 700px) { .local-list { grid-template-columns: 1fr; } }

/* ===== download notes ===== */
.dl-notes { margin-top: 28px; max-width: 72ch; }
.dl-notes p { margin-top: 10px; }
.dl-notes strong { color: var(--ink); }
.dl-notes em { font-style: normal; font-weight: 600; color: var(--ink); }
.dl-notes .label-mono { margin-top: 22px; }
code {
  font-family: "Chivo Mono", monospace; font-size: 13px;
  background: var(--well); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 6px;
}
.checksum { display: block; padding: 10px 12px; word-break: break-all; }
.dl-verify { font-size: 15px; color: var(--muted); }

/* ===== guide pages ===== */
.doc { max-width: 900px; }
.doc h1 { font-size: clamp(30px, 4vw, 42px); margin: 10px 0 18px; }
.doc h2 { font-size: 24px; margin-bottom: 14px; }
.doc section { margin-top: 56px; }
.doc p { max-width: 72ch; }
.crumb a { text-decoration: none; }
.tight { list-style: none; margin-top: 18px; max-width: 72ch; }
.tight li { position: relative; padding-left: 18px; margin-top: 10px; }
.tight li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.tight strong { color: var(--ink); }
.note-after { margin-top: 14px; font-size: 15px; color: var(--muted); }

/* filename anatomy diagram */
.fn-anatomy {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 2px;
  background: var(--well); border: 1px solid var(--border);
  border-radius: 14px; padding: 26px 24px 18px;
  font-family: "Chivo Mono", monospace;
}
.fn-seg { display: inline-flex; flex-direction: column; }
.fn-text {
  font-size: 17px; font-weight: 500; color: var(--part);
  border-bottom: 2px solid var(--part); padding-bottom: 4px;
}
.fn-label {
  margin-top: 7px; font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--part);
}
.fn-us, .fn-ext { font-size: 17px; color: var(--muted); line-height: 1.55; }
.fn-seg[data-part="subject"]   { --part: #B4451F; }
.fn-seg[data-part="timepoint"] { --part: #4A6B59; }
.fn-seg[data-part="date"]      { --part: #7A5B22; }
.fn-seg[data-part="note"]      { --part: #5F4F82; }
body[data-dark] .fn-seg[data-part="subject"]   { --part: #E8734A; }
body[data-dark] .fn-seg[data-part="timepoint"] { --part: #8AA894; }
body[data-dark] .fn-seg[data-part="date"]      { --part: #D0A85A; }
body[data-dark] .fn-seg[data-part="note"]      { --part: #B0A0D8; }

/* tables on guide pages */
.fn-table th[scope="row"] { white-space: nowrap; }
.fn-table td { white-space: normal; font-family: inherit; text-align: left; }
.fn-table thead th { text-align: left; }
.fn-table code { background: none; border: none; padding: 0; font-size: 13px; }
.recog { margin-top: 20px; align-items: start; }
.recog .card { padding: 22px; }
.mini { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
.mini td { padding: 5px 0; vertical-align: top; border-bottom: 1px solid var(--border); }
.mini tr:last-child td { border-bottom: none; }
.mini td:last-child { text-align: right; color: var(--ink); white-space: nowrap; padding-left: 10px; }
.mini code { background: none; border: none; padding: 0; font-size: 12.5px; }
.mini-note { margin-top: 12px; font-size: 13px; color: var(--muted); }
.fn-pair {
  margin: 16px 0; padding: 16px 18px; background: var(--well);
  border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0;
  overflow-x: auto;
}
.fn-pair code {
  background: none; border: none; padding: 0; font-size: 14px;
  color: var(--ink); line-height: 1.9; white-space: pre;
}

/* guide index */
.guide-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 28px; }
.guide-item { text-decoration: none; display: block; }
.guide-item h3 { margin-bottom: 8px; }
.guide-item p { color: var(--body); }
.guide-item .label-mono { display: block; margin-top: 14px; color: var(--accent); }

@media (max-width: 860px) { .guide-list { grid-template-columns: 1fr; } }
.recog.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.local-callout.warn { margin-top: 22px; }

.dl-platforms { grid-template-columns: 1fr; gap: 8px; margin: 14px 0 4px; }
.dl-platforms li { font-size: 16px; }
.ck-name { margin-top: 16px !important; font-size: 14px; color: var(--muted); }
/* four dataset cards now, so let them flow rather than force three */
.datasets .grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
