/* ExerkineAtlas — design system and page styles
   Themes: light (white), mixed (dark header and footer, grey page), dark.
   Domain colours: the paper's assignment, on a validated categorical palette (light and dark steps).
   Tier colours: validated ordinal slate ramp (deep = Tier 1). */

/* ─── Fonts ─────────────────────────────────────────────────────────────── */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/Inter.woff2") format("woff2"); }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/InterTight.woff2") format("woff2"); }

/* ─── Tokens ────────────────────────────────────────────────────────────── */
:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Inter Tight", "Inter", system-ui, -apple-system, sans-serif;
  --container: 1200px;
  --gutter: clamp(18px, 4vw, 36px);
  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 22px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ink: #0E1A2B;
  --paper: #FBFAF7;

  /* light theme (default) */
  color-scheme: light;
  --bg: #FFFFFF;
  --bg-alt: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #F2F4F8;
  --border: #E2E7EE;
  --border-strong: #C9D2DE;
  --text: #0E1A2B;
  --text-2: #44536A;
  --muted: #56657C;
  --link: #1F4E8C;
  --focus: #2a78d6;
  --shadow-s: 0 1px 2px rgba(14, 26, 43, .06);
  --shadow: 0 1px 2px rgba(14, 26, 43, .05), 0 10px 30px -12px rgba(14, 26, 43, .14);
  --btn-bg: #0E1A2B;
  --btn-text: #FFFFFF;
  --btn-hover: #1D3150;

  --header-bg: rgba(255, 255, 255, .86);
  --header-text: #0E1A2B;
  --header-muted: #44536A;
  --header-border: #E2E7EE;
  --header-hover: #F2F4F8;
  --footer-bg: #F5F7FA;
  --footer-text: #0E1A2B;
  --footer-muted: #5A6880;
  --footer-border: #E2E7EE;

  /* domains follow the paper: CV pink, Met yellow, Neuro blue, MSK orange, Inflam green, Onco purple */
  --d-cv: #e87ba4; --d-met: #eda100; --d-neuro: #2a78d6; --d-msk: #eb6834; --d-inflam: #1baf7a; --d-onco: #6250d6;
  --t1: #14233D; --t2: #2E4A73; --t3: #5674A3; --t4: #8FA7CF;
  --t1-text: #FFFFFF; --t2-text: #FFFFFF; --t3-text: #FFFFFF; --t4-text: #14233D;

  --chart-grid: #E7EBF0;
  --chart-axis: #C3CCD8;
  --chart-a: #2E4A73;          /* primary series (deep slate) */
  --chart-b: #A9BEE0;          /* complementary part (light slate) */
  --chart-hover: rgba(14, 26, 43, .05);
  /* trial phases: ordinal slate ramp, light (early) to deep (phase 4); N/A neutral */
  --ph-ep1: #C9D6EA; --ph-p1: #8FA7CF; --ph-p2: #5674A3; --ph-p3: #2E4A73; --ph-p4: #14233D; --ph-na: #D9DDE3;
}

[data-theme="mixed"] {
  --bg: #EDF0F4;
  --bg-alt: #E4E8EE;
  --surface: #FFFFFF;
  --surface-2: #F3F5F8;
  --border: #DCE2EA;
  --header-bg: #0E1A2B;
  --header-text: #F4F1EA;
  --header-muted: #B5C1D3;
  --header-border: #0E1A2B;
  --header-hover: rgba(255, 255, 255, .08);
  --footer-bg: #0E1A2B;
  --footer-text: #F4F1EA;
  --footer-muted: #A7B4C8;
  --footer-border: #22324D;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A1220;
  --bg-alt: #0E1828;
  --surface: #111C2E;
  --surface-2: #172438;
  --border: #22324A;
  --border-strong: #33476A;
  --text: #E9EEF5;
  --text-2: #B7C3D6;
  --muted: #8C9BB3;
  --link: #8FB5EE;
  --focus: #5E9CEB;
  --shadow-s: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -14px rgba(0, 0, 0, .6);
  --btn-bg: #E9EEF5;
  --btn-text: #0E1A2B;
  --btn-hover: #FFFFFF;
  --header-bg: rgba(10, 18, 32, .86);
  --header-text: #E9EEF5;
  --header-muted: #B7C3D6;
  --header-border: #1A273C;
  --header-hover: rgba(255, 255, 255, .07);
  --footer-bg: #0D1626;
  --footer-text: #E9EEF5;
  --footer-muted: #96A5BC;
  --footer-border: #1F2D44;

  --d-cv: #d55181; --d-met: #c98500; --d-neuro: #3987e5; --d-msk: #d95926; --d-inflam: #199e70; --d-onco: #9085e9;
  --t1: #DCE6F5; --t2: #A9BEE0; --t3: #7895C4; --t4: #4D6A9C;
  --t1-text: #111C2E; --t2-text: #111C2E; --t3-text: #111C2E; --t4-text: #FFFFFF;

  --chart-grid: #1E2B40;
  --chart-axis: #34465F;
  --chart-a: #A9BEE0;
  --chart-b: #3E5577;
  --chart-hover: rgba(255, 255, 255, .05);
  --ph-ep1: #2D3F5C; --ph-p1: #4D6A9C; --ph-p2: #7895C4; --ph-p3: #A9BEE0; --ph-p4: #DCE6F5; --ph-na: #2A3446;
}

