/* G-MEGC Atlas — stylesheet
   Tokens first; components below. No framework, no build step. */

:root {
  color-scheme: light;
  --ground: #EEF2F0;      /* mineral: page background */
  --paper: #FFFFFF;       /* surfaces: tables, spec sheets */
  --ink: #17262D;         /* primary text, header band */
  --slate: #46565C;       /* secondary text (7.1:1 on paper) */
  --rule: #CFD9D5;        /* dividers and borders */
  --tint: #E2EAE7;        /* table headers, quiet fills */
  --teal: #0B5C58;        /* links, primary actions, blood+tissue group */
  --teal-ink: #FFFFFF;
  --ochre: #8A5A12;       /* tissue-only group */
  --gc: #1D4E89;
  --eac: #B4530A;
  --escc: #2F7D4F;
  --ok: #2F6B3F;
  --warn: #8A5A12;
  --need: #8C2F39;
  --focus: #2F6FDB;

  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Source Serif 4", Georgia, "Times New Roman", serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 2rem;
  --step-4: 2.75rem;
  --step-5: clamp(2.4rem, 4.6vw, 3.75rem);

  --wrap: 1200px;
  --measure: 68ch;
  --gap: clamp(1rem, 2.5vw, 2rem);
  --section: clamp(3.5rem, 8vw, 6.5rem);
  --radius-s: 4px;
  --radius-m: 8px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0F1A1E; --paper: #16252B; --ink: #E7EEEC; --slate: #A9B8BC;
    --rule: #2C3E44; --tint: #1D2F35; --teal: #6CC4BA; --teal-ink: #0F1A1E;
    --ochre: #E0AE62; --gc: #7FA8E0; --eac: #F0A15C; --escc: #74C493;
    --ok: #8FD0A0; --warn: #E0AE62; --need: #F09AA3; --focus: #8DB4FF;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0F1A1E; --paper: #16252B; --ink: #E7EEEC; --slate: #A9B8BC;
  --rule: #2C3E44; --tint: #1D2F35; --teal: #6CC4BA; --teal-ink: #0F1A1E;
  --ochre: #E0AE62; --gc: #7FA8E0; --eac: #F0A15C; --escc: #74C493;
  --ok: #8FD0A0; --warn: #E0AE62; --need: #F09AA3; --focus: #8DB4FF;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 400 var(--step-0)/1.65 var(--f-body);
  font-variant-numeric: tabular-nums;
}
img, svg { max-width: 100%; }
a { color: var(--teal); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
main:focus { outline: none; }
.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: .75rem 1rem; z-index: 50; }
.skip:focus { left: 1rem; top: 1rem; }

h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.12; margin: 0; color: var(--ink); font-weight: 700; }
h1 { font-size: var(--step-5); font-weight: 800; font-stretch: 112%; letter-spacing: -0.015em; }
h2 { font-size: var(--step-4); font-weight: 780; font-stretch: 108%; letter-spacing: -0.01em; }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p { margin: 0; max-width: var(--measure); }
.lede { font-size: var(--step-1); color: var(--slate); }
.small { font-size: var(--step--1); color: var(--slate); }
.ui { font-family: var(--f-display); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gap); }
.section { padding: var(--section) 0; }
.section + .section { border-top: 1px solid var(--rule); }
.stack > * + * { margin-top: 1rem; }
.stack-l > * + * { margin-top: 2rem; }

