/* Veritas Now — design system.
 *
 * COLOUR + TYPE: unchanged from the original site — cream #e8e4d8 ground, navy
 * #1a2240 ink, teal #4a7c8e and warm gold #c8a96e accents, Playfair Display for
 * display copy over Inter for body.
 *
 * MOTION: this is where Apple's marketing pages are the reference — long
 * cubic-bezier(.28,.11,.32,1) easing, scroll-triggered reveals with staggered
 * children, a pinned hero that scales and fades as it leaves, parallax on the
 * map, counting statistics, and hover lifts that settle rather than snap.
 *
 * Fonts are self-hosted in assets/fonts/ so the page makes no third-party
 * request and the Content-Security-Policy can stay self-only.
 */

/* ── fonts ────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("fonts/PlayfairDisplay-var.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("fonts/PlayfairDisplay-var-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}

/* ── tokens ───────────────────────────────────────────────────────────────── */

:root {
  --bg: #e8e4d8;
  --bg-card: #f2efe6;
  --bg-mid: #ddd9cc;
  --bg-dark: #1a2240;
  --bg-darkest: #111827;

  --ink: #1a2240;
  --ink-muted: #4a5568;
  --ink-subtle: #8a9ab5;

  --accent: #1a2240;
  --teal: #4a7c8e;
  --teal-light: #7fc0d6;
  --accent-warm: #c8a96e;

  --border: rgba(26, 34, 64, .10);
  --border-strong: rgba(26, 34, 64, .20);
  --border-light: rgba(232, 228, 216, .16);

  --col: 1240px;          /* shared content column — see .band > * */
  --panel-w: 292px;       /* the app shell's floating side panels */
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-hover: 0 10px 40px rgba(26, 34, 64, .18);
  --nav-h: 66px;
  --ticker-h: 34px;

  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  /* Apple's standard marketing easing + a softer overshoot for entrances. */
  --ease: cubic-bezier(.28, .11, .32, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

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

/* A display: rule beats the hidden attribute, and a "hidden" element that still
   lays out sits over the map and eats every pin click. Make hidden mean hidden. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
section:focus, main:focus { outline: none; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: var(--bg); padding: 12px 18px;
  border-radius: 0 0 8px 0; font-size: 14px; text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ── nav ──────────────────────────────────────────────────────────────────── */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 300;
  height: var(--nav-h);
  padding: 0 max(40px, calc((100% - var(--col)) / 2));
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(232, 228, 216, .82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  /* Apple's nav tightens and gains a hairline once you leave the top. */
  transition: height .4s var(--ease), background .4s var(--ease),
              border-color .4s var(--ease);
}
.nav.scrolled {
  height: 52px;
  background: rgba(232, 228, 216, .94);
  border-bottom-color: var(--border);
}

.nav-brand { display: flex; align-items: baseline; gap: 5px; text-decoration: none; }
.nav-brand-mark { height: 26px; width: auto; align-self: center; display: block; }
.nav-brand-word { font-family: var(--font-display); font-size: 23px; font-weight: 600; color: var(--ink); }
.nav-brand-dot {
  width: 7px; height: 7px; background: var(--teal); border-radius: 50%;
  margin: 0 2px 3px; align-self: flex-end;
}
.nav-brand-now { font-family: var(--font-display); font-size: 23px; font-style: italic; font-weight: 400; color: var(--teal); }

.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a {
  position: relative; font-size: 13.5px; color: var(--ink-muted);
  text-decoration: none; transition: color .25s var(--ease);
}
.nav-links a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 1px;
  background: var(--teal); transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease);
}
.nav-links a:not(.nav-cta):hover { color: var(--ink); }
.nav-links a:not(.nav-cta):hover::after { transform: scaleX(1); transform-origin: left; }
.nav-cta {
  background: var(--ink); color: var(--bg) !important;
  padding: 8px 22px; border-radius: 100px; font-weight: 500; font-size: 13px;
  transition: transform .3s var(--ease), background .3s var(--ease);
}
.nav-cta:hover { transform: scale(1.04); background: #243060; }

.search-wrap { position: relative; width: 195px; }
.search-input {
  width: 100%; padding: 7px 15px 7px 34px; border-radius: 100px;
  border: 1.5px solid var(--border-strong); background: rgba(232, 228, 216, .7);
  font-family: var(--font-body); font-size: 13px; color: var(--ink); outline: none;
  transition: border-color .3s var(--ease), width .4s var(--ease);
}
.search-input:focus { border-color: var(--teal); }
.search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--ink-subtle); pointer-events: none; font-size: 13px;
}

/* ── ticker ───────────────────────────────────────────────────────────────── */

