/* Berlin clinic site selection: case study styles
   Clinical white + teal, rounded "lens and capsule" shapes. Map ramps live in js/main.js. */

:root {
  --bg: #f3f8f7;
  --surface: #ffffff;
  --tint: #e4f2f0;
  --tint-2: #cfe8e4;
  --line: #d6e5e3;
  --line-strong: #b3cbc8;
  --text: #0e2a2d;
  --text-2: #35545a;
  --text-3: #557074;
  --accent: #0a7c78;
  --accent-dark: #075e5b;
  --accent-bright: #2fb5a8;
  --accent-soft: #dcf2ef;

  --font: "Manrope", "Segoe UI", system-ui, sans-serif;

  --header-h: 64px;
  --gutter: clamp(16px, 4vw, 56px);
  --r-lg: 28px;
  --r: 20px;
  --r-sm: 14px;
  --shadow: 0 1px 2px rgba(14, 42, 45, .05), 0 12px 32px rgba(14, 42, 45, .08);
  --shadow-lg: 0 2px 6px rgba(14, 42, 45, .05), 0 30px 80px rgba(14, 42, 45, .14);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font);
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-weight: 400; line-height: 1.12; margin: 0; letter-spacing: -0.025em; }
p { margin: 0 0 1em; }
a { color: inherit; }
b, strong { font-weight: 650; }

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

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--accent); color: #fff; padding: 8px 16px; border-radius: 999px;
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

.i { width: 18px; height: 18px; flex: none; color: var(--accent); }

.button {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  background: var(--accent); color: #fff;
  padding: 14px 28px; border-radius: 999px; font-weight: 600; font-size: 1rem;
  box-shadow: 0 6px 18px rgba(10, 124, 120, .28);
  transition: background .2s, transform .2s;
}
.button:hover { background: var(--accent-dark); }
.button-light { background: #fff; color: var(--accent-dark); box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.button-light:hover { background: var(--accent-soft); }

/* ------------------------------------------------------------ header */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--gutter);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(179, 203, 200, .5);
}
.site-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 1.02rem; text-decoration: none; white-space: nowrap; letter-spacing: -0.01em; }
/* logo mark: a small teal disc with a medical plus */
.site-mark {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background:
    linear-gradient(#fff, #fff) center / 12px 3px no-repeat,
    linear-gradient(#fff, #fff) center / 3px 12px no-repeat,
    var(--accent);
}
.site-nav { display: flex; align-items: center; gap: clamp(12px, 2.2vw, 28px); font-size: .92rem; font-weight: 500; }
.site-nav a { color: var(--text-2); text-decoration: none; }
.site-nav a:hover { color: var(--accent); }
.site-nav .nav-cta { color: #fff; background: var(--accent); padding: 8px 18px; border-radius: 999px; }
.site-nav .nav-cta:hover { color: #fff; background: var(--accent-dark); }
.read-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; }
.read-progress span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent-bright), var(--accent)); transform-origin: 0 50%; transform: scaleX(0); border-radius: 0 3px 3px 0; }

@media (max-width: 720px) {
  :root { --header-h: 56px; }
  .site-nav a:not(.nav-cta):not([href="#shortlist"]) { display: none; }
}