/* Header */
.site-header { background: var(--ink); color: var(--ground); position: sticky; top: 0; z-index: 20; }
@media (max-width: 760px) { .site-header { position: static; } .spectrum-key span:last-child { display: none; } }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding-block: .75rem; }
.brand { display: flex; align-items: center; gap: .75rem; color: inherit; text-decoration: none; font-family: var(--f-display); max-width: 28rem; }
.brand-name { font-weight: 800; font-size: 1.25rem; font-stretch: 112%; display: block; line-height: 1.1; }
.brand-sub { font-size: .8rem; opacity: .82; display: block; line-height: 1.3; margin-top: .15rem; }
.nav { display: flex; flex-wrap: wrap; gap: .25rem; font-family: var(--f-display); }
.nav a { color: inherit; text-decoration: none; padding: .7rem .8rem; min-height: 44px; display: inline-flex; align-items: center; border-bottom: 2px solid transparent; opacity: .86; }
.nav a:hover { opacity: 1; }
.nav a[aria-current="page"] { opacity: 1; font-weight: 650; border-bottom-color: currentColor; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-header { background: #0A1316; color: var(--ink); } }
:root[data-theme="dark"] .site-header { background: #0A1316; color: var(--ink); }
.status-bar { background: var(--tint); font: 500 var(--step--1)/1.4 var(--f-display); color: var(--slate); }
.status-bar .wrap { padding-block: .55rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 1.25rem; border-radius: var(--radius-s); font: 650 1rem/1 var(--f-display); text-decoration: none; border: 1.5px solid var(--teal); }
.btn-primary { background: var(--teal); color: var(--teal-ink); }
.btn-quiet { color: var(--teal); background: transparent; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Hero + spectrum navigator (the one bold element) */
.hero { padding: clamp(3rem, 7vw, 5.5rem) 0 0; }
.hero h1 { max-width: 21ch; }
.hero .lede { margin-top: 1.5rem; }
.hero .btn-row { margin-top: 2rem; }
.spectrum { margin-top: clamp(2.5rem, 6vw, 4rem); position: relative; }
.spectrum svg { display: block; width: 100%; height: auto; overflow: visible; }
.spectrum .axis { stroke: var(--ink); stroke-width: 1.5; }
.spectrum .tick { stroke: var(--rule); stroke-width: 1; }
.spectrum .noise { stroke: var(--rule); stroke-width: 2; stroke-linecap: round; }
.spectrum a .peak { stroke-width: 6; stroke-linecap: round; transition: stroke-width .15s ease; }
.spectrum a.both .peak { stroke: var(--teal); }
.spectrum a.tissue .peak { stroke: var(--ochre); }
.spectrum a text { font: 600 13px var(--f-display); fill: var(--ink); }
.spectrum a .plat { font-weight: 400; fill: var(--slate); font-size: 11.5px; }
.spectrum a:hover .peak, .spectrum a:focus-visible .peak { stroke-width: 10; }
.spectrum a:focus-visible { outline: none; }
.spectrum a:focus-visible text { text-decoration: underline; }
.spectrum-key { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: 1rem; font: 500 var(--step--1) var(--f-display); color: var(--slate); }
.key-dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; margin-right: .4rem; vertical-align: -1px; }
.spectrum-list { display: none; }
@media (max-width: 760px) {
  .spectrum svg { display: none; }
  .spectrum-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
  .spectrum-list a { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); font-family: var(--f-display); min-height: 44px; }
  .spectrum-list .plat { color: var(--slate); font-size: var(--step--1); text-align: right; }
}

/* Cancer trio */
.trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--gap); margin-top: 2.5rem; }
.cancer { border-top: 6px solid var(--c); padding-top: 1.25rem; }
.cancer .code { font: 700 var(--step--1) var(--f-display); color: var(--c); }
.cancer h3 { margin-top: .25rem; }
.cancer p { margin-top: .75rem; }
.cancer .partners { font-size: var(--step--1); color: var(--slate); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; align-items: flex-end; padding: 1.25rem 0; border-block: 1px solid var(--rule); margin-top: 2rem; }
.filter-group { border: 0; padding: 0; margin: 0; }
.filter-group legend { font: 600 var(--step--1) var(--f-display); color: var(--slate); margin-bottom: .5rem; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { min-height: 44px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); font: 500 .95rem var(--f-display); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); font-weight: 650; }
.count { margin-left: auto; font: 500 var(--step--1) var(--f-display); color: var(--slate); }

/* Tables */
.table-box { overflow-x: auto; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-m); margin-top: 1.5rem; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .85rem 1rem; vertical-align: top; }
thead th { background: var(--tint); font: 650 var(--step--1) var(--f-display); color: var(--ink); white-space: nowrap; }
tbody tr + tr td, tbody tr + tr th { border-top: 1px solid var(--rule); }
tbody th { font-family: var(--f-display); font-weight: 650; }
td.num { font-family: var(--f-display); white-space: nowrap; }
.empty { padding: 1.5rem 1rem; color: var(--slate); }
.tag { display: inline-block; font: 650 .75rem/1 var(--f-display); padding: .35rem .5rem; border-radius: var(--radius-s); margin: 0 .25rem .25rem 0; white-space: nowrap; }
.tag-gc { background: var(--gc); color: #fff; } .tag-eac { background: var(--eac); color: #fff; } .tag-escc { background: var(--escc); color: #fff; }
.tag-matrix { background: var(--tint); color: var(--ink); }
:root[data-theme="dark"] .tag-gc, :root[data-theme="dark"] .tag-eac, :root[data-theme="dark"] .tag-escc { color: #0F1A1E; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag-gc, :root:not([data-theme="light"]) .tag-eac, :root:not([data-theme="light"]) .tag-escc { color: #0F1A1E; } }

/* Status */
.status { display: inline-flex; align-items: center; gap: .45rem; font: 600 var(--step--1) var(--f-display); white-space: nowrap; }
.status::before { content: ""; width: .65rem; height: .65rem; border-radius: 50%; background: currentColor; }
.status-operational { color: var(--ok); } .status-validation { color: var(--warn); } .status-budget { color: var(--need); }
.legend { display: flex; flex-wrap: wrap; gap: .75rem 2rem; margin-top: 1.5rem; }
.legend div { max-width: 32ch; }
.legend p { font-size: var(--step--1); color: var(--slate); margin-top: .2rem; }

/* Preliminary figures */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); margin-top: 2.5rem; }
.figure { border-top: 2px solid var(--ink); padding-top: 1rem; }
.figure .v { font: 800 var(--step-4)/1 var(--f-display); font-stretch: 110%; display: block; margin-bottom: .6rem; }
.figure p { color: var(--slate); }