/* ─── Base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.6; font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); line-height: 1.12; margin: 0 0 .5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 4.1rem); font-weight: 650; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); font-weight: 620; letter-spacing: -0.03em; }
h3 { font-size: 1.25rem; font-weight: 620; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(42, 120, 214, .22); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--btn-bg); color: var(--btn-text);
  padding: 8px 14px; border-radius: var(--radius-s); text-decoration: none; transition: top .15s; }
.skip-link:focus { top: 12px; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding-inline: var(--gutter); }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.tnum { font-variant-numeric: tabular-nums; }

/* ─── Header ────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50; background: var(--header-bg); color: var(--header-text);
  border-bottom: 1px solid var(--header-border);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; flex: none; }
.brand-mark { width: 40px; height: 40px; }
.brand-word { font-family: var(--font-display); font-size: 1.32rem; letter-spacing: -0.025em; font-weight: 400; white-space: nowrap; }
.brand-word b { font-weight: 650; }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
  color: var(--header-muted); text-decoration: none; font-weight: 520; font-size: .95rem;
  padding: 8px 14px; border-radius: 999px; transition: color .15s, background-color .15s;
}
.site-nav a:hover { color: var(--header-text); background: var(--header-hover); }
.site-nav a[aria-current="page"] { color: var(--header-text); background: var(--header-hover); }
.header-tools { display: flex; align-items: center; gap: 8px; }
.theme-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; border: 1px solid var(--header-border);
  background: var(--header-hover); }
[data-theme="mixed"] .theme-switch { border-color: rgba(255, 255, 255, .14); }
.theme-switch button {
  display: grid; place-items: center; width: 32px; height: 30px; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--header-muted); transition: background-color .15s, color .15s;
}
.theme-switch button:hover { color: var(--header-text); }
.theme-switch button[aria-pressed="true"] { background: var(--header-text); color: var(--header-bg); }
[data-theme="mixed"] .theme-switch button[aria-pressed="true"] { color: #0E1A2B; }
[data-theme="dark"] .theme-switch button[aria-pressed="true"] { color: #0A1220; }
.theme-switch .icon { width: 17px; height: 17px; }
.menu-toggle { display: none; border: 0; background: transparent; color: var(--header-text); width: 40px; height: 40px;
  border-radius: 10px; cursor: pointer; place-items: center; }
.menu-toggle:hover { background: var(--header-hover); }

/* ─── Footer ────────────────────────────────────────────────────────────── */
.site-footer { background: var(--footer-bg); color: var(--footer-text); border-top: 1px solid var(--footer-border); margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.15fr 1.6fr .8fr .8fr; gap: 40px; padding-block: 56px 36px; }
.site-footer h2 { font-family: var(--font-sans); font-size: .78rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase;
  color: var(--footer-muted); margin: 4px 0 14px; }