/* ------------------------------------------------------------ hero */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 24px) var(--gutter) 40px;
  overflow: hidden;
  background:
    radial-gradient(42% 58% at 76% 52%, rgba(47, 181, 168, .20), rgba(47, 181, 168, 0) 70%),
    radial-gradient(30% 40% at 8% 90%, rgba(47, 181, 168, .10), rgba(47, 181, 168, 0) 70%),
    var(--bg);
}
.hero-inner {
  width: 100%; max-width: 1320px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: clamp(32px, 5vw, 88px);
}
.hero-copy { max-width: 36rem; }
.hero-meta {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .85rem; font-weight: 500; color: var(--accent-dark);
  background: var(--accent-soft); padding: 6px 14px 6px 10px; border-radius: 999px;
  margin-bottom: 1.4em;
}
.hero-meta::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-bright); }
.hero h1 {
  font-size: clamp(2.4rem, min(4.5vw, 7.2vh), 4.3rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
  margin-bottom: .5em;
}
.hero-result { font-size: clamp(1.02rem, 1.3vw, 1.15rem); color: var(--text-2); max-width: 32rem; }
.hero-picks { list-style: none; margin: 1.4em 0 1.8em; padding: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.hero-picks li {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 5px 20px 5px 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 2px 8px rgba(14, 42, 45, .05);
  font-weight: 600; font-size: 1.02rem;
  opacity: 0; transform: translateX(-8px);
  transition: opacity .6s ease, transform .6s ease;
}
.hero-picks li.is-in { opacity: 1; transform: none; }
.pick-no {
  display: inline-grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-weight: 700; font-size: .85rem;
}

/* the lens: a round map window with a dermatoscope-style scale ring */
.lens { margin: 0; display: grid; justify-items: center; gap: 16px; }
.lens-body {
  position: relative;
  width: min(44vw, calc(100svh - var(--header-h) - 170px), 620px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--line);
}
/* The map must never show as a square: clip by border-radius, clip-path and a round mask,
   and round the WebGL canvas itself (some GPUs/browsers ignore clipping on composited canvases). */
.lens-map {
  position: absolute; inset: 7%;
  border-radius: 50%; overflow: hidden; clip-path: circle(50%);
  -webkit-mask-image: radial-gradient(circle closest-side, #000 calc(100% - 1px), transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 calc(100% - 1px), transparent 100%);
  background: var(--tint);
  transition: filter 2s cubic-bezier(.3, .6, .3, 1);
}
.lens-map .maplibregl-canvas-container,
.lens-map .maplibregl-canvas { border-radius: 50%; }
/* out of focus until the intro zoom starts, like focusing a dermatoscope */
.lens-map.is-blurred { filter: blur(8px) saturate(.45) brightness(1.05); }
/* bezel: teal hairline, a frosted inner rim and a soft vignette make the ring read as a frame */
.lens-body::after {
  content: ""; position: absolute; inset: 7%; z-index: 1; border-radius: 50%; pointer-events: none;
  box-shadow:
    inset 0 0 0 2px rgba(10, 124, 120, .45),
    inset 0 0 0 7px rgba(255, 255, 255, .55),
    inset 0 0 0 8px rgba(10, 124, 120, .12),
    inset 0 0 44px rgba(14, 42, 45, .16);
}
.lens-reticle { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.ret-ring { fill: none; stroke: var(--line-strong); stroke-width: .5; }
.ret-ticks {
  fill: none; stroke: var(--accent); stroke-width: 3; stroke-dasharray: .45 7.928; opacity: .55;
  transform-box: fill-box; transform-origin: center;
  transition: transform 4.6s cubic-bezier(.25, .8, .25, 1);
}
/* the fine scale turns while the lens zooms, like a focus ring */
.lens.is-turned .ret-ticks { transform: rotate(40deg); }
.ret-major { fill: none; stroke: var(--accent); stroke-width: 5.5; stroke-dasharray: 1.2 148.03; }
.ret-cross { stroke: var(--accent); stroke-width: .7; opacity: .55; }
.lens figcaption { font-size: .78rem; color: var(--text-3); text-align: center; max-width: 28rem; }
/* magnification readout on the rim, driven by the map zoom */
.lens-mag {
  position: absolute; z-index: 2; left: 50%; bottom: 3.5%; transform: translate(-50%, 50%);
  min-width: 64px; padding: 5px 12px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 4px 14px rgba(14, 42, 45, .1);
  font-weight: 700; font-size: .8rem; letter-spacing: .02em; color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}

/* hovering a site in the list highlights its pin in the lens */
.hero-picks li { transition: opacity .6s ease, transform .6s ease, background .2s, border-color .2s; }
.hero-picks li.is-hover { background: var(--accent-soft); border-color: var(--accent-bright); }

@media (max-width: 900px) {
  .hero { align-items: flex-start; padding-top: calc(var(--header-h) + 20px); }
  .hero-inner { grid-template-columns: 1fr; gap: 24px; }
  .lens { order: -1; }
  .lens-body { width: min(84vw, 440px, 52svh); }
}

/* ------------------------------------------------------------ brief */
.brief { padding: clamp(88px, 14vh, 160px) var(--gutter); background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; position: relative; }
.brief-inner {
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(40px, 6vw, 100px);
  align-items: start;
}
.brief h2 {
  display: inline-block; font-size: .9rem; font-weight: 600; color: var(--accent-dark); letter-spacing: 0;
  background: var(--accent-soft); padding: 6px 14px; border-radius: 999px; margin-bottom: 1.6em;
}
.brief-question {
  font-weight: 300; font-size: clamp(1.8rem, 3.2vw, 2.8rem); line-height: 1.15; letter-spacing: -0.03em;
  text-wrap: balance; margin-bottom: 1em;
}
.brief-lead > p:last-child { color: var(--text-2); max-width: 36rem; }
.brief-facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.brief-facts > div { padding: 20px; background: var(--bg); border-radius: var(--r); display: grid; gap: 8px; align-content: start; }
.brief-facts dt { display: flex; align-items: center; gap: 10px; font-size: .85rem; font-weight: 600; color: var(--text-3); }
.brief-facts dt .i { width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.brief-facts dd { margin: 0; font-size: 1rem; font-weight: 500; line-height: 1.45; }

@media (max-width: 860px) {
  .brief-inner { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .brief-facts { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------ story (scrollytelling) */
.story {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  background: var(--bg);
}
.story-map {
  grid-column: 2; grid-row: 1;
  position: sticky; top: calc(var(--header-h) + 16px);
  height: calc(100vh - var(--header-h) - 32px);
  height: calc(100svh - var(--header-h) - 32px);
  margin: 16px var(--gutter) 16px 0;
  align-self: start;
  border-radius: var(--r-lg);
  overflow: hidden; isolation: isolate;
  background: var(--tint);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.map { position: absolute; inset: 0; }
.story-steps { grid-column: 1; grid-row: 1; padding: 0 clamp(24px, 4vw, 64px) 0 var(--gutter); }

.step {
  min-height: 92vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 12vh 0;
  max-width: 32rem;
  opacity: .32;
  transition: opacity .45s ease;
}
.step.is-active { opacity: 1; }
/* the active step's content settles into place, one element after another */
.step > * { transform: translateY(12px); transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.step.is-active > * { transform: none; }
.step.is-active > :nth-child(2) { transition-delay: .06s; }
.step.is-active > :nth-child(3) { transition-delay: .12s; }
.step.is-active > :nth-child(4) { transition-delay: .18s; }
.step.is-active > :nth-child(n+5) { transition-delay: .24s; }
.step:first-child { padding-top: 22vh; }
.step:last-child { min-height: 100vh; padding-bottom: 30vh; }
.step h2 { font-size: clamp(1.85rem, 2.5vw, 2.4rem); font-weight: 400; margin-bottom: .7em; text-wrap: balance; }
.step p { color: var(--text-2); }
.step-note {
  font-size: .9rem; color: var(--text-2) !important;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 16px 12px 44px; position: relative;
}
.step-note::before {
  content: "i"; position: absolute; left: 14px; top: 13px;
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; font-size: .75rem; line-height: 1;
}

/* colour key of the map layer this step shows (filled in by main.js) */
.layer-key {
  display: grid; grid-template-columns: repeat(5, 1fr);
  width: 92px; height: 10px; margin-bottom: 20px;
  border-radius: 999px; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(14, 42, 45, .08);
}
/* the key fills segment by segment when its step becomes active */
.layer-key span { transform: scaleX(0); transform-origin: left center; transition: transform .35s ease; }
.step.is-active .layer-key span { transform: scaleX(1); }
.step.is-active .layer-key span:nth-child(2) { transition-delay: .07s; }
.step.is-active .layer-key span:nth-child(3) { transition-delay: .14s; }
.step.is-active .layer-key span:nth-child(4) { transition-delay: .21s; }
.step.is-active .layer-key span:nth-child(5) { transition-delay: .28s; }

.figure { display: grid; gap: 4px; margin: .2em 0 1.4em; }
.figure-num {
  font-weight: 300; font-size: clamp(2.8rem, 4.2vw, 3.7rem); line-height: 1; letter-spacing: -0.04em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.figure-label { font-size: .95rem; color: var(--text-2); max-width: 26rem; }

/* variant toggle + weights table */
.variant-toggle {
  display: inline-grid; grid-auto-flow: column; gap: 4px; align-self: flex-start;
  padding: 5px; margin: .4em 0 1.1em;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 2px 8px rgba(14, 42, 45, .05);
}
.variant-toggle button {
  appearance: none; border: 0; cursor: pointer;
  min-width: 58px; padding: 9px 20px; border-radius: 999px;
  background: transparent; color: var(--text-2);
  font: 700 .95rem/1 var(--font);
}
.variant-toggle button:hover { color: var(--accent); }
.variant-toggle button[aria-pressed="true"] { background: var(--accent); color: #fff; }

.weights {
  width: 100%; max-width: 26rem; margin-bottom: 1.6em;
  border-collapse: separate; border-spacing: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden;
  font-size: .95rem; font-variant-numeric: tabular-nums;
}
.weights th, .weights td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 500; }
.weights tbody tr:last-child th, .weights tbody tr:last-child td { border-bottom: 0; }
.weights thead th { color: var(--text-3); font-size: .8rem; font-weight: 600; background: var(--bg); }
.weights td, .weights thead th:not(:first-child) { text-align: right; }
.weights tbody tr { color: var(--text-3); transition: background .2s, color .2s; }
.weights tbody tr.is-active { color: var(--accent-dark); background: var(--accent-soft); font-weight: 700; }
.weights tbody tr.is-active th, .weights tbody tr.is-active td { font-weight: 700; }

/* shortlist cards */
.step-pick { max-width: 34rem; }
.pick {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow);
}
.pick-rank {
  position: absolute; top: 24px; right: 24px; margin: 0;
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 1.25rem;
  box-shadow: 0 0 0 6px var(--accent-soft);
}
.pick h3 { font-size: 1.9rem; font-weight: 500; margin-bottom: .2em; padding-right: 64px; }
.pick-place { color: var(--text-2); margin-bottom: .9em !important; }
.lines { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 20px; padding: 0; }
.lines li { font-size: .8rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); }
.lines .lines-icon { background: none; padding: 0 2px 0 0; display: inline-flex; }
.pick-stats { margin: 0 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick-stats > div { background: var(--bg); border-radius: var(--r-sm); padding: 12px 14px; }
.pick-stats dt { display: flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 600; color: var(--text-3); }
.pick-stats dt .i { width: 16px; height: 16px; }
.pick-stats dd { margin: 4px 0 0; font-size: 1.35rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pick-why { font-size: .98rem; color: var(--text-2); }
.scores { display: grid; gap: 7px; margin-top: 4px; padding: 14px 16px; background: var(--bg); border-radius: var(--r-sm); }
.score { display: grid; grid-template-columns: 16px 1fr 38px; align-items: center; gap: 10px; font-size: .85rem; font-variant-numeric: tabular-nums; }
.score span { color: var(--text-3); font-weight: 700; }
.score i { display: block; height: 8px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); position: relative; overflow: hidden; }
.score i::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--v) * 100%); background: var(--accent); border-radius: 999px;
  transform: scaleX(0); transform-origin: left center; transition: transform .9s cubic-bezier(.2, .8, .2, 1) .15s;
}
.step.is-active .score i::after { transform: scaleX(1); }
.step.is-active .score:nth-child(2) i::after { transition-delay: .27s; }
.step.is-active .score:nth-child(3) i::after { transition-delay: .39s; }
.score:not(:first-child) i::after { background: #8bd4c8; }
.score b { text-align: right; font-weight: 700; }

/* ------------------------------------------------------------ map chrome */
.legend {
  position: absolute; left: 16px; bottom: 16px; z-index: 3;
  width: min(290px, calc(100% - 32px));
  padding: 14px 16px 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  font-size: .8rem; line-height: 1.35;
}
.legend:empty { display: none; }
.legend.is-changing { animation: legend-in .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes legend-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* step bar on the map: which chapter of the analysis is showing */
.chapters {
  position: absolute; top: 14px; left: 14px; z-index: 3;
  display: flex; gap: 2px; padding: 4px;
  max-width: calc(100% - 28px); overflow-x: auto; scrollbar-width: none;
  background: rgba(255, 255, 255, .94); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: var(--shadow);
}
.chapters::-webkit-scrollbar { display: none; }
.chapter-thumb {
  position: absolute; top: 4px; left: 0; height: calc(100% - 8px); width: 0;
  border-radius: 999px; background: var(--accent); opacity: 0;
  box-shadow: 0 4px 12px rgba(10, 124, 120, .3);
  transition: transform .5s cubic-bezier(.3, .8, .3, 1), width .5s cubic-bezier(.3, .8, .3, 1), opacity .3s;
}
.chapters button {
  position: relative; z-index: 1; flex: none;
  appearance: none; border: 0; background: none; cursor: pointer;
  padding: 7px 12px; border-radius: 999px;
  font: 600 .78rem/1 var(--font); color: var(--text-3); white-space: nowrap;
  transition: color .3s;
}
.chapters button:hover { color: var(--accent-dark); }
.chapters button.is-done { color: var(--accent-dark); }
.chapters button[aria-current="step"] { color: #fff; }
.legend-title { font-size: .95rem; font-weight: 700; color: var(--text); margin: 0 0 2px; letter-spacing: -0.01em; }
.legend-note { color: var(--text-3); margin: 0 0 10px; }
.legend-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.legend-rows li { display: flex; align-items: center; gap: 9px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.legend-rows + .legend-rows { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.sw { flex: none; width: 16px; height: 12px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(14, 42, 45, .08); }
.sw-hatch { background: repeating-linear-gradient(135deg, rgba(14,42,45,.6) 0 1px, transparent 1px 4px), #bcdc7a; } /* income ramp, class 2 */
.sw-nodata { background: #b7c1c2; }
.sw-dim { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-strong); }
.sw-clinic {
  width: 13px; height: 13px; margin: 0 1.5px; border-radius: 50%;
  background:
    linear-gradient(#fff, #fff) center / 7px 2px no-repeat,
    linear-gradient(#fff, #fff) center / 2px 7px no-repeat,
    #6d3fe0; /* mirrors C.clinic in main.js */
  box-shadow: 0 0 0 1.5px #fff, 0 0 0 4px rgba(109, 63, 224, .25);
}
.sw-ring { width: 10px; height: 10px; margin: 0 3px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1.5px var(--text); }
.sw-cand-pass { width: 13px; height: 13px; margin: 0 1.5px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 3px var(--accent-dark); }
.sw-cand-fail { width: 9px; height: 9px; margin: 0 3.5px; border-radius: 50%; background: #9fb0b2; box-shadow: 0 0 0 1px #fff; }
.sw-line { height: 0; border-top: 2px solid var(--text); border-radius: 0; box-shadow: none; }
.sw-dash { height: 0; border-top: 1.5px dashed var(--text); border-radius: 0; box-shadow: none; }
.sw-accent-line { height: 0; border-top: 3px solid var(--accent); border-radius: 0; box-shadow: none; }
.sw-pin { width: 18px; height: 18px; border-radius: 50%; background: #fff; color: var(--accent-dark); display: grid; place-items: center; font-size: 9px; font-weight: 800; box-shadow: inset 0 0 0 2px var(--accent); }
.legend-ramp { display: grid; gap: 5px; }
.legend-ramp-bar { display: grid; grid-template-columns: repeat(5, 1fr); height: 10px; border-radius: 999px; overflow: hidden; }
.legend-ramp-ends { display: flex; justify-content: space-between; color: var(--text-3); }
.legend-ramp + .legend-rows { margin-top: 10px; }

.tooltip {
  position: absolute; z-index: 4; left: 0; top: 0;
  pointer-events: none;
  max-width: 250px;
  padding: 11px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: 0 12px 32px rgba(14, 42, 45, .16);
  font-size: .82rem; line-height: 1.45; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.tooltip[hidden] { display: none; }
.tip-title { display: block; font-size: .95rem; color: var(--text); font-weight: 700; margin-bottom: 1px; }
.tip-sub { display: block; color: var(--text-3); margin-bottom: 6px; }
.tip-value b { color: var(--text); font-weight: 700; }
.tip-note { display: block; color: var(--text-3); margin-top: 4px; }
.tip-accent { display: block; color: var(--accent); font-weight: 700; margin-top: 4px; }

.map-message {
  position: absolute; inset: auto 16px 16px 16px; z-index: 5;
  margin: 0; padding: 14px 16px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--accent); color: var(--text);
  font-size: .9rem;
}
.map-message[hidden] { display: none; }

/* numbered map pins (MapLibre markers): lollipop, the stem tip marks the station */
.pin-wrap { width: 30px; height: 44px; }
.pin {
  position: relative;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--accent-dark);
  font: 800 .85rem/1 var(--font);
  box-shadow: inset 0 0 0 2.5px var(--accent), 0 4px 12px rgba(14, 42, 45, .3);
  pointer-events: none;
  opacity: 0; transform: scale(.4); transform-origin: 50% 146%;
  transition: opacity .45s ease, transform .55s cubic-bezier(.2, 1.4, .4, 1), background .3s, color .3s;
}
.pin::before {
  content: ""; position: absolute; left: 50%; top: calc(100% + 1px);
  width: 2px; height: 13px; margin-left: -1px;
  background: var(--accent); box-shadow: 0 0 0 1px #fff;
}
.pin.is-visible { opacity: 1; transform: scale(1); }
.pin.is-focus { background: var(--accent); color: #fff; box-shadow: 0 0 0 2.5px #fff, 0 0 0 6px rgba(47, 181, 168, .45), 0 4px 12px rgba(14, 42, 45, .3); }
.pin::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--accent-bright); opacity: 0;
}
.pin.is-visible.ping::after { animation: ping 1.4s ease-out 1; }
@keyframes ping { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }

.maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(255, 255, 255, .88); border-radius: 12px; }
.maplibregl-ctrl-attrib a, .maplibregl-ctrl-attrib-inner { color: var(--text-3) !important; }
.maplibregl-ctrl-group { border-radius: 14px !important; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow) !important; }

/* ------------------------------------------------------------ method */
.method { padding: clamp(88px, 14vh, 160px) var(--gutter); background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.method > h2 { max-width: 1240px; margin: 0 auto 52px; font-size: clamp(2rem, 3.2vw, 2.7rem); font-weight: 300; letter-spacing: -0.03em; }
.method-grid { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(40px, 6vw, 96px); }
.method h3 { font-size: 1rem; font-weight: 700; letter-spacing: 0; margin: 0 0 18px; }
.method h3:not(:first-child) { margin-top: 44px; }
.method-steps { margin: 0; padding: 0; list-style: none; counter-reset: m; display: grid; gap: 8px; }
.method-steps li {
  counter-increment: m; position: relative;
  padding: 16px 18px 16px 62px; background: var(--bg); border-radius: var(--r-sm);
  color: var(--text-2); font-size: .96rem;
}
.method-steps li::before {
  content: counter(m); position: absolute; left: 16px; top: 14px;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--accent-dark); font-weight: 700; font-size: .85rem;
  box-shadow: inset 0 0 0 1.5px var(--tint-2);
}
.method-steps b { color: var(--text); font-weight: 700; }
.method-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.method-list li { padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--text-2); font-size: .94rem; }
.sources li { font-size: .88rem; }

@media (max-width: 860px) { .method-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ CTA */
.site-footer { padding: 0 var(--gutter) 40px; background: var(--surface); }
.cta {
  position: relative; overflow: hidden;
  max-width: 1240px; margin: 0 auto;
  padding: clamp(40px, 7vw, 96px);
  border-radius: 36px;
  background: linear-gradient(135deg, #0c8a84 0%, var(--accent) 45%, #0a5a5f 100%);
  color: #fff;
}
/* soft concentric "lens" rings echoing the hero */
.cta::before, .cta::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
.cta::before { width: 520px; height: 520px; right: -140px; top: -160px; border: 1px solid rgba(255, 255, 255, .22); box-shadow: 0 0 0 60px rgba(255, 255, 255, .04), 0 0 0 120px rgba(255, 255, 255, .03); }
.cta::after { width: 180px; height: 180px; right: 120px; bottom: -60px; background: rgba(255, 255, 255, .08); }
.cta > * { position: relative; z-index: 1; }
.cta-line { font-weight: 300; font-size: clamp(2rem, 4.4vw, 3.6rem); line-height: 1.08; letter-spacing: -0.035em; margin-bottom: .8em; max-width: 18ch; text-wrap: balance; }
.cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin: 0; }
.cta-contact { color: rgba(255, 255, 255, .88); font-weight: 500; }
.colophon { max-width: 1240px; margin: 28px auto 0; font-size: .9rem; color: var(--text-3); }
.colophon a { color: var(--accent-dark); font-weight: 600; }

/* ------------------------------------------------------------ story on small screens: map on top, text below */
@media (max-width: 960px) {
  .story { display: block; }
  .story-map {
    position: sticky; top: calc(var(--header-h) + 8px); z-index: 2;
    height: 48vh; height: 48svh;
    margin: 8px 8px 0;
    border-radius: var(--r);
  }
  .story-steps { position: relative; z-index: 1; padding: 0 16px; }
  .step { min-height: 70vh; min-height: 70svh; padding: 6vh 0; max-width: 40rem; opacity: .4; }
  .step:first-child { padding-top: 8vh; }
  .step:last-child { min-height: 80svh; padding-bottom: 30vh; }
  .legend { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: 420px; padding: 9px 11px 8px; font-size: .72rem; border-radius: var(--r-sm); }
  .legend-title { font-size: .86rem; }
  .legend-note { margin-bottom: 6px; }
  .legend-rows { grid-template-columns: 1fr 1fr; gap: 3px 10px; }
  .legend-rows + .legend-rows, .legend-ramp + .legend-rows { margin-top: 6px; padding-top: 6px; }
  .sw { width: 13px; height: 10px; }
  /* step bar collapses to dots; only the current chapter keeps its label */
  .chapters { top: 8px; left: 8px; max-width: calc(100% - 16px); }
  .chapters button { padding: 6px 10px; font-size: .72rem; }
  .chapters button:not([aria-current]) { font-size: 0; padding: 6px 5px; }
  .chapters button:not([aria-current])::before { content: ""; display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
  .chapters button.is-done:not([aria-current])::before { background: var(--accent-bright); }
  .pick { padding: 22px 18px 18px; border-radius: var(--r); }
  .pick-rank { top: 18px; right: 18px; width: 40px; height: 40px; font-size: 1.05rem; }
  .pick h3 { font-size: 1.6rem; }
}

@media (max-width: 480px) {
  .legend-note { display: none; }
  .legend-title { margin-bottom: 6px; }
  .pick-stats dd { font-size: 1.12rem; }
  .pick-stats > div { padding: 10px 11px; }
  .cta { border-radius: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .step, .step > *, .hero-picks li, .pin, .weights tbody tr, .layer-key span, .score i::after, .chapter-thumb { transition: none !important; }
  .step > * { transform: none; }
  .layer-key span, .score i::after { transform: none; }
  .pin.is-visible.ping::after, .legend.is-changing { animation: none; }
  .lens-map, .ret-ticks { transition: none; }
}

/* ------------------------------------------------------------ dark theme (follows the GeoSifter site) */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1617;
  --surface: #132224;
  --tint: #172b2d;
  --tint-2: #24403f;
  --line: #22393b;
  --line-strong: #37585a;
  --text: #e6f2f1;
  --text-2: #b6cccb;
  --text-3: #8aa5a6;
  --accent: #14968d;
  --accent-dark: #6fd9cc;
  --accent-bright: #2fc4b5;
  --accent-soft: #123735;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 30px 80px rgba(0, 0, 0, .5);
}
[data-theme="dark"] .button:hover,
[data-theme="dark"] .site-nav .nav-cta:hover { background: #0f7d76; }
[data-theme="dark"] .site-header { background: rgba(12, 22, 23, .84); border-bottom-color: rgba(55, 88, 90, .55); }
[data-theme="dark"] .hero {
  background:
    radial-gradient(42% 58% at 76% 52%, rgba(47, 196, 181, .14), rgba(47, 196, 181, 0) 70%),
    radial-gradient(30% 40% at 8% 90%, rgba(47, 196, 181, .08), rgba(47, 196, 181, 0) 70%),
    var(--bg);
}
[data-theme="dark"] .lens-body::after {
  box-shadow:
    inset 0 0 0 2px rgba(47, 196, 181, .5),
    inset 0 0 0 7px rgba(255, 255, 255, .06),
    inset 0 0 0 8px rgba(47, 196, 181, .14),
    inset 0 0 44px rgba(0, 0, 0, .45);
}
[data-theme="dark"] .legend { background: rgba(19, 34, 36, .95); }
[data-theme="dark"] .chapters { background: rgba(19, 34, 36, .94); }
[data-theme="dark"] .tooltip { background: var(--surface); box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
[data-theme="dark"] .pin { background: var(--surface); }
[data-theme="dark"] .pin::before { box-shadow: 0 0 0 1px var(--bg); }
[data-theme="dark"] .pin.is-focus { color: #fff; box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 6px rgba(47, 196, 181, .45), 0 4px 12px rgba(0, 0, 0, .5); }
[data-theme="dark"] .sw-ring { background: var(--bg); }
[data-theme="dark"] .sw-cand-pass { background: var(--bg); }
[data-theme="dark"] .sw-pin { background: var(--surface); }
[data-theme="dark"] .sw-hatch { background: repeating-linear-gradient(135deg, rgba(230,242,241,.6) 0 1px, transparent 1px 4px), #bcdc7a; }
[data-theme="dark"] .score:not(:first-child) i::after { background: #3bafa2; }
[data-theme="dark"] .maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(19, 34, 36, .88); }
[data-theme="dark"] .maplibregl-ctrl-group { background: var(--surface); }
[data-theme="dark"] .maplibregl-ctrl-group button + button { border-top-color: var(--line); }
[data-theme="dark"] .maplibregl-ctrl-group .maplibregl-ctrl-icon { filter: invert(1) hue-rotate(180deg); }
[data-theme="dark"] .cta { background: linear-gradient(135deg, #0b6f6a 0%, #0a5f5b 45%, #08403f 100%); }
[data-theme="dark"] .button-light { background: #e6f2f1; color: #0a5a57; }
/* ------------------------------------------------------------ light/dark switch (this project's own) */
.theme-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 50%;
  background: transparent; color: var(--text-2); cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.theme-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }