/* ANTAR — academic editorial design system.
   Swiss-modernist grid, scholarly serif headings (Crimson Pro), clear humanist body (Source Sans 3), tabular
   figures in IBM Plex Mono. All three are SIL OFL and self-hosted (assets/fonts). Colours come from the logo:
   teal, ochre, rust and navy. Every colour is a token; dark mode is designed alongside light, not inverted. */

@font-face { font-family: "Crimson Pro"; src: url("assets/fonts/crimson-pro-var.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Crimson Pro"; src: url("assets/fonts/crimson-pro-var-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("assets/fonts/source-sans-3-var.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("assets/fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("assets/fonts/plex-mono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --bg: #f5f4ee; --surface: #ffffff; --surface-2: #ecebe2; --text: #0e1f1a; --muted: #4a5a54;
  --border: #d8d5c8; --border-strong: #b2ae9f; --accent: #0a6559; --accent-ink: #ffffff; --accent-soft: #d9ebe6; --ring: #0a6559;
  --good: #25603f; --good-bg: #dcebe3; --warn: #7d5200; --warn-bg: #f9ecc9;
  --bad: #9b2c2c; --bad-bg: #f7dcdc; --neutral: #46544d; --neutral-bg: #e6e8e1;
  --c1: #0f6b61; --c2: #9a6b2f; --c3: #a84a1e; --c4: #1f3a68;
  /* the dark "ink" surfaces (findings band, footer): the logo's spruce and navy, with mint as the accent; the three emissions paths keep their chart colours */
  --band: #0b2420; --band-2: #0f3a3c; --band-ink: #eef4ef; --band-muted: #a9bfb6; --band-line: rgba(238, 244, 239, .2); --band-card: rgba(255, 255, 255, .055); --band-card-line: rgba(255, 255, 255, .15);
  --mint: #7ee0cd; --apricot: #f2a56b; --sp126: #5cc8b6; --sp370: #d3a05a; --sp585: #e07f55;   /* the three emissions paths, as in every chart (dark-theme --c1, --c2, --c3) */
  --stage: #fefefe;   /* the hero video's own background, in both themes, so stage and footage are seamless */
  --map-land: #e6dfcc; --map-forest: #2a7a4b; --map-woodland: #a9b878; --map-water: #78a9d4; --map-line: #6b6b60; --map-outline: #2b2b26;
  --serif: "Crimson Pro", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 8px; --nav-h: 64px; --gutter: clamp(16px, 4vw, 40px);
  --shadow: 0 1px 0 rgba(21, 32, 28, .04), 0 8px 24px -16px rgba(21, 32, 28, .22);
  --ease: cubic-bezier(.22, .61, .36, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1412; --surface: #151d1a; --surface-2: #1c2622; --text: #e9eee9; --muted: #a3b0a9;
    --border: #2a3631; --border-strong: #3f4e47; --accent: #5cc8b6; --accent-ink: #06201c; --accent-soft: #17332e; --ring: #5cc8b6;
    --good: #7fcaa2; --good-bg: #213a2d; --warn: #e6b455; --warn-bg: #3a2f17;
    --bad: #ee8b8b; --bad-bg: #3d2222; --neutral: #a9b6ae; --neutral-bg: #28322c;
    --c1: #5cc8b6; --c2: #d3a05a; --c3: #e07f55; --c4: #8fb0e6;
    --map-land: #3a3d36; --map-forest: #3f9a63; --map-woodland: #7f8e55; --map-water: #3d6c96; --map-line: #b4b4a6; --map-outline: #e8e8da;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 24px -16px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  --bg: #0e1412; --surface: #151d1a; --surface-2: #1c2622; --text: #e9eee9; --muted: #a3b0a9;
  --border: #2a3631; --border-strong: #3f4e47; --accent: #5cc8b6; --accent-ink: #06201c; --accent-soft: #17332e; --ring: #5cc8b6;
  --good: #7fcaa2; --good-bg: #213a2d; --warn: #e6b455; --warn-bg: #3a2f17;
  --bad: #ee8b8b; --bad-bg: #3d2222; --neutral: #a9b6ae; --neutral-bg: #28322c;
  --c1: #5cc8b6; --c2: #d3a05a; --c3: #e07f55; --c4: #8fb0e6;
  --map-land: #3a3d36; --map-forest: #3f9a63; --map-woodland: #7f8e55; --map-water: #3d6c96; --map-line: #b4b4a6; --map-outline: #e8e8da;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 24px -16px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }
html { color-scheme: light dark; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1.0625rem/1.6 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; letter-spacing: -.012em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 1.45rem + 2.4vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 1.25rem + 1vw, 2.1rem); margin-top: 2.2em; }
h3 { font-size: 1.3rem; line-height: 1.2; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: var(--mono); font-size: .86em; background: var(--surface-2); padding: .12em .4em; border-radius: 3px; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--accent-soft); color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: 12px; top: -64px; z-index: 2000; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 4px; text-decoration: none; font-weight: 700; }
.skip:focus { top: 12px; }

/* ---------- header: lies on the hero video, turns into a frosted bar once the page scrolls ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; z-index: 1100; height: var(--nav-h); border-bottom: 1px solid transparent; transition: background-color .3s var(--ease), border-color .3s var(--ease); }
.topbar .wrap { height: 100%; max-width: 1360px; display: flex; align-items: center; gap: 20px; }
body:not(.is-home) .topbar, .topbar.solid { background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: saturate(1.5) blur(16px); backdrop-filter: saturate(1.5) blur(16px); border-bottom-color: var(--border); }
/* over the (white) hero the bar is transparent with a soft white scrim and ink-coloured tokens in both themes */
body.is-home .topbar:not(.solid) { background: linear-gradient(to bottom, rgba(254, 254, 254, .95), rgba(254, 254, 254, 0)); --text: #15201c; --muted: #4a5750; --accent: #0f6b61; --border: #cfd6cc; --border-strong: #8d968f; --surface: #fff; --surface-2: #eef0ea; --bg: #fefefe; color: #15201c; }
.brand { display: inline-flex; align-items: center; text-decoration: none; flex: none; }
.brand-logo { height: 34px; width: auto; display: block; background: #fff; border-radius: 4px; padding: 2px 8px; }
nav { flex: 1; display: flex; justify-content: center; align-items: center; gap: clamp(10px, 1.5vw, 24px); min-width: 0; }
nav a { position: relative; padding: 10px 1px; color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 700; letter-spacing: .005em; white-space: nowrap; }
nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
nav a:hover::after, nav a.active::after { transform: scaleX(1); }
nav a.active { color: var(--accent); }
.theme-btn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; background: transparent; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--text); cursor: pointer; transition: background-color .18s, border-color .18s; touch-action: manipulation; }
.theme-btn:hover { background: var(--surface-2); }
.theme-btn svg { width: 20px; height: 20px; }

main { padding: calc(var(--nav-h) + clamp(24px, 4vw, 48px)) 0 40px; min-height: 70vh; }
body.is-home main { padding-top: 0; }
main:focus { outline: none; }

/* ---------- hero: the video is the page, full screen, and the bar sits on it ---------- */
.hero-full { --text: #15201c; --muted: #4a5750; --accent: #0f6b61; --accent-ink: #fff; --border: #cfd6cc; --border-strong: #15201c; --bg: #fefefe; --ring: #0f6b61; color: var(--text);
  position: relative; display: grid; align-items: end; height: 100vh; height: 100svh; min-height: 560px; background: var(--stage); overflow: hidden; isolation: isolate; }
.hero-media { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; z-index: -1; }
/* the frame keeps the footage's 16:9 so its edges can be feathered; narrow screens show all of it (white bars are invisible
   against the white footage), wide screens fill the viewport */
.hero-frame { width: min(100vw, calc(100svh * 16 / 9)); aspect-ratio: 16 / 9; transform: translateY(-3svh); -webkit-mask-image: linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent); }
@media (min-aspect-ratio: 43 / 25) { .hero-frame { width: max(100vw, calc(100svh * 16 / 9)); } }   /* fill only when the crop is under ~3%, so the wordmark never touches an edge */
.hero-video { display: block; width: 100%; height: 100%; object-fit: fill; background: var(--stage); }
.hero-copy { width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 var(--gutter) clamp(56px, 8svh, 84px); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 40px; align-items: end; }
/* frosted panel: the footage zooms into the letters behind the copy at 5-6 s, so the words sit on a translucent white pane
   (80% white keeps ink text above 10:1 and the muted line above 5.5:1 even over the darkest teal) */
.hero-text { width: fit-content; max-width: 100%; padding: 20px 28px 24px; border: 1px solid rgba(21, 32, 28, .1); border-radius: 8px; background: rgba(254, 254, 254, .8); -webkit-backdrop-filter: blur(14px) saturate(1.15); backdrop-filter: blur(14px) saturate(1.15); box-shadow: 0 10px 30px -18px rgba(21, 32, 28, .35); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .hero-text { background: rgba(254, 254, 254, .94); } }
.hero-cta .btn.secondary { background: rgba(254, 254, 254, .86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.hero-cta .btn.secondary:hover { background: var(--text); }
.hero-copy .rule { display: block; width: 56px; height: 3px; background: var(--accent); margin-bottom: 14px; }
.hero-copy h1 { font-size: clamp(1.4rem, .9rem + 1.5vw, 2.05rem); max-width: none; margin: 0 0 .3em; }
.hero-sub { max-width: 62ch; margin: 0; color: #424f48; font-size: clamp(1rem, .95rem + .2vw, 1.1rem); }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.hero-toggle { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid #b9c2b9; background: rgba(255, 255, 255, .92); color: #15201c; display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 3px rgba(20, 35, 28, .18); touch-action: manipulation; transition: background-color .18s, transform .18s; }
.hero-toggle:hover { background: #fff; transform: scale(1.05); }
.hero-toggle:active { transform: scale(.96); }
.hero-toggle[hidden] { display: none; }
.scroll-cue { position: absolute; left: 50%; bottom: 10px; width: 44px; height: 44px; margin-left: -22px; display: grid; place-items: center; color: var(--text); border-radius: 50%; border: 0; background: none; cursor: pointer; }
.scroll-cue svg { width: 22px; height: 22px; animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { 0%, 100% { transform: translateY(-3px); opacity: .55; } 50% { transform: translateY(4px); opacity: 1; } }

/* ---------- sections, cards ---------- */
.sec { padding-top: clamp(44px, 7vw, 96px); }
.sec-head { display: flex; align-items: baseline; gap: 16px; padding-bottom: 12px; margin-bottom: 26px; border-bottom: 1px solid var(--border-strong); }
.sec-head h2 { margin: 0; }
.sec-no { font: 500 .8rem/1 var(--mono); letter-spacing: .1em; color: var(--accent); }
.about { display: block; }
.about .lead { font-family: var(--serif); font-size: clamp(1.25rem, 1rem + .9vw, 1.65rem); line-height: 1.42; color: var(--text); margin: 0; max-width: none; text-wrap: pretty; }
.about > div:empty { display: none; }
.about > div:not(:empty) { margin-top: 22px; }
.lead { font-size: 1.12rem; color: var(--muted); }                 /* description under a page title: the full width of the page, like the content below it */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.card h3 { margin-top: 0; }
.grid { display: grid; gap: clamp(12px, 2vw, 20px); }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.stat { position: relative; padding-top: 26px; }
.stat::before { content: ""; position: absolute; left: 22px; top: 0; width: 34px; height: 3px; background: var(--accent); }
.stat .num { font-family: var(--serif); font-size: clamp(2.3rem, 1.7rem + 1.7vw, 3.2rem); font-weight: 600; line-height: 1; letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; }
.stat .cap { margin-top: 12px; font-size: .92rem; font-weight: 700; }
.stat .sub { margin-top: 6px; font-size: .82rem; color: var(--muted); line-height: 1.5; }
.eng { display: flex; flex-direction: column; gap: 4px; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.eng:hover { border-color: var(--accent); transform: translateY(-2px); }
.eng-no { font: 500 .74rem/1 var(--mono); letter-spacing: .12em; color: var(--accent); margin-bottom: 8px; }
.eng p { color: var(--muted); }
.eng a { margin-top: auto; font-weight: 700; }

.chip { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.neutral { background: var(--neutral-bg); color: var(--neutral); }
.callout { border-left: 3px solid var(--warn); background: var(--warn-bg); color: var(--text); padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; margin: 16px 0; font-size: .95rem; }
.callout.info { border-color: var(--accent); background: var(--accent-soft); }
.callout.bad { border-color: var(--bad); background: var(--bad-bg); }
.callout strong:first-child { display: inline-block; margin-right: 4px; }

/* tables read like a journal: rules, not boxes; figures in tabular mono */
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
thead th { border-top: 2px solid var(--text); border-bottom: 1px solid var(--text); }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
tbody tr:last-child td { border-bottom: 1px solid var(--text); }
td.num, th.num { text-align: right; font-family: var(--mono); font-size: .86em; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; }

select, input[type=text], input[type=search] { font: inherit; min-height: 42px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--surface); color: var(--text); max-width: 100%; }
select:hover, input:hover { border-color: var(--text); }
label { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 4px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: 700 .95rem var(--font); letter-spacing: .01em; text-decoration: none; cursor: pointer; touch-action: manipulation; transition: background-color .18s, color .18s, border-color .18s, transform .18s; }
.btn:hover { background: color-mix(in srgb, var(--accent) 85%, #000); border-color: color-mix(in srgb, var(--accent) 85%, #000); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn.secondary:hover { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- map and place explorer ---------- */
.maplayout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .maplayout { grid-template-columns: minmax(0, 1fr); } }   /* minmax(0,..): a select with a long option must not widen the page */
#map { height: min(74vh, 720px); min-height: 400px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface-2); }
.legend { margin-top: 12px; }
.legend .bar { height: 12px; border-radius: 2px; border: 1px solid var(--border); }
.legend .ends { display: flex; justify-content: space-between; font: 400 .76rem var(--mono); color: var(--muted); margin-top: 4px; }
.swatch { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; font-size: .82rem; }
.swatch i { width: 14px; height: 14px; border-radius: 2px; border: 1px solid var(--border); display: inline-block; }
.side h3 { margin-top: 0; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 3px 14px; font-size: .86rem; }
.kv span:nth-child(odd) { color: var(--muted); }
.kv span:nth-child(even) { text-align: right; font-family: var(--mono); font-size: .9em; font-variant-numeric: tabular-nums; }
.seg { display: flex; border: 1px solid var(--border-strong); border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.seg button { flex: 1; min-height: 44px; font: 700 .86rem var(--font); padding: 6px; border: 0; background: var(--surface); color: var(--text); cursor: pointer; transition: background-color .18s, color .18s; }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button:hover { background: var(--surface-2); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
label.chk { display: flex; align-items: center; gap: 10px; font-size: .9rem; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text); margin: 9px 0 0; min-height: 28px; }
label.chk input { accent-color: var(--accent); width: 18px; height: 18px; }
.opts { margin-top: 16px; padding-top: 6px; border-top: 1px solid var(--border); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.map-img { image-rendering: auto; }
#map .leaflet-control-attribution { font-size: 10px; max-width: 70%; }
.leaflet-popup-content { font: 13px/1.5 var(--font); }
.xhair { background: none; border: 0; }
.xhair i { position: absolute; inset: 0; }
.xhair i::before, .xhair i::after { content: ""; position: absolute; background: var(--text); box-shadow: 0 0 0 1.5px var(--surface); }
.xhair i::before { left: 12px; top: 3px; width: 2px; height: 20px; }
.xhair i::after { top: 12px; left: 3px; height: 2px; width: 20px; }

svg.chart { width: 100%; height: auto; display: block; }
svg.chart text { fill: var(--text); font-family: var(--font); }
svg.chart .tick { font-size: 11.5px; fill: var(--muted); font-family: var(--mono); }
svg.chart .label { font-size: 12px; fill: var(--muted); }
svg.chart .grid { stroke: var(--border); stroke-width: 1; }
svg.chart .axis { stroke: var(--muted); stroke-width: 1.2; }
svg.chart .whisker { stroke: var(--text); stroke-width: 1.6; opacity: .7; }

.toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 14px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--surface); cursor: pointer; font-weight: 700; font-size: .9rem; user-select: none; }
.toggle input { accent-color: var(--accent); }
.engine { scroll-margin-top: calc(var(--nav-h) + 16px); }
.engine ul { padding-left: 1.2em; margin: 0 0 .5em; }
.engine li { margin-bottom: .6em; }
.plainbox li { font-size: 1.04rem; }
.refitem { padding: 12px 0; border-bottom: 1px solid var(--border); }
.refitem { overflow-wrap: anywhere; }       /* dataset identifiers such as aegis_ecosystem_services_value_and_restoration_cost have no break points */
.refitem .t { font-weight: 700; }
.loading { padding: 80px 0; text-align: center; color: var(--muted); }

/* page titles (every page opens with a wrap > h1) */
main > .wrap > h1:first-child { padding-bottom: .4em; border-bottom: 1px solid var(--border-strong); margin-bottom: .7em; }

/* ---------- footer ---------- */
footer { margin-top: clamp(56px, 9vw, 112px); border-top: 1px solid var(--border-strong); background: var(--surface); }
.foot { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); padding-block: 44px 52px; font-size: .92rem; }
.foot-name { font: 600 1.25rem/1.2 var(--serif); margin: 0 0 10px; max-width: 24ch; }
.foot p { color: var(--muted); max-width: 44ch; }
.foot h4 { font: 700 .72rem/1 var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 4px 0 12px; }
.foot a { display: block; padding: 5px 0; color: var(--text); text-decoration: none; }
.foot a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- scroll reveal (home only; always shows after 1.2 s even if the observer never fires) ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { nav a { font-size: .86rem; } .about { grid-template-columns: 1fr; } .foot { grid-template-columns: 1fr 1fr; } .foot > :first-child { grid-column: 1 / -1; } }
@media (max-width: 900px) {
  :root { --nav-h: 56px; }
  .topbar .wrap { gap: 10px; }
  .scroll-cue { display: none; }
}
@media (max-width: 900px) { .hero-copy { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .foot { grid-template-columns: 1fr; } .hero-sub { font-size: .98rem; } }
@media (max-height: 780px) { .hero-sub { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* citation and copyright */
.cite { padding-block: 8px 36px; border-top: 1px solid var(--border); }
.cite-main { padding-top: 28px; max-width: 920px; }
.cite h4 { font: 700 .72rem/1 var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 12px; }
.cite-text { font-family: var(--serif); font-size: 1.12rem; line-height: 1.5; margin: 0 0 14px; max-width: 78ch; overflow-wrap: anywhere; }
.cite-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.small-btn { min-height: 40px; padding: 0 14px; font-size: .88rem; }
.cite-bibtex { margin: 6px 0 10px; }
.cite-bibtex summary { cursor: pointer; font-weight: 700; font-size: .9rem; padding: 6px 0; }
.cite-bibtex pre { margin: 6px 0 0; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.cite-bibtex code { background: none; padding: 0; font-size: .84rem; line-height: 1.55; }
.legal { border-top: 1px solid var(--border); background: var(--bg); font-size: .85rem; color: var(--muted); }
.legal .wrap { padding-top: 16px; padding-bottom: 20px; }

/* author */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.author { display: grid; grid-template-columns: minmax(220px, 340px) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.author-photo { margin: 0; }
.author-photo img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
.author-bio h2 { margin-top: 0; }
.author-bio p { max-width: 64ch; }
.author-role { color: var(--muted); font-weight: 700; margin-bottom: 1.2em; }
.author-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 22px; align-items: center; max-width: 820px; }
.author-card img { width: 112px; height: 112px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border-strong); }
.author-name { font: 600 1.35rem/1.2 var(--serif); margin: 0 0 6px; }
.author-card p { margin-bottom: .6em; }
@media (max-width: 760px) { .author { grid-template-columns: 1fr; } .author-photo { max-width: 360px; } .author-card { grid-template-columns: 84px minmax(0, 1fr); gap: 16px; } .author-card img { width: 84px; height: 84px; } }


/* acknowledgments: margin-label rows, then the project fact sheet */
.ack-rows { margin-top: 4px; }
.ack-row { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: clamp(20px, 5vw, 72px); padding: clamp(22px, 3.5vw, 40px) 0; border-bottom: 1px solid var(--border); }
.ack-row:last-child { border-bottom: 0; }
.ack-label { display: flex; gap: 14px; align-items: baseline; }
.ack-no { font: 500 .8rem/1 var(--mono); letter-spacing: .1em; color: var(--accent); }
.ack-label h2 { margin: 0; font-size: 1.22rem; line-height: 1.25; }
.ack-text p { max-width: 68ch; margin: 0; font-size: 1.12rem; line-height: 1.7; text-wrap: pretty; hyphens: auto; }
.foracca { padding-top: clamp(40px, 6vw, 80px); }
.foracca-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.foracca-lead { font: 400 clamp(1.3rem, 1rem + .9vw, 1.65rem)/1.4 var(--serif); margin: 0 0 1.4em; max-width: 36ch; }
.foracca-text h3 { font: 700 .72rem/1 var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 1.8em 0 .8em; }
.foracca-text p { max-width: 64ch; text-wrap: pretty; }
.foracca-aims { list-style: none; margin: 0; padding: 0; max-width: 64ch; }
.foracca-aims li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.foracca-aims li:last-child { border-bottom: 1px solid var(--border); }
.foracca-aims li span { font: 500 .85rem/1.7 var(--mono); color: var(--accent); }
.factsheet { margin: 0; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 22px; }
.factsheet > div { padding: 14px 0; border-bottom: 1px solid var(--border); }
.factsheet > div:last-child { border-bottom: 0; }
.factsheet dt { font: 700 .72rem/1 var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; }
.factsheet dd { margin: 0; font-size: 1rem; line-height: 1.5; }
.ack-foot { margin-top: 28px; }
@media (max-width: 900px) { .ack-row { grid-template-columns: 1fr; gap: 12px; } .foracca-grid { grid-template-columns: 1fr; } .foracca-lead { max-width: none; } }

/* navbar: brand left, items centred on the page, theme button right (wide screens); narrower screens centre the items between the two */
@media (min-width: 1200px) {
  .topbar .wrap { display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); }
  .topbar .brand { justify-self: start; }
  .topbar nav { flex: none; justify-content: center; }
  .topbar .tools { justify-self: end; }
}
/* hyphenation helps a long measure but fragments words in a narrow phone column */
.ack-text p { hyphens: manual; }
@media (min-width: 901px) { .ack-text p { hyphens: auto; hyphenate-limit-chars: 7 3 3; } }

/* below 1100 px the items no longer fit on one line: a single scrolling row, centred when it fits ("safe" falls back to the start when it does not) */
@media (max-width: 1100px) {
  .topbar .wrap { gap: 10px; }
  nav { gap: 9px; justify-content: flex-start; justify-content: safe center; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
  nav::-webkit-scrollbar { display: none; }
  nav a { flex: 0 0 auto; scroll-snap-align: center; min-height: 44px; display: inline-flex; align-items: center; padding: 0 4px; font-size: .84rem; }
  nav a::after { bottom: 8px; left: 4px; right: 4px; }
}

/* ---------- Method: typeset formulas (ui/math.js) ---------- */
.engine .katex { font-size: 1.04em; }
.tex:not(.done) { font-family: var(--mono); font-size: .88em; color: var(--muted); }
.tex-fail { color: var(--bad); }
.flow { margin: 20px 0 22px; }
.flow-svg { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 10px; aspect-ratio: 888 / 780; }
.flow-svg svg { display: block; width: 100%; height: auto; }
.fig-arch {
  --svg-run: var(--good-bg); --svg-reduced: var(--warn-bg); --svg-built: #e8eef6; --svg-none: var(--bad-bg); --svg-drv: var(--surface-2);
  --svg-paper: var(--surface); --svg-ink: var(--text); --svg-mute: var(--muted); --svg-line: var(--c4);
}
:root[data-theme="dark"] .fig-arch { --svg-built: #22314a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fig-arch { --svg-built: #22314a; } }

/* ---------- enlarged chart (Charts.zoom) ---------- */
.zoomable { position: relative; cursor: zoom-in; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.zoomable:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.zoom-hint { position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; color: var(--muted); opacity: 0; transition: opacity .15s var(--ease); }
.zoomable:hover .zoom-hint, .zoomable:focus-visible .zoom-hint { opacity: 1; }
@media (hover: none) { .zoom-hint { opacity: .8; } }
dialog.zoom { width: min(1040px, calc(100vw - 16px)); max-width: calc(100vw - 16px); max-height: 94vh; padding: 0; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55); overflow: auto; overscroll-behavior: contain; }
dialog.zoom::backdrop { background: rgba(10, 15, 13, .62); backdrop-filter: blur(2px); }
.zoom-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.zoom-head h3 { margin: 0; font-size: 1.3rem; }
.zoom-x { min-width: 44px; min-height: 44px; border: 1px solid var(--border-strong); border-radius: 4px; background: none; color: var(--text); font-size: 1.7rem; line-height: 1; cursor: pointer; }
.zoom-x:hover { background: var(--surface-2); }
.zoom-body { padding: 14px 20px 22px; }
.zoom-table { margin-top: 14px; font-size: .9rem; }
html:has(dialog.zoom[open]) { overflow: hidden; }          /* the page behind the enlarged chart does not scroll */
svg.chart.big .tick { font-size: 14px; }
svg.chart.big .label { font-size: 14.5px; }

/* ---------- phones: the page list becomes a menu ---------- */
.menu-btn { display: none; flex: none; width: 44px; height: 44px; place-items: center; background: transparent; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--text); cursor: pointer; touch-action: manipulation; }
.menu-btn:hover { background: var(--surface-2); }
.menu-btn svg { width: 22px; height: 22px; }
.menu-btn .m-close { display: none; }
.menu-btn[aria-expanded="true"] .m-open { display: none; }
.menu-btn[aria-expanded="true"] .m-close { display: inline; }
@media (max-width: 760px) {
  .menu-btn { display: grid; }
  .topbar .tools { margin-left: auto; }
  .topbar .wrap { gap: 10px; }
  #mainnav { display: none; position: fixed; top: var(--nav-h); left: 0; right: 0; max-height: calc(100dvh - var(--nav-h)); overflow-y: auto; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; padding: 6px var(--gutter) 18px; background: var(--surface); border-bottom: 1px solid var(--border-strong); box-shadow: 0 24px 40px -24px rgba(0, 0, 0, .45); overscroll-behavior: contain; }
  #mainnav.open { display: flex; }
  #mainnav a { flex: none; min-height: 52px; padding: 0 4px; font-size: 1.05rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; scroll-snap-align: none; }
  #mainnav a::after { display: none; }
  #mainnav a.active { color: var(--accent); }
  #mainnav a.active::before { content: ""; width: 4px; height: 22px; border-radius: 2px; background: var(--accent); margin-right: 12px; }
  body.menu-open .topbar { background: var(--surface); border-bottom-color: var(--border); }
  body.is-home.menu-open .topbar { --text: var(--text); }
}


/* =====================================================================================================================
   Design refresh: ink band for the findings, relief artwork from the project's own terrain, photographs with credits,
   header tools, dark footer. Every colour is a token above; nothing here changes a number.
   ===================================================================================================================== */

/* ---------- header tools: search, menu, theme ---------- */
.tools { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.search-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: transparent; color: var(--text); font: 700 .88rem var(--font); cursor: pointer; touch-action: manipulation; transition: background-color .18s, border-color .18s; }
.search-btn:hover { background: var(--surface-2); border-color: var(--text); }
.search-btn svg { width: 20px; height: 20px; flex: none; }
.search-btn kbd { font: 500 .68rem/1 var(--mono); padding: 4px 6px; border-radius: 4px; border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface); }
@media (max-width: 1199px) { .search-btn .search-text, .search-btn kbd { display: none; } .search-btn { width: 44px; padding: 0; justify-content: center; } }
@media (hover: none) { .search-btn kbd { display: none; } }

/* ---------- inner pages: contour lines of Armenia's own terrain, faint, behind the page title ---------- */
main { position: relative; isolation: isolate; }
body:not(.is-home) main::before { content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: clamp(240px, 30vw, 380px); pointer-events: none;
  background: linear-gradient(to bottom, var(--accent), transparent 92%); opacity: .16;
  -webkit-mask: url(assets/relief.svg) right clamp(-160px, -6vw, 0px) top 12px / auto 150% no-repeat; mask: url(assets/relief.svg) right clamp(-160px, -6vw, 0px) top 12px / auto 150% no-repeat; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body:not(.is-home) main::before { opacity: .22; } }
:root[data-theme="dark"] body:not(.is-home) main::before { opacity: .22; }
@media (max-width: 700px) { body:not(.is-home) main::before { opacity: .1; } }

/* ---------- overview: the evidence base in one ruled line ---------- */
.ledger { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin: 28px 0 6px; padding: 0; background: var(--border-strong); border-top: 2px solid var(--text); border-bottom: 1px solid var(--border-strong); }
.ledger > div { background: var(--bg); padding: 14px 16px 14px 18px; }
.ledger > div:first-child { padding-left: 0; }
.ledger dt { font: 700 .68rem/1.2 var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.ledger dd { margin: 6px 0 0; font: 600 clamp(1.7rem, 1.3rem + 1vw, 2.2rem)/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.ledger small { display: block; margin-top: 6px; font: 400 .78rem/1.3 var(--font); color: var(--muted); }
@media (max-width: 900px) { .ledger { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ledger > div:first-child { padding-left: 18px; } }
@media (max-width: 560px) { .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- the findings band ---------- */
.band { position: relative; margin-top: clamp(48px, 7vw, 96px); padding: clamp(36px, 5.5vw, 76px) 0 clamp(40px, 6vw, 84px); color: var(--band-ink); border-block: 1px solid rgba(126, 224, 205, .18);
  background: radial-gradient(1100px 480px at 6% -8%, rgba(126, 224, 205, .13), transparent 62%), radial-gradient(900px 420px at 100% 108%, rgba(141, 184, 238, .12), transparent 60%), linear-gradient(180deg, var(--band), var(--band-2)); }
.band a { color: var(--mint); }
.band .sec-head { border-bottom-color: var(--band-line); }
.band .sec-no { color: var(--mint); }
.band h2 { color: var(--band-ink); margin-top: 0; }
.band-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(26px, 4.5vw, 64px); align-items: start; }
.band-lead { font: 400 clamp(1.15rem, 1rem + .55vw, 1.4rem)/1.5 var(--serif); color: var(--band-ink); margin: 0; text-wrap: pretty; min-height: 4.5em; }
.scen { display: grid; gap: 10px; margin: 20px 0 6px; }
.scen-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.scen-label { flex: 0 0 104px; font: 700 .7rem/1.2 var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--band-muted); }
.seg-on-band { display: inline-flex; max-width: 100%; padding: 3px; border: 1px solid var(--band-card-line); border-radius: 999px; background: rgba(0, 0, 0, .2); }
.opt { position: relative; display: block; margin: 0; text-transform: none; letter-spacing: 0; font-size: inherit; color: inherit; }
.opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.opt span { display: grid; place-items: center; min-height: 44px; padding: 0 clamp(11px, 2.4vw, 17px); border-radius: 999px; font: 700 .9rem var(--font); color: var(--band-ink); white-space: nowrap; transition: background-color .18s var(--ease), color .18s var(--ease); }
.opt:hover span { background: rgba(255, 255, 255, .1); }
.opt input:checked + span, .opt:hover input:checked + span { background: var(--mint); color: #062520; }
.opt input:focus-visible + span { outline: 3px solid var(--band-ink); outline-offset: 2px; }
.relief { margin: 26px 0 0; }
.relief[hidden] { display: none; }
.relief-art svg { display: block; width: 100%; height: auto; max-height: 440px; }
.relief .minor { stroke: var(--band-ink); stroke-opacity: .2; }
.relief .major { stroke: var(--band-ink); stroke-opacity: .5; }
.relief .outline { stroke: var(--band-ink); stroke-opacity: .85; }
.relief .hl0, .relief .hl1 { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.relief .hl0 { stroke: var(--mint); stroke-width: 2.2; }
.relief .hl1 { stroke: var(--sp585); stroke-width: 2.6; stroke-dasharray: 7 4; }
.relief .hl1.s126, .key.k1.s126 { stroke: var(--sp126); border-color: var(--sp126); } .relief .hl1.s370, .key.k1.s370 { stroke: var(--sp370); border-color: var(--sp370); } .relief .hl1.s585, .key.k1.s585 { stroke: var(--sp585); border-color: var(--sp585); }
.relief figcaption { margin-top: 10px; font-size: .86rem; line-height: 1.55; color: var(--band-muted); }
.relief figcaption b { color: var(--band-ink); font-weight: 600; }
.relief .muted { color: var(--band-muted); }
.key { display: inline-block; width: 24px; height: 0; margin-right: 6px; vertical-align: middle; border-top: 2.5px solid var(--mint); }
.key.k1 { border-top: 2.5px dashed var(--sp585); }

.fcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.fcards > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.fcard { display: flex; flex-direction: column; padding: 20px 22px 18px; border: 1px solid var(--band-card-line); border-radius: 14px; background: var(--band-card); transition: border-color .2s var(--ease), background-color .2s var(--ease); }
.fcard:hover { border-color: rgba(126, 224, 205, .5); background: rgba(255, 255, 255, .08); }
.fcard .eyebrow { font: 500 .66rem/1 var(--mono); letter-spacing: .13em; color: var(--mint); }
.fcard h3 { margin: 10px 0 0; font: 600 1.3rem/1.15 var(--serif); color: var(--band-ink); }
.fnum { margin: 10px 0 0; font: 600 clamp(2.5rem, 1.9rem + 2vw, 3.5rem)/1 var(--serif); letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; color: var(--band-ink); }
.fnum small { margin-left: 2px; font-size: .5em; font-weight: 500; color: var(--band-muted); }
.fwhat { margin: 4px 0 8px; font-size: .86rem; line-height: 1.4; color: var(--band-muted); }
.fdelta { margin: 0 0 4px; font-size: .9rem; line-height: 1.4; color: var(--band-ink); }
.fdelta span { color: var(--band-muted); }
.fdelta b { font-weight: 700; }
.frange { margin: 2px 0 0; font-size: .83rem; line-height: 1.4; color: var(--band-muted); }
.frange b { color: var(--band-ink); font-weight: 600; }
.flink { margin-top: auto; padding-top: 12px; font-weight: 700; font-size: .92rem; text-decoration: none; }
.flink:hover { text-decoration: underline; }
.fcards.tick .fnum { animation: tickin .38s var(--ease); }
@keyframes tickin { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.spark { display: block; width: 100%; height: auto; margin: 8px 0 2px; overflow: visible; }
.spark .sp-axis, .spark .sp-tick { stroke: var(--band-line); stroke-width: 1; }
.spark .sp-x { font: 400 9.5px var(--mono); fill: var(--band-muted); }
.spark .sp-band { fill: var(--band-ink); opacity: .13; }
.spark .sp-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.spark .sp-line.ctx { stroke-width: 1.3; stroke-dasharray: 3 3; opacity: .55; }
.spark .sp-line.sel { stroke-width: 2.4; }
.spark .sp-dot { stroke: var(--band); stroke-width: 1.2; }
.spark .sp-dot.on { stroke: var(--band-ink); stroke-width: 1.6; }
.spark .sp-end { font: 600 11px var(--mono); fill: var(--band-ink); }
.spark .sp-line.s126 { stroke: var(--sp126); } .spark .sp-line.s370 { stroke: var(--sp370); } .spark .sp-line.s585 { stroke: var(--sp585); }
.spark .sp-dot.s126 { fill: var(--sp126); } .spark .sp-dot.s370 { fill: var(--sp370); } .spark .sp-dot.s585 { fill: var(--sp585); }

.band-foot { margin-top: 18px; color: var(--band-muted); }
.band-foot .small { margin: 0 0 8px; max-width: 78ch; }
.band .chip.good { background: rgba(126, 224, 205, .16); color: var(--mint); }
.band .chip.neutral { background: rgba(255, 255, 255, .1); color: var(--band-ink); }
.pathkey { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 8px; font-size: .82rem; }
.pathkey span { display: inline-flex; align-items: center; gap: 7px; }
.pathkey i { display: inline-block; width: 18px; height: 0; border-top: 2.5px solid; }
.pathkey .s126 { border-color: var(--sp126); } .pathkey .s370 { border-color: var(--sp370); } .pathkey .s585 { border-color: var(--sp585); }
.howto summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 700; color: var(--band-ink); }
.howto dl { margin: 0 0 6px; max-width: 78ch; }
.howto dt { margin-top: 12px; font-weight: 700; color: var(--band-ink); }
.howto dd { margin: 2px 0 0; font-size: .92rem; line-height: 1.55; }
@media (max-width: 1060px) { .band-grid { grid-template-columns: minmax(0, 1fr); } .relief-art svg { max-height: 380px; } }
@media (max-width: 560px) { .fcards { grid-template-columns: minmax(0, 1fr); } .scen-label { flex-basis: 100%; } .band-lead { min-height: 0; } }

/* ---------- landscapes: photographs, each with its credit on the image ---------- */
.landscapes { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: clamp(190px, 21vw, 300px); gap: 14px; margin: 24px 0 14px; }
.photo { position: relative; margin: 0; overflow: hidden; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.photo.p1, .photo.p4 { grid-column: span 7; }
.photo.p2, .photo.p3 { grid-column: span 5; }
.photo-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.photo:hover img { transform: scale(1.035); }
.photo figcaption { position: absolute; inset: auto 0 0 0; display: grid; gap: 2px; padding: 42px 16px 12px; color: #fff; font-size: .8rem; line-height: 1.35; background: linear-gradient(to top, rgba(5, 14, 12, .86), rgba(5, 14, 12, 0)); pointer-events: none; }
.photo figcaption strong { font: 600 1.08rem/1.2 var(--serif); }
.photo figcaption a { color: #fff; pointer-events: auto; text-decoration: underline; text-underline-offset: 2px; }
.credit { font-size: .72rem; line-height: 1.4; }
.photo figcaption .credit { opacity: .95; }
@media (max-width: 760px) { .landscapes { grid-auto-rows: clamp(200px, 58vw, 320px); } .photo.p1, .photo.p2, .photo.p3, .photo.p4 { grid-column: 1 / -1; } }
.photo-big { margin: 0; }
.photo-big img { display: block; width: 100%; height: auto; border-radius: 8px; }
.photo-big figcaption { margin-top: 12px; font-size: .92rem; line-height: 1.55; }
.photo-big .credit { display: block; margin-top: 6px; font-size: .82rem; color: var(--muted); }

/* ---------- engines and "where to look" ---------- */
.eng-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.eng-top .eng-no { margin-bottom: 0; }
.eng h3 { margin-bottom: .1em; letter-spacing: .01em; }
.eng-sub { margin: 0 0 8px; font-weight: 600; color: var(--text) !important; font-size: .96rem; }
.look { display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none; transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); }
.look:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 14px 28px -18px rgba(14, 31, 26, .45); }
.look h3 { margin: 6px 0 0; }
.look p { margin: 0; color: var(--muted); }
.look-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.look-ic svg { width: 25px; height: 25px; }
.look-go { margin-top: auto; padding-top: 10px; font-weight: 700; color: var(--accent); }

/* ---------- footer: the same ink as the findings band, with the relief behind it ---------- */
footer { position: relative; isolation: isolate; border-top: 0; color: var(--band-ink); background: linear-gradient(180deg, var(--band-2), var(--band)); }
footer::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--band-ink); opacity: .06;
  -webkit-mask: url(assets/relief.svg) right 3% center / auto 170% no-repeat; mask: url(assets/relief.svg) right 3% center / auto 170% no-repeat; }
footer a, footer .foot a { color: var(--band-ink); }
footer .foot-name { color: var(--band-ink); }
footer .foot p, footer .foot h4, footer .cite h4, footer .small.muted, footer .legal { color: var(--band-muted); }
footer .foot a:hover, footer .legal a:hover { color: var(--mint); }
footer .cite { border-top-color: var(--band-line); }
footer .cite-text { color: var(--band-ink); }
footer .cite-bibtex pre { background: rgba(0, 0, 0, .28); border-color: var(--band-line); color: var(--band-ink); }
footer .cite-bibtex code { color: var(--band-ink); }
footer .btn.secondary { color: var(--band-ink); border-color: var(--band-card-line); background: transparent; }
footer .btn.secondary:hover { background: var(--band-ink); color: var(--band); border-color: var(--band-ink); }
footer .legal { background: rgba(0, 0, 0, .25); border-top-color: var(--band-line); }
footer a:focus-visible, footer button:focus-visible, footer summary:focus-visible { outline-color: var(--mint); }

/* ---------- search palette (palette.js) ---------- */
dialog.palette { width: min(640px, calc(100vw - 16px)); max-width: calc(100vw - 16px); margin: min(14vh, 120px) auto 0; padding: 0; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 34px 90px -24px rgba(0, 0, 0, .55); overflow: hidden; }
dialog.palette::backdrop { background: rgba(8, 18, 15, .6); backdrop-filter: blur(3px); }
.pal-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--border); }
.pal-head svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.pal-head input { flex: 1; min-width: 0; min-height: 52px; border: 0; background: transparent; color: var(--text); font: 400 1.1rem var(--font); }
.pal-head input:focus { outline: none; }
.pal-head input:hover { border: 0; }
.pal-x { min-width: 44px; min-height: 44px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: 500 .72rem var(--mono); cursor: pointer; }
.pal-x:hover { background: var(--surface-2); }
.pal-list { list-style: none; margin: 0; padding: 6px; max-height: min(56vh, 460px); overflow-y: auto; }
.pal-group { padding: 10px 12px 4px; font: 700 .68rem/1 var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.pal-item { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.pal-item[aria-selected="true"] { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
.pal-item .pal-t { font-weight: 600; }
.pal-item .pal-s { flex: none; font-size: .8rem; color: var(--muted); text-align: right; }
.pal-empty { padding: 22px 16px; color: var(--muted); }
.pal-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: .78rem; color: var(--muted); }
.pal-foot kbd { font: 500 .7rem var(--mono); padding: 2px 5px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--surface-2); }
html:has(dialog.palette[open]) { overflow: hidden; }

.howto summary { list-style: none; gap: 8px; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--band-card-line); border-radius: 50%; font: 500 .95rem/1 var(--mono); color: var(--mint); }
.howto[open] summary::before { content: "\2212"; }
.engines-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .engines-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .engines-grid { grid-template-columns: minmax(0, 1fr); } }
.look-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .look-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .look-grid { grid-template-columns: minmax(0, 1fr); } }
footer .legal a { text-decoration: underline; }

.photo-credits ul { margin: 14px 0 0; padding-left: 1.1em; max-width: 68ch; }
.photo-credits li { margin-bottom: .7em; font-size: 1rem; line-height: 1.55; }

/* narrow screens: controls and sentence first, then the cards, then the relief */
@media (max-width: 1060px) {
  .band-intro { display: contents; }
  .band-intro > .sec-head, .band-intro > .band-lead, .band-intro > .scen { grid-column: 1; }
  .band-main { order: 4; }
  .relief { order: 5; margin-top: 0; }
}

/* ---------- second pass: reserved space for the relief, download button ---------- */
.relief-art { aspect-ratio: 556 / 562; max-height: 440px; }
.relief-art:empty { border-radius: 12px; background: rgba(255, 255, 255, .045); }
.relief-art svg { height: 100%; }
.band-dl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 6px; }
.dl-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--band-card-line); border-radius: 999px; background: rgba(255, 255, 255, .06); color: var(--band-ink); font: 700 .88rem var(--font); cursor: pointer; touch-action: manipulation; transition: background-color .18s, border-color .18s; }
.dl-btn:hover { background: rgba(126, 224, 205, .16); border-color: rgba(126, 224, 205, .55); }
.dl-btn svg { width: 18px; height: 18px; color: var(--mint); }

/* ---------- photographic page banner (app.js bannerize) ---------- */
body.has-ban main { padding-top: var(--nav-h); }
body.has-ban main::before { display: none; }
.pageban { position: relative; isolation: isolate; display: grid; align-items: end; min-height: clamp(220px, 27vw, 330px); margin: 0 0 clamp(20px, 3vw, 36px); overflow: hidden; background: var(--band); color: #fff; }
.pageban img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.pageban::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(5, 16, 14, .86) 0%, rgba(5, 16, 14, .5) 52%, rgba(5, 16, 14, .22) 100%); }
.pageban-in { width: 100%; padding-top: 28px; padding-bottom: clamp(34px, 4.5vw, 52px); }
.pageban h1 { margin: 0; padding: 0; border: 0; color: #fff; text-shadow: 0 1px 18px rgba(0, 0, 0, .45); font-size: clamp(2.2rem, 1.5rem + 2.8vw, 3.5rem); }
.pageban figcaption { position: absolute; inset: auto 0 0 0; width: 100%; padding-bottom: 8px; pointer-events: none; }
.pageban .credit { display: block; font-size: .72rem; line-height: 1.35; color: rgba(255, 255, 255, .88); max-width: 120ch; }
.pageban .credit a { color: #fff; pointer-events: auto; text-decoration: underline; text-underline-offset: 2px; }
.pageban .credit a:focus-visible { outline-color: #fff; }

.fcard > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cgrid { font: 500 .64rem/1 var(--mono); letter-spacing: .06em; color: var(--band-muted); white-space: nowrap; }

/* ---------- Decision page: the portfolio on a map ---------- */
.dec-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 14px 20px; margin: 18px 0 14px; }
.dec-controls label { margin: 0; }
.dec-budget { font: 600 1.7rem/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; min-width: 4.5ch; }
.dec-controls input[type=range] { flex: 1 1 260px; min-height: 44px; accent-color: var(--accent); }
.dec-ticks { display: flex; justify-content: space-between; flex: 1 1 100%; margin: -6px 0 0; font: 400 .74rem var(--mono); color: var(--muted); }
.dec-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
#dmap { height: min(72vh, 680px); min-height: 420px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface-2); }
.dec-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: .84rem; }
.dec-legend span { display: inline-flex; align-items: center; gap: 7px; }
.dec-legend i, .sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(255, 255, 255, .55); flex: none; }
.dec-legend i.elig { background: rgba(40, 40, 40, .3); border-color: var(--border-strong); }
.dec-legend i.inel { background: transparent; border: 1px solid rgba(0, 0, 0, .3); }
.dec-side { display: grid; gap: 14px; }
.dec-side .card { padding: 16px 18px; }
.dec-side h3 { margin: 0 0 8px; font: 700 .72rem/1 var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.dstats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; margin: 0; }
.dstats dt { font: 700 .66rem/1.2 var(--font); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.dstats dd { margin: 3px 0 0; font: 600 1.35rem/1.1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.dstats small { display: block; margin-top: 3px; font: 400 .74rem/1.3 var(--font); color: var(--muted); }
.dg { display: grid; grid-template-columns: 14px minmax(70px, 1fr) minmax(60px, 2fr) auto; align-items: center; gap: 8px; margin: 6px 0; font-size: .86rem; }
.dgb { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.dgb i { display: block; height: 100%; }
.dgv { font: 400 .8rem var(--mono); color: var(--muted); }
#dmethods ul { margin: 0; padding-left: 1.1em; font-size: .86rem; }
#dmarz table { font-size: .84rem; }
#dmarz th, #dmarz td { padding: 5px 8px; }
#dcell { min-height: 8.5em; font-size: .86rem; line-height: 1.5; }
.dv { list-style: none; margin: 6px 0 0; padding: 0; }
.dv li { display: flex; gap: 8px; align-items: baseline; margin: 3px 0; color: var(--muted); }
.dec-details { margin-top: 20px; }
.dec-details > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font: 600 1.25rem/1.2 var(--serif); }
@media (max-width: 960px) { .dec-grid { grid-template-columns: minmax(0, 1fr); } #dmap { height: 60vh; min-height: 340px; } }

/* ---- variance partition: one stacked bar per metric ---- */
.part { margin: 14px 0 6px; }
.part-row { display: grid; grid-template-columns: minmax(130px, 210px) 1fr; gap: 6px 14px; align-items: center; margin: 7px 0; }
.part-row .lab { font-size: .88rem; font-weight: 600; line-height: 1.3; }
.part-row .lab small { display: block; font-weight: 400; color: var(--muted); font-size: .76rem; }
.stack { display: flex; height: 26px; border-radius: 4px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2, transparent); }
.stack > span { display: flex; align-items: center; justify-content: center; font: 700 .72rem var(--mono); color: #fff; min-width: 0; overflow: hidden; white-space: nowrap; }
.stack .s-gcm { background: var(--c1); } .stack .s-ssp { background: var(--c2); } .stack .s-horizon { background: var(--c3); } .stack .s-inter { background: var(--c4); }
:root[data-theme="dark"] .stack > span { color: #101418; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stack > span { color: #101418; } }
.part-key { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; margin: 6px 0 2px; }
.part-key i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
@media (max-width: 560px) { .part-row { grid-template-columns: 1fr; } }

.dec-cap { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.dec-cap label { font-weight: 600; font-size: .9rem; }
.dec-cap select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); font: inherit; min-height: 36px; }
