/* ==========================================================================
   TerraNova project page
   Site navy / cream, with the paper's Okabe-Ito accents used semantically:
     field  #0072B2  gridded fields        country #D55E00  administrative units
     time   #009E73  the temporal axis     st      #008892  the fused state
   ========================================================================== */

/* -- tokens -- */
:root {
  --primary: #1f3a5f;
  --primary-hover: #162a45;

  --c-field: #0072B2;
  --c-country: #D55E00;
  --c-time: #009E73;
  --c-st: #008892;

  /* darker ink variants: the same hues at AA contrast, used wherever the
     accent carries text (kickers, inline accent words, selected tab fill).
     Bars, rules and gradients keep the pure palette above. */
  --c-field-ink: #0072B2;
  --c-country-ink: #B24E00;
  --c-time-ink: #00775A;
  --c-st-ink: #00707A;

  /* accent variants that survive on the dark navy band */
  --c-field-on: #74b8e6;
  --c-country-on: #f5924f;
  --c-time-on: #4fd0a6;
  --c-st-on: #48c3cb;

  --ink: #22303b;
  --paper: #f7f4ef;

  --bg: #ffffff;
  --bg-alt: #f6f3ee;
  --surface: #ffffff;
  --band: #1b3555;
  --band-ink: #f4f1ea;
  --band-dim: #b9c8da;
  --border: rgba(31, 58, 95, 0.14);
  --border-soft: rgba(31, 58, 95, 0.08);
  --text: var(--ink);
  --text-dim: #55636f;
  --link: var(--primary);
  --link-hover: var(--primary-hover);
  --plate: #ffffff;

  --shadow-sm: 0 1px 2px rgba(20, 35, 55, .05), 0 4px 14px rgba(20, 35, 55, .05);
  --shadow-md: 0 2px 6px rgba(20, 35, 55, .06), 0 14px 40px rgba(20, 35, 55, .09);
  --shadow-lg: 0 30px 80px rgba(15, 24, 36, .22);

  --measure: 80ch;
  --wide: 1180px;
  --shell: 1320px;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;

  --font-sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Spectral", "Iowan Old Style", "Times New Roman", serif;
  --font-mono: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1824;
    --bg-alt: #132030;
    --surface: #17222f;
    --band: #16283f;
    --band-ink: #e8eef5;
    --band-dim: #9db0c6;
    --border: rgba(155, 183, 209, 0.19);
    --border-soft: rgba(155, 183, 209, 0.11);
    --text: #e3e9f0;
    --text-dim: #a7b4c3;
    --link: #9dbad4;
    --link-hover: #cadaea;
    --paper: #17222f;
    --plate: #e9eef3;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, .35), 0 14px 40px rgba(0, 0, 0, .38);
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, .6);
    --c-field: #55a8dc;
    --c-country: #f08a4b;
    --c-time: #3ecaa0;
    --c-st: #3cb8c0;
    --c-field-ink: #55a8dc;
    --c-country-ink: #f08a4b;
    --c-time-ink: #3ecaa0;
    --c-st-ink: #3cb8c0;
  }
}

/* explicit overrides from the theme toggle: they must win in both directions */
:root[data-theme="dark"] {
  --bg: #0f1824;
  --bg-alt: #132030;
  --surface: #17222f;
  --band: #16283f;
  --band-ink: #e8eef5;
  --band-dim: #9db0c6;
  --border: rgba(155, 183, 209, 0.19);
  --border-soft: rgba(155, 183, 209, 0.11);
  --text: #e3e9f0;
  --text-dim: #a7b4c3;
  --link: #9dbad4;
  --link-hover: #cadaea;
  --paper: #17222f;
  --plate: #e9eef3;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, .35), 0 14px 40px rgba(0, 0, 0, .38);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .6);
  --c-field: #55a8dc;
  --c-country: #f08a4b;
  --c-time: #3ecaa0;
  --c-st: #3cb8c0;
  --c-field-ink: #55a8dc;
  --c-country-ink: #f08a4b;
  --c-time-ink: #3ecaa0;
  --c-st-ink: #3cb8c0;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f6f3ee;
  --surface: #ffffff;
  --band: #1b3555;
  --band-ink: #f4f1ea;
  --band-dim: #b9c8da;
  --border: rgba(31, 58, 95, 0.14);
  --border-soft: rgba(31, 58, 95, 0.08);
  --text: #22303b;
  --text-dim: #55636f;
  --link: #1f3a5f;
  --link-hover: #162a45;
  --paper: #f7f4ef;
  --plate: #ffffff;
  --shadow-sm: 0 1px 2px rgba(20, 35, 55, .05), 0 4px 14px rgba(20, 35, 55, .05);
  --shadow-md: 0 2px 6px rgba(20, 35, 55, .06), 0 14px 40px rgba(20, 35, 55, .09);
  --shadow-lg: 0 30px 80px rgba(15, 24, 36, .22);
  --c-field: #0072B2;
  --c-country: #D55E00;
  --c-time: #009E73;
  --c-st: #008892;
  --c-field-ink: #0072B2;
  --c-country-ink: #B24E00;
  --c-time-ink: #00775A;
  --c-st-ink: #00707A;
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.68;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--link);
  text-decoration-color: color-mix(in srgb, var(--link) 38%, transparent);
  text-underline-offset: .18em;
  text-decoration-thickness: 1px;
  transition: color .18s var(--ease), text-decoration-color .18s var(--ease);
}

a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

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

sup {
  font-size: .62em;
  font-weight: 600;
  vertical-align: super;
  line-height: 0;
  color: var(--text-dim);
}

.nw {
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--primary);
  color: #fff;
  padding: .7rem 1.1rem;
  border-radius: 0 0 var(--r-sm) 0;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2.75rem);
}

.prose {
  max-width: var(--measure);
}

.prose p {
  margin: 0 0 1.1em;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* semantic accent text */
.c-field { color: var(--c-field-ink); }
.c-country { color: var(--c-country-ink); }
.c-time { color: var(--c-time-ink); }
.c-st { color: var(--c-st-ink); }

/* -- hero -- */
.hero {
  position: relative;
  isolation: isolate;
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, color-mix(in srgb, var(--paper) 82%, var(--bg)) 0%, var(--bg) 100%);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--c-field) 0%, var(--c-st) 48%, var(--c-country) 100%);
  z-index: 2;
}

.hero-glow {
  position: absolute;
  inset: -35% -10% auto -10%;
  height: 120%;
  z-index: -2;
  background:
    radial-gradient(48% 46% at 16% 26%, color-mix(in srgb, var(--c-field) 14%, transparent) 0%, transparent 70%),
    radial-gradient(46% 44% at 86% 20%, color-mix(in srgb, var(--c-country) 12%, transparent) 0%, transparent 70%),
    radial-gradient(62% 52% at 52% 80%, color-mix(in srgb, var(--c-st) 9%, transparent) 0%, transparent 72%);
  filter: blur(6px);
  opacity: .8;
  pointer-events: none;
}

:root[data-theme="dark"] .hero-glow { opacity: .5; }
:root[data-theme="light"] .hero-glow { opacity: .8; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero-glow { opacity: .5; }
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  display: block;
}

.hero-inner {
  position: relative;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin: 0 0 1.6rem;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  padding: .34rem .9rem;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.eyebrow-dot {
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-field) 0 50%, var(--c-country) 50% 100%);
  flex: none;
}

.title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(3.4rem, 12vw, 7.5rem);
  line-height: .95;
  letter-spacing: -.04em;
  color: var(--text);
}

.title-word {
  background: linear-gradient(100deg,
      color-mix(in srgb, var(--c-field) 82%, var(--text)) 0%,
      var(--text) 42%,
      var(--text) 60%,
      color-mix(in srgb, var(--c-country) 78%, var(--text)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin: .7rem 0 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.25rem, 3.6vw, 1.95rem);
  letter-spacing: -.012em;
  color: var(--text-dim);
}

.tagline {
  max-width: 46ch;
  margin: 1.9rem auto 0;
  font-size: clamp(1.08rem, 2.4vw, 1.3rem);
  line-height: 1.55;
  color: var(--text);
  text-wrap: balance;
}

.authors {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem 2.2rem;
  margin: 2.5rem 0 0;
  padding: 0;
  font-size: clamp(1.05rem, 2.6vw, 1.22rem);
  font-weight: 500;
}

.authors a {
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--link) 32%, transparent);
  padding-bottom: 1px;
}

.authors a:hover {
  border-bottom-color: currentColor;
}

.affiliations {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  font-size: .9rem;
  line-height: 1.55;
  color: var(--text-dim);
}

.affiliations li + li {
  margin-top: .12rem;
}

/* -- buttons -- */
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .7rem;
  margin-top: 2.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .68rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .98rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}

.btn svg {
  width: 1.05em;
  height: 1.05em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
  color: var(--text);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] .btn-primary:hover {
  background: #2c4a72;
  border-color: #3a5c88;
  color: #f2f6fa;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary,
  :root:not([data-theme="light"]) .btn-primary:hover {
    background: #2c4a72;
    border-color: #3a5c88;
    color: #f2f6fa;
  }
}

.btn-meta {
  font-weight: 400;
  font-size: .82em;
  opacity: .72;
}

.btn-disabled {
  background: transparent;
  color: var(--text-dim);
  border-style: dashed;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
  color: var(--text-dim);
}

/* -- navbar -- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.navbar-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.5rem;
}

.navbar-brand {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -.02em;
  text-decoration: none;
  color: var(--text);
  flex: none;
}

.navbar-brand::after {
  content: "";
  display: block;
  height: 2px;
  width: 100%;
  margin-top: -1px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--c-field), var(--c-country));
  opacity: .55;
}

.navlinks {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .15rem;
  margin: 0 0 0 auto;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.navlinks::-webkit-scrollbar {
  display: none;
}

.navlinks a {
  display: block;
  padding: .42rem .72rem;
  border-radius: 999px;
  font-size: .92rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s var(--ease), background-color .18s var(--ease);
}

.navlinks a:hover,
.navlinks a.active {
  color: var(--text);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.navlinks a.active {
  font-weight: 600;
}

.theme-toggle {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}

.theme-toggle:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  transform: translateY(-1px);
}

.theme-toggle svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  grid-area: 1 / 1;
}

.icon-moon { display: none; }
.icon-sun { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-moon { display: block; }
  :root:not([data-theme="light"]) .icon-sun { display: none; }
}

:root[data-theme="dark"] .icon-moon { display: block; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: block; }

/* -- sections -- */
.section {
  padding: clamp(3.25rem, 7vw, 6rem) 0;
}

.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border-soft);
}

/* an untinted section that would otherwise run into the next one */
.section-edge {
  border-bottom: 1px solid var(--border-soft);
}

.sec-head {
  margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
  max-width: var(--measure);
}

/* editorial two-column rhythm: a side rail for the section head */
.sec-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 2rem);
}

/* grid items must be allowed to shrink below their content width, so that
   wide figures scroll inside their own box instead of stretching the page */
.sec-grid > * {
  min-width: 0;
}

/* the grid gap already separates head from body; without this the head's own
   margin stacks on the row gap below 1100px and leaves a hole */
.sec-grid > .sec-head {
  margin-bottom: 0;
}

@media (min-width: 1100px) {
  .sec-grid {
    grid-template-columns: minmax(270px, 380px) minmax(0, 1fr);
    column-gap: clamp(2.5rem, 5vw, 4rem);
    row-gap: clamp(2rem, 4vw, 3rem);
    align-items: start;
  }

  .sec-grid > .sec-head {
    position: sticky;
    top: 5.25rem;
    margin-bottom: 0;
  }
}

/* full-width content that follows a sec-grid lives outside the grid, so the
   sticky head above can never travel down over it */
.sec-below {
  margin-top: clamp(2rem, 4vw, 3rem);
}

.kicker {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 0 0 .5rem;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--k, var(--c-st));
}

.kicker::before {
  content: "";
  width: 1.9rem;
  height: 3px;
  border-radius: 3px;
  background: var(--k, var(--c-st));
  flex: none;
}

.h-section {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.95rem, 4vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -.028em;
  color: var(--text);
  text-wrap: balance;
  overflow-wrap: break-word;
}

.sec-head .note {
  margin: .9rem 0 0;
}

.sec-intro {
  margin: .9rem 0 0;
  font-size: 1.12rem;
  color: var(--text-dim);
}

.lede {
  font-size: 1.24rem;
  line-height: 1.6;
  color: var(--text);
}

.note {
  font-size: .95rem;
  color: var(--text-dim);
}

.note-standalone {
  margin-top: clamp(2.25rem, 5vw, 3.5rem);
  padding-top: 1.4rem;
  border-top: 1px solid var(--border-soft);
}

/* -- disclosure -- */
.disclosure {
  margin-top: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.disclosure summary {
  cursor: pointer;
  list-style: none;
  padding: .95rem 1.25rem;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--text);
}

.disclosure summary::-webkit-details-marker {
  display: none;
}

.disclosure summary::before {
  content: "";
  width: .55rem;
  height: .55rem;
  flex: none;
  border-right: 2px solid var(--c-st);
  border-bottom: 2px solid var(--c-st);
  transform: rotate(-45deg);
  transition: transform .2s var(--ease);
}

.disclosure[open] summary::before {
  transform: rotate(45deg);
}

.disclosure summary:hover {
  background: color-mix(in srgb, var(--primary) 4%, transparent);
}

.disclosure-body {
  padding: 0 1.25rem 1.35rem;
  border-top: 1px solid var(--border-soft);
}

.disclosure-body p {
  margin: 1.1rem 0 0;
  font-size: 1rem;
  line-height: 1.68;
  color: var(--text-dim);
}

/* -- stats band -- */
.band {
  background: var(--band);
  color: var(--band-ink);
  position: relative;
}

.band::before,
.band::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-field-on), var(--c-st-on) 50%, var(--c-country-on));
  opacity: .85;
}

.band::after {
  inset: auto 0 0 0;
  opacity: .35;
}

.stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat {
  padding: clamp(1.6rem, 3.5vw, 2.4rem) clamp(.8rem, 2vw, 1.5rem);
  position: relative;
}

.stat + .stat {
  border-left: 1px solid rgba(255, 255, 255, .12);
}

.stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: clamp(.8rem, 2vw, 1.5rem);
  width: 34px;
  height: 4px;
  border-radius: 0 0 3px 3px;
  background: var(--k);
}

.stat-num {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.03em;
  color: var(--band-ink);
}

.stat-label {
  display: block;
  margin-top: .45rem;
  font-size: .92rem;
  line-height: 1.4;
  color: var(--band-dim);
  max-width: 22ch;
}

/* -- figures -- */
.fig {
  margin: 0;
}

.fig-wide {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
}

.fig-media {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  border-radius: var(--r-md);
}

.fig-zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  background: #fff;
  cursor: zoom-in;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .25s var(--ease);
}

.fig-zoom:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
}

.fig-zoom img {
  width: 100%;
}

.fig-wide .fig-zoom {
  padding: clamp(.5rem, 2vw, 1.1rem);
}

figcaption,
.figcaption {
  margin-top: .9rem;
  font-size: .93rem;
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 82ch;
}

.fig-small {
  margin-top: 2.25rem;
  max-width: 760px;
}

.fig-mid {
  max-width: 920px;
}

/* -- cards -- */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 1.9rem 1.8rem 1.7rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--k);
  opacity: .9;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--k) 35%, var(--border));
}

.card h3 {
  margin: 0 0 .6rem;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.015em;
  color: var(--text);
}

.card p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.62;
  color: var(--text-dim);
}

/* -- tabs -- */
.tabs-nav {
  display: none;
}

html.js .tabs-nav {
  display: block;
  position: relative;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.tablist {
  display: flex;
  gap: .45rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: .25rem .25rem .5rem;
  margin-inline: -.25rem;
  scroll-snap-type: x proximity;
}

.tablist::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: none;
  scroll-snap-align: start;
  padding: .6rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font: inherit;
  font-size: .98rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: color .18s var(--ease), background-color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}

.tab:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--k) 45%, var(--border));
  transform: translateY(-1px);
}

.tab[aria-selected="true"] {
  background: var(--k);
  border-color: var(--k);
  color: #fff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--k) 30%, transparent);
}

:root[data-theme="dark"] .tab[aria-selected="true"] { color: #0d1620; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tab[aria-selected="true"] { color: #0d1620; }
}

.panel {
  outline-offset: 6px;
}

.panel[hidden] {
  display: none;
}

/* stacked, no-JS fallback: keep the panels visually separated */
html:not(.js) .panel + .panel {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--border);
}

.panel-head {
  max-width: var(--measure);
  margin-bottom: clamp(1.35rem, 3vw, 2rem);
}

/* wide screens: a panel head uses the same spine as the section head above it,
   title in the rail, prose in the body column. Without this the head is one
   narrow column of text with the full-width figure beneath it and nothing to
   its right, which reads as a grid that broke rather than a decision. */
@media (min-width: 1100px) {
  .panel-head {
    display: grid;
    grid-template-columns: minmax(270px, 380px) minmax(0, 1fr);
    column-gap: clamp(2.5rem, 5vw, 4rem);
    align-items: start;
    max-width: none;
  }

  .panel-head > * {
    min-width: 0;
  }

  .panel-head h3 {
    margin-bottom: 0;
  }

  .panel-head p {
    max-width: var(--measure);
  }
}

.panel-head h3 {
  margin: 0 0 .6rem;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3.4vw, 2.05rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.022em;
  color: var(--text);
  text-wrap: balance;
}

.panel-head h3::before {
  content: "";
  display: inline-block;
  vertical-align: .18em;
  width: .55rem;
  height: .55rem;
  margin-right: .6rem;
  border-radius: 2px;
  background: var(--k);
}

.panel-head p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.62;
  color: var(--text-dim);
}

html.js .panel.is-active {
  animation: panel-in .38s var(--ease) both;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* -- pickers -- */
/* chips and cards that choose which figure a panel shows. Hidden without JS,
   where the panel falls back to the one figure its markup already carries. */
.picker-row {
  display: flex;
  align-items: baseline;
  gap: .5rem .9rem;
  flex-wrap: wrap;
  margin-bottom: clamp(1rem, 2.2vw, 1.4rem);
}

html:not(.js) .picker-row {
  display: none;
}

.picker-row-block {
  display: block;
}

.picker-label {
  margin: 0;
  flex: none;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.picker-row-block .picker-label {
  margin-bottom: .6rem;
}

.picker {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.chip {
  flex: none;
  padding: .42rem .85rem;
  min-height: 2.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
  transition: color .18s var(--ease), background-color .18s var(--ease), border-color .18s var(--ease);
}

.chip:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--k) 45%, var(--border));
}

.chip[aria-checked="true"] {
  background: var(--k);
  border-color: var(--k);
  color: #fff;
}

:root[data-theme="dark"] .chip[aria-checked="true"] { color: #0d1620; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip[aria-checked="true"] { color: #0d1620; }
}

/* the same control as a card, for choices that need a line of explanation */
.cardpicker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
}

.pick-card {
  display: block;
  text-align: left;
  padding: .65rem .9rem .7rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  font: inherit;
  cursor: pointer;
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}

.pick-card:hover {
  border-color: color-mix(in srgb, var(--k) 45%, var(--border));
}

.pick-card[aria-checked="true"] {
  border-color: color-mix(in srgb, var(--k) 45%, var(--border));
  border-left-color: var(--k);
  background: color-mix(in srgb, var(--k) 9%, var(--surface));
}

.pick-card-t {
  display: block;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.pick-card-d {
  display: block;
  margin-top: .12rem;
  font-size: .82rem;
  line-height: 1.4;
  color: var(--text-dim);
}

/* two pickers side by side */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem clamp(1.5rem, 4vw, 3rem);
}

/* caption sets: one line per choice. With JS only the chosen one shows; with no
   JS every line stays, which reads as a legend for the panel. */
html.js .capset .cap {
  display: none;
}

html.js .capset .cap.is-on {
  display: inline;
}

.capset .cap-fixed {
  display: block;
  margin-top: .35rem;
}

.cap-now {
  color: var(--text);
}

/* a figure whose image is centred inside a fixed box, so that swapping between
   sources of different shapes never moves the page */
.emb-frame {
  aspect-ratio: 3 / 2;
}

.fig-zoom.emb-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* four maps of one indicator */
.quad {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.75rem);
}

.quad figcaption {
  margin-top: .55rem;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
}

.why-list {
  margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem);
}

.why-list p {
  margin: 0 0 1em;
  font-size: 1.02rem;
  color: var(--text-dim);
}

.why-list p:last-child {
  margin-bottom: 0;
}

.why-list b {
  color: var(--text);
}

/* three findings, three columns, rather than one tall stack of prose in the
   left half of the panel */
@media (min-width: 1100px) {
  .why-list {
    max-width: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1.5rem, 3vw, 2.5rem);
  }

  .why-list p {
    margin: 0;
    padding-top: .85rem;
    border-top: 2px solid color-mix(in srgb, var(--k, var(--c-st)) 55%, transparent);
  }
}

img.is-loading {
  opacity: .45;
}

/* -- pan / zoom viewer -- */
.zoomer-frame {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--plate);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.zoomer-stage {
  position: relative;
  aspect-ratio: var(--ar, 4034 / 2047);
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  background: var(--plate);
}

.zoomer-stage.is-grabbing {
  cursor: grabbing;
}

.zoomer-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  image-rendering: auto;
}

.zoomer-img.is-loading {
  filter: blur(1px);
  opacity: 1;
}

/* fetching a view that has no low-resolution stand-in */
.zoomer.is-busy .zoomer-frame::after {
  content: "Loading";
  position: absolute;
  top: .75rem;
  right: .75rem;
  z-index: 3;
  padding: .32rem .75rem;
  border-radius: 999px;
  background: rgba(12, 22, 33, .74);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
}

.zoomer.is-busy .zoomer-stage {
  opacity: .55;
}

/* bottom left: the top of a figure can carry its own printed title */
.zoomer-hint {
  position: absolute;
  bottom: .75rem;
  left: .75rem;
  margin: 0;
  padding: .32rem .75rem;
  border-radius: 999px;
  background: rgba(12, 22, 33, .74);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  pointer-events: none;
  transition: opacity .35s var(--ease);
}

.zoomer-hint.is-gone {
  opacity: 0;
}

.zoomer-controls {
  position: absolute;
  right: .75rem;
  bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem;
  border-radius: 999px;
  background: rgba(12, 22, 33, .74);
  backdrop-filter: blur(6px);
}

.zoomer-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 .55rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color .18s var(--ease);
}

.zoomer-btn:hover {
  background: rgba(255, 255, 255, .28);
}

.zoomer-reset {
  font-size: .82rem;
  font-weight: 600;
}

.zoomer-level {
  min-width: 3.1rem;
  text-align: center;
  color: #e6eef6;
  font-size: .8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* -- comparison slider -- */
.cmp-frame {
  position: relative;
  aspect-ratio: var(--ar, 2 / 1);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--plate);
  box-shadow: var(--shadow-sm);
  touch-action: pan-y;
  --p: 50%;
}

.cmp-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

.cmp-clip {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--p)) 0 0);
}

.cmp-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--p);
  width: 2px;
  margin-left: -1px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 0 0 1px rgba(20, 35, 55, .3);
  pointer-events: none;
  z-index: 2;
}

.cmp-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, .96);
  border: 2px solid var(--primary);
  box-shadow: 0 4px 14px rgba(15, 25, 40, .3);
  display: grid;
  place-items: center;
}

.cmp-knob::before,
.cmp-knob::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border-block: 5px solid transparent;
}

.cmp-knob::before {
  left: .55rem;
  transform: translateY(-50%);
  border-right: 7px solid var(--primary);
}

.cmp-knob::after {
  right: .55rem;
  transform: translateY(-50%);
  border-left: 7px solid var(--primary);
}

.cmp-label {
  position: absolute;
  top: .7rem;
  z-index: 2;
  padding: .3rem .7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(20, 35, 55, .16);
  color: #1b2733;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .01em;
  pointer-events: none;
  max-width: 46%;
}

.cmp-label-a { left: .7rem; }
.cmp-label-b { right: .7rem; }

.cmp-range {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: ew-resize;
}

.cmp-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 2.6rem;
  height: 900px;
  background: transparent;
  cursor: ew-resize;
}

.cmp-range::-moz-range-thumb {
  width: 2.6rem;
  height: 900px;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: ew-resize;
}

.cmp-frame:focus-within .cmp-knob {
  outline: 3px solid var(--c-field);
  outline-offset: 3px;
}

.cmp-fig figcaption {
  margin-top: .95rem;
}

/* -- resources -- */
.resources {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--wide);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.res {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  height: 100%;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}

a.res:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--primary) 38%, var(--border));
  color: var(--text);
}

.res-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 9%, transparent);
  color: var(--primary);
}

:root[data-theme="dark"] .res-icon { color: var(--link); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .res-icon { color: var(--link); }
}

.res-icon svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.res-body {
  display: block;
  min-width: 0;
}

.res-title {
  display: block;
  font-weight: 600;
  font-size: 1.06rem;
  line-height: 1.35;
}

.res-meta {
  display: block;
  margin-top: .18rem;
  font-size: .89rem;
  line-height: 1.5;
  color: var(--text-dim);
  font-weight: 400;
}

.res-off {
  border-style: dashed;
  box-shadow: none;
  background: transparent;
  color: var(--text-dim);
}

.res-off .res-icon {
  background: color-mix(in srgb, var(--text-dim) 12%, transparent);
  color: var(--text-dim);
}

.pill {
  display: inline-block;
  margin-left: .4rem;
  padding: .1rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-dim);
  vertical-align: 2px;
}

/* -- bibtex -- */
.codeblock {
  position: relative;
  max-width: var(--measure);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.codeblock::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-field), var(--c-st) 55%, var(--c-country));
  opacity: .85;
}

.codeblock pre {
  margin: 0;
  padding: 1.6rem 1.4rem 1.4rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: .88rem;
  line-height: 1.65;
  color: var(--text);
  tab-size: 2;
}

.copy-btn {
  position: absolute;
  top: .8rem;
  right: .8rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-dim);
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease), background-color .18s var(--ease);
}

.copy-btn svg {
  width: .95em;
  height: .95em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.copy-btn:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}

.copy-btn.is-copied {
  color: var(--c-time-ink);
  border-color: color-mix(in srgb, var(--c-time) 55%, transparent);
}

/* -- footer -- */
.footer {
  position: relative;
  padding: clamp(2.5rem, 5vw, 3.5rem) 0;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-alt);
}

.footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--c-field), var(--c-st) 50%, var(--c-country));
  opacity: .55;
}

.footer-inner {
  text-align: center;
}

.footer-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.footer-meta {
  margin: .3rem 0 0;
  font-size: .92rem;
  color: var(--text-dim);
}

.footer-links {
  margin: .9rem 0 0;
  font-size: .93rem;
  display: flex;
  justify-content: center;
  gap: .7rem;
  flex-wrap: wrap;
  color: var(--text-dim);
}