.ticker {
  position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 250;
  height: var(--ticker-h); display: flex; align-items: center;
  background: var(--accent); color: var(--bg); overflow: hidden;
  transition: top .4s var(--ease);
}
.nav.scrolled + .ticker { top: 52px; }
.ticker-label {
  flex-shrink: 0; height: 100%; display: flex; align-items: center; padding: 0 16px;
  font-size: 9.5px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase;
  background: rgba(0, 0, 0, .2); border-right: 1px solid rgba(255, 255, 255, .18);
}
.ticker-view { flex: 1; overflow: hidden; }
.ticker-track {
  display: flex; gap: 44px; white-space: nowrap; width: max-content;
  animation: ticker 64s linear infinite;
}
.ticker-track span { font-size: 12.5px; color: rgba(232, 228, 216, .85); }
.ticker-track span::before { content: "\2726\00a0\00a0"; color: var(--accent-warm); }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── hero ─────────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--nav-h) + var(--ticker-h) + 72px)
           max(40px, calc((100% - var(--col)) / 2)) 76px;
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center;
  /* Driven by --scroll-progress (0 → 1) from app.js as the hero leaves the
     viewport: the whole block eases back and dissolves, the way an Apple
     hero hands off to the section beneath it. */
  transform: scale(calc(1 - var(--hero-out, 0) * .06))
             translateY(calc(var(--hero-out, 0) * -34px));
  opacity: calc(1 - var(--hero-out, 0) * .85);
  will-change: transform, opacity;
}
.hero-eyebrow {
  font-size: 11px; font-weight: 500; letter-spacing: 2.4px; text-transform: uppercase;
  color: var(--teal); margin-bottom: 16px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(42px, 6.1vw, 82px); line-height: 1.04; font-weight: 600;
  letter-spacing: -1px; margin-bottom: 20px;
}
.hero h1 em { font-style: italic; color: var(--teal); font-weight: 400; }
.hero-sub {
  font-size: clamp(15px, 1.5vw, 18px); font-weight: 300; line-height: 1.68;
  color: var(--ink-muted); max-width: 46ch; margin-bottom: 30px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn-primary, .btn-secondary {
  display: inline-block; padding: 13px 28px; border-radius: 100px;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  text-decoration: none; cursor: pointer;
  transition: transform .35s var(--ease), background .3s var(--ease),
              box-shadow .35s var(--ease);
}
.btn-primary { background: var(--ink); color: var(--bg); border: 1.5px solid var(--ink); }
.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 30px rgba(26, 34, 64, .26);
}
.btn-secondary { background: transparent; color: var(--ink); border: 1.5px solid var(--border-strong); }
.btn-secondary:hover { background: rgba(26, 34, 64, .05); transform: translateY(-2px); }
.btn-secondary[disabled] { opacity: .45; cursor: default; transform: none; }

/* The hero globe is a real canvas globe with a dot per story — see HeroGlobe
   in app.js. It floats gently; the spin happens inside the canvas. */
.hero-visual { display: flex; align-items: center; justify-content: center; }
.hero-globe {
  display: block; width: min(420px, 76vw); height: auto; aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--bg-dark), #243060);
  box-shadow:
    0 30px 90px rgba(26, 34, 64, .28),
    0 0 0 1px rgba(74, 124, 142, .28),
    0 0 60px rgba(74, 124, 142, .18);
  animation: float 9s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }

/* ── section furniture ────────────────────────────────────────────────────── */

/* Scroll targets must clear the fixed nav + ticker, or a jumped-to heading
   lands underneath them. The nav shrinks to 52px once scrolled, which is the
   state you are always in by the time a jump lands. */
main, section[id], .hero { scroll-margin-top: calc(52px + var(--ticker-h) + 22px); }

/* One content column, 1240px wide with 40px minimum gutters, shared by the nav,
   the hero, every band and the footer so nothing is a few pixels off from the
   thing above it. Bands are full-bleed (so band-alt can paint edge to edge) and
   it is their children that sit in the column — margin-left is computed rather
   than "auto" because auto would centre a narrow child instead of aligning it
   to the column's left edge. */
.band { padding: 96px 40px; }
.band > * {
  max-width: var(--col);
  margin-left: max(0px, calc((100% - var(--col)) / 2));
  margin-right: auto;
}
.band-alt { background: var(--bg-mid); }

.section-label {
  font-size: 10.5px; font-weight: 500; letter-spacing: 2.2px; text-transform: uppercase;
  color: var(--teal); margin-bottom: 10px;
}
.band-head { max-width: 62ch; margin-bottom: 34px; }
.band-head h2 {
  font-family: var(--font-display); font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.16; font-weight: 600; letter-spacing: -.4px; margin-bottom: 9px;
}
.band-head p { font-size: 14.5px; font-weight: 300; line-height: 1.68; color: var(--ink-muted); }
.band-head strong { font-weight: 500; }
.band-head .hint { color: var(--teal); font-weight: 500; }

.state-note { padding: 42px 22px; text-align: center; font-size: 15px; color: var(--ink-muted); }

/* ── map ──────────────────────────────────────────────────────────────────── */

.map-shell {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--bg-darkest); border: 1px solid rgba(26, 34, 64, .3);
  box-shadow: 0 24px 70px rgba(26, 34, 64, .22);
}
.map-wrap { position: relative; display: block; overflow: hidden; }
/* Parallax: app.js feeds --map-shift as the section crosses the viewport. */
#mapImage {
  width: 100%; height: auto; display: block; opacity: .9;
  transform: scale(1.06) translateY(var(--map-shift, 0px));
  will-change: transform;
}
#mapCanvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.map-pins { position: absolute; inset: 0; }
.map-pin-btn {
  position: absolute; width: 32px; height: 32px; padding: 0;
  transform: translate(-50%, -50%); background: transparent;
  border: none; border-radius: 50%; cursor: pointer;
}
.map-pin-btn:focus-visible { outline: 2px solid var(--bg); outline-offset: 0; }

.map-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: rgba(232, 228, 216, .6);
}

.map-tooltip {
  position: absolute; z-index: 12; width: 238px; padding: 12px 14px;
  background: rgba(17, 24, 39, .93);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-light); border-radius: 12px;
  color: var(--bg); pointer-events: none;
  opacity: 0; transform: translateY(4px);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.map-tooltip.visible { opacity: 1; transform: none; }
.map-tooltip-tag {
  font-size: 9.5px; font-weight: 600; letter-spacing: 1.2px;
  color: var(--teal-light); margin-bottom: 5px;
}
.map-tooltip-title { font-size: 13px; line-height: 1.4; font-weight: 500; margin-bottom: 4px; }
.map-tooltip-meta { font-size: 11px; color: rgba(232, 228, 216, .55); }

/* the mini story popup — replaces the old alert() */
.map-popup {
  position: absolute; z-index: 20; width: 336px; max-height: 86%;
  display: flex; flex-direction: column; overflow: hidden;
  padding: 18px 18px 15px;
  background: rgba(17, 24, 39, .95);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--border-light); border-radius: 18px;
  box-shadow: 0 26px 64px rgba(0, 0, 0, .55);
  color: var(--bg);
  opacity: 0; transform: scale(.9) translateY(10px); transform-origin: left center;
  /* Slight overshoot on the way in, plain ease on the way out. */
  transition: opacity .26s var(--ease-out),
              transform .42s cubic-bezier(.16, 1.1, .3, 1);
}
.map-popup.visible { opacity: 1; transform: none; }

/* Contents rise in behind the card itself, one after another. */
.map-popup .map-popup-head,
.map-popup .map-popup-body > *,
.map-popup .map-popup-foot {
  opacity: 0; transform: translateY(9px);
  transition: opacity .34s var(--ease-out), transform .34s var(--ease-out);
}
.map-popup.visible .map-popup-head,
.map-popup.visible .map-popup-body > *,
.map-popup.visible .map-popup-foot { opacity: 1; transform: none; }
.map-popup.visible .map-popup-head { transition-delay: .06s; }
.map-popup.visible .map-popup-body > * {
  /* --i is the child's index, set in buildStoryCard(). */
  transition-delay: calc(.10s + var(--i, 0) * .05s);
}
.map-popup.visible .map-popup-foot { transition-delay: .30s; }
.map-popup-head { flex-shrink: 0; display: flex; align-items: flex-start; gap: 12px; margin-bottom: 9px; }
/* Only this middle band scrolls, so the source footer never gets cut off. */
.map-popup-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.map-popup-tag {
  flex: 1; font-size: 10px; font-weight: 600; letter-spacing: 1.1px;
  color: var(--teal-light); line-height: 1.45;
}
.map-popup-close {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(232, 228, 216, .12); border: none; color: var(--bg);
  font-size: 11px; line-height: 1; cursor: pointer; font-family: var(--font-body);
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.map-popup-close:hover { background: rgba(232, 228, 216, .25); transform: rotate(90deg); }
.map-popup-title {
  font-family: var(--font-display); font-size: 19px; line-height: 1.26;
  font-weight: 600; letter-spacing: -.3px; margin-bottom: 13px;
}
.map-popup-stat {
  display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
  padding: 11px 13px; margin-bottom: 13px;
  background: rgba(232, 228, 216, .07); border-radius: 11px;
  border-left: 2px solid var(--accent-warm);
}
.map-popup-stat-value {
  font-family: var(--font-display); font-size: 27px; font-weight: 600;
  letter-spacing: -.6px; color: var(--accent-warm);
}
.map-popup-stat-label { font-size: 11.5px; line-height: 1.4; color: rgba(232, 228, 216, .6); }
.map-popup-facts-label {
  font-size: 9.5px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase;
  color: rgba(232, 228, 216, .45); margin-bottom: 8px;
}
.map-popup-facts { list-style: none; margin-bottom: 13px; }
.map-popup-facts li {
  position: relative; padding-left: 15px; margin-bottom: 8px;
  font-size: 12.5px; line-height: 1.55; color: rgba(232, 228, 216, .85);
}
.map-popup-facts li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--teal-light);
}
.map-popup-why {
  font-size: 12.5px; line-height: 1.55; color: rgba(232, 228, 216, .68); margin-bottom: 13px;
}
/* ── reader rating (inside a story card) ─────────────────────────────────── */

.rating {
  margin-top: 4px; padding-top: 12px;
  border-top: 1px solid var(--border-light);
}
.rating-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 9px;
}
.rating-label {
  font-size: 9.5px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase;
  color: rgba(232, 228, 216, .55);
}
/* The editorial score sits beside the reader scale on purpose: they measure
   different things and must not be mistaken for one another. */
.rating-editorial { font-size: 10px; color: var(--teal-light); font-weight: 500; }

.rating-scale { display: flex; gap: 6px; margin-bottom: 8px; }
.rating-dot {
  flex: 1; height: 28px; border-radius: 8px; cursor: pointer;
  background: rgba(232, 228, 216, .07);
  border: 1px solid rgba(232, 228, 216, .14);
  color: rgba(232, 228, 216, .5);
  font-family: var(--font-body); font-size: 11.5px; font-weight: 600;
  transition: background .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease), transform .2s var(--ease);
}
.rating-dot:hover { background: rgba(232, 228, 216, .16); color: var(--bg); transform: translateY(-1px); }
.rating-dot.on {
  background: var(--accent-warm); border-color: var(--accent-warm);
  color: #1a2240;
}
.rating-dot:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }

.rating-note { font-size: 10.5px; line-height: 1.45; color: rgba(232, 228, 216, .5); }

.map-popup-foot {
  flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 11px; border-top: 1px solid var(--border-light);
  font-size: 11px; color: rgba(232, 228, 216, .5);
}
.map-popup-source { color: var(--teal-light); text-decoration: none; font-weight: 500; }
.map-popup-source:hover { text-decoration: underline; }

/* ── globe page ───────────────────────────────────────────────────────────── */

/* Deliberately brighter than the dark ops-room references: the globe sits on
   the same cream ground as the rest of the site, lit from a soft radial pool
   rather than floating in black. */

/* ── app shell (explore.html) ─────────────────────────────────────────────── */

/* Conflictly's three-column layout — feed | globe | priority — on the Veritas
   cream palette rather than their black. A fixed-height app view, not a page
   that scrolls: only the two side panels scroll, independently. */

/* The shell is a fixed-height column: bar, ticker, then the grid takes the rest.
   Without display:flex here the grid's `flex: 1` does nothing and the whole
   layout grows to fit its content instead of the viewport. */
body.page-app {
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh; overflow: hidden;
}
body.page-landing { height: 100vh; height: 100dvh; overflow: hidden; }

.app-bar {
  height: 58px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 18px;
  background: rgba(232, 228, 216, .92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.app-bar .nav-brand-word, .app-bar .nav-brand-now { font-size: 20px; }

.app-stats { display: flex; align-items: center; gap: 22px; }
.app-stat { display: flex; align-items: baseline; gap: 6px; }
.app-stat-num {
  font-family: var(--font-display); font-size: 19px; font-weight: 600;
  color: var(--teal); letter-spacing: -.3px;
}
.app-stat-label {
  font-size: 9.5px; font-weight: 600; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--ink-subtle);
}
.app-stat-live { gap: 7px; align-items: center; }

.app-bar-right { display: flex; align-items: center; gap: 12px; }
.app-updated {
  font-size: 11px; font-weight: 500; letter-spacing: .4px;
  color: var(--ink-subtle); font-variant-numeric: tabular-nums;
}
.btn-ghost-sm {
  padding: 7px 14px; border-radius: 100px; cursor: pointer;
  border: 1px solid var(--border-strong); background: transparent;
  font-family: var(--font-body); font-size: 12.5px; color: var(--ink);
  transition: background .25s var(--ease);
}
.btn-ghost-sm:hover { background: rgba(26, 34, 64, .05); }
.btn-ghost-sm[disabled] { opacity: .45; cursor: default; }

/* The app shell's ticker is in flow, not fixed like the marketing page's. */
body.page-app .ticker { position: static; flex-shrink: 0; }

/* The globe is the page: it fills everything under the bar, and the two panels
   float over it as translucent glass. */
.app-grid { position: relative; flex: 1; min-height: 0; }

.panel {
  position: absolute; top: 14px; bottom: 14px; z-index: 10;
  width: var(--panel-w);
  display: flex; flex-direction: column; min-height: 0;
  background: rgba(242, 239, 230, .58);
  backdrop-filter: saturate(170%) blur(22px);
  -webkit-backdrop-filter: saturate(170%) blur(22px);
  border: 1px solid rgba(26, 34, 64, .13);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 18px 50px rgba(26, 34, 64, .16);
}
.panel-left  { left: 14px; }
.panel-right { right: 14px; }
/* Section dividers inside glass need to be lighter or they read as hard lines. */
.panel .feed-item, .panel .priority-item,
.panel .filter-row, .panel .panel-foot { border-color: rgba(26, 34, 64, .09); }
.panel .feed-item:hover, .panel .priority-item:hover { background: rgba(255, 255, 255, .38); }
.panel-head {
  flex-shrink: 0; display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; padding: 11px 13px 8px;
}
.panel-title {
  font-size: 9.5px; font-weight: 600; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--ink-muted);
}
.panel-count { font-size: 10px; color: var(--ink-subtle); }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 6px 8px; }
.panel-foot {
  flex-shrink: 0; display: flex; align-items: baseline; gap: 7px;
  padding: 9px 13px; border-top: 1px solid var(--border);
}
.panel-foot .mission-stat-num { font-size: 18px; margin-bottom: 0; color: var(--teal); }
.panel-foot .mission-stat-label { font-size: 10px; color: var(--ink-subtle); }

.filter-row {
  flex-shrink: 0; display: flex; gap: 5px; flex-wrap: wrap;
  padding: 0 13px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px;
}
.filter-chip {
  padding: 3px 9px; border-radius: 100px; cursor: pointer;
  border: 1px solid var(--border-strong); background: transparent;
  font-family: var(--font-body); font-size: 9.5px; font-weight: 500;
  letter-spacing: .2px; text-transform: uppercase; color: var(--ink-muted);
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.filter-chip:hover { background: rgba(26, 34, 64, .05); }
.filter-chip[aria-pressed="true"] {
  background: var(--ink); border-color: var(--ink); color: var(--bg);
}

/* Feed rows become compact cards in a 340px column. */
.panel .feed-list { border-top: none; }
.panel .feed-item {
  display: block; padding: 9px 8px; border-bottom: 1px solid var(--border);
  border-radius: 7px;
}
.panel .feed-item:hover { padding-left: 10px; background: rgba(26, 34, 64, .05); }
.panel .feed-item .feed-time {
  display: inline-block; margin-right: 7px; font-size: 9.5px; color: var(--teal);
  font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
}
.panel .feed-item .feed-source { display: inline; font-size: 9.5px; text-align: left; }
.panel .feed-item .feed-title {
  display: block; margin-top: 4px; font-size: 12px; line-height: 1.38;
}

/* Priority rows likewise. */
.panel .priority-item { border: none; border-bottom: 1px solid var(--border); border-radius: 8px; background: transparent; }
.panel .priority-item:hover { --lift: 0px; box-shadow: none; background: rgba(26, 34, 64, .05); }
.panel .priority-item > div:first-child { width: 3px; border-radius: 2px; }
.panel .priority-item-inner { grid-template-columns: 21px 1fr; gap: 8px; padding: 9px 8px; align-items: start; }
.panel .priority-rank { font-size: 16px; }
.panel .priority-title { font-size: 12px; line-height: 1.34; margin-bottom: 3px; }
.panel .priority-subtitle { display: none; }
.panel .priority-badge { font-size: 8.5px; padding: 2px 6px; margin-bottom: 5px; }
.panel .priority-scores { display: grid; grid-column: 2; margin-top: 6px; gap: 4px; }
.panel .score-row { grid-template-columns: 44px 1fr 20px; font-size: 9px; }
.panel .priority-track { margin: 0 13px 8px; }
/* The scrolling panel body IS the grid container, so it has a definite height,
   and grid items with overflow:hidden have no automatic minimum size — between
   them the rows collapsed to an equal share of the panel and clipped their
   headlines. Plain block flow here: rows size to their content and the panel
   scrolls, with no track sizing to fight. */
.panel .priority-list { display: block; }
.panel .priority-item { margin-bottom: 2px; }

/* Globe fills the whole area behind the panels. */
body.page-app .globe-stage {
  position: absolute; inset: 0; z-index: 0;
  height: auto; min-height: 0; border: none; border-radius: 0;
  box-shadow: none;
  background: radial-gradient(circle at 50% 44%, #f4f2ea 0%, #e9e6db 45%, #ddd9cb 100%);
}

.globe-legend {
  position: absolute; bottom: 16px; z-index: 5;
  left: 50%; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px;
  max-width: calc(100% - (var(--panel-w) + 30px) * 2);
  padding: 9px 12px; border-radius: 10px;
  background: rgba(242, 239, 230, .82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  font-size: 10.5px; color: var(--ink-muted);
}
.globe-legend:empty { display: none; }
.globe-legend-item { display: flex; align-items: center; gap: 6px; }
.globe-legend-dot { width: 7px; height: 7px; border-radius: 50%; }

@media (max-width: 1240px) { :root { --panel-w: 262px; } }

@media (max-width: 1000px) {
  /* Too narrow to float panels over the globe: stack them under it instead. */
  body.page-app { height: auto; overflow: auto; }
  .app-grid { display: flex; flex-direction: column; gap: 12px; padding: 12px; }
  body.page-app .globe-stage {
    position: relative; inset: auto; height: 52vh; min-height: 340px;
    border-radius: var(--radius); border: 1px solid var(--border);
    /* The globe leads even though the feed comes first in the DOM. */
    order: -1;
  }
  .panel {
    position: relative; top: auto; bottom: auto; left: auto; right: auto;
    width: auto; max-height: 440px;
    background: var(--bg-card); backdrop-filter: none; -webkit-backdrop-filter: none;
    box-shadow: none;
  }
  .globe-legend { max-width: calc(100% - 28px); }
  .globe-controls { right: 16px; }
}
@media (max-width: 760px) {
  .app-bar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  .app-bar-right { width: 100%; }
  .app-bar-right .search-wrap { flex: 1; width: auto; }
  .globe-legend { display: none; }
}

/* ── landing hand-off wipe ────────────────────────────────────────────────── */

.page-wipe {
  position: fixed; inset: 0; z-index: 500; pointer-events: none;
  background: var(--bg); opacity: 0;
}
.page-wipe.on { pointer-events: auto; }

#globeCount { color: var(--teal); font-weight: 500; }

.globe-layout { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: stretch; }

/* The card sits beside its marker inside the stage and follows it as the globe
   turns — positioned by positionPopup() in globe.js, not centred like a modal. */
.globe-popup { position: absolute; z-index: 30; }
/* Marker has rotated round the back: fade the card but keep it readable. */
.globe-popup.behind { opacity: .45; }

.globe-stage {
  position: relative; min-height: 620px; height: 70vh; border-radius: var(--radius-lg);
  overflow: hidden; border: 1px solid var(--border);
  background:
    radial-gradient(circle at 50% 46%, #ffffff 0%, #eceadf 38%, #dcd8ca 78%, #cfcabb 100%);
  box-shadow: inset 0 0 90px rgba(26, 34, 64, .10);
}
#globeCanvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#globeCanvas:active { cursor: grabbing; }
#globeCanvas:focus-visible { outline: 2px solid var(--teal); outline-offset: -4px; }

.globe-controls {
  position: absolute; bottom: 16px; z-index: 5;
  right: calc(var(--panel-w) + 30px);
  display: grid; gap: 7px; justify-items: end;
}
.globe-btn {
  min-width: 36px; height: 36px; padding: 0 11px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: rgba(242, 239, 230, .9);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--ink); font-family: var(--font-body); font-size: 15px; font-weight: 500;
  cursor: pointer; transition: background .25s var(--ease), transform .25s var(--ease);
}
.globe-btn:hover { background: var(--bg-card); transform: translateY(-1px); }
.globe-btn-wide { font-size: 12.5px; }

.globe-fallback {
  position: absolute; inset: auto 24px 24px; padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 12px;
  font-size: 13.5px; line-height: 1.55; color: var(--ink-muted);
}
.globe-failed #globeCanvas { display: none; }

.globe-panel {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 8px 8px 20px;
}
.globe-panel-title {
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
  letter-spacing: -.2px; margin-bottom: 12px; padding-right: 12px;
}
.globe-list { flex: 1; overflow-y: auto; padding-right: 12px; display: grid; gap: 2px; align-content: start; }

.globe-row {
  display: grid; grid-template-columns: 10px 1fr; gap: 11px; align-items: start;
  width: 100%; padding: 12px 10px; border: none; border-radius: 10px;
  background: transparent; text-align: left; cursor: pointer; font-family: var(--font-body);
  transition: background .25s var(--ease);
}
.globe-row:hover { background: rgba(26, 34, 64, .05); }
.globe-row-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; }
.globe-row-text { display: grid; gap: 4px; min-width: 0; }
.globe-row-title { font-size: 13.5px; line-height: 1.38; color: var(--ink); }
.globe-row-meta { font-size: 11.5px; color: var(--ink-subtle); }

@media (max-width: 1000px) {
  .globe-layout { grid-template-columns: 1fr; }
  .globe-stage { height: 56vh; min-height: 420px; }
  .globe-panel { max-height: 420px; }
}
@media (max-width: 900px) {
  /* Dock the card to the bottom of the stage; positionPopup() stops setting
     left/top below this width so these values win. */
  .globe-popup {
    left: 12px !important; right: 12px !important; top: auto !important;
    bottom: 12px; width: auto; max-height: 66%;
    transform-origin: bottom center;
  }
}
@media (max-width: 620px) {
  .globe-stage { height: 46vh; min-height: 320px; }
}

/* ── story modal (same card, centred, for non-map opens) ──────────────────── */

.story-modal {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(17, 24, 39, 0);
  backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px);
  transition: background .3s var(--ease), backdrop-filter .3s var(--ease);
}
.story-modal.visible {
  background: rgba(17, 24, 39, .55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
/* Override the absolute positioning the map popup uses; here it is centred. */
.story-modal-card {
  position: relative; left: auto !important; top: auto !important;
  width: min(430px, 100%); max-height: min(76vh, 640px);
  transform-origin: center center;
  transform: scale(.9) translateY(16px);
}
.story-modal.visible .story-modal-card { transform: none; }
body.modal-open { overflow: hidden; }

.map-legend {
  display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap;
  padding: 16px 22px; border-top: 1px solid var(--border-light);
  font-size: 11.5px; color: rgba(232, 228, 216, .6);
}
.map-legend-label { font-weight: 500; color: rgba(232, 228, 216, .5); }
.map-legend-item { display: flex; align-items: center; gap: 7px; }
.map-legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ── priority index ───────────────────────────────────────────────────────── */

.priority-axis { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 9px; }
.priority-axis span { font-size: 11px; color: var(--ink-muted); }
.priority-axis span:nth-child(2) { text-align: center; }
.priority-axis span:nth-child(3) { text-align: right; }
.priority-track {
  height: 4px; border-radius: 4px; margin-bottom: 26px;
  background: linear-gradient(90deg, #2e7d52, var(--accent-warm) 52%, #b03a2e);
  transform: scaleX(var(--track-grow, 1)); transform-origin: left;
}

.priority-list { display: grid; gap: 12px; }
.priority-item {
  display: flex; overflow: hidden; cursor: pointer;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.priority-item > div:first-child { width: 4px; flex-shrink: 0; }
.priority-item:hover { --lift: -3px; box-shadow: var(--shadow-hover); }
.priority-item-inner {
  flex: 1; display: grid; grid-template-columns: 54px 1fr 220px;
  gap: 18px; align-items: center; padding: 20px 22px;
}
.priority-rank {
  font-family: var(--font-display); font-size: 32px; font-weight: 600;
  letter-spacing: -1px; color: var(--ink-subtle);
}
.priority-badge {
  display: inline-block; margin-bottom: 8px; padding: 3px 10px; border-radius: 100px;
  font-size: 10px; font-weight: 600; letter-spacing: .3px;
}
.badge-critical { background: rgba(46, 125, 82, .13); color: #23694a; }
.badge-high     { background: rgba(200, 169, 110, .2); color: #8a6122; }
.badge-moderate { background: rgba(176, 58, 46, .12); color: #9c3226; }
.priority-title {
  font-family: var(--font-display); font-size: 18px; line-height: 1.3;
  font-weight: 600; letter-spacing: -.2px; margin-bottom: 6px;
}
.priority-subtitle { font-size: 13px; font-weight: 300; line-height: 1.58; color: var(--ink-muted); }

.priority-scores { display: grid; gap: 8px; }
.score-row {
  display: grid; grid-template-columns: 62px 1fr 30px; gap: 9px; align-items: center;
  font-size: 11px; color: var(--ink-muted);
}
.score-row span:last-child { text-align: right; font-weight: 600; color: var(--ink); }
.score-bar-wrap { height: 5px; background: rgba(26, 34, 64, .1); border-radius: 4px; overflow: hidden; }
/* Bars grow from zero when the row scrolls in; app.js sets the final width. */
.score-bar { height: 100%; border-radius: 4px; transform-origin: left; transition: width .9s var(--ease-out); }
.score-importance { background: #2e7d52; }
.score-coverage   { background: var(--ink-subtle); }

/* ── featured cards ───────────────────────────────────────────────────────── */

.featured-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; align-items: start; }
.side-stack { display: grid; gap: 20px; }
.card {
  overflow: hidden; cursor: pointer; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.card:hover { --lift: -5px; box-shadow: var(--shadow-hover); }
.card-art {
  position: relative; height: 268px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.card-art-tall { height: 190px; }
/* Apple's slow ken-burns creep on card imagery. */
.card-art::before {
  content: ""; position: absolute; inset: -6%;
  background: radial-gradient(circle at 30% 26%, rgba(232, 228, 216, .16), transparent 60%);
  transition: transform 1.1s var(--ease);
}
.card:hover .card-art::before { transform: scale(1.12); }
.card-art-flag { position: relative; font-size: 48px; line-height: 1; transition: transform .6s var(--ease); }
.card:hover .card-art-flag { transform: scale(1.08) translateY(-3px); }
.card-art-label {
  position: relative; font-size: 10.5px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: rgba(232, 228, 216, .82);
}
.card-body { padding: 24px 26px 26px; }
.card-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cat-chip {
  padding: 3px 11px; border-radius: 100px;
  font-size: 10px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase;
}
.card-body h2 {
  font-family: var(--font-display); font-size: 26px; line-height: 1.22;
  font-weight: 600; letter-spacing: -.5px; margin-bottom: 11px;
}
.card-body h3 {
  font-family: var(--font-display); font-size: 18px; line-height: 1.3;
  font-weight: 600; letter-spacing: -.2px; margin-bottom: 10px;
}
.card-excerpt { font-size: 14px; font-weight: 300; line-height: 1.62; color: var(--ink-muted); margin-bottom: 14px; }
.card-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--ink-subtle); }
.card-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-subtle); }
.region-tag { font-weight: 500; color: var(--ink-muted); }

/* ── live feed ────────────────────────────────────────────────────────────── */

.live-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 24px;
}
.live-title { display: flex; align-items: center; gap: 12px; }
.live-title h2 {
  font-family: var(--font-display); font-size: clamp(24px, 2.8vw, 30px);
  font-weight: 600; letter-spacing: -.4px;
}
.live-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px;
  border-radius: 100px; background: rgba(176, 58, 46, .1); color: #9c3226;
  font-size: 11px; font-weight: 600;
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #b03a2e; animation: pulse 1.9s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.82); } }

.feed-list { border-top: 1px solid var(--border); }
.feed-item {
  display: grid; grid-template-columns: 84px 1fr 150px; gap: 18px; align-items: center;
  padding: 15px 10px; border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background .3s var(--ease), padding-left .3s var(--ease);
}
.feed-item:hover { background: rgba(26, 34, 64, .04); padding-left: 18px; }
.feed-time { font-size: 12px; color: var(--ink-subtle); font-variant-numeric: tabular-nums; }
.feed-title { font-size: 14.5px; line-height: 1.45; }
.feed-source { font-size: 12px; color: var(--ink-subtle); text-align: right; }

/* ── mission ──────────────────────────────────────────────────────────────── */

.mission {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 46px; align-items: center;
  padding: 56px 52px; border-radius: var(--radius-lg);
  background: var(--bg-dark); color: var(--bg);
  overflow: hidden; position: relative;
}
.mission::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 78% 32%, rgba(127, 192, 214, .18), transparent 58%);
  pointer-events: none;
}
.mission > * { position: relative; }
.mission-label {
  font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(232, 228, 216, .45); margin-bottom: 8px;
}
.mission h2 {
  font-family: var(--font-display); font-size: clamp(24px, 3vw, 34px);
  line-height: 1.22; font-weight: 600; letter-spacing: -.5px; margin-bottom: 13px;
}
.mission p { font-size: 14.5px; font-weight: 300; line-height: 1.7; color: rgba(232, 228, 216, .62); }
.mission-stat { text-align: center; }
.mission-stat-num {
  font-family: var(--font-display); font-size: 74px; font-weight: 600;
  letter-spacing: -2px; line-height: 1; color: var(--accent-warm); margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}
.mission-stat-label { font-size: 12.5px; line-height: 1.55; color: rgba(232, 228, 216, .6); }

/* ── footer ───────────────────────────────────────────────────────────────── */

.footer { background: var(--bg-darkest); color: var(--bg); padding: 52px 40px 32px; }
.footer-inner { max-width: 1240px; margin: 0 auto; }
.footer-top {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 34px;
  padding-bottom: 30px; border-bottom: 1px solid rgba(232, 228, 216, .1);
}
.footer-brand-name { font-family: var(--font-display); font-size: 21px; font-weight: 600; margin-bottom: 10px; }
.footer-note { font-size: 12.5px; font-weight: 300; line-height: 1.7; color: rgba(232, 228, 216, .48); max-width: 34ch; }
.footer-col h4 { font-size: 12px; font-weight: 600; margin-bottom: 12px; }
.footer-col ul { list-style: none; display: grid; gap: 9px; }
.footer-col a {
  font-size: 12.5px; color: rgba(232, 228, 216, .48); text-decoration: none;
  transition: color .25s var(--ease);
}
.footer-col a:hover { color: var(--bg); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; padding-top: 18px; font-size: 11.5px; color: rgba(232, 228, 216, .38);
}
.footer-bottom nav { display: flex; gap: 18px; }
.footer-bottom a { color: rgba(232, 228, 216, .38); text-decoration: none; }
.footer-bottom a:hover { color: var(--bg); }

/* ── scroll-linked animation ──────────────────────────────────────────────── */

/*
 * Every animated block is driven continuously by scroll position, not switched
 * on once by an observer: app.js writes --ty (lift), --sc (scale) and opacity
 * each frame, so a block rises into place as it enters and eases back out as it
 * leaves the top of the viewport — the same treatment the hero gets.
 *
 * --lift is separate so a :hover lift can compose with the scroll transform
 * instead of overwriting it. The 150ms transition is short enough to feel
 * scroll-locked but long enough to smooth the hover.
 */
.anim {
  transform: translateY(calc(var(--ty, 0px) + var(--lift, 0px))) scale(var(--sc, 1));
  transition: opacity .15s linear, transform .15s linear;
  will-change: opacity, transform;
}

/* The hero's own copy plays a one-time entrance on load instead — it is already
   on screen, so there is nothing to scroll it into. */
@keyframes heroIn {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}
.hero .reveal { animation: heroIn .95s var(--ease-out) both; }
.hero .hero-eyebrow { animation-delay: .05s; }
.hero h1            { animation-delay: .14s; }
.hero .hero-sub     { animation-delay: .23s; }
.hero .hero-actions { animation-delay: .32s; }
.hero .hero-visual  { animation-delay: .20s; }

/* ── responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 1050px) {
  .hero { grid-template-columns: 1fr; text-align: center; min-height: 0; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-visual { order: -1; }
}

@media (max-width: 900px) {
  /* Phone landing: copy at the top, globe in the middle taking whatever space
     is left, button pinned below it — the whole thing inside one screen so the
     scroll lock never hides the only way in.

     `display: contents` dissolves the wrapper div so the eyebrow, headline,
     sub and actions become direct flex children of .hero and can be ordered
     around the globe without restructuring the HTML. */
  .hero {
    display: flex; flex-direction: column; align-items: center;
    height: 100dvh; min-height: 0; gap: 0;
    padding: calc(var(--nav-h) + var(--ticker-h) + 14px) 20px 22px;
    text-align: center;
  }
  .hero > div:first-child { display: contents; }

  .hero-eyebrow { order: 1; margin-bottom: 6px; font-size: 10px; }
  .hero h1 {
    order: 2; font-size: clamp(27px, 8.2vw, 40px); line-height: 1.08;
    letter-spacing: -.5px; margin-bottom: 8px;
  }
  .hero-sub {
    order: 3; font-size: 13.5px; line-height: 1.5; margin-bottom: 0;
    max-width: 40ch;
  }
  /* The globe is the only flexible element, so it absorbs the leftover height
     and shrinks first on a short screen instead of pushing the button off. */
  .hero-visual {
    order: 4; flex: 1 1 0; min-height: 0; width: 100%;
    display: flex; align-items: center; justify-content: center; padding: 10px 0;
  }
  .hero-globe {
    width: auto; height: auto; aspect-ratio: 1;
    max-height: 100%; max-width: min(74vw, 300px);
    animation-duration: 11s;
  }
  .hero-actions { order: 5; flex-shrink: 0; margin-top: 2px; }
  .hero-actions .btn-primary { padding: 13px 30px; font-size: 15px; }
}

/* Last resort: on a genuinely short screen (landscape phone, small device) let
   the landing scroll rather than trapping the button off-screen. */
@media (max-width: 900px) and (max-height: 620px) {
  body.page-landing { overflow-y: auto; }
  .hero { height: auto; min-height: 100dvh; }
  .hero-visual { flex: 0 0 auto; }
  .hero-globe { max-width: min(52vw, 200px); }
}

@media (max-width: 1050px) {
  .featured-grid { grid-template-columns: 1fr; }
  .mission { grid-template-columns: 1fr; padding: 40px 30px; gap: 28px; }
  .priority-item-inner { grid-template-columns: 44px 1fr; }
  .priority-scores { display: none; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  /* Below this width the popup docks to the bottom of the map instead of
     floating beside a pin — position() in app.js stops setting left/top. */
  .map-popup {
    left: 12px !important; right: 12px !important; top: auto !important;
    bottom: 12px; width: auto; max-height: 64%; transform-origin: bottom center;
  }
}

@media (max-width: 760px) {
  .nav { padding: 0 20px; }
  .band { padding: 64px 20px; }
  .hero { padding: calc(var(--nav-h) + var(--ticker-h) + 44px) 20px 56px; }
  .search-wrap, .nav-links li:has(.nav-cta) { display: none; }
  .nav-links { gap: 18px; }
  .feed-item { grid-template-columns: 70px 1fr; }
  .feed-source { display: none; }
  .footer { padding: 40px 20px 28px; }
  .map-legend { gap: 13px; font-size: 10.5px; }
  .mission-stat-num { font-size: 56px; }
}

/* Must come after the 760px block — both apply on a phone and the later one wins. */
@media (max-width: 620px) {
  /* Phone nav: one non-wrapping row that scrolls sideways if it must, rather
     than wrapping onto a second line and overflowing the fixed bar. */
  .nav { padding: 0 16px; }
  .nav-brand { flex-shrink: 0; }
  .nav-brand-word, .nav-brand-now { font-size: 18px; }
  .nav-brand-dot { width: 5px; height: 5px; }
  .nav-links {
    flex-wrap: nowrap; gap: 15px; min-width: 0;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links li { flex-shrink: 0; }
  .nav-links a { font-size: 12px; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal, .stagger > * { opacity: 1 !important; transform: none !important; }
  .hero { transform: none !important; opacity: 1 !important; }
  #mapImage { transform: scale(1.06) !important; }
}
