/* ============ Tokens ============ */
:root {
  --bg: #f4efe4;
  --surface: #fbf8f2;
  --surface-2: #ece5d6;
  --ink: #1b221e;
  --ink-2: #414b45;
  --muted: #69716c;
  --line: #d9cfbc;
  --forest: #1e3a2f;
  --forest-ink: #f4efe4;
  --accent: #a8552a;          /* copper — for the copper-eyed frog, Allobates chalcopis */
  --accent-text: #93461f;
  --bar: #a8552a;
  --map-land: #e3dac7;
  --map-worked: #cdb99a;
  --map-line: #f4efe4;
  --shadow: 0 1px 2px rgb(30 40 35 / .06), 0 6px 24px rgb(30 40 35 / .08);
  --radius: 14px;
  --serif: "Source Serif 4", Georgia, serif;
  --display: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1180px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111612; --surface: #18201b; --surface-2: #202a24; --ink: #ece6d9; --ink-2: #c9c2b4; --muted: #939a93;
    --line: #2d3731; --forest: #0c120e; --forest-ink: #ece6d9; --accent: #e0935f; --accent-text: #e7a275; --bar: #d07a45;
    --map-land: #26302a; --map-worked: #4a4034; --map-line: #111612;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 28px rgb(0 0 0 / .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111612; --surface: #18201b; --surface-2: #202a24; --ink: #ece6d9; --ink-2: #c9c2b4; --muted: #939a93;
  --line: #2d3731; --forest: #0c120e; --forest-ink: #ece6d9; --accent: #e0935f; --accent-text: #e7a275; --bar: #d07a45;
  --map-land: #26302a; --map-worked: #4a4034; --map-line: #111612;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 28px rgb(0 0 0 / .35);
  color-scheme: dark;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--accent-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; letter-spacing: -.01em; margin: 0; font-optical-sizing: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 32px; } }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ============ Header ============ */
.site-head { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-family: var(--display); font-weight: 650; font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: .94rem; font-weight: 500; padding: 8px 12px; border-radius: 999px; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.theme-btn { background: none; border: 0; color: var(--ink-2); padding: 8px; border-radius: 999px; cursor: pointer; margin-left: 4px; display: grid; place-items: center; }
.theme-btn:hover { background: var(--surface-2); }
.menu-btn { display: none; background: none; border: 0; width: 44px; height: 44px; padding: 12px 10px; cursor: pointer; }
.menu-btn span { display: block; height: 2px; background: var(--ink); margin: 6px 0; border-radius: 2px; transition: transform .2s; }
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav { position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; border-radius: 10px; font-size: 1.05rem; }
  .theme-btn { align-self: flex-start; margin: 4px 0 0 4px; }
  .menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
}

/* ============ Footer ============ */
.site-foot { margin-top: 96px; background: var(--forest); color: var(--forest-ink); padding: 40px 0; }
.foot-row { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.foot-name { font-family: var(--display); font-size: 1.3rem; font-weight: 600; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-links a { color: var(--forest-ink); opacity: .85; text-decoration: none; font-size: .94rem; }
.foot-links a:hover { opacity: 1; text-decoration: underline; }

/* ============ Shared blocks ============ */
.block { margin-top: 88px; }
.sec-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.sec-title { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
.more { font-weight: 500; text-decoration: none; white-space: nowrap; }
.page-head { padding-top: 56px; padding-bottom: 28px; }
.page-head h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); }
.lede { font-family: var(--serif); font-size: 1.2rem; color: var(--ink-2); max-width: 44em; margin: 16px 0 0; }
.btn { display: inline-block; background: var(--accent); color: #fff; padding: 12px 20px; border-radius: 999px; text-decoration: none; font-weight: 500; }
.btn:hover { filter: brightness(1.08); }
.btn-small { display: inline-block; font-size: .88rem; font-weight: 500; border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--surface); }
.btn-small:hover { border-color: var(--accent); color: var(--accent-text); }
.credit { font-family: var(--sans); font-size: .76rem; color: var(--muted); }

/* ============ Cards ============ */
.cards { display: grid; gap: 28px 24px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 12px; }
.card-img { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 7 / 5; background: var(--surface-2); }
.card-img > img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.card:hover .card-img > img { transform: scale(1.04); }
.card h3 { font-size: 1.28rem; font-weight: 600; }
.card:hover h3 { color: var(--accent-text); }
.chip { position: absolute; left: 12px; top: 12px; background: rgb(15 20 17 / .72); color: #f4efe4; font-size: .74rem; font-weight: 500; letter-spacing: .02em; padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(4px); }
.feat { grid-template-columns: repeat(3, 1fr); }
.feat .card-big { grid-column: span 2; grid-row: span 2; }
.feat .card-big .card-img { aspect-ratio: auto; flex: 1; min-height: 320px; }
.feat .card-big h3 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
@media (max-width: 900px) { .feat { grid-template-columns: 1fr 1fr; } .feat .card-big { grid-column: span 2; grid-row: auto; } .feat .card-big .card-img { aspect-ratio: 16/9; flex: none; min-height: 0; } }
@media (max-width: 560px) { .feat { grid-template-columns: 1fr; } .feat .card-big { grid-column: auto; } }

/* ============ Filters ============ */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.fchip { font: 500 .9rem var(--sans); color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.fchip:hover { border-color: var(--ink-2); }
.fchip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
[hidden] { display: none !important; }

/* ============ Home ============ */
/* short collage band that drifts slowly (tilted, so the drift reads as diagonal); the track holds the photos twice for a seamless loop */
.hero { --hero-h: min(54.6vh, 504px); --rows: 3; --tw: clamp(190px, 17.5vw, 300px); --th: min(24vh, 230px); --dur: 110s;
  position: relative; height: var(--hero-h); min-height: 308px; overflow: hidden; background: var(--forest); }
@supports (height: 1svh) { .hero { --hero-h: min(54.6svh, 504px); --th: min(24svh, 230px); } }
.mosaic { position: absolute; left: -12%; right: -12%; top: 50%; transform: translateY(-50%) rotate(-4deg); }
.mosaic-track { display: grid; grid-auto-flow: column; grid-template-rows: repeat(var(--rows), var(--th)); grid-auto-columns: var(--tw); gap: 4px; padding-right: 4px; width: max-content; animation: drift var(--dur) linear infinite; will-change: transform; }
@keyframes drift { to { transform: translate3d(-50%, 0, 0); } }
.mosaic .tile { overflow: hidden; background: #22302a; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: tileIn 1.2s ease forwards; }
.mosaic .tile:nth-child(3n+1) img { animation-delay: .1s; } .mosaic .tile:nth-child(3n+2) img { animation-delay: .35s; } .mosaic .tile:nth-child(3n) img { animation-delay: .6s; }
@keyframes tileIn { to { opacity: 1; } }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(10 16 12 / .15) 0%, rgb(10 16 12 / .25) 45%, rgb(10 16 12 / .82) 100%); }
.hero-text { position: absolute; left: 0; right: 0; bottom: 18px; z-index: 2; }
@media (max-width: 700px) { .hero-text { bottom: 22px; } }
.hero h1 { color: #f7f2e8; font-size: clamp(3rem, 11vw, 8.5rem); font-weight: 700; letter-spacing: -.035em; line-height: .92; text-shadow: 0 1px 2px rgb(0 0 0 / .45), 0 3px 14px rgb(0 0 0 / .4), 0 2px 40px rgb(0 0 0 / .35); }
@media (max-width: 700px) {
  .hero { --hero-h: 49vh; --rows: 5; --tw: 35vw; --th: 12.2vh; --dur: 60s; }
  @supports (height: 1svh) { .hero { --hero-h: 49svh; --th: 12.2svh; } }
}
@media (prefers-reduced-motion: reduce) { .mosaic img { animation: none; opacity: 1; } .mosaic-track { animation: none; } .card-img img { transition: none; } }

/* portrait sized so all of it shows under the collage on first load */
.intro { --pt: clamp(180px, calc(100vh - 61px - min(54.6vh, 504px) - 52px), 300px); display: grid; grid-template-columns: var(--pt) 1fr; gap: 48px; align-items: start; margin-top: 28px; }
@supports (height: 1svh) { .intro { --pt: clamp(180px, calc(100svh - 61px - min(54.6svh, 504px) - 52px), 300px); } }
.intro .portrait, .about-top .portrait { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 5px solid var(--surface); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--accent) 70%, transparent), var(--shadow); }
.intro .prose p:first-child { font-size: 1.35rem; line-height: 1.5; font-family: var(--display); font-weight: 400; color: var(--ink); }
@media (max-width: 800px) { .intro { grid-template-columns: 1fr; gap: 28px; } .intro .portrait { width: 180px; } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 56px; }
.stat { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; transition: transform .25s cubic-bezier(.2,.7,.2,1), border-color .2s, box-shadow .25s; }
.stat:hover, .stat:focus-visible { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.stat:active { transform: translateY(-1px) scale(.99); }
.stat-go { position: absolute; top: 18px; right: 18px; color: var(--muted); transition: transform .25s cubic-bezier(.2,.7,.2,1), color .2s; }
.stat:hover .stat-go, .stat:focus-visible .stat-go { color: var(--accent-text); transform: translateX(3px); }
.stat-n { font-family: var(--display); font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 650; line-height: 1; color: var(--accent-text); }
.stat-l { color: var(--ink-2); font-size: .95rem; }
@media (max-width: 800px) { .stats { grid-template-columns: 1fr 1fr; } }

.dyk { background: var(--forest); color: var(--forest-ink); padding: 56px 0 64px; }
.dyk .sec-title { color: var(--forest-ink); margin-bottom: 24px; }
/* full-bleed carousel that steps along every few seconds (assets/site.js), with position dots below */
.dyk-track { --pad: max(16px, calc((100vw - var(--wrap)) / 2 + 32px)); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 320px); gap: 16px; overflow-x: auto; padding: 4px var(--pad) 8px; scroll-padding-inline: var(--pad); scroll-snap-type: x mandatory; scrollbar-width: none; }
.dyk-track::-webkit-scrollbar { display: none; }
.dyk-card { scroll-snap-align: start; background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .12); border-radius: var(--radius); padding: 22px; color: var(--forest-ink); text-decoration: none; display: flex; }
.dyk-card p { margin: 0; font-family: var(--serif); font-size: 1.12rem; line-height: 1.45; }
.dyk-card:hover { background: rgb(255 255 255 / .11); }
.dyk-dots { display: flex; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.dyk-dots button { padding: 8px 3px; border: 0; background: none; cursor: pointer; border-radius: 999px; } /* roomy tap area around a small dot */
.dyk-dots button::before { content: ""; display: block; width: 8px; height: 8px; border-radius: 999px; background: rgb(244 239 228 / .3); transition: width .3s cubic-bezier(.2,.7,.2,1), background .2s; }
.dyk-dots button:hover::before { background: rgb(244 239 228 / .6); }
.dyk-dots button[aria-current="true"]::before { width: 24px; background: var(--forest-ink); }
.dyk-dots button:focus-visible { outline-color: var(--forest-ink); }

.sp-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.sp-mini { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1; color: #fff; text-decoration: none; background: var(--surface-2); }
.sp-mini img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.sp-mini:hover img { transform: scale(1.06); }
.sp-mini span { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 10px 8px; font-size: .82rem; background: linear-gradient(transparent, rgb(0 0 0 / .75)); line-height: 1.25; }
@media (max-width: 900px) { .sp-strip { grid-template-columns: repeat(3, 1fr); } }

/* ============ Map ============ */
.map-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; overflow: hidden; }
.worldmap { width: 100%; height: auto; display: block; }
.worldmap .grat { fill: none; stroke: var(--line); stroke-width: .5; opacity: .6; }
.worldmap .land path { fill: var(--map-land); stroke: var(--map-line); stroke-width: .6; }
.worldmap .land path.worked { fill: var(--map-worked); }
.worldmap .pin-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center; transition: transform .3s cubic-bezier(.3,1.5,.5,1); }
.worldmap .pin-halo { fill: var(--accent); opacity: .18; }
.worldmap .pin:focus-visible .pin-dot { transform: scale(2.15); }
@media (hover: hover) { .worldmap .pin:hover .pin-dot { transform: scale(2.15); } }

/* ---- full-screen map page (assets/map.js) */
.page-map .site-foot { display: none; }
.map-stage { position: relative; height: calc(100vh - 61px); overflow: hidden; background: var(--surface); user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
@supports (height: 1dvh) { .map-stage { height: calc(100dvh - 61px); } }
.map-stage .worldmap { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; opacity: 0; transition: opacity .5s; }
.map-stage.ready .worldmap { opacity: 1; }
.map-stage.dragging .worldmap { cursor: grabbing; }
.map-stage .worldmap .land path, .map-stage .worldmap .grat { vector-effect: non-scaling-stroke; }
.map-stage .worldmap .land path { stroke-width: .8px; }
.map-stage .worldmap .pin { cursor: pointer; outline: none; }
.map-stage .worldmap .pin.on .pin-halo { transform-box: fill-box; transform-origin: center; animation: pinPulse 1.8s ease-out infinite; }
@keyframes pinPulse { from { transform: scale(.6); opacity: .55; } to { transform: scale(2); opacity: 0; } }
.map-title { position: absolute; left: 0; top: 0; padding: 20px 24px; font-size: clamp(1.25rem, 2.6vw, 2rem); pointer-events: none; transition: opacity .3s; text-shadow: 0 1px 14px var(--surface), 0 0 4px var(--surface); }
.map-stage.is-open .map-title { opacity: 0; }
.map-zoom { position: absolute; left: 16px; bottom: 16px; z-index: 4; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; transition: opacity .25s; }
.map-zoom button { width: 42px; height: 42px; border: 0; background: none; color: var(--ink); font: 500 1.35rem/1 var(--sans); cursor: pointer; display: grid; place-items: center; }
.map-zoom button + button { border-top: 1px solid var(--line); }
.map-zoom button:hover { background: var(--surface-2); }
.map-ui { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
/* the home-page map: same pins and previews, no pan/zoom (so the page still scrolls), and a way through to the full map */
.map-stage.map-embed { height: clamp(300px, 52vw, 640px); border: 1px solid var(--line); border-radius: var(--radius); }
.map-embed .worldmap { touch-action: manipulation; cursor: default; }
.map-cta { position: absolute; left: 50%; bottom: 22px; z-index: 4; transform: translateX(-50%); display: inline-flex; align-items: center; gap: .45em; white-space: nowrap;
  font: 600 clamp(1.1rem, 2vw, 1.45rem)/1 var(--display); letter-spacing: -.01em; color: var(--bg); background: var(--ink); padding: .8em 1.35em; border-radius: 999px; text-decoration: none; box-shadow: 0 10px 30px rgb(10 16 12 / .25); transition: background .2s, opacity .25s, transform .25s cubic-bezier(.2,.7,.2,1); }
.map-cta span { transition: transform .25s cubic-bezier(.2,.7,.2,1); }
.map-cta:hover { background: var(--accent); color: #fff; transform: translateX(-50%) translateY(-2px); }
.map-cta:hover span { transform: translateX(4px); }
.map-embed.is-open .map-cta { opacity: 0; pointer-events: none; }
@media (max-width: 700px) { .map-cta { font-size: 1.02rem; bottom: 14px; } }
.map-link { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; opacity: 0; transition: opacity .3s; }
.map-link line { stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 2 6; stroke-linecap: round; }
.map-node { position: absolute; left: 0; top: 0; border-radius: 50%; background: #1e3a2f; pointer-events: none; transform-origin: 50% 50%; will-change: transform;
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 5.5px var(--accent), 0 18px 48px rgb(10 16 12 / .32); transition: box-shadow .25s, opacity .3s; }
.map-node-img { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; }
.map-node-img > img { width: 100%; height: 100%; object-fit: cover; animation: tileIn .6s ease both; }
.map-node.docked { pointer-events: auto; } /* not clickable until it has moved aside, so the tap that opened it can't also follow it */
.map-node.docked:hover { box-shadow: 0 0 0 4px var(--surface), 0 0 0 8px var(--accent), 0 22px 56px rgb(10 16 12 / .38); }
.map-node.leaving { opacity: 0; transition: opacity .4s .12s; }
.map-panel { position: absolute; pointer-events: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow), 0 20px 50px rgb(10 16 12 / .16); padding: 32px 32px 30px; max-height: calc(100% - 32px); overflow: auto;
  opacity: 0; visibility: hidden; transform: translateX(28px); transition: opacity .35s ease, transform .6s cubic-bezier(.2,.8,.2,1), visibility 0s .6s; }
.map-panel.show { opacity: 1; visibility: visible; transform: none; transition-delay: .12s, .12s, 0s; }
.map-panel h2 { font-size: clamp(1.8rem, 2.9vw, 2.5rem); margin: 0 40px 16px 0; }
.map-panel p { font-family: var(--serif); font-size: 1.35rem; line-height: 1.5; color: var(--ink-2); margin: 0 0 24px; }
.map-panel .btn { font-size: 1.08rem; padding: 14px 24px; }
.map-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.map-close:hover { color: var(--ink); }
@media (max-width: 700px), (max-aspect-ratio: 9/10) {
  .map-title { padding: 14px 16px; }
  .map-stage.is-open .map-zoom { opacity: 0; pointer-events: none; }
  .map-panel { padding: 20px 20px 18px; border-radius: 18px; transform: translateY(24px); }
  .map-panel h2 { font-size: 1.62rem; margin-bottom: 10px; }
  .map-panel p { font-size: 1.22rem; line-height: 1.45; margin-bottom: 16px; }
  .map-panel .btn { font-size: 1.02rem; padding: 12px 20px; }
}
@media (max-height: 700px) and (max-width: 700px) {
  .map-panel h2 { font-size: 1.3rem; margin-bottom: 8px; }
  .map-panel p { font-size: .98rem; margin-bottom: 12px; }
  .map-panel .btn { font-size: .95rem; padding: 10px 18px; }
}

/* ============ Chart ============ */
.chart-fig { margin: 0 0 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 10px; }
.chart-title { font-weight: 600; font-size: .95rem; margin-bottom: 8px; color: var(--ink); }
.chart { position: relative; width: 100%; height: 220px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font: 11px var(--sans); }
.chart .bar path { fill: var(--bar); }
.chart .bar .hit { fill: transparent; }
.chart .bar:hover path, .chart .bar:focus path, .chart .bar.on path { fill: var(--ink); }
.chart .bar { cursor: pointer; outline: none; }
/* intro: a light sweeps left to right, bars spring up behind it */
.chart .scan { display: none; }
.chart .scan line { stroke: var(--bar); stroke-width: 2; stroke-linecap: round; }
.chart stop { stop-color: var(--bar); }
.chart svg.chart-intro .scan { display: inline; animation: scanMove var(--sweep) linear both, scanOut .45s ease var(--sweep) both; }
.chart svg.chart-intro .bar path { transform-box: fill-box; transform-origin: 50% 100%; animation: barGrow .8s cubic-bezier(.2,1.4,.35,1) var(--d) both; }
.chart svg.chart-intro .grid line { stroke-dasharray: 1; animation: gridDraw var(--sweep) cubic-bezier(.45,0,.2,1) both; }
.chart svg.chart-intro .axis .yr { animation: yrIn .5s ease var(--d) both; }
.chart svg.chart-intro .axis text:not(.yr) { animation: yrIn .6s ease both; }
@keyframes scanMove { from { transform: translateX(0); } to { transform: translateX(var(--sweep-w)); } }
@keyframes scanOut { to { opacity: 0; } }
@keyframes barGrow { 0% { transform: scaleY(0); filter: brightness(1.7) saturate(1.3); } 55% { filter: brightness(1.25); } 100% { transform: scaleY(1); filter: none; } }
@keyframes gridDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes yrIn { from { opacity: 0; transform: translateY(6px); } }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: .82rem; padding: 6px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); box-shadow: var(--shadow); z-index: 3; }

/* ============ Story ============ */
.story-hero { position: relative; height: min(82vh, 760px); min-height: 380px; background: var(--forest); overflow: hidden; }
.story-hero img { width: 100%; height: 100%; object-fit: cover; }
.story-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgb(8 12 10 / .78)); }
.story-hero-text { position: absolute; left: 0; right: 0; bottom: 40px; z-index: 2; }
.story-hero h1 { color: #f7f2e8; font-size: clamp(2.4rem, 7vw, 5.2rem); font-weight: 650; max-width: 14em; text-shadow: 0 2px 24px rgb(0 0 0 / .4); letter-spacing: -.025em; }
.hero-credit { text-align: right; margin-top: 8px; font-size: .76rem; color: var(--muted); }
.story-grid { display: grid; grid-template-columns: 200px minmax(0, 680px); gap: 56px; justify-content: center; margin-top: 40px; }
.glance { position: sticky; top: 84px; align-self: start; }
.glance dl { margin: 0; display: grid; gap: 16px; border-top: 2px solid var(--ink); padding-top: 16px; }
.glance dt { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.glance dd { margin: 2px 0 0; font-family: var(--serif); font-size: 1.05rem; }
.glance-dl { margin-top: 20px; }
@media (max-width: 900px) {
  .story-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .glance { position: static; }
  .glance dl { grid-template-columns: repeat(3, auto); justify-content: start; gap: 12px 32px; }
}
.prose { font-family: var(--serif); font-size: 1.14rem; line-height: 1.72; color: var(--ink); }
.prose > p:first-of-type::first-letter { font-family: var(--display); float: left; font-size: 4.1em; line-height: .82; padding: 6px 10px 0 0; color: var(--accent-text); font-weight: 600; }
.intro .prose > p:first-of-type::first-letter, .about-top .prose > p:first-of-type::first-letter { all: unset; }
.prose p { margin: 0 0 1.15em; }
.prose h2 { font-size: 1.7rem; margin: 1.8em 0 .6em; }
.prose em, .prose i { font-style: italic; }
.prose a { color: var(--accent-text); }
.prose ul, .prose ol { padding-left: 1.3em; }
.fig { margin: 2.2em 0; }
.fig img { width: auto; max-width: 100%; max-height: 80vh; margin: 0 auto; border-radius: 10px; background: var(--surface-2); }
@media (min-width: 1100px) { .page-story .fig { margin-left: -60px; margin-right: -60px; } }
.fig figcaption { font-family: var(--sans); font-size: .88rem; line-height: 1.5; color: var(--ink-2); margin-top: 10px; }
.fig figcaption .credit { display: block; margin-top: 2px; }
.pull { margin: 1.8em 0; padding: 0 0 0 24px; border-left: 3px solid var(--accent); }
.pull p { font-family: var(--display); font-size: clamp(1.35rem, 2.5vw, 1.7rem); line-height: 1.35; font-weight: 450; font-style: italic; color: var(--ink); margin: 0; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px 8px; margin: 2em 0; font-family: var(--sans); font-size: 1rem; line-height: 1.6; }
.fact h3 { font-size: 1.15rem; margin-bottom: 10px; color: var(--accent-text); }
.fact p { margin: 0 0 .9em; }
.papers { max-width: 936px; margin-top: 64px; }
.papers h2 { font-size: 1.6rem; margin-bottom: 16px; }
.cites { padding-left: 1.2em; margin: 0; display: grid; gap: 12px; font-size: .95rem; color: var(--ink-2); }
.cite-title a { color: var(--ink); font-weight: 500; }
.story-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 72px; }
@media (max-width: 600px) { .story-nav { grid-template-columns: 1fr; } }

/* ============ Species ============ */
/* title that is also the filter menu */
.page-head h1.sp-title { font-size: clamp(1.25rem, 3vw, 2.1rem); display: flex; flex-wrap: wrap; gap: .35em .3em; margin: 0; }
.tchip { font: inherit; font-weight: 500; letter-spacing: -.015em; line-height: 1.1; color: var(--ink-2); background: transparent; border: 1.5px solid var(--line); padding: .22em .62em .26em; border-radius: 999px; transition: background .2s, color .2s, border-color .2s, transform .2s cubic-bezier(.2,.7,.2,1); }
.tchip .tchip-n { font-weight: 650; color: var(--accent-text); font-variant-numeric: tabular-nums; transition: color .2s; }
.tchip:hover { border-color: var(--ink-2); color: var(--ink); transform: translateY(-2px); }
.tchip:active { transform: translateY(0) scale(.97); }
.tchip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tchip[aria-pressed="true"] .tchip-n { color: inherit; }
.page-head:has(.sp-title) { padding-bottom: 36px; }
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; align-items: start; }
.sp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sp summary { list-style: none; cursor: pointer; }
.sp summary::-webkit-details-marker { display: none; }
.sp summary img, .sp-noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.sp-noimg { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }
.sp h3 { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; padding: 12px 16px 14px; }
.sp[open] h3 { color: var(--accent-text); }
.sp-body { padding: 0 16px 16px; font-size: .92rem; color: var(--ink-2); }
.sp-body p { margin: 0 0 10px; }
.sp-common { font-weight: 600; color: var(--ink); }
.sp-body dl { margin: 0 0 12px; display: grid; gap: 6px; }
.sp-body dt { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.sp-body dd { margin: 0; }

/* ============ Publications ============ */
.pub-controls { display: grid; gap: 12px; margin-bottom: 24px; position: sticky; top: 60px; background: var(--bg); padding: 12px 0; z-index: 5; }
.search input { width: 100%; font: 1rem var(--sans); padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
.search input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.selects { display: flex; flex-wrap: wrap; gap: 8px; }
.selects select { font: .9rem var(--sans); padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); max-width: 100%; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.seg button { font: 500 .9rem var(--sans); color: var(--ink-2); background: none; border: 0; padding: 5px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.seg button:hover { color: var(--ink); background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg-n { font-variant-numeric: tabular-nums; opacity: .6; margin-left: 2px; }
.count { margin: 0; font-size: .88rem; color: var(--muted); }
.clear-year { margin-left: 8px; font: inherit; background: none; border: 0; color: var(--accent-text); cursor: pointer; text-decoration: underline; padding: 0; }
.year-group h2 { font-size: 1.6rem; margin: 36px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); position: sticky; }
.pub { border-bottom: 1px solid var(--line); }
.pub > button { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 1fr auto; gap: 16px; width: 100%; padding: 14px 4px; cursor: pointer; }
.pub > button:focus-visible { outline: 2px solid var(--accent); border-radius: 6px; }
.pub-title { font-family: var(--serif); font-size: 1.08rem; line-height: 1.4; color: var(--ink); }
.pub > button:hover .pub-title { color: var(--accent-text); }
.pub-meta { font-family: var(--sans); font-size: .86rem; color: var(--muted); margin-left: 6px; }
.pub-flag { align-self: start; font-size: .72rem; font-weight: 600; letter-spacing: .03em; color: var(--accent-text); border: 1px solid currentColor; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.pub-detail { padding: 0 4px 18px; font-size: .95rem; color: var(--ink-2); display: grid; gap: 10px; }
.pub-detail .summary { font-family: var(--serif); font-size: 1.05rem; color: var(--ink); margin: 0; }
.pub-detail .authors b { color: var(--ink); }
.pub-detail .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .75rem; background: var(--surface-2); color: var(--ink-2); padding: 3px 9px; border-radius: 999px; }
.chev { transition: transform .2s; color: var(--muted); align-self: start; margin-top: 4px; }
.pub.open .chev { transform: rotate(180deg); }

/* ============ About ============ */
.about-top { display: grid; grid-template-columns: 300px minmax(0, 720px); gap: 56px; padding-top: 64px; align-items: center; }
@media (max-width: 860px) { .about-top { grid-template-columns: 1fr; gap: 28px; } .about-top .portrait { width: 200px; } }
.about-top h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); margin-bottom: 18px; }
.about-lead { font-family: var(--display); font-size: clamp(1.25rem, 2.2vw, 1.65rem); line-height: 1.42; font-weight: 400; color: var(--ink); margin: 0; }
/* chapters: text beside a row of photos, alternating sides */
.chapter { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.3fr); gap: 56px; align-items: center; margin-top: 64px; scroll-margin-top: 90px; }
.chapter.flip { grid-template-columns: minmax(0, 1.3fr) minmax(0, .85fr); }
.chapter.flip .ch-text { order: 2; }
.ch-photos.n2 .ph:nth-child(2) { margin-top: 40px; } /* a little stagger */
.chapter.solo { grid-template-columns: minmax(0, 720px); }
.ch-num { display: block; font-family: var(--display); font-size: 3.4rem; font-weight: 400; line-height: 1; color: var(--accent-text); opacity: .4; margin-bottom: 8px; }
.chapter h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); margin-bottom: 20px; }
.chapter .prose { font-size: 1.12rem; }
.chapter:not(#arctic) .prose > p:first-of-type::first-letter { all: unset; }
.ch-photos, .band-grid { display: flex; gap: 16px; align-items: flex-start; }
.ph { flex: var(--ar, 1.33) 1 0; min-width: 0; margin: 0; }
.ph-img { border-radius: 12px; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow); aspect-ratio: var(--ar, 1.33); }
.ph-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.ph:hover .ph-img img { transform: scale(1.03); }
.ph figcaption { font-size: .86rem; line-height: 1.45; color: var(--ink-2); margin-top: 10px; }
.ph figcaption .credit { display: block; margin-top: 2px; }
.ph-slot { display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); font-size: .9rem; font-weight: 500; box-shadow: none; border: 2px dashed color-mix(in srgb, var(--accent) 40%, var(--line));
  background: repeating-linear-gradient(135deg, transparent 0 12px, color-mix(in srgb, var(--surface-2) 70%, transparent) 12px 24px), var(--surface); }
.about-band { background: var(--forest); color: var(--forest-ink); padding: 56px 0 64px; margin-top: 72px; scroll-margin-top: 61px; }
.about-band .sec-title { color: var(--forest-ink); margin-bottom: 28px; }
.about-band figcaption { color: rgb(244 239 228 / .82); }
.about-band .credit { color: rgb(244 239 228 / .55); }
.about-band .ph-img { box-shadow: 0 10px 30px rgb(0 0 0 / .3); }
.page-about .timeline-sec { margin-top: 72px; }
@media (max-width: 860px) {
  .chapter, .chapter.solo { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 48px; }
  .chapter.flip { grid-template-columns: minmax(0, 1fr); }
  .chapter.flip .ch-text { order: 0; }
  .ch-photos.n2 .ph:nth-child(2) { margin-top: 0; }
  .ch-num { font-size: 2.6rem; }
  .about-band { margin-top: 48px; padding: 40px 0 48px; }
  .page-about .timeline-sec { margin-top: 56px; }
}
@media (max-width: 560px) { .ch-photos, .band-grid { flex-direction: column; gap: 22px; } .ph { flex: none; width: 100%; } }
/* chapters rise into place as they scroll into view */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }
.timeline { list-style: none; padding: 0; margin: 24px 0 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 70px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 70px 1fr; gap: 28px; padding: 10px 0; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 65px; top: 19px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); }
.t-year { font-family: var(--display); font-weight: 600; font-size: 1.15rem; text-align: right; padding-right: 8px; }
.timeline p { margin: 0; font-family: var(--serif); font-size: 1.06rem; padding-left: 8px; }
.roles { margin-top: 72px; }
.role-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.role-list li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; line-height: 1.5; }
.role-list b { font-weight: 600; color: var(--ink); }
.role-list span { color: var(--ink-2); font-size: .94rem; }
.role-list .yrs { color: var(--muted); }
.contact { margin-top: 72px; }
.contact .profiles { color: var(--muted); }

/* small hero images: shown whole over a blurred copy instead of stretched */
.story-hero.small .story-hero-bg { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(28px) saturate(1.1) brightness(.7); }
.story-hero.small .story-hero-img { position: relative; z-index: 1; width: auto; max-width: min(100%, 1100px); height: 100%; margin: 0 auto; object-fit: contain; }
.map-wrap + .cards, section.map-wrap + section { margin-top: 32px; }
