/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --paper: #eef1ee;
  --surface: #f7f9f7;
  --ink: #141b18;
  --muted: #55625c;
  --rule: #cfd7d2;
  --accent: #1f3fbf;
  --accent-ink: #ffffff;
  --accent-soft: #dce3fa;
  --grid: rgba(20, 27, 24, 0.055);
  --model-low: #23389c;
  --model-high: #9fb3ff;
  --series-1: #2a5bd7;
  --series-2: #eb6834;
  --series-dim: #b9c3be;
  --map-land: #e3e8e4;
  --map-edge: #9aa6a0;
  --stop: #d03b3b;
  --target: #0c8a3c;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 74rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius-lg: 20px;
  --radius-md: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121715;
    --surface: #18201c;
    --ink: #e3e9e5;
    --muted: #95a39c;
    --rule: #2a3430;
    --accent: #8ea6ff;
    --accent-ink: #0d1430;
    --accent-soft: #1e2747;
    --grid: rgba(227, 233, 229, 0.05);
    --model-low: #3a58d6;
    --model-high: #cfd9ff;
    --series-1: #5f7ff0;
    --series-2: #d95926;
    --series-dim: #3a4641;
    --map-land: #222c27;
    --map-edge: #4a5752;
    --stop: #e66767;
    --target: #3fbf6a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121715;
  --surface: #18201c;
  --ink: #e3e9e5;
  --muted: #95a39c;
  --rule: #2a3430;
  --accent: #8ea6ff;
  --accent-ink: #0d1430;
  --accent-soft: #1e2747;
  --grid: rgba(227, 233, 229, 0.05);
  --model-low: #3a58d6;
  --model-high: #cfd9ff;
  --series-1: #5f7ff0;
  --series-2: #d95926;
  --series-dim: #3a4641;
  --map-land: #222c27;
  --map-edge: #4a5752;
  --stop: #e66767;
  --target: #3fbf6a;
  color-scheme: dark;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
strong { font-weight: 650; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--muted); }

h2 {
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  line-height: 1.05;
  font-weight: 760;
  font-variation-settings: "wdth" 118;
  letter-spacing: -0.02em;
  margin-bottom: clamp(1.75rem, 4vw, 3rem);
}
h3 {
  font-size: 1.3rem;
  line-height: 1.25;
  font-weight: 700;
  font-variation-settings: "wdth" 108;
  letter-spacing: -0.01em;
}

.skip {
  position: absolute; left: 1rem; top: -3rem; z-index: 50;
  background: var(--accent); color: var(--accent-ink);
  padding: .5rem .9rem; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 1rem; }