/* Assay hub */
.group { margin-top: 3rem; }
.group-head { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: baseline; border-bottom: 2px solid var(--g); padding-bottom: .75rem; }
.group-head p { color: var(--slate); font-size: var(--step--1); max-width: 60ch; }
.assay-rows { list-style: none; margin: 0; padding: 0; }
.assay-row { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.5fr) 8.5rem 15rem; gap: .5rem 1.5rem; align-items: baseline; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.assay-row h3 { font-size: var(--step-1); }
.assay-row h3 a { color: var(--ink); text-decoration: none; }
.assay-row h3 a:hover { text-decoration: underline; }
.assay-row .plat { font-family: var(--f-display); color: var(--slate); font-size: .95rem; }
.assay-row .sum { grid-column: 1 / -1; color: var(--slate); font-size: .98rem; }
@media (max-width: 760px) { .assay-row { grid-template-columns: 1fr; } }

.matrix td, .matrix th { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.dot { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; background: var(--teal); }
.dot-t { background: var(--ochre); }

/* Assay detail */
.crumbs { font: 500 var(--step--1) var(--f-display); color: var(--slate); }
.crumbs a { color: var(--slate); }
.assay-head { padding: clamp(2.5rem, 6vw, 4rem) 0 2rem; border-bottom: 1px solid var(--rule); }
.assay-head h1 { font-size: clamp(2.2rem, 4.4vw, 3.5rem); max-width: 20ch; margin-top: 1rem; }
.assay-head .platform { font: 600 var(--step-1) var(--f-display); color: var(--g); margin-top: .75rem; }
.assay-head .meta { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; margin-top: 1rem; }
.assay-head .lede { margin-top: 1.25rem; }
.assay-body { display: flex; flex-wrap: wrap; gap: clamp(2rem, 5vw, 4rem); padding: 3rem 0 var(--section); }
.assay-main { flex: 999 1 520px; min-width: 0; }
.assay-aside { flex: 1 1 300px; min-width: 0; }
.assay-main h2 { font-size: var(--step-2); margin-top: 2.75rem; }
.assay-main h2:first-child { margin-top: 0; }
.assay-main h2 + * { margin-top: 1rem; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 1rem 0 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 1.25rem 3rem; max-width: var(--measure); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: .05rem; width: 2rem; height: 2rem; border-radius: 50%; border: 1.5px solid var(--g); color: var(--g); font: 700 .9rem/1.9rem var(--f-display); text-align: center; }
.steps li::after { content: ""; position: absolute; left: 1rem; top: 2.3rem; bottom: .2rem; width: 1px; background: var(--rule); }
.steps li:last-child::after { display: none; }
.steps b { font-family: var(--f-display); display: block; }
.bullets { padding-left: 1.2rem; margin: 1rem 0 0; max-width: var(--measure); }
.bullets li + li { margin-top: .4rem; }
.spec { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1.5rem; }
.spec h2 { font-size: var(--step-1); }
.spec dl { margin: 1rem 0 0; }
.spec dt { font: 650 var(--step--1) var(--f-display); color: var(--slate); margin-top: 1rem; }
.spec dd { margin: .2rem 0 0; font-size: .95rem; }
.perf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.perf .v { font: 800 var(--step-2)/1.1 var(--f-display); display: block; }
.perf span:not(.v) { font-size: var(--step--1); color: var(--slate); }
.placeholder { background: var(--tint); padding: 0 .2em; border-radius: 2px; }
.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 1.5rem; margin-top: 3rem; font-family: var(--f-display); }
.pager a { min-height: 44px; display: inline-flex; flex-direction: column; justify-content: center; text-decoration: none; }
.pager small { color: var(--slate); font-size: var(--step--1); }