.site-footer p { color: var(--footer-muted); font-size: .9rem; line-height: 1.55; margin: 0 0 .5em; }
.footer-brand .brand { margin-bottom: 14px; color: var(--footer-text); }
.footer-cite .cite-authors { color: var(--footer-text); font-weight: 560; }
.footer-cite .cite-title { color: var(--footer-text); }
.footer-cite em { color: var(--footer-text); }
.cite-doi { font-variant-numeric: tabular-nums; }
.site-footer a { color: var(--footer-text); }
.footer-links { display: flex; flex-direction: column; gap: 8px; font-size: .92rem; }
.footer-links a { text-decoration: none; color: var(--footer-muted); width: fit-content; }
.footer-links a:hover { color: var(--footer-text); text-decoration: underline; }
.footer-note { color: var(--footer-muted); font-size: .82rem; margin-top: 6px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 18px 26px;
  border-top: 1px solid var(--footer-border); color: var(--footer-muted); font-size: .82rem; }

/* ─── Shared components ─────────────────────────────────────────────────── */
.section { padding-block: clamp(56px, 8vw, 104px); }
.section.alt { background: var(--bg-alt); }
.section-head { max-width: 760px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head p { color: var(--text-2); font-size: 1.08rem; }
.eyebrow { display: block; font-size: .78rem; font-weight: 650; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.lede { font-size: clamp(1.08rem, 1.6vw, 1.25rem); color: var(--text-2); line-height: 1.6; }

.btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; border-radius: 999px; font-weight: 600;
  font-size: .98rem; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: all .18s var(--ease); line-height: 1.2; }
.btn .icon { width: 18px; height: 18px; transition: transform .18s var(--ease); }
.btn:hover .icon { transform: translateX(3px); }
.btn-primary { background: var(--btn-bg); color: var(--btn-text); }
.btn-primary:hover { background: var(--btn-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-small { padding: 7px 14px; font-size: .88rem; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-s); }

.tier-badge { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 26px; height: 24px;
  padding: 0 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
  font-variant-numeric: tabular-nums; }
.tier-badge.t1 { background: var(--t1); color: var(--t1-text); }
.tier-badge.t2 { background: var(--t2); color: var(--t2-text); }
.tier-badge.t3 { background: var(--t3); color: var(--t3-text); }
.tier-badge.t4 { background: var(--t4); color: var(--t4-text); }
.tier-badge.inv { box-shadow: inset 0 0 0 2px var(--surface), 0 0 0 1.5px var(--t4); }
.tier-badge.large { height: 30px; padding: 0 12px; font-size: .85rem; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.d-cv { --dc: var(--d-cv); } .d-met { --dc: var(--d-met); } .d-neuro { --dc: var(--d-neuro); }
.d-msk { --dc: var(--d-msk); } .d-inflam { --dc: var(--d-inflam); } .d-onco { --dc: var(--d-onco); }
.dot { background: var(--dc); }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .86rem; font-weight: 540;
  text-decoration: none; white-space: nowrap; line-height: 1.3; }
a.chip:hover { border-color: var(--dc, var(--border-strong)); }
.chip.soft { background: var(--surface-2); }
.chip .muted { color: var(--muted); font-weight: 450; }

.tag-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2);
  font-size: .76rem; font-weight: 600; letter-spacing: .02em; }

/* ─── Home ──────────────────────────────────────────────────────────────── */
.hero { padding-block: clamp(48px, 7vw, 96px) clamp(40px, 6vw, 72px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero h1 { margin-bottom: 18px; }
.hero h1 .soft { display: block; font-weight: 380; color: var(--text-2); font-size: .62em; letter-spacing: -0.025em; margin-top: .25em; }
.hero .lede { max-width: 620px; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }
.hero-cite { display: inline-flex; align-items: flex-start; gap: 12px; line-height: 1.5; padding: 10px 16px 10px 12px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface); font-size: .88rem; color: var(--text-2); max-width: 600px; }
.hero-cite .icon { color: var(--muted); width: 22px; height: 22px; }
.hero-cite em { color: var(--text); }
.hero-cite .cite-link { display: block; margin-top: 6px; font-weight: 600; text-decoration: none; }
.hero-cite .cite-link:hover { text-decoration: underline; }
.hero-visual { position: relative; aspect-ratio: 1; max-width: 520px; width: 100%; justify-self: center; }
.hero-visual svg { width: 100%; height: 100%; overflow: visible; }
.hero-visual .ring { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s var(--ease) forwards;
  animation-delay: calc(var(--i) * 0.12s + .15s); }
.hero-visual .core { transform-origin: 29.2px 29.5px; transform: scale(.4); opacity: 0; animation: pop .9s var(--ease) .1s forwards; }
.hero-visual .runner { opacity: 0; animation: fade .8s var(--ease) .75s forwards; }
@keyframes draw { 99% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; stroke-dasharray: none; } }
@keyframes pop { to { transform: scale(1); opacity: 1; } }
@keyframes fade { to { opacity: 1; } }