/* ── Buttons & links ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: .6rem 1.15rem;
  border: 1.5px solid var(--ink); border-radius: 999px;
  background: transparent; color: var(--ink);
  font: inherit; font-weight: 600; font-size: .98rem; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.text-link {
  color: var(--accent); font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .2em;
}
.text-link:hover { text-decoration-thickness: 3px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.header-row { display: flex; align-items: center; gap: 1.5rem; min-height: 3.75rem; }
.wordmark {
  font-weight: 760; font-variation-settings: "wdth" 120; letter-spacing: -0.01em;
  text-decoration: none; margin-right: auto;
}
.site-header nav { display: flex; gap: 1.4rem; }
.site-header nav a { text-decoration: none; color: var(--muted); font-weight: 550; font-size: .95rem; }
.site-header nav a:hover { color: var(--ink); }
.theme-toggle {
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem;
  border: 1px solid var(--rule); border-radius: 50%;
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--ink); }
@media (max-width: 760px) {
  .header-row { flex-wrap: wrap; row-gap: 0; }
  .site-header nav {
    order: 3; width: 100%; overflow-x: auto; gap: 1.1rem;
    padding-bottom: .6rem; scrollbar-width: none; white-space: nowrap;
  }
  .site-header nav::-webkit-scrollbar { display: none; }
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(3rem, 7vw, 5rem); }
.hero-body {
  display: grid; gap: 2rem clamp(2rem, 6vw, 5rem);
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: end;
}
@media (max-width: 820px) { .hero-body { grid-template-columns: minmax(0, 1fr); } }
.hero-side { border-left: 2px solid var(--accent); padding-left: 1.25rem; }
@media (max-width: 820px) { .hero-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 1.25rem; } }
.hero-side-h { font-size: .9rem; color: var(--muted); margin-bottom: .4rem; }
.jump-list li + li { margin-top: .2rem; }
.jump-list a {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem); font-weight: 700; font-variation-settings: "wdth" 112;
  text-decoration: none; letter-spacing: -0.01em;
}
.jump-list a:hover { color: var(--accent); }
.portrait { width: 5.5rem; height: 5.5rem; border-radius: 50%; object-fit: cover; margin-bottom: 1.5rem; }

.name {
  font-size: clamp(3.4rem, 10.5vw, 8.25rem);
  line-height: .86;
  font-weight: 820;
  font-variation-settings: "wdth" 125;
  letter-spacing: -0.035em;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}
.name span { display: block; }
.name span + span { color: var(--accent); }

@media (prefers-reduced-motion: no-preference) {
  .name span { animation: rise .9s cubic-bezier(.2, .7, .1, 1) both; }
  .name span + span { animation-delay: .12s; }
  .role, .pitch, .actions { animation: fade .8s .35s ease-out both; }
}
@keyframes rise { from { transform: translateY(.35em); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.role { font-size: 1.2rem; line-height: 1.45; margin-bottom: 1.1rem; }
.pitch { max-width: 44ch; font-size: 1.12rem; color: var(--muted); margin-bottom: 2rem; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }

/* ── 3D viewer ──────────────────────────────────────────────────────────── */
.viewer { min-width: 0; }
.viewer-stage {
  position: relative; aspect-ratio: 1 / 1;
  border: 1px solid var(--rule); border-radius: var(--radius-lg);
  background-color: var(--surface);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: center;
  overflow: hidden;
  touch-action: none;
}
.viewer-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.viewer-stage canvas:active { cursor: grabbing; }
.viewer-status {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: .95rem; color: var(--muted); text-align: center; max-width: 80%;
  pointer-events: none;
}
.viewer-stage[data-state="ready"] .viewer-status { display: none; }

.viewer figcaption { padding-top: 1rem; }
.viewer-title { font-weight: 700; font-variation-settings: "wdth" 108; font-size: 1.1rem; }
.viewer-note { font-size: .95rem; min-height: 1.5em; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .9rem; }
.chip {
  font: inherit; font-size: .88rem; font-weight: 550;
  padding: .4rem .8rem; min-height: 2.2rem;
  border: 1px solid var(--rule); border-radius: 999px;
  background: transparent; color: var(--ink); cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.viewer-hint { font-size: .85rem; margin-top: .9rem; }

/* ── Sections ───────────────────────────────────────────────────────────── */
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); border-top: 1px solid var(--rule); }
.section--quiet { background: var(--surface); }

/* Experience timeline */
.timeline { border-top: 1px solid var(--rule); }
.job {
  display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 1rem 2.5rem;
  padding-block: 2rem 2.25rem; border-bottom: 1px solid var(--rule);
}
.job-dates { color: var(--muted); font-size: .95rem; font-variant-numeric: tabular-nums; padding-top: .35rem; }
.job-company {
  font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 760;
  font-variation-settings: "wdth" 115; letter-spacing: -0.02em; line-height: 1.15;
}
.job-title { font-weight: 600; margin-top: .15rem; }
.job-about { color: var(--muted); margin-top: .6rem; max-width: 65ch; }
.job-highlights { margin-top: .9rem; max-width: 68ch; }
.job-highlights li { position: relative; padding-left: 1.2rem; margin-top: .35rem; }
.job-highlights li::before {
  content: ""; position: absolute; left: 0; top: .72em;
  width: .5rem; height: 2px; background: var(--accent);
}
@media (max-width: 720px) {
  .job { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
  .job-dates { padding-top: 0; }
}

/* AstraZeneca rotations: a real sequence, so numbered */
.rotations {
  counter-reset: step; margin-top: 1.5rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem;
}
.rotations li {
  counter-increment: step; position: relative;
  padding: .9rem 1rem .95rem 3rem;
  border: 1px solid var(--rule); border-radius: var(--radius-md);
  background: var(--paper);
}
.section--quiet .rotations li { background: var(--surface); }
.rotations li::before {
  content: counter(step);
  position: absolute; left: 1rem; top: .95rem;
  font-weight: 760; font-variation-settings: "wdth" 120; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.step-team { font-weight: 650; line-height: 1.35; }
.step-role { font-size: .95rem; }
.step-meta { font-size: .88rem; color: var(--muted); }
.step-result { font-size: .92rem; margin-top: .35rem; }

/* Journey */
.journey { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.journey h3 { font-size: 1.05rem; margin-bottom: 1rem; }
.journey-line { display: flex; flex-wrap: wrap; align-items: center; row-gap: .6rem; }
.journey-line li { display: inline-flex; align-items: center; font-size: .95rem; }
.journey-line li:not(:last-child)::after {
  content: ""; width: 1.6rem; height: 2px; margin-inline: .55rem;
  background: var(--accent); opacity: .55;
}
.journey-line li:last-child { font-weight: 650; }

/* Projects */
.project {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 3.5rem); align-items: center;
}
.project + .project { margin-top: clamp(3rem, 7vw, 5rem); }
.project--flip .project-media { order: 2; }
.project-media { display: grid; gap: .75rem; }
.project-media img { border-radius: var(--radius-md); border: 1px solid var(--rule); width: 100%; object-fit: cover; }
.media-main { aspect-ratio: 4 / 3; }
.media-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.media-thumbs img { aspect-ratio: 4 / 3; }
.project-text { max-width: 60ch; }
.project-text h3 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); font-variation-settings: "wdth" 112; font-weight: 740; }
.project-tags { font-size: .92rem; margin: .35rem 0 1rem; }
.project-text p + p { margin-top: 1rem; }
@media (max-width: 800px) {
  .project { grid-template-columns: minmax(0, 1fr); }
  .project--flip .project-media { order: 0; }
}

.writing { margin-top: clamp(3rem, 7vw, 5rem); padding-top: 2rem; border-top: 1px solid var(--rule); }
.writing h3 { font-size: 1.05rem; margin-bottom: 1rem; }
.pubs li { max-width: 60ch; }
.pub-title { font-size: 1.3rem; font-weight: 700; font-variation-settings: "wdth" 110; }
.pubs .text-link { display: inline-block; margin-top: .4rem; }

