/* BrainRot3D field guide. One dark look, Apple product-page rhythm.
   Color is spent in two places only: the hero headline and each specimen's glow. */

:root {
  color-scheme: dark;
  --bg: #000;
  --surface: #111114;
  --surface-2: #1c1c1e;
  --surface-3: #2c2c2e;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #8e8e93;
  --hair: rgba(255, 255, 255, 0.1);
  --link: #2997ff;
  --button: #0071e3;
  --cyan: #00e5ff;
  --magenta: #ff1f8a;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--sans);

  --pl: max(22px, env(safe-area-inset-left, 0px));
  --pr: max(22px, env(safe-area-inset-right, 0px));
  --max: 1080px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  padding-left: var(--pl);
  padding-right: var(--pr);
  background: var(--bg);
  color: var(--text);
  font: 17px/1.47 var(--sans);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; user-select: none; -webkit-user-select: none; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(255, 31, 138, 0.4); }
h1, h2, h3 { text-wrap: balance; overflow-wrap: break-word; hyphens: auto; }
section[id] { scroll-margin-top: 100px; }

/* Nav: translucent layer, content scrolls under it */
.nav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  margin-left: calc(-1 * var(--pl));
  margin-right: calc(-1 * var(--pr));
  padding-left: var(--pl);
  padding-right: var(--pr);
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-inner {
  max-width: var(--max);
  min-height: 76px;
  padding-block: 8px;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.mark { height: 60px; width: auto; display: block; }
.wordmark { height: 30px; width: auto; display: block; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; font-size: 14px; }
.nav-links a { color: var(--text-2); text-decoration: none; transition: color 0.2s; }
@media (hover: hover) and (pointer: fine) { .nav-links a:hover { color: var(--text); } }
.nav-links .nav-random {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  padding: 5px 13px;
  border-radius: 980px;
  transition: background 0.2s, transform 0.1s ease-out;
}
@media (hover: hover) and (pointer: fine) { .nav-links .nav-random:hover { background: rgba(255, 255, 255, 0.2); } }
.nav-links .nav-random:active { transform: scale(0.96); }

/* Shared type */
.eyebrow {
  margin: 0;
  font: 600 12px/1.3 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
}
.latin { margin: 0; font-family: var(--serif); font-style: italic; color: var(--text-2); letter-spacing: 0; }
.latin-lg { font-size: 22px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 980px;
  padding: 12px 22px;
  font-size: 17px;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s ease-out;
}
.btn i { font-style: normal; }
.btn-primary { background: var(--button); color: #fff; }
@media (hover: hover) and (pointer: fine) { .btn-primary:hover { background: #0077ed; } }
.btn:active, .dl-links a:active, .card:active, .pager a:active { transform: scale(0.97); }
.link-chev { color: var(--link); text-decoration: none; font-size: 17px; }
.link-chev::after { content: " ›"; }
@media (hover: hover) and (pointer: fine) { .link-chev:hover { text-decoration: underline; } }

/* Hero */
.hero { max-width: var(--max); margin-inline: auto; padding-block: 72px 24px; text-align: center; }
.hero h1 {
  margin: 14px 0 20px;
  font-size: clamp(56px, 11vw, 120px);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.grad {
  background: linear-gradient(90deg, var(--cyan), #8f7bff 50%, var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  max-width: 34ch;
  margin: 0 auto;
  font-size: clamp(19px, 2.3vw, 24px);
  line-height: 1.38;
  color: var(--text-2);
  text-wrap: balance;
}
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px 28px; margin-top: 32px; }

/* Specimen plate: glow, graph paper, and the hybrid formula */
.plate {
  position: relative;
  isolation: isolate;
  margin: 0;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-width: 100%;
  overflow: hidden;
  background:
    radial-gradient(55% 55% at 50% 50%, var(--glow), transparent 72%),
    linear-gradient(180deg, #141417, #08080a);
}
.plate::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 25%, transparent 75%);
  mask-image: radial-gradient(circle at 50% 50%, #000 25%, transparent 75%);
}
.fig {
  position: absolute;
  top: 12px;
  left: 14px;
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
}
.formula {
  display: flex;
  align-items: center;
  font-size: clamp(40px, 6.5vw, 60px);
  line-height: 1;
  transition: transform 0.5s var(--ease);
}
.glyph {
  display: inline-block;
  font-family: var(--emoji);
  color: var(--hue);
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
}
.x { font-family: var(--serif); font-style: italic; font-size: 0.42em; color: rgba(255, 255, 255, 0.45); margin-inline: 0.18em; }
.plate figcaption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-2);
  text-align: left;
}
.plate-hero {
  max-width: 960px;
  aspect-ratio: 2 / 1;
  margin: 56px auto 0;
  border-radius: 28px;
}
.plate-hero .formula { font-size: clamp(84px, 15vw, 180px); }
.plate-lg { border-radius: 28px; }
.plate-lg .formula { font-size: clamp(80px, 14vw, 150px); }
.plate.spin .glyph { animation: spin 5.86s linear infinite; }
@keyframes spin { to { transform: rotateY(360deg); } }
/* On its own page, each specimen's emoji spin like Maxwell (No. 015). Speeds are Pierce's calls:
   Maxwell 5.86s per turn (.spin, above), everyone else 7.82s. Cards and the logo stay still. */
.plate-lg .glyph { animation: spin 7.82s linear infinite; }

/* Stats */
.stats {
  max-width: 880px;
  margin-inline: auto;
  padding-block: 40px 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 16px;
  text-align: center;
}
.stats strong {
  display: block;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stats span { color: var(--text-2); font-size: 14px; }

/* Sections */
.section { max-width: var(--max); margin-inline: auto; padding-block: 64px; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  margin-bottom: 24px;
}
.section-head h2 { margin: 0; font-size: clamp(32px, 4.5vw, 48px); line-height: 1.08; font-weight: 700; letter-spacing: -0.03em; }
.section-head p { margin: 0; color: var(--text-2); }
/* On a specimen page the neighbors sit below the H1 in rank, so their head is section size. */
.sp-more .section-head h2 { font-size: 24px; letter-spacing: -0.02em; }

/* Segmented control */
.seg-wrap { max-width: 100%; overflow-x: auto; margin-bottom: 24px; scrollbar-width: none; }
.seg-wrap::-webkit-scrollbar { display: none; }
.seg { position: relative; display: inline-flex; padding: 4px; background: var(--surface-2); border-radius: 12px; }
.seg button {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 9px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s;
}
.seg button span { color: var(--text-3); margin-left: 3px; font-variant-numeric: tabular-nums; }
.seg button[aria-pressed="true"] { color: var(--text); }
.seg:not(.ready) button[aria-pressed="true"] { background: var(--surface-3); }
.seg-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: 9px;
  background: var(--surface-3);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.seg.ready .seg-thumb { transition: transform 0.38s var(--ease), width 0.38s var(--ease); }

/* Grid and cards */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.35s var(--ease), background 0.2s;
}
.card-body { padding: 14px 16px 18px; }
.card h3 { margin: 0 0 2px; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.card .latin { font-size: 15px; }
.card-status { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; font-size: 12px; line-height: 18px; color: var(--text-2); }
@media (hover: hover) and (pointer: fine) {
  .card:hover { background: #17171b; transform: translateY(-3px); }
  .card:hover .formula { transform: scale(1.08); }
}

/* Conservation status colors, shared by pills and the IUCN scale */
.pill {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 18px;
  padding-inline: 5px;
  border-radius: 5px;
  font: 700 10.5px/1 var(--mono);
  color: #000;
}
.pill-ew { background: #bf5af2; }
.pill-cr { background: #ff453a; }
.pill-en { background: #ff9f0a; }
.pill-vu { background: #ffd60a; }
.pill-nt { background: #a4d65e; }
.pill-lc { background: #30d158; }
.pill-dd { background: #8e8e93; }

/* How it works */
.how-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.how-grid h3 { margin: 0 0 8px; font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.how-grid p { margin: 0; color: var(--text-2); max-width: 60ch; }

/* Specimen page */
.crumb { max-width: var(--max); margin-inline: auto; padding-top: 20px; }
.crumb a { color: var(--link); text-decoration: none; font-size: 15px; }
@media (hover: hover) and (pointer: fine) { .crumb a:hover { text-decoration: underline; } }
.sp-hero {
  max-width: var(--max);
  margin-inline: auto;
  padding-block: 24px 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px 56px;
  align-items: center;
}
.sp-intro h1 { margin: 10px 0 4px; font-size: clamp(40px, 6vw, 64px); line-height: 1.04; font-weight: 700; letter-spacing: -0.035em; }
.lede { margin: 20px 0 28px; font-size: 21px; line-height: 1.4; max-width: 34ch; }
.dl-links { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dl-links a {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s, transform 0.1s ease-out;
}
@media (hover: hover) and (pointer: fine) { .dl-links a:hover { background: var(--surface-3); } }
.dl-links span { margin-right: auto; color: var(--text-2); font-weight: 400; font-size: 13px; }
.dl-links i { font-style: normal; color: var(--link); }

.sp-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px 56px; padding-top: 24px; }
.field h2 { margin: 0 0 16px; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.data { margin: 0; }
.data div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 16px; padding-block: 14px; border-top: 1px solid var(--hair); }
.data div:last-child { border-bottom: 1px solid var(--hair); }
.data dt { padding-top: 3px; font: 600 11.5px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.data dd { margin: 0; }
.iucn { display: flex; flex-wrap: wrap; gap: 6px; }
.iucn-cell {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--text-3);
  font: 700 12px/1 var(--mono);
}
.iucn-cell:not(.is-on) { background: var(--surface-2); }
.iucn-cell.is-on { color: #000; }
.iucn-label { margin: 12px 0 0; font-size: 17px; font-weight: 600; }
.field .notes-head { margin-top: 44px; }
.notes { margin: 0 0 20px; color: var(--text-2); max-width: 60ch; line-height: 1.55; }
.field h3 { margin: 24px 0 6px; font-size: 17px; font-weight: 600; }

.pager { max-width: var(--max); margin-inline: auto; padding-block: 0 64px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pager a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s, transform 0.1s ease-out;
}
@media (hover: hover) and (pointer: fine) { .pager a:hover { background: #17171b; } }
.pager span { font: 600 12px/1.3 var(--mono); letter-spacing: 0.06em; color: var(--text-3); }
.pager .next { align-items: flex-end; text-align: right; }

/* Lexicon (memes.html) and its home-page preview */
.nav-links a[aria-current="page"] { color: var(--text); }
.hero-page { padding-bottom: 8px; }
.hero-page h1 { font-size: clamp(48px, 9vw, 104px); }
.az { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 720px; margin: 32px auto 0; }
.az a {
  padding: 6px 13px;
  border-radius: 980px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
@media (hover: hover) and (pointer: fine) { .az a:hover { background: var(--surface-3); color: var(--text); } }
.lexicon { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 8px; }
.entry {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 28px 22px;
  border-radius: 22px;
  background: var(--surface);
  scroll-margin-top: 100px;
}
.entry:target { box-shadow: inset 0 0 0 1px rgba(41, 151, 255, 0.7); }
.entry header { display: grid; gap: 6px; }
.headword { margin: 0; font-size: 40px; line-height: 1.05; font-weight: 700; letter-spacing: -0.03em; }
.entry-meta { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; color: var(--text-2); }
.pos { font-family: var(--serif); font-style: italic; letter-spacing: 0; }
.usage { margin: 0; font: 600 11px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.senses { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.senses li::marker { font-weight: 700; color: var(--text-3); }
.example { margin: 0; font-family: var(--serif); font-style: italic; color: var(--text-2); letter-spacing: 0; }
.etym { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text-2); }
.etym span { display: block; margin-bottom: 4px; font: 600 11px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.see { color: var(--link); text-decoration: none; white-space: nowrap; }
.see::after { content: " ›"; }
@media (hover: hover) and (pointer: fine) { .see:hover { text-decoration: underline; } }
.entry-links {
  list-style: none;
  margin: auto 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--hair);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}
.entry-links a { color: var(--link); text-decoration: none; font-size: 15px; font-weight: 500; }
@media (hover: hover) and (pointer: fine) { .entry-links a:hover { text-decoration: underline; } }
.entry-links i { font-style: normal; margin-left: 4px; }
.teaser-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.teaser {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.35s var(--ease), background 0.2s;
}
.teaser .headword { font-size: 34px; margin-top: 6px; }
.teaser-def { margin: 6px 0 0; font-size: 15px; color: var(--text-2); }
.teaser:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .teaser:hover { background: #17171b; transform: translateY(-3px); }
}
.more { margin: 24px 0 0; }

/* Search, counts, and letter index (catalog and lexicon) */
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 20px; }
.tools .seg-wrap { margin-bottom: 0; }
.search { position: relative; flex: 1 1 260px; max-width: 420px; }
.search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font: 16px/1.25 var(--sans);
  padding: 11px 14px 11px 36px;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus-visible { outline: 2px solid var(--link); outline-offset: 0; }
.count { margin: 0 0 16px; color: var(--text-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.empty { margin: 0; padding-block: 40px; text-align: center; color: var(--text-2); }
.az-letters { max-width: 640px; gap: 6px; }
.az-letters a, .az-letters span { min-width: 34px; padding: 6px 0; text-align: center; font-variant-numeric: tabular-nums; }
.az-letters span { border-radius: 980px; font-size: 14px; color: #3a3a3c; }
.letter {
  grid-column: 1 / -1;
  margin: 28px 0 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-3);
  scroll-margin-top: 100px;
}
.letter:first-child { margin-top: 0; }

/* Legal pages and footer links */
.legal { max-width: 720px; margin-inline: auto; padding-block: 48px 72px; }
.legal h1 { margin: 12px 0 8px; font-size: clamp(40px, 6vw, 56px); line-height: 1.05; font-weight: 700; letter-spacing: -0.03em; }
.legal .updated { margin: 0 0 24px; font-size: 15px; color: var(--text-2); }
.legal h2 { margin: 36px 0 10px; font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.legal p { margin: 0 0 14px; color: var(--text-2); line-height: 1.6; }
.legal a { color: var(--link); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { color: var(--text-2); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .foot-links a:hover { color: var(--text); text-decoration: underline; } }

/* Footer */
.foot { margin-left: calc(-1 * var(--pl)); margin-right: calc(-1 * var(--pr)); padding: 32px var(--pr) 48px var(--pl); border-top: 1px solid var(--hair); background: #0a0a0b; }
.foot-inner { max-width: var(--max); margin-inline: auto; font-size: 12px; line-height: 1.55; color: var(--text-3); }
.foot-inner p { margin: 0 0 10px; max-width: 80ch; }
.foot-brand img { height: 28px; width: auto; display: block; }
.foot-small { color: var(--text-3); }
.foot-small a { color: inherit; }

/* Wider screens */
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lexicon { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section { padding-block: 96px; }
  .hero { padding-top: 96px; }
}
@media (min-width: 860px) {
  .sp-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-top: 32px; }
  .sp-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* Phones */
@media (max-width: 700px) {
  .hide-sm { display: none; }
}
@media (max-width: 640px) {
  .plate-hero { aspect-ratio: 4 / 3; margin-top: 44px; border-radius: 22px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .teaser-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .hero { padding-top: 48px; }
  .section { padding-block: 48px; }
}
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .brand { gap: 8px; }
  .wordmark { height: 26px; }
  .nav-links { gap: 6px 14px; font-size: 13px; }
  .nav-links .nav-random { padding: 4px 11px; }
  .entry { padding: 22px 20px 18px; }
  .headword { font-size: 34px; }
  .grid { gap: 12px; }
  .card { border-radius: 16px; }
  .card-body { padding: 12px 12px 14px; }
  .card h3 { font-size: 15px; }
  .card .latin { font-size: 13px; }
  .dl-links { grid-template-columns: minmax(0, 1fr); }
  .data div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .pager a { padding: 14px 16px; font-size: 15px; }
}
@media (max-width: 480px) {
  .nav-inner { column-gap: 10px; row-gap: 2px; }
  .mark { height: 52px; }
  .wordmark { height: 24px; }
  section[id], .entry, .letter { scroll-margin-top: 124px; }
  .nav-links { column-gap: 12px; }
  .seg { display: flex; }
  .seg button { flex: 1 1 auto; padding: 8px 6px; font-size: 13px; }
  .seg button span { display: none; }
}

/* Phone held sideways: keep the sticky bar short */
@media (max-height: 500px) and (orientation: landscape) {
  .nav-inner { min-height: 60px; padding-block: 4px; }
  .mark { height: 48px; }
  .wordmark { height: 24px; }
  .hero { padding-top: 32px; }
  .plate-hero { aspect-ratio: 3 / 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav { background: #000; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