.stats-strip { display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat { padding: 22px 18px 20px; border-left: 1px solid var(--border); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat-value { display: block; font-family: var(--font-display); font-size: clamp(1.7rem, 2.6vw, 2.3rem); font-weight: 620;
  letter-spacing: -0.03em; line-height: 1.05; color: var(--text); }
.stat-label { display: block; margin-top: 6px; font-size: .84rem; color: var(--muted); line-height: 1.35; }
.stats-note { margin-top: 12px; font-size: .82rem; color: var(--muted); }

/* atlas map (Figure 1) */
.atlas { overflow-x: auto; }
.atlas-grid { display: grid; grid-template-columns: 150px repeat(6, minmax(120px, 1fr)); min-width: 920px;
  border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.atlas-head { padding: 16px 14px 14px; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); position: relative; }
.atlas-head::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--dc); }
.atlas-head strong { display: block; font-family: var(--font-display); font-size: .98rem; font-weight: 620; letter-spacing: -0.01em; }
.atlas-head span { display: block; font-size: .76rem; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.atlas-corner { border-bottom: 1px solid var(--border); padding: 16px 14px; font-size: .76rem; color: var(--muted);
  display: flex; align-items: flex-end; }
.atlas-tier { padding: 16px 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.atlas-tier strong { font-family: var(--font-display); font-size: .95rem; font-weight: 620; line-height: 1.25; }
.atlas-tier:first-of-type { border-top: 0; }
.atlas-tier small { font-size: .76rem; color: var(--muted); line-height: 1.3; }
.atlas-cell { padding: 12px 10px; border-left: 1px solid var(--border); border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; min-height: 76px; transition: background-color .2s; }
.atlas-cell.row1 { border-top: 0; }
.atlas-cell.empty::after { content: "—"; color: var(--border-strong); font-size: .9rem; padding: 4px; }
.ex-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .84rem; font-weight: 560;
  text-decoration: none; transition: transform .15s var(--ease), border-color .15s, box-shadow .15s; white-space: nowrap; }
.ex-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dc, var(--muted)); flex: none; }
.ex-chip:hover, .ex-chip:focus-visible { border-color: var(--dc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dc) 18%, transparent); transform: translateY(-1px); }
.ex-chip.target::after { content: "t"; font-size: .7rem; font-weight: 700; color: var(--muted); margin-left: -2px; }
.atlas-grid.dim .ex-chip:not(.on) { opacity: .28; }
.atlas-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; font-size: .84rem; color: var(--muted); }

.atlas-list { display: none; }
.atlas-list details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 10px; overflow: hidden; }
.atlas-list summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  font-family: var(--font-display); font-weight: 620; }
.atlas-list summary::-webkit-details-marker { display: none; }
.atlas-list summary .count { margin-left: auto; color: var(--muted); font-family: var(--font-sans); font-size: .85rem; font-weight: 500; }
.atlas-list .tier-row { display: flex; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--border); align-items: flex-start; }
.atlas-list .tier-row .chips { display: flex; flex-wrap: wrap; gap: 6px; }

.tier-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tier-card { padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.tier-card h3 { margin: 4px 0 0; font-size: 1.12rem; }
.tier-card p { color: var(--text-2); font-size: .92rem; margin: 0; }
.tier-card .count { font-family: var(--font-display); font-size: 2.2rem; font-weight: 620; letter-spacing: -0.03em; line-height: 1; margin-top: auto; padding-top: 10px; }
.tier-card .count small { font-family: var(--font-sans); font-size: .82rem; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.tier-meter { display: flex; gap: 3px; }
.tier-meter span { height: 6px; flex: 1; border-radius: 3px; background: var(--surface-2); }
.tier-meter span.on { background: var(--t2); }
[data-theme="dark"] .tier-meter span.on { background: var(--t2); }

.biomarkers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.biomarker { display: flex; gap: 16px; padding: 18px 20px; align-items: flex-start; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s var(--ease); }
.biomarker:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.biomarker .name { font-family: var(--font-display); font-weight: 650; font-size: 1.05rem; min-width: 104px; display: flex; align-items: center; gap: 8px; }
.biomarker p { margin: 0; color: var(--text-2); font-size: .94rem; }
.domain-card { flex-direction: column; gap: 6px; border-left: 4px solid var(--dc); }
.domain-card .more { font-size: .84rem; color: var(--muted); font-weight: 550; margin-top: 4px; }
.domain-card:hover .more { color: var(--text); }

.quote { max-width: 860px; margin: 0 auto; text-align: center; }
.quote p { font-family: var(--font-display); font-size: clamp(1.35rem, 2.6vw, 2rem); line-height: 1.35; letter-spacing: -0.02em; font-weight: 450; color: var(--text); }
.quote .actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* ─── Page heads ────────────────────────────────────────────────────────── */
.page-head { padding-block: clamp(40px, 6vw, 72px) clamp(24px, 3vw, 36px); }
.page-head h1 { font-size: clamp(2.1rem, 4.4vw, 3.3rem); margin-bottom: 14px; }
.page-head .lede { max-width: 760px; margin: 0; }

/* ─── Explore ───────────────────────────────────────────────────────────── */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; padding: 14px; margin-bottom: 18px; position: sticky; top: 76px; z-index: 5; }
.search { position: relative; flex: 1 1 260px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.search input { width: 100%; height: 42px; padding: 0 14px 0 40px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: .95rem; }
.search input::placeholder { color: var(--muted); }
.seg { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: .86rem; font-weight: 600; white-space: nowrap;
  padding: 7px 12px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-s); }
[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--border-strong); }
.seg .icon { width: 16px; height: 16px; }
.domain-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.domain-filters button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 10px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit;
  font-size: .85rem; font-weight: 560; cursor: pointer; }
.domain-filters button::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--dc, var(--muted)); }
.domain-filters button[aria-pressed="true"] { border-color: var(--dc); color: var(--text); background: color-mix(in srgb, var(--dc) 12%, var(--surface)); }
.result-count { margin-left: auto; color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }

.legend-row { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: .84rem; margin: 0 0 14px; }
.legend-row .sym { font-weight: 700; color: var(--text); margin-right: 4px; }

.matrix-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-s); }
table.matrix { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 860px; }
.matrix th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: .76rem; font-weight: 650;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.matrix th button { all: unset; display: flex; align-items: center; gap: 6px; padding: 12px 14px; cursor: pointer; width: 100%; box-sizing: border-box; }
.matrix th button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.matrix th.dom button { justify-content: center; }
.matrix th .dot { width: 8px; height: 8px; }
.matrix th[aria-sort] button::after { content: "↕"; opacity: .35; font-size: .9em; }
.matrix th[aria-sort="ascending"] button::after { content: "↑"; opacity: .9; }
.matrix th[aria-sort="descending"] button::after { content: "↓"; opacity: .9; }
.matrix td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.matrix tbody tr { transition: background-color .12s; }
.matrix tbody tr:hover { background: var(--chart-hover); }
.matrix tbody tr:last-child td { border-bottom: 0; }
.matrix .name a { font-weight: 650; color: var(--text); text-decoration: none; font-family: var(--font-display); font-size: 1rem; }
.matrix .name a:hover { text-decoration: underline; }
.matrix .name small { display: block; color: var(--muted); font-size: .8rem; margin-top: 1px; max-width: 280px; }
.matrix .tissue { color: var(--text-2); max-width: 240px; }
.matrix td.dom { text-align: center; width: 72px; font-size: 1.05rem; }
.score { color: var(--dc); font-weight: 700; }
.score.none { color: var(--border-strong); font-weight: 400; }
.score sup { font-size: .62em; color: var(--muted); font-weight: 700; margin-left: 1px; }

.cards { display: none; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ex-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; text-decoration: none; color: inherit;
  border-top: 4px solid var(--dc); transition: transform .15s var(--ease), box-shadow .15s; }
.ex-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ex-card .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ex-card h3 { margin: 0; font-size: 1.2rem; }
.ex-card .full { color: var(--text-2); font-size: .9rem; margin: 0; }
.ex-card .meta { color: var(--muted); font-size: .82rem; margin: 0; }
.ex-card .doms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.view-cards .cards { display: grid; }
.view-cards .matrix-wrap, .view-cards .legend-row { display: none; }
.empty-state { display: none; padding: 40px; text-align: center; color: var(--muted); }
.empty-state.show { display: block; }

/* ─── Exerkine detail ───────────────────────────────────────────────────── */
.crumbs { display: flex; gap: 8px; align-items: center; font-size: .86rem; color: var(--muted); margin-bottom: 18px; flex-wrap: wrap; }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.ex-hero { padding-block: clamp(32px, 5vw, 56px) clamp(24px, 3vw, 36px); border-bottom: 1px solid var(--border); position: relative; }
.ex-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--dc); }
.ex-title { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.ex-title h1 { margin: 0; font-size: clamp(2.6rem, 6vw, 4.6rem); }
.ex-full { font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: var(--text-2); margin: 0 0 20px; }
.ex-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ex-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); padding-block: 40px 72px; }
.toc { position: sticky; top: 92px; align-self: start; display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.toc .label { font-size: .74rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.toc a { color: var(--text-2); text-decoration: none; padding: 6px 12px; border-left: 2px solid var(--border); }
.toc a:hover, .toc a.active { color: var(--text); border-left-color: var(--dc); }
.meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-bottom: 32px; }
.meta-item { padding: 16px 18px; border-left: 1px solid var(--border); }
.meta-item:first-child { border-left: 0; }
.meta-item dt { font-size: .74rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.meta-item dd { margin: 0; font-size: .95rem; color: var(--text); }
.block { margin-bottom: 44px; scroll-margin-top: 92px; }
.block > h2 { font-size: 1.55rem; margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
.prose { color: var(--text); font-size: 1.02rem; line-height: 1.72; max-width: 760px; }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: .55em; }
.prose li::marker { color: var(--dc); }
.prose a { color: var(--link); font-size: .82em; font-weight: 600; text-decoration: none; white-space: nowrap;
  padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.prose a:hover { text-decoration: underline; }
.prose .pmids { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: 1px; margin-left: 2px; }
.prose .pmids a { font-size: .74rem; padding: 1px 6px; }
.prose strong { font-weight: 650; }
.note { color: var(--muted); font-size: .92rem; }

.evidence { padding: 22px; }
.ev-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-bottom: 22px; }
.ev-tile { padding: 4px 16px; border-left: 1px solid var(--border); }
.ev-tile:first-child { border-left: 0; padding-left: 0; }
.ev-tile .v { font-family: var(--font-display); font-size: 1.75rem; font-weight: 620; letter-spacing: -0.03em; line-height: 1.1; display: block; }
.ev-tile .l { font-size: .8rem; color: var(--muted); display: block; margin-top: 4px; line-height: 1.35; }
.ev-tile .rank { font-size: .76rem; color: var(--text-2); display: block; margin-top: 4px; }
.bar-label { display: flex; justify-content: space-between; font-size: .84rem; color: var(--text-2); margin-bottom: 8px; gap: 12px; }
.bar-label strong { color: var(--text); font-weight: 600; }
.stackbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; background: var(--surface); margin-bottom: 10px; }
.stackbar span { display: block; height: 100%; }
.stackbar span:first-child { border-radius: 7px 0 0 7px; }
.stackbar span:last-child { border-radius: 0 7px 7px 0; }
.ratio-bar { height: 14px; border-radius: 7px; background: var(--chart-b); overflow: hidden; margin-bottom: 10px; }
.ratio-bar span { display: block; height: 100%; background: var(--chart-a); border-radius: 7px 0 0 7px; }
.key { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--text-2); }
.key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ev-row { margin-bottom: 18px; }
.ph-ep1 { background: var(--ph-ep1); } .ph-p1 { background: var(--ph-p1); } .ph-p2 { background: var(--ph-p2); }
.ph-p3 { background: var(--ph-p3); } .ph-p4 { background: var(--ph-p4); } .ph-na { background: var(--ph-na); }
.c-a { background: var(--chart-a); } .c-b { background: var(--chart-b); }

.refs { display: flex; flex-wrap: wrap; gap: 6px; }
.refs a { font-size: .82rem; font-weight: 600; font-variant-numeric: tabular-nums; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); text-decoration: none; }
.refs a:hover { border-color: var(--dc); color: var(--text); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
.pager a { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; text-decoration: none; color: var(--text); }
.pager a:hover { border-color: var(--border-strong); }
.pager .next { text-align: right; align-items: flex-end; }
.pager small { color: var(--muted); font-size: .8rem; display: inline-flex; align-items: center; gap: 6px; }
.pager strong { font-family: var(--font-display); font-size: 1.1rem; }
.related { display: flex; flex-wrap: wrap; gap: 6px; }

/* ─── Dashboard ─────────────────────────────────────────────────────────── */
.dash-filters { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; padding: 14px; margin-bottom: 22px; position: sticky; top: 76px; z-index: 5; }
.dash-filters label { font-size: .82rem; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.select { max-width: 280px; height: 38px; padding: 0 34px 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font: inherit; font-size: .9rem; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.tile { padding: 20px; }
.tile .v { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 620; letter-spacing: -0.03em; line-height: 1.05; display: block; }
.tile .l { display: block; font-size: .86rem; color: var(--text-2); margin-top: 6px; font-weight: 550; }
.tile .s { display: block; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.chart-card { padding: 22px 22px 16px; display: flex; flex-direction: column; min-width: 0; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-card h2 { font-size: 1.18rem; margin-bottom: 6px; letter-spacing: -0.015em; }
.chart-card .desc { color: var(--text-2); font-size: .9rem; margin-bottom: 14px; max-width: 720px; }
.chart-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--text-2); font-family: var(--font-sans); font-size: 12px; }
.chart .axis-label { fill: var(--muted); font-size: 11.5px; }
.chart .grid line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .baseline { stroke: var(--chart-axis); stroke-width: 1; }
.chart .row-hit { fill: transparent; cursor: pointer; }
.chart .row:hover .row-hit, .chart .row.hl .row-hit { fill: var(--chart-hover); }
.chart .lbl { fill: var(--text); font-weight: 550; }
.chart .val { fill: var(--text-2); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.chart .pt { stroke: var(--surface); stroke-width: 2; cursor: pointer; transition: r .12s; }
.chart .pt:hover { stroke: var(--text); }
.chart .pt-label { fill: var(--text-2); font-size: 11px; font-weight: 550; pointer-events: none; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--text-2); margin-top: 10px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-legend i.round { border-radius: 50%; }
.tooltip { position: fixed; z-index: 60; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 10px 12px; font-size: .82rem; box-shadow: var(--shadow); min-width: 160px; max-width: 280px;
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.tooltip.show { opacity: 1; transform: none; }
.tooltip strong { font-family: var(--font-display); font-size: .98rem; display: block; margin-bottom: 4px; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tooltip .tt-row b { color: var(--text); font-weight: 600; }
details.data-view { margin-top: 12px; font-size: .86rem; }
details.data-view summary { cursor: pointer; color: var(--muted); font-weight: 600; width: fit-content; }
details.data-view table { width: 100%; border-collapse: collapse; margin-top: 10px; font-variant-numeric: tabular-nums; }
details.data-view th, details.data-view td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
details.data-view th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
details.data-view .scroll { max-height: 320px; overflow: auto; }

/* ─── About ─────────────────────────────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); padding-block: 24px 80px; }
.about-grid > div, .ex-layout > article { min-width: 0; }
.about-section { margin-bottom: 56px; scroll-margin-top: 92px; }
.about-section > h2 { font-size: 1.7rem; }
.about-section .prose p { margin-bottom: 1em; }
.steps { counter-reset: step; display: grid; gap: 14px; margin: 18px 0; padding: 0; list-style: none; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 16px 18px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); font-weight: 700; font-family: var(--font-display); color: var(--text); }
.steps h3 { font-size: 1.02rem; margin: 4px 0 4px; }
.steps p { margin: 0; color: var(--text-2); font-size: .95rem; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 16px 0; }
.person { padding: 16px 18px; }
.person strong { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.person span { font-size: .86rem; color: var(--text-2); }
.cite-box { padding: 20px; margin: 16px 0; }
.cite-box .text { font-size: .98rem; line-height: 1.6; margin-bottom: 14px; }
.cite-box pre { margin: 0; padding: 14px 16px; border-radius: var(--radius-s); background: var(--surface-2); color: var(--text);
  font-size: .82rem; line-height: 1.55; overflow-x: auto; }
.cite-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.downloads { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; }
.download { display: flex; gap: 12px; align-items: center; padding: 16px; text-decoration: none; color: var(--text); }
.download:hover { border-color: var(--border-strong); }
.download .icon { color: var(--muted); }
.download small { display: block; color: var(--muted); font-size: .8rem; }

.center-page { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 80px 0; }
.center-page img { width: 140px; height: 140px; margin: 0 auto 22px; }

/* ─── Reveal on scroll ──────────────────────────────────────────────────── */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-strip { grid-template-columns: repeat(3, 1fr); }
  .stat:nth-child(4) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n+4) { border-top: 1px solid var(--border); }
  .tier-cards { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .charts { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .menu-toggle { display: grid; }
  .site-nav { position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 2px; padding: 10px var(--gutter) 16px;
    background: var(--header-bg); border-bottom: 1px solid var(--header-border); display: none; margin: 0;
    -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); }
  [data-theme="mixed"] .site-nav { background: #0E1A2B; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 14px; border-radius: 10px; font-size: 1rem; }
  .header-tools { margin-left: auto; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 340px; order: -1; }
  .atlas-grid { display: none; }
  .atlas-list { display: block; }
  .atlas-legend { display: none; }
  .biomarkers { grid-template-columns: 1fr; }
  .ex-layout, .about-grid { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .meta-grid { grid-template-columns: 1fr; }
  .meta-item { border-left: 0; border-top: 1px solid var(--border); padding-inline: 0; }
  .meta-item:first-child { border-top: 0; }
  .ev-tiles { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
  .ev-tile:nth-child(3) { border-left: 0; padding-left: 0; }
  .toolbar, .dash-filters { position: static; }
  .cards { display: grid; }
  .matrix-wrap, .legend-row { display: none; }
  .view-toggle { display: none; }
}
@media (max-width: 600px) {
  .brand-word { font-size: 1.12rem; }
  .brand-mark { width: 34px; height: 34px; }
  .header-inner { gap: 12px; height: 62px; }
  .site-nav { top: 62px; }
  .theme-switch button { width: 28px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .stat, .stat:first-child { padding: 16px 0; border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .stat:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--border); }
  .tier-cards { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .pager { grid-template-columns: 1fr; }
  .biomarker { flex-direction: column; gap: 6px; }
  .chart-card { padding: 18px 14px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .hero-visual .ring { stroke-dashoffset: 0; stroke-dasharray: none; }
  .hero-visual .core, .hero-visual .runner { opacity: 1; transform: none; }
  .reveal { opacity: 1; transform: none; }
}
@media print {
  .site-header, .site-footer, .toolbar, .dash-filters, .toc, .theme-switch { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ─── Chart fills (SVG marks take `fill`, legend swatches take `background`) ─ */
.chart .c-a { fill: var(--chart-a); } .chart .c-b { fill: var(--chart-b); }
.chart .ph-ep1 { fill: var(--ph-ep1); } .chart .ph-p1 { fill: var(--ph-p1); } .chart .ph-p2 { fill: var(--ph-p2); }
.chart .ph-p3 { fill: var(--ph-p3); } .chart .ph-p4 { fill: var(--ph-p4); } .chart .ph-na { fill: var(--ph-na); }
.chart .stem { stroke: var(--chart-b); stroke-width: 2; stroke-linecap: round; }
.tier-1 { background: var(--t1); } .tier-2 { background: var(--t2); } .tier-3 { background: var(--t3); } .tier-4 { background: var(--t4); }
.chart .tier-1 { fill: var(--t1); } .chart .tier-2 { fill: var(--t2); } .chart .tier-3 { fill: var(--t3); } .chart .tier-4 { fill: var(--t4); }
.chart a.row:focus-visible { outline: none; }
.chart a.row:focus-visible .row-hit { fill: var(--chart-hover); stroke: var(--focus); stroke-width: 1.5; }