/* Education & skills */
.quals-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2.5rem, 6vw, 5rem); }
.quals-grid h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 1.5rem; }
@media (max-width: 800px) { .quals-grid { grid-template-columns: minmax(0, 1fr); } }
.edu li { padding-block: .85rem; border-top: 1px solid var(--rule); }
.edu li:last-child { border-bottom: 1px solid var(--rule); }
.edu-award { font-weight: 650; }
.skills { display: grid; gap: 1rem; }
.skills dt { font-weight: 650; }
.skills dd { color: var(--muted); }
.outside-h { margin-top: 2.25rem; font-size: 1.05rem; }
.interests { color: var(--muted); margin-top: .5rem; max-width: 60ch; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(2rem, 6vw, 5rem); }
@media (max-width: 800px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 42ch; margin-bottom: 1.25rem; }
.contact-form { display: grid; gap: 1rem; }
.contact-form label { display: grid; gap: .35rem; font-weight: 600; font-size: .95rem; }
.contact-form input, .contact-form textarea {
  font: inherit; font-weight: 400; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-md);
  padding: .75rem .9rem; width: 100%;
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.contact-form textarea { resize: vertical; min-height: 8rem; }
.contact-form .btn { justify-self: start; }
.honey { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding-block: 2rem; color: var(--muted); font-size: .92rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.lab { display: inline-flex; align-items: center; gap: .5rem; }
.lab-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--muted); }
.lab[data-online="true"] .lab-dot { background: #1f9d55; box-shadow: 0 0 0 3px color-mix(in srgb, #1f9d55 25%, transparent); }

/* Thanks page */
.thanks { padding-block: 6rem; }
.thanks h1 { font-size: clamp(2.4rem, 7vw, 4rem); font-variation-settings: "wdth" 120; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 1rem; }
.thanks p + p { margin-top: 1.5rem; }

/* Preview-only markers for missing content */
.todo {
  display: inline-block; font-size: .82rem; font-weight: 600; line-height: 1.3;
  color: var(--accent); border: 1.5px dashed var(--accent); border-radius: 8px;
  padding: .3rem .55rem; background: var(--accent-soft);
}
p.todo { display: block; }
.viewer--empty { display: grid; place-items: center; aspect-ratio: 1 / 1; border: 1.5px dashed var(--rule); border-radius: var(--radius-lg); padding: 2rem; }
.dev-banner {
  position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: var(--paper); font-size: .85rem; font-weight: 550;
  padding: .55rem 1rem; border-radius: 999px; width: max-content; max-width: calc(100% - 2rem); text-align: center;
}

/* Earlier roles */
.earlier { margin-top: 2rem; }
.earlier h3 { font-size: 1.05rem; margin-bottom: .6rem; }
.earlier li { margin-top: .3rem; }
.earlier-role { font-weight: 600; }

/* ── Shared section bits ───────────────────────────────────────────────── */
.section-lede { font-size: 1.15rem; color: var(--muted); max-width: 62ch; margin: -1.25rem 0 clamp(2rem, 5vw, 3rem); }
.btn-small { min-height: 2.4rem; padding: .45rem .95rem; font-size: .9rem; }
.tools { font-size: .95rem; margin-top: 1rem; }

/* ── Imaging, simulation and 3D ────────────────────────────────────────── */
.imaging-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.viewer-col { position: sticky; top: 5rem; }
@media (max-width: 900px) {
  .imaging-grid { grid-template-columns: minmax(0, 1fr); }
  .viewer-col { position: static; }
}
.chip-group { margin-top: .9rem; }
.chip-group-h { font-size: .82rem; color: var(--muted); margin-bottom: .35rem; }
.chip-group .chips { margin-top: 0; }

.case + .case { margin-top: clamp(2.5rem, 6vw, 4rem); padding-top: clamp(2.5rem, 6vw, 4rem); border-top: 1px solid var(--rule); }
.case-context { font-size: .92rem; margin-bottom: .2rem; }
.case h3 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); font-weight: 740; font-variation-settings: "wdth" 112; letter-spacing: -0.015em; }
.case-summary { margin-top: .7rem; max-width: 62ch; }
.pipeline { counter-reset: p; margin-top: 1.25rem; display: grid; gap: .45rem; }
.pipeline li { counter-increment: p; position: relative; padding-left: 2.1rem; }
.pipeline li::before {
  content: counter(p); position: absolute; left: 0; top: .05rem;
  width: 1.45rem; height: 1.45rem; border-radius: 50%; display: grid; place-items: center;
  font-size: .8rem; font-weight: 700; color: var(--accent); border: 1.5px solid var(--accent);
  font-variant-numeric: tabular-nums;
}
.detail { margin-top: 1.4rem; display: grid; gap: .9rem; }
.detail dt { font-weight: 650; }
.detail dd { color: var(--muted); max-width: 62ch; }
.case-gallery { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: .75rem; margin-top: 1.5rem; max-width: calc(var(--n, 3) * 13rem); }
.case-gallery img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--rule); background: #fff; }
.case-gallery figcaption { font-size: .8rem; color: var(--muted); margin-top: .35rem; line-height: 1.35; }
@media (max-width: 480px) { .case-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.case-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.viewer-col .viewer-stage { aspect-ratio: 1 / 1; }
@media (max-width: 900px) { .viewer-col .viewer-stage { aspect-ratio: 4 / 3; } }

/* ── Mycogrow ──────────────────────────────────────────────────────────── */
.parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem clamp(2rem, 5vw, 4rem); }
@media (max-width: 760px) { .parts { grid-template-columns: minmax(0, 1fr); } }
.part { border-top: 2px solid var(--ink); padding-top: 1rem; }
.part h3 { margin-bottom: .45rem; }
.part p { max-width: 60ch; }
.part .tags { font-size: .9rem; margin-top: .6rem; }
.part .text-link { display: inline-block; margin-top: .5rem; }