/* -- lightbox -- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, #0b131d 88%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .2s var(--ease);
}

.lightbox[hidden] {
  display: none;
}

.lightbox.is-open {
  opacity: 1;
}

.lightbox-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  align-items: center;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  border-radius: var(--r-sm);
  background: #fff;
  box-shadow: var(--shadow-lg);
  object-fit: contain;
}

.lightbox-figure figcaption {
  margin: 0;
  color: #dfe6ee;
  text-align: center;
  max-width: 70ch;
  font-size: .92rem;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.15rem;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color .18s var(--ease), transform .18s var(--ease);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, .2);
  transform: scale(1.05);
}

body.lb-open {
  overflow: hidden;
}

/* -- reveal -- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

html:not(.js) .reveal {
  opacity: 1;
  transform: none;
}

/* -- responsive -- */
@media (max-width: 1080px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat:nth-child(odd) {
    border-left: 0;
  }

  .stat:nth-child(n+3) {
    border-top: 1px solid rgba(255, 255, 255, .12);
  }
}

@media (max-width: 1000px) {
  .cardpicker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .resources {
    grid-template-columns: 1fr;
  }

  .quad {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 1.06rem;
  }

  .navbar-brand {
    display: none;
  }

  .navlinks {
    margin-left: 0;
    margin-right: auto;
    gap: 0;
  }

  .navlinks a {
    padding: .4rem .58rem;
    font-size: .88rem;
  }

  .actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .lightbox-figure img {
    max-height: 74vh;
  }

  .cmp-label {
    font-size: .72rem;
    padding: .25rem .55rem;
  }

  .zoomer-hint {
    font-size: .72rem;
    bottom: .5rem;
    left: .5rem;
    padding: .22rem .55rem;
  }

  .zoomer-controls {
    right: .5rem;
    bottom: .5rem;
    gap: .2rem;
    padding: .2rem;
  }

  .zoomer-btn {
    min-width: 1.65rem;
    height: 1.65rem;
    padding: 0 .4rem;
    font-size: .85rem;
  }

  .zoomer-reset {
    font-size: .72rem;
  }

  .zoomer-level {
    min-width: 2.5rem;
    font-size: .72rem;
  }

  .codeblock pre {
    padding-top: 3.3rem;
  }

  /* dense scientific figures stay legible: pan inside the figure card */
  .fig-media .fig-zoom {
    min-width: 560px;
  }

  .fig-wide .fig-media .fig-zoom {
    min-width: 660px;
  }

  figcaption::after {
    content: " Swipe the figure to pan, tap to enlarge.";
    color: var(--text-dim);
    opacity: .8;
    font-style: italic;
  }

  .cmp-fig figcaption::after,
  .quad figcaption::after,
  .figcaption::after {
    content: "";
  }

  .cardpicker {
    grid-template-columns: 1fr;
  }

  /* a little more room for thumbs */
  .chip {
    font-size: .88rem;
    padding: .45rem .8rem;
    min-height: 2.4rem;
  }
}

@media (max-width: 460px) {
  .btn-meta {
    display: none;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .stat + .stat {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, .12);
  }

  .cmp-knob {
    width: 2.4rem;
    height: 2.4rem;
  }
}

/* -- motion / print -- */
@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 {
    opacity: 1;
    transform: none;
  }

  html.js .panel.is-active {
    animation: none;
  }
}

@media print {
  .navbar,
  .lightbox,
  .theme-toggle,
  .copy-btn,
  .hero-canvas,
  .hero-glow,
  .tabs-nav,
  .picker-row,
  .controls,
  .zoomer-controls,
  .zoomer-hint,
  .cmp-range,
  .cmp-divider,
  .skip-link {
    display: none !important;
  }

  .panel[hidden] {
    display: block !important;
  }

  .panel + .panel {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ccc;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .cmp-clip {
    clip-path: inset(0 50% 0 0) !important;
  }

  /* one caption per choice: print the one that is showing */
  .capset .cap {
    display: none !important;
  }

  .capset .cap.is-on {
    display: inline !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .band {
    background: #fff;
    color: #000;
    border: 1px solid #ccc;
  }

  .stat-num,
  .stat-label {
    color: #000;
  }

  .section {
    padding: 1.25rem 0;
  }

  .fig,
  .card,
  .res,
  .codeblock {
    break-inside: avoid;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: .8em;
    color: #555;
  }
}