/* Generic lists of people / tiers */
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--gap); margin-top: 2rem; }
.person { border-top: 1px solid var(--rule); padding-top: 1rem; }
.person h3 { font-size: var(--step-1); }
.person .org { font: 500 var(--step--1) var(--f-display); color: var(--slate); margin-top: .2rem; }
.person p { margin-top: .5rem; font-size: .98rem; }
.person.lead { border-top: 4px solid var(--teal); }
.names { columns: 2 240px; column-gap: var(--gap); padding: 0; list-style: none; margin: 1.5rem 0 0; }
.names li { break-inside: avoid; padding: .35rem 0; }
.names b { font-family: var(--f-display); font-weight: 650; }

/* Home team map */
.team-map { margin-top: 1.75rem; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-m); overflow: hidden; }
.team-map-stage { position: relative; }
.team-map svg { display: block; width: 100%; height: auto; background: #f7f8f8; }
.team-map .land { fill: #d9d9d9; stroke: #f7f8f8; stroke-width: .8; stroke-linejoin: round; }
.team-map .pin { cursor: pointer; }
.team-map .pin circle.dot { stroke: #fff; stroke-width: 2; }
.team-map .pin:hover circle.dot, .team-map .pin:focus circle.dot, .team-map .pin.is-on circle.dot { stroke: #17262D; stroke-width: 2.5; }
.team-map .pin:focus { outline: none; }
.map-legend { position: absolute; left: .85rem; bottom: .85rem; margin: 0; padding: .85rem 1.1rem; list-style: none; background: #1B2A4A; color: #fff; font: 500 1.05rem/1.2 var(--f-display); border-radius: 2px; }
.map-legend li { display: flex; align-items: center; gap: .7rem; padding: .32rem 0; }
.map-legend i { width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid #fff; display: block; flex: none; }
.map-detail { margin: 0; padding: .8rem 1rem 1rem; font: 500 var(--step--1)/1.45 var(--f-display); color: var(--slate); min-height: 2.6rem; }
.map-detail b { color: var(--ink); font-weight: 700; }
@media (max-width: 520px) {
  .map-legend { position: static; border-radius: 0; }
}

.aims { list-style: none; padding: 0; margin: 2rem 0 0; counter-reset: a; }
.aim { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 1.5rem; padding: 2rem 0; border-top: 1px solid var(--rule); }
.aim .n { font: 800 var(--step-4)/1 var(--f-display); color: var(--teal); }
.aim h3 { font-size: var(--step-2); }
.aim p { margin-top: .75rem; }
.aim .assay-links { margin-top: .75rem; font: 500 var(--step--1) var(--f-display); }
@media (max-width: 560px) { .aim { grid-template-columns: 1fr; gap: .5rem; } }

.hyp { background: var(--ink); color: var(--ground); border-radius: var(--radius-m); padding: clamp(1.5rem, 4vw, 2.5rem); }
.hyp p { font: 500 var(--step-2)/1.4 var(--f-display); max-width: 48ch; color: inherit; }
.hyp .small { color: inherit; opacity: .85; font: 400 var(--step-0)/1.6 var(--f-body); margin-top: 1rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hyp { background: var(--paper); color: var(--ink); } }
:root[data-theme="dark"] .hyp { background: var(--paper); color: var(--ink); }

.two { display: flex; flex-wrap: wrap; gap: clamp(2rem, 5vw, 4rem); }
.two > * { flex: 1 1 420px; min-width: 0; }

/* Footer */
.site-footer { background: var(--ink); color: var(--ground); font: 400 var(--step--1)/1.6 var(--f-display); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-block: 2.5rem; }
.site-footer a { color: inherit; }
.theme-toggle { background: transparent; color: inherit; border: 1px solid currentColor; border-radius: var(--radius-s); min-height: 44px; padding: 0 .9rem; font: 500 var(--step--1) var(--f-display); cursor: pointer; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-footer { background: #0A1316; color: var(--ink); } }
:root[data-theme="dark"] .site-footer { background: #0A1316; color: var(--ink); }

/* Motion: one moment only — the spectrum draws in on first load */
@media (prefers-reduced-motion: no-preference) {
  .spectrum.draw a .peak { transform-box: fill-box; transform-origin: 50% 100%; animation: rise .8s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 70ms); }
  @keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
}
@media print {
  .site-header, .site-footer, .status-bar, .filters, .spectrum { display: none; }
  body { background: #fff; }
  .spec { position: static; }
}