.forecast {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 4rem);
  align-items: start; margin-top: clamp(3rem, 7vw, 5rem); padding-top: clamp(2.5rem, 6vw, 3.5rem); border-top: 1px solid var(--rule);
}
@media (max-width: 860px) { .forecast { grid-template-columns: minmax(0, 1fr); } .map-col { order: 2; } }
.forecast-text h3 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); font-weight: 740; font-variation-settings: "wdth" 112; margin-bottom: .7rem; }
.forecast-text > p { max-width: 60ch; }
.uk-map { position: relative; width: 100%; max-width: 380px; margin-inline: auto; aspect-ratio: 1000 / 1890; }
.uk-map canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-status { position: absolute; inset: auto 0 50% 0; text-align: center; color: var(--muted); font-size: .95rem; }
.uk-map[data-ready] .map-status { display: none; }
.seg-group { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.4rem; }
.seg {
  font: inherit; font-size: .9rem; font-weight: 550; min-height: 2.4rem; padding: .45rem .85rem;
  border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); color: var(--ink); cursor: pointer;
}
.seg:hover:not(:disabled) { border-color: var(--ink); }
.seg[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.seg:disabled { opacity: .45; cursor: not-allowed; }
.map-legend { margin-top: 1.1rem; min-height: 3.2rem; }
.legend-title { font-size: .9rem; font-weight: 600; margin-bottom: .35rem; }
.legend-ramp { height: .7rem; border-radius: 4px; max-width: 320px; }
.legend-ends { display: flex; justify-content: space-between; max-width: 320px; font-size: .82rem; color: var(--muted); margin-top: .2rem; font-variant-numeric: tabular-nums; }
.legend-dots { display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.legend-dots .dot { width: .8rem; height: .8rem; border-radius: 50%; background: var(--series-2); }
.map-note { font-size: .9rem; margin-top: .6rem; max-width: 56ch; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); }
@media (max-width: 420px) { .facts { grid-template-columns: minmax(0, 1fr); } }
.facts dt { font-size: .85rem; color: var(--muted); }
.facts dd { font-weight: 600; }

.charts-h { margin-top: clamp(3rem, 6vw, 4rem); margin-bottom: 1.25rem; font-size: 1.3rem; }
.charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem clamp(1.5rem, 3vw, 2.5rem); }
@media (max-width: 960px) { .charts { grid-template-columns: minmax(0, 1fr); max-width: 640px; } }
.credits { font-size: .82rem; margin-top: 2rem; }

/* Charts */
.chart { min-width: 0; }
.chart-title { font-weight: 700; font-variation-settings: "wdth" 108; text-wrap: balance; }
.chart-sub { font-size: .88rem; margin-bottom: .9rem; }
.chart-legend { display: flex; gap: 1rem; font-size: .85rem; margin-bottom: .5rem; }
.chart-legend li { display: flex; align-items: center; gap: .4rem; }
.swatch { width: .75rem; height: .75rem; border-radius: 3px; display: inline-block; }
.swatch.s1, .bar.s1 { background: var(--series-1); }
.swatch.s2, .bar.s2 { background: var(--series-2); }
.bar.dim { background: var(--series-dim); }
.chart-plot { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); height: 190px; }
.chart-y { position: relative; }
.chart-y span { position: absolute; right: .45rem; transform: translateY(50%); font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-area { position: relative; border-left: 1px solid var(--rule); }
.gl { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--rule); }
.gl-zero { border-top: 1px solid var(--muted); }
.band { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--series-1) 9%, transparent); border-inline: 1px dashed color-mix(in srgb, var(--series-1) 50%, transparent); }
.band-label { position: absolute; top: .2rem; left: .35rem; font-size: .72rem; color: var(--ink); white-space: nowrap; }
.chart-cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
.col { position: relative; cursor: default; }
.col:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.bar { position: absolute; }
.bar.pos { border-radius: 4px 4px 0 0; }
.bar.neg { border-radius: 0 0 4px 4px; }
.chart-x { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); margin-left: 2.6rem; font-size: .75rem; color: var(--muted); padding-top: .3rem; }
.chart-x span { white-space: nowrap; }
.chart-table { margin-top: .6rem; font-size: .85rem; }
.chart-table summary { cursor: pointer; color: var(--muted); }
.table-wrap { overflow-x: auto; max-height: 16rem; margin-top: .5rem; }
.chart-table table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { text-align: left; padding: .25rem .6rem .25rem 0; border-bottom: 1px solid var(--rule); white-space: nowrap; }

.tip {
  position: fixed; z-index: 70; pointer-events: none; max-width: 18rem;
  background: var(--ink); color: var(--paper); font-size: .82rem; line-height: 1.35;
  padding: .45rem .65rem; border-radius: 8px;
}

/* ── Trading ───────────────────────────────────────────────────────────── */
.trading-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 900px) { .trading-grid { grid-template-columns: minmax(0, 1fr); } }
.mr-figure { border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--surface); padding: 1rem 1rem .8rem; }
.mr-scroll { overflow-x: auto; }
.mr-svg { display: block; width: 100%; min-width: 540px; height: auto; }
.mr-figure figcaption { font-size: .88rem; margin-top: .5rem; }
.mr-band { fill: color-mix(in srgb, var(--series-1) 12%, transparent); stroke: none; }
.mr-sma { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
.mr-price { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.mr-stop { stroke: var(--stop); stroke-width: 2; stroke-dasharray: 6 4; }
.mr-target { stroke: var(--target); stroke-width: 2; stroke-dasharray: 6 4; }
.mr-entry { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.mr-lbl { font-family: var(--font); font-size: 13px; fill: var(--ink); }
.mr-lbl.strong { font-weight: 650; }
.mr-lbl.muted, .mr-axis { fill: var(--muted); }
.mr-axis { font-family: var(--font); font-size: 12px; }
.principles-h, .steps-h { font-size: 1.15rem; margin-bottom: .8rem; }
.principles-h { margin-top: 2rem; }
.principles li { position: relative; padding-left: 1.2rem; margin-top: .45rem; max-width: 60ch; }
.principles li::before { content: ""; position: absolute; left: 0; top: .72em; width: .5rem; height: 2px; background: var(--accent); }
.disclaimer { margin-top: 1.25rem; font-size: .9rem; font-weight: 600; }
.daily-steps { counter-reset: d; display: grid; gap: 1.1rem; }
.daily-steps li { counter-increment: d; display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); column-gap: .6rem; }
.daily-steps li::before {
  content: counter(d); grid-row: span 2; font-size: 1.5rem; font-weight: 780; font-variation-settings: "wdth" 120;
  color: var(--accent); line-height: 1.1; font-variant-numeric: tabular-nums;
}
.daily-steps .step-h { font-weight: 700; }
.daily-steps p:not(.step-h) { color: var(--muted); }
