/* ═══════════════════════════════════════════════
   YJTOON — Greenbar
   A table-first catalog, drawn like the greenbar stock tabular data used to
   be printed on: pale green-gray paper with banded rows, ink type, and two
   colors that each carry meaning — lime marks what you SAVE, vermilion marks
   what you SPEND. Fonts (self-hosted): Archivo (variable width + weight;
   condensed-heavy for headings, normal width for text) + Martian Mono for code only.
   ═══════════════════════════════════════════════ */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo.woff2") format("woff2");
  font-weight: 400 900;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Martian Mono";
  src: url("/assets/fonts/martian-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-style: normal;
  font-display: swap;
}

/* ═══ DESIGN TOKENS ═══ */
:root {
  /* Surfaces — greenbar paper (hue ~120°, low chroma: reads as paper, not as "green") */
  --canvas: #f2f5f0;
  --surface: #ffffff;
  --surface-hover: #e9f0e5;
  --elevated: #e6ede2; /* the green band */
  --border: #cbd5c6;
  --border-hover: #9fb09a;
  --border-subtle: rgba(16, 22, 18, 0.07);

  /* Text — green-black ink scale (all ≥ 5.3:1 on every surface above) */
  --text-primary: #101612;
  --text-secondary: #3f4a43;
  --text-muted: #566359;

  /* Action + link: deep green. Fills use --ink; the highlighter is --mark. */
  --accent: #17603c;
  --accent-hover: #0f4a2d;
  --accent-dim: rgba(23, 96, 60, 0.12);
  --accent-subtle: rgba(23, 96, 60, 0.07);
  --accent-contrast: #ffffff; /* text on accent fills */
  --ink: #101612;

  /* Meaning colors. Lime = saved / the good number. Vermilion = spent / the costly number. */
  --mark: #d5f23e;
  --mark-dim: rgba(213, 242, 62, 0.45);
  --ember: #c8321b;

  /* Semantic */
  --success: #17603c;
  --success-dim: rgba(23, 96, 60, 0.1);

  /* Motion */
  --duration-instant: 100ms;
  --duration-fast: 160ms;
  --duration-normal: 260ms;
  --duration-slow: 420ms;
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Spacing — 8px scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* Radii — datasheet-crisp */
  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 8px;
  --radius-full: 9999px;

  /* Typography */
  --font-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Labels, counts and kickers are set in Archivo itself; mono is reserved for
     real code (pre, code, kbd, the Studio panes), where alignment is the point. */
  --font-label: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-code: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --stretch-display: 76%;

  /* Elevation — borders do the work; one hard shadow for floating layers */
  --shadow-card: 0 0 0 1px rgba(16, 22, 18, 0.08);
  --shadow-card-hover: 0 0 0 1px rgba(16, 22, 18, 0.28);
  --shadow-float: 0 1px 0 rgba(16, 22, 18, 0.06), 0 12px 32px rgba(16, 22, 18, 0.14);
}

/* ═══ SERIF UTILITIES ═══ */
.serif {
  /* Legacy class name: now the condensed display voice. */
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 800;
  letter-spacing: -0.012em;
  line-height: 1.02;
}

/* Section label: a small tab, not a shouted eyebrow. The lime square is the
   same marker used everywhere "saved" is meant — here it just anchors the label. */
.section-kicker {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

.section-kicker::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--mark);
  box-shadow: 0 0 0 1px rgba(16, 22, 18, 0.55);
  flex: none;
}

kbd {
  font-family: var(--font-code);
  font-size: 0.78em;
  padding: 1px 7px;
  border: 1px solid var(--border-hover);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
}

/* ═══ VISUALLY HIDDEN (a11y) ═══ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ═══ SKIP LINK ═══ */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  padding: var(--space-3) var(--space-5);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top var(--duration-fast) var(--ease-smooth);
}

.skip-link:focus {
  top: var(--space-4);
  color: #fff;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  background: var(--canvas);
  color: var(--text-primary);
  min-height: 100vh;
}

/* `clip`, not `hidden`: hidden makes body a scroll container that mobile
   browsers still let you pan sideways when something spills past the edge. */
html,
body {
  overflow-x: clip;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition:
    color var(--duration-fast) var(--ease-smooth),
    background-color var(--duration-fast) var(--ease-smooth);
}
a:hover {
  color: var(--accent-hover);
}

/* Prose links wear the highlighter: underline in ink, lime fill on hover. */
.blog-content a,
.faq-body a,
.about-byline a,
.micro-note a,
.section-follow a,
.rv-line a,
.rv-mid a,
.studio-note a,
.catalog-lede a {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.blog-content a:hover,
.faq-body a:hover,
.about-byline a:hover,
.micro-note a:hover,
.section-follow a:hover,
.rv-line a:hover,
.rv-mid a:hover,
.studio-note a:hover,
.catalog-lede a:hover {
  background: var(--mark);
  color: var(--ink);
  text-decoration-color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
  box-shadow: 0 0 0 5px var(--mark-dim);
}

::selection {
  background: var(--mark);
  color: var(--ink);
}

/* ═══ LAYOUT ═══ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-4);
  }
}

/* ═══ HEADER ═══ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid var(--border);
  background: rgba(242, 245, 240, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

@media (max-width: 768px) {
  .site-header .container {
    height: 54px;
  }
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  flex-shrink: 0;
}
.logo:hover {
  color: var(--text-primary);
}

.logo svg {
  width: 30px;
  height: 30px;
  flex: none;
}

.logo-text {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav-links a {
  position: relative;
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.nav-links a:hover {
  color: var(--ink);
  background: var(--mark);
}

.nav-links a[aria-current="page"] {
  color: var(--ink);
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: var(--space-3);
  right: var(--space-3);
  bottom: 2px;
  height: 3px;
  background: var(--mark);
  box-shadow: 0 0 0 1px rgba(16, 22, 18, 0.55);
}

/* Mobile menu — fades in place. (It used to slide in from translateX(100%),
   which parked 390px of layout off-screen to the right and let phones pan the
   whole page sideways.) */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 44px;
  min-height: 44px;
  padding: var(--space-2);
  background: none;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  cursor: pointer;
  z-index: 500;
}

.mobile-menu-btn span {
  width: 20px;
  height: 2px;
  background: var(--ink);
  transition: transform var(--duration-fast) var(--ease-smooth),
    opacity var(--duration-fast) var(--ease-smooth);
}

@media (max-width: 768px) {
  .nav-links {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    min-height: calc(100vh - 54px);
    min-height: calc(100dvh - 54px);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-4) var(--space-4) var(--space-8);
    gap: 0;
    background: var(--canvas);
    border-top: 1px solid var(--border);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition:
      opacity var(--duration-normal) var(--ease-out),
      transform var(--duration-normal) var(--ease-out),
      visibility 0s linear var(--duration-normal);
    overflow-y: auto;
  }

  .nav-links.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition-delay: 0s;
  }

  .nav-links a {
    padding: var(--space-4) var(--space-2);
    font-family: var(--font-display);
    font-stretch: var(--stretch-display);
    font-weight: 800;
    font-size: 1.9rem;
    line-height: 1;
    min-height: 60px;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }

  .nav-links a[aria-current="page"]::after {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
  }
  .mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* ═══ PLAYGROUND (live format instrument) ═══
   An ink panel: this is the one place the page shows raw bytes, and the three
   bars under the code are the product's thesis measured on the dataset above. */
.playground {
  --pg-text: #e4ece4;
  --pg-muted: #9db0a2;
  --pg-line: rgba(228, 236, 228, 0.14);
  background: var(--ink);
  color: var(--pg-text);
  border: 1px solid var(--ink);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 8px 8px 0 var(--elevated), 8px 8px 0 1px var(--border-hover);
  min-width: 0;
}

.playground-tabs {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--pg-line);
}

.playground-tabs button {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--pg-muted);
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-smooth),
    color var(--duration-fast) var(--ease-smooth);
}

.playground-tabs button:hover {
  color: #fff;
  border-color: var(--pg-line);
}

.playground-tabs button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--mark);
}

.playground-file {
  margin-left: auto;
  font-family: var(--font-label);
  font-size: 0.72rem;
  color: var(--pg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playground-code {
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--pg-text);
  max-height: 340px;
  min-height: 220px;
}

.playground-code:hover {
  border: none;
}

/* Three real sizes of the same dataset, as lengths. */
.playground-bars {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--pg-line);
  list-style: none;
}

.playground-bars li {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) 5.6rem;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-label);
  font-size: 0.72rem;
  color: var(--pg-muted);
  font-variant-numeric: tabular-nums;
}

.playground-bars li[aria-current="true"] {
  color: #fff;
}

.playground-bars .pb-track {
  height: 10px;
  background: rgba(228, 236, 228, 0.1);
}

.playground-bars .pb-fill {
  display: block;
  height: 100%;
  width: 0;
  background: #7f9486;
  transition: width var(--duration-slow) var(--ease-out);
}

.playground-bars [data-bar="json"] .pb-fill {
  background: #ee6a50; /* vermilion, lifted for the dark panel */
}

.playground-bars [data-bar="toon"] .pb-fill {
  background: var(--mark);
}

.playground-bars .pb-val {
  text-align: right;
}

.playground-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  margin: 0;
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--pg-line);
  font-family: var(--font-label);
  font-size: 0.74rem;
  color: var(--pg-muted);
  font-variant-numeric: tabular-nums;
}

.playground-meta a {
  color: var(--mark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.playground-meta a:hover {
  color: #fff;
}

.playground .btn-mini {
  background: transparent;
  color: var(--pg-text);
  border-color: var(--pg-line);
}

.playground .btn-mini:hover {
  background: var(--mark);
  border-color: var(--mark);
  color: var(--ink);
}

.playground-links {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.hero-page {
  padding-bottom: var(--space-16);
}

.hero-page .container {
  max-width: 860px;
}

.hero-page .hero-kicker {
  margin-bottom: var(--space-5);
}

.hero-page h1 {
  font-size: clamp(2.6rem, 5.5vw, 4.5rem);
}

/* ═══ BUTTONS ═══
   Ink fills for actions; the highlighter appears on hover — the same
   gesture as a marker pass over the words you chose. */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 46px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-smooth),
    color var(--duration-fast) var(--ease-smooth),
    transform var(--duration-instant) var(--ease-smooth);
}

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

.btn-primary:hover {
  background: var(--mark);
  color: var(--ink);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--ink);
}

.btn-secondary:hover {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transform: translate(-1px, -1px);
}

.btn-primary:active,
.btn-secondary:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ═══ SECTIONS ═══ */
.section {
  padding: var(--space-20) 0;
  position: relative;
}

.section-title {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  letter-spacing: -0.012em;
  line-height: 0.98;
  text-wrap: balance;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.04rem;
  margin-bottom: var(--space-8);
  line-height: 1.65;
  max-width: 62ch;
}

/* ═══ DATASET VIEW ═══ */
.dataset-view {
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.dataset-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-4);
  background: var(--elevated);
}

.dataset-header h2 {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-size: 1.7rem;
  line-height: 1;
  font-weight: 800;
  color: var(--text-primary);
}

.dataset-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.format-btn {
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-label);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-smooth);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.format-btn:hover {
  background: var(--mark);
}

.format-btn.active {
  background: var(--ink);
  color: var(--mark);
}

.dataset-content {
  padding: var(--space-5) var(--space-6);
  overflow-x: auto;
  background: transparent;
}

/* Code is always an ink panel: raw bytes read as bytes, never as prose. */
pre.code-block {
  --code-text: #e4ece4;
  font-family: var(--font-code);
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--code-text);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: var(--space-5);
  overflow-x: auto;
  overflow-y: auto;
  max-height: 520px;
  tab-size: 2;
  position: relative;
  font-variant-numeric: tabular-nums;
}

.copy-btn {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  min-height: 40px;
  padding: var(--space-2) var(--space-4);
  background: var(--ink);
  border: 1px solid rgba(228, 236, 228, 0.3);
  border-radius: var(--radius-sm);
  color: #e4ece4;
  font-size: 0.74rem;
  font-family: var(--font-label);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-smooth);
  opacity: 0;
  z-index: 10;
}

pre.code-block:hover .copy-btn,
pre.code-block:focus-within .copy-btn,
.copy-btn:focus-visible {
  opacity: 1;
}

.copy-btn:hover {
  background: var(--mark);
  border-color: var(--mark);
  color: var(--ink);
}

.copy-btn.copied {
  background: var(--mark);
  border-color: var(--mark);
  color: var(--ink);
}

/* Touch devices have no hover: keep the copy control visible. */
@media (hover: none) {
  .copy-btn {
    opacity: 1;
  }
}

/* ═══ SEARCH + TAG FILTER ═══ */
.search-bar-inner {
  position: relative;
  max-width: 640px;
}

.search-input {
  width: 100%;
  min-height: 54px;
  padding: 14px 20px 14px 48px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-body);
  outline: none;
  transition: box-shadow var(--duration-fast) var(--ease-smooth);
}

.search-input:focus {
  box-shadow: 4px 4px 0 var(--mark), 4px 4px 0 1px var(--ink);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink);
  pointer-events: none;
}

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-6) 0 var(--space-8);
}

.tag-chip {
  min-height: 40px;
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: var(--font-label);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-smooth);
}

.tag-chip:hover {
  background: var(--mark);
  border-color: var(--ink);
  color: var(--ink);
}

.tag-chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--mark);
}

.text-muted {
  color: var(--text-muted);
}

/* ═══ DATASET VIEW EXTRAS ═══ */
.dataset-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-3);
  font-size: 0.82rem;
  font-family: var(--font-label);
}

.dataset-links a {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.dataset-links a:hover {
  background: var(--mark);
}

.cite-row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  margin-top: var(--space-2);
}

.cite-row .studio-note {
  flex: 1;
  min-width: 0;
}

.btn-mini {
  flex-shrink: 0;
  min-height: 36px;
  padding: var(--space-1) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-family: var(--font-label);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-smooth);
}

.btn-mini:hover {
  background: var(--mark);
}

.btn-mini.copied {
  background: var(--mark);
  border-color: var(--ink);
}

/* ═══ BREADCRUMB ═══ */
.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-label);
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
}

.breadcrumb a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumb a:hover {
  background: var(--mark);
}

.breadcrumb-sep {
  color: var(--text-muted);
  font-size: 0.6rem;
}

/* ═══ STATES ═══ */
.loading {
  text-align: center;
  padding: var(--space-12);
  color: var(--text-muted);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto var(--space-4);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-state {
  text-align: center;
  padding: var(--space-12);
  color: var(--text-muted);
}

.error-state {
  text-align: center;
  padding: var(--space-10) var(--space-6);
  color: var(--text-secondary);
}

/* ═══ FOOTER ═══
   The one dark surface on the page: it closes the sheet. */
.site-footer {
  --ft-text: #b4bfb6;
  --ft-line: rgba(228, 236, 228, 0.16);
  padding: var(--space-16) 0 var(--space-8);
  margin-top: var(--space-24);
  background: var(--ink);
  color: var(--ft-text);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-12);
}

.footer-word {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: var(--space-3);
}

.footer-brand p {
  font-size: 0.9rem;
  color: var(--ft-text);
  max-width: 30ch;
  line-height: 1.6;
}

.site-footer nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-head {
  font-family: var(--font-label);
  font-size: 0.75rem;
  color: var(--mark);
  margin-bottom: var(--space-2);
}

.site-footer nav a {
  font-size: 0.92rem;
  color: var(--ft-text);
  width: fit-content;
}

.site-footer nav a:hover {
  color: var(--ink);
  background: var(--mark);
}

.footer-status {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-top: var(--space-6);
  border-top: 1px solid var(--ft-line);
  font-family: var(--font-label);
  font-size: 0.74rem;
  color: var(--ft-text);
  font-variant-numeric: tabular-nums;
}

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

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

/* ═══ ERROR PAGES ═══ */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.error-container {
  text-align: center;
  padding: var(--space-8);
}

.error-container h1 {
  display: inline-block;
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-size: clamp(6rem, 22vw, 11rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: var(--mark);
  padding: 0 0.12em;
  line-height: 0.92;
  margin-bottom: var(--space-6);
}

.error-container p {
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  font-size: 1.05rem;
}

.error-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-5);
  margin-top: var(--space-6);
  font-size: 0.92rem;
}

.error-links a {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.error-links a:hover {
  background: var(--mark);
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--canvas);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ═══ REVEAL ═══ */
.reveal {
  transition:
    opacity 0.5s var(--ease-out),
    transform 0.5s var(--ease-out);
}

/* Reveal animation only when JS is active — content stays visible without it */
html.js .reveal {
  opacity: 0;
  transform: translateY(20px);
}

html.js .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══ API PAGE UTILITIES ═══ */
.inline-code {
  background: var(--elevated);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: var(--font-code);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.api-code {
  display: block;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-code);
  font-size: 0.8rem;
  color: #e4ece4;
  line-height: 1.6;
  margin-top: var(--space-2);
  overflow-x: auto;
}

.api-section-title {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
  margin: var(--space-10) 0 var(--space-3);
}

.api-section-title:first-child {
  margin-top: 0;
}

.api-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: var(--space-6);
  max-width: 68ch;
}

.api-endpoint {
  margin-bottom: var(--space-6);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.api-endpoint:nth-of-type(even) {
  background: var(--elevated);
}

.api-endpoint-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: var(--space-2);
}
.api-try {
  margin-top: var(--space-2);
  font-size: 0.85rem;
}
.api-try a {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.api-try a:hover {
  background: var(--mark);
}
.api-endpoint-label strong {
  color: var(--text-primary);
}
.api-desc strong {
  color: var(--text-primary);
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .section {
    padding: var(--space-12) 0;
  }
  .card {
    padding: var(--space-4) var(--space-5);
  }
  .dataset-header {
    flex-direction: column;
  }
  .dataset-actions {
    width: 100%;
    overflow-x: auto;
  }
}

/* ═══ REDUCED MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .card:hover {
    transform: none !important;
  }
  .scroll-progress {
    display: none;
  }
  .hero-video {
    display: none;
  }
}

/* ═══ BLOG ═══ */
.blog-list {
  display: flex;
  flex-direction: column;
  margin-top: var(--space-8);
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--surface);
}

.blog-card {
  padding: var(--space-5) var(--space-5);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--duration-fast) var(--ease-smooth);
}

.blog-card:last-child {
  border-bottom: 0;
}

.blog-card:hover {
  background: var(--mark);
}

.blog-title-link {
  color: var(--text-primary);
  text-decoration: none;
}

.blog-title-link:hover {
  color: var(--ink);
}

.blog-title-link h2 {
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  line-height: 1.05;
  margin: 0 0 var(--space-2);
}

.blog-meta {
  font-family: var(--font-label);
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: var(--space-3);
}

.blog-card:hover .blog-meta,
.blog-card:hover .blog-excerpt {
  color: var(--ink);
}

.blog-excerpt {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.55;
  margin: 0 0 var(--space-4);
  max-width: 70ch;
}

.blog-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.blog-tags .tag {
  font-size: 0.7rem;
  padding: 1px 7px;
  background: transparent;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.blog-readmore {
  font-size: 0.88rem;
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  font-weight: 700;
}

.blog-card:hover .blog-readmore {
  text-decoration-color: var(--ink);
}

.blog-list-footer {
  margin-top: var(--space-8);
}

/* Blog detail template */
.blog-article .container {
  max-width: 740px;
}
.blog-article-header h1 {
  font-size: clamp(2.3rem, 5.6vw, 3.8rem);
  line-height: 0.98;
  margin-bottom: var(--space-3);
}
.blog-kicker {
  font-family: var(--font-label);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}
.blog-article-header .blog-meta {
  margin: var(--space-3) 0 var(--space-6);
}
.blog-article-footer {
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 2px solid var(--ink);
  font-size: 0.875em;
  color: var(--text-muted);
}
.blog-article-footer p + p {
  margin-top: 4px;
}
.blog-content {
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--text-primary);
}
.blog-content p {
  margin: 0 0 1.1em;
}
.blog-content h2 {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-size: 1.9rem;
  line-height: 1.02;
  font-weight: 800;
  margin: 1.8em 0 0.5em;
}
.blog-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.5em 0 0.4em;
}
.blog-content pre,
.blog-content code {
  font-family: var(--font-code);
  font-size: 0.88em;
}
.blog-content :not(pre) > code {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.05em 0.35em;
}
.blog-content pre {
  background: var(--ink);
  color: #e4ece4;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  overflow: auto;
  line-height: 1.6;
}
.blog-content ul,
.blog-content ol {
  padding-left: 1.3em;
  margin: 0 0 1.1em;
}
.blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.2em;
  font-size: 0.92rem;
  display: block;
  overflow-x: auto;
}
.blog-content th,
.blog-content td {
  border: 1px solid var(--border);
  padding: 7px 11px;
  text-align: left;
}
.blog-content th {
  background: var(--ink);
  color: #fff;
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 600;
}
.blog-content li {
  margin: 0.3em 0;
}

.blog-content > p:first-of-type {
  font-size: 1.18em;
  line-height: 1.6;
  color: var(--text-primary);
}

/* ── Search Results ── */
.search-section-label {
  font-family: var(--font-label);
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

/* ── Dataset Stats ── */
.dataset-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-3);
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-family: var(--font-label);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.7rem;
}

/* ═══ POST PRODUCT CTA (blog article footer + catalog aside) ═══ */
.post-cta {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  margin-top: var(--space-8);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition:
    box-shadow var(--duration-fast) var(--ease-smooth),
    transform var(--duration-fast) var(--ease-smooth);
}

.post-cta:hover {
  color: inherit;
  box-shadow: 5px 5px 0 var(--mark), 5px 5px 0 1px var(--ink);
  transform: translate(-2px, -2px);
}

.post-cta img {
  flex-shrink: 0;
  width: 64px;
  height: auto;
  border: 1px solid var(--ink);
  border-radius: 2px;
}

.post-cta-body {
  min-width: 0;
}

.post-cta-kicker {
  display: block;
  font-family: var(--font-label);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.post-cta-title {
  display: block;
  margin: 2px 0 var(--space-1);
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-size: 1.35rem;
  line-height: 1.02;
  font-weight: 800;
  color: var(--text-primary);
}

.post-cta-text {
  display: block;
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.post-related {
  margin-top: var(--space-6);
  font-size: 0.92rem;
  color: var(--text-muted);
}

.post-related a {
  font-weight: 600;
}

/* ═══ ABOUT STATEMENT ═══ */
.about-grid {
  max-width: 900px;
}

.about-statement {
  font-family: var(--font-display);
  font-stretch: 84%;
  font-size: clamp(1.8rem, 3.9vw, 3rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: var(--space-6);
  text-wrap: pretty;
}

.about-byline {
  font-size: 0.98rem;
  color: var(--text-secondary);
}

/* ═══ BOOK FEATURE ═══
   The shelf: each book is a spec sheet — cover, one-line argument, the facts
   a buyer needs (format, length, price), one action. */
.book-feature {
  position: relative;
  padding: var(--space-20) 0;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--surface);
  overflow: hidden;
}

.book-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--space-16);
  align-items: center;
}

.book-feature h2.serif {
  font-size: clamp(2.5rem, 5.6vw, 4.5rem);
  line-height: 0.95;
  margin-bottom: var(--space-5);
  color: var(--text-primary);
}

.book-pull {
  font-size: clamp(1.12rem, 2vw, 1.35rem);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: var(--space-6);
  max-width: 40ch;
  text-wrap: pretty;
}

.book-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  justify-content: start;
  margin: 0 0 var(--space-6);
  border: 1px solid var(--ink);
}

.book-facts div {
  padding: var(--space-2) var(--space-5) var(--space-2) var(--space-4);
  border-right: 1px solid var(--border);
}

.book-facts div:last-child {
  border-right: 0;
}

.book-facts dt {
  font-family: var(--font-label);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.book-facts dd {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-size: 1.5rem;
  line-height: 1.1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.book-meta {
  font-family: var(--font-label);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.book-meta strong {
  color: var(--text-primary);
}

.book-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.book-cover {
  display: block;
  width: min(100%, 340px);
  margin: 0 auto;
  transform: perspective(1400px) rotateY(-9deg) rotateX(2deg);
  transform-origin: 60% 50%;
  transition: transform var(--duration-slow) var(--ease-out);
}

.book-cover:hover,
.book-cover:focus-visible {
  transform: perspective(1400px) rotateY(-2deg) rotateX(0deg) translateY(-3px);
}

.book-cover img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--ink);
  border-radius: 2px;
  box-shadow: 12px 12px 0 var(--elevated), 12px 12px 0 1px var(--border-hover);
}

@media (max-width: 860px) {
  .book-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-10);
  }
  .book-cover {
    width: min(70%, 260px);
    order: -1;
    margin-left: 0;
    transform: none;
  }
  .book-cover img {
    box-shadow: 8px 8px 0 var(--elevated), 8px 8px 0 1px var(--border-hover);
  }
  .book-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .book-facts div {
    padding-right: var(--space-2);
  }
}

/* ═══ NOTES TEASER (editorial rows) ═══ */
.blog-teaser .teaser-date {
  grid-column: 3;
  grid-row: 1;
  font-family: var(--font-label);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.blog-teaser .card:hover .teaser-date {
  color: var(--ink);
}

/* ═══ SEARCH (instrument input; base look lives in the app.js template) ═══ */
#search-bar {
  margin-bottom: var(--space-8);
}

#search-input {
  border-radius: var(--radius-sm);
  font-size: 1rem;
}

/* ═══ STORE WIDGET — "From the author" ebook shelf ═══ */
.sw-root {
  font-family: var(--font-body);
}

.sw-toggle {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2147483001;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 44px;
  padding: 13px 0 11px;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-float);
  color: #fff;
  cursor: pointer;
  transition:
    border-color var(--duration-fast) var(--ease-smooth),
    box-shadow var(--duration-fast) var(--ease-smooth);
}

.sw-toggle:hover {
  background: #1c2620;
  border-color: var(--ink);
  box-shadow:
    0 0 0 1px rgba(16, 22, 18, 0.29),
    0 4px 16px rgba(33, 27, 18, 0.12);
}

.sw-toggle:focus-visible,
.sw-close:focus-visible,
.sw-btn:focus-visible,
.sw-foot-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sw-toggle-icon {
  color: var(--mark);
  display: flex;
}

.sw-toggle-label {
  writing-mode: vertical-rl;
  font-family: var(--font-label);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sw-badge {
  display: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-sm);
  background: var(--mark);
  color: var(--ink);
  font-family: var(--font-label);
  font-size: 0.66rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}

.sw-badge.sw-show {
  display: inline-flex;
}

.sw-panel {
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  width: min(480px, calc(100vw - 68px));
  max-height: min(70vh, 560px);
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity var(--duration-normal) var(--ease-smooth),
    transform var(--duration-normal) var(--ease-smooth),
    visibility var(--duration-normal);
}

@media (min-width: 720px) {
  .sw-panel {
    right: 70px;
    bottom: auto;
    top: 50%;
    transform: translateY(calc(-50% + 10px));
    width: 520px;
    max-height: calc(100vh - 56px);
  }
}

.sw-panel.sw-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

@media (min-width: 720px) {
  .sw-panel.sw-open {
    transform: translateY(-50%);
  }
}

.sw-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.sw-title {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.sw-sub {
  margin: 2px 0 0;
  font-family: var(--font-label);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sw-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
}

.sw-close:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.sw-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-2) var(--space-3);
}

.sw-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.sw-row:hover {
  background: var(--surface-hover);
}

.sw-row + .sw-row {
  border-top: 1px solid var(--border-subtle);
}

.sw-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--elevated);
  border: 1px solid var(--border-subtle);
}

.sw-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sw-thumb img.sw-thumb-err {
  display: none;
}

.sw-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sw-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sw-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sw-price {
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.sw-foot {
  border-top: 1px solid var(--border);
  padding: var(--space-3) var(--space-5);
}

.sw-foot-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 40px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease-smooth), color var(--duration-fast) var(--ease-smooth);
}

.sw-foot-link:hover {
  background: var(--mark);
  color: var(--ink);
}

.sw-foot-icon {
  display: flex;
}

.sw-state {
  padding: var(--space-10) var(--space-5);
  text-align: center;
}

.sw-spinner {
  width: 26px;
  height: 26px;
  margin: 0 auto;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: sw-spin 0.8s linear infinite;
}

.sw-state-icon {
  color: var(--text-muted);
  display: flex;
  justify-content: center;
}

.sw-state-title {
  margin: var(--space-3) 0 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.sw-state-sub {
  margin: var(--space-1) 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.sw-state-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.sw-btn {
  min-height: 38px;
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.sw-btn:hover {
  background: var(--mark);
  color: var(--ink);
}

.sw-btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--accent);
}

@keyframes sw-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 719px) {
  .sw-root {
    right: 10px;
    top: auto;
    bottom: 10px;
    transform: none;
  }

  .sw-toggle {
    width: 40px;
    padding: 11px 0 9px;
    right: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sw-panel,
  .sw-toggle,
  .sw-foot-link {
    transition: none;
  }

  .sw-spinner {
    animation: none;
  }
}

/* ═══════════════════════════════════════════════════════════
   VOXEL CATALOG — the index drawn as a physical plate
   Canvas is decoration; .voxel-legend is the real interface.
   ═══════════════════════════════════════════════════════════ */

.voxel {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
  border-top: 1px solid var(--border-subtle);
}

.voxel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
  gap: var(--space-10);
  align-items: start;
}

.voxel-stage {
  position: relative;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  overflow: hidden;
  aspect-ratio: 3 / 2;
}

#voxel-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

#voxel-canvas.is-dragging {
  cursor: grabbing;
}

#voxel-canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}

.voxel-readout {
  position: absolute;
  left: var(--space-3);
  right: var(--space-3);
  bottom: var(--space-3);
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
}

.voxel-readout-title {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.voxel-readout-meta {
  margin: 0;
  min-width: 0;
  font-family: var(--font-label);
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
}

.voxel-readout-link {
  font-family: var(--font-label);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.voxel-readout-link:hover {
  text-decoration: underline;
}

.voxel-controls {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: flex;
  gap: var(--space-2);
}

.voxel-toggle {
  padding: 5px 11px;
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-label);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.voxel-toggle:hover {
  background: var(--mark);
  color: var(--ink);
}

.voxel-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.voxel-caption {
  margin: var(--space-3) 0 0;
  font-family: var(--font-label);
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* No-WebGL, no-GPU, or lost-context state: the plate steps aside and the
   list becomes the whole interface rather than leaving a blank rectangle. */
.voxel--no-webgl .voxel-stage {
  display: none;
}

.voxel--no-webgl .voxel-legend {
  max-height: none;
}

.voxel-panel {
  min-width: 0;
}

.voxel-legend {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 2px 0;
  max-height: 340px;
  overflow-y: auto;
}

.voxel-legend a {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  transition:
    background var(--duration-fast) var(--ease-smooth),
    color var(--duration-fast) var(--ease-smooth);
}

.voxel-legend a::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--swatch, var(--border));
  align-self: center;
}

.voxel-legend a:hover,
.voxel-legend a:focus-visible {
  background: var(--mark);
  color: var(--ink);
}

.voxel-legend a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.lg-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lg-count {
  flex: 0 0 auto;
  font-family: var(--font-label);
  font-size: 0.66rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 960px) {
  .voxel-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-8);
  }

  .voxel-stage {
    aspect-ratio: 4 / 3;
  }

  .voxel-legend {
    max-height: none;
  }
}

/* ═══════════════════════════════════════════════════════════
   TOON STUDIO — encoder and cost meter
   ═══════════════════════════════════════════════════════════ */

.studio {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
  border-top: 1px solid var(--border-subtle);
}

.studio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-8);
}

.studio-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.studio-pane-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--ink);
  background: var(--elevated);
}

.studio-label {
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}

.studio-file {
  margin-left: auto;
  font-family: var(--font-label);
  font-size: 0.68rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-source {
  width: 100%;
  min-height: 300px;
  padding: var(--space-4);
  border: 0;
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font-code);
  font-size: 0.78rem;
  line-height: 1.6;
  resize: vertical;
}

.studio-source:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.studio-output {
  margin: 0;
  background: var(--ink);
  color: #e4ece4;
  padding: var(--space-4);
  min-height: 300px;
  max-height: 460px;
  overflow: auto;
  font-family: var(--font-code);
  font-size: 0.78rem;
  line-height: 1.6;
  white-space: pre;
  tab-size: 2;
}

.studio-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.studio-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.studio-preset-label {
  font-family: var(--font-label);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: var(--space-1);
}

.studio-preset {
  padding: 5px 12px;
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-label);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.studio-preset:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.studio-preset[aria-pressed="true"] {
  color: var(--mark);
  border-color: var(--ink);
  background: var(--ink);
}

.studio-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: 0;
  list-style: none;
}

.studio-stats li {
  padding: 5px 12px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font-label);
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.studio-stats li[data-emphasis] {
  border-color: var(--ink);
  background: var(--mark);
  color: var(--ink);
  font-weight: 700;
}

.studio-stats .is-negative {
  color: var(--text-muted);
}

.studio-status {
  margin: var(--space-4) 0 0;
  font-family: var(--font-label);
  font-size: 0.72rem;
  color: var(--text-muted);
  min-height: 1.2em;
}

.studio-status.is-error {
  color: var(--ember);
  font-weight: 600;
}

.studio-note {
  margin: var(--space-3) 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Generic small print: used under the hero and the comparison table. */
.micro-note {
  margin: var(--space-4) 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.micro-note a {
  color: var(--accent);
}

.hero-copy .micro-note {
  margin-top: var(--space-4);
  margin-bottom: 0;
}

@media (max-width: 860px) {
  .studio-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .studio-source,
  .studio-output {
    min-height: 240px;
  }
}

/* ═══════════════════════════════════════════════════════════
   TRUST BAR · USE CASES · COMPARISON · FAQ
   ═══════════════════════════════════════════════════════════ */

.table-scroll {
  margin-top: var(--space-8);
  overflow-x: auto;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.compare-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.compare-table caption {
  caption-side: top;
  text-align: left;
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-label);
  font-size: 0.76rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.compare-table th,
.compare-table td {
  padding: var(--space-3) var(--space-5);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.compare-table thead th {
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  background: var(--ink);
  border-bottom: 1px solid var(--ink);
}

.compare-table tbody th {
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.compare-table td {
  color: var(--text-secondary);
}

.compare-table tr:last-child th,
.compare-table tr:last-child td {
  border-bottom: 0;
}

.faq-list {
  margin-top: var(--space-8);
  border-top: 2px solid var(--ink);
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-5) 0;
  cursor: pointer;
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  list-style: none;
}

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

.faq-item summary::after {
  content: "+";
  margin-left: auto;
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-family: var(--font-label);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.faq-item[open] summary::after {
  content: "–";
  background: var(--mark);
}

.faq-item summary:hover {
  background: var(--mark-dim);
}

.faq-item summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.faq-body {
  padding: 0 0 var(--space-5);
  max-width: 72ch;
}

.faq-body p {
  margin: 0 0 var(--space-3);
  color: var(--text-secondary);
  line-height: 1.7;
}

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

/* ═══════════════════════════════════════════════════════════
   CATALOG PAGES — generated, human-readable reference pages
   ═══════════════════════════════════════════════════════════ */

.catalog-header {
  padding-top: var(--space-10);
}

.catalog-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-label);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}

.catalog-crumbs a {
  color: var(--text-secondary);
  text-decoration: none;
}

.catalog-crumbs a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.catalog-crumbs span[aria-hidden] {
  color: var(--border-hover);
}

.catalog-lede {
  max-width: 68ch;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: var(--space-4) 0 0;
}

.catalog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
  padding: 0;
  list-style: none;
}

.catalog-meta li {
  padding: 3px 10px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font-label);
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.catalog-section {
  margin-top: var(--space-12);
}

.catalog-section > h2 {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--ink);
}

.dataset-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}

.dataset-list a {
  display: block;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition:
    border-color var(--duration-fast) var(--ease-smooth),
    background var(--duration-fast) var(--ease-smooth);
}

.dataset-list a:hover {
  border-color: var(--ink);
  background: var(--mark);
}

.dataset-list a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dataset-list h3 {
  margin: 0 0 6px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0;
}

.dataset-list p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.category-tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-3);
}

.category-tile {
  display: block;
  height: 100%;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition:
    border-color var(--duration-fast) var(--ease-smooth),
    transform var(--duration-fast) var(--ease-smooth);
}

.category-tile:hover {
  border-color: var(--ink);
  background: var(--mark);
}

.category-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.category-tile h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.category-tile p {
  margin: 0 0 var(--space-3);
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.category-tile .lg-count {
  font-size: 0.7rem;
}

.format-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: 0;
  list-style: none;
}

.format-links a {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font-label);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.format-links a:hover {
  background: var(--mark);
}

/* Rendered dataset content: whatever shape the data has becomes real HTML. */
.data-block {
  margin: 0 0 var(--space-5);
}

.data-block > h3 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-label);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table th,
.data-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-subtle);
  line-height: 1.6;
}

.data-table thead th {
  position: sticky;
  top: 0;
  background: var(--ink);
  font-family: var(--font-label);
  font-size: 0.76rem;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: var(--mark);
}

.data-table td code,
.data-table th code {
  font-family: var(--font-code);
  font-size: 0.78rem;
  word-break: break-word;
}

.data-dl {
  margin: 0;
  display: grid;
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.data-dl > div {
  display: grid;
  grid-template-columns: minmax(140px, 0.32fr) minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
}


.data-dl dt {
  font-family: var(--font-label);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  word-break: break-word;
}

.data-dl dd {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text-primary);
  word-break: break-word;
}

.data-list {
  margin: 0;
  padding-left: var(--space-5);
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.data-scalar {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.code-block {
  overflow-x: auto;
}

.api-call {
  display: block;
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  font-family: var(--font-code);
  font-size: 0.78rem;
  color: #e4ece4;
  overflow-x: auto;
  white-space: pre;
}

.catalog-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: var(--space-10);
  align-items: start;
}

.catalog-aside {
  display: grid;
  gap: var(--space-4);
  position: sticky;
  top: 84px;
}

@media (max-width: 940px) {
  .catalog-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-8);
  }

  .catalog-aside {
    position: static;
  }

  .data-dl > div {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .usecase,
  .category-tile,
  .voxel-legend a,
  .studio-preset,
  .voxel-toggle {
    transition: none;
  }

  .usecase:hover,
  .category-tile:hover {
    transform: none;
  }
}

/* ═══ ANNOUNCE BAR — slim, dismissible, homepage only ═══
   In-flow above the sticky header: it scrolls away with the page, so it
   never steals viewport or shifts layout after load. Hidden permanently
   once dismissed (localStorage) or when JS is off it simply renders. */
.announce {
  background: var(--ink);
  font-size: 0.88rem;
  color: #d5ded7;
}

.announce-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-2) var(--space-6);
  text-align: center;
}

.announce-kicker {
  font-family: var(--font-label);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--mark);
  padding: 1px 7px;
  white-space: nowrap;
}

.announce a {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--mark);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.announce a:hover {
  background: var(--mark);
  color: var(--ink);
  text-decoration-color: var(--ink);
}

.announce-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: var(--space-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #aeb9b0;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.announce-close:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.announce[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .announce-inner {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
    font-size: 0.8rem;
  }
  .announce-kicker {
    display: none;
  }
}

/* ═══ BOOK SHELF — second book row under the featured book ═══ */
.book-shelf-rule {
  border: 0;
  border-top: 1px solid var(--ink);
  max-width: 1200px;
  margin: var(--space-20) auto 0;
}

.book-shelf-rule + .book-grid {
  margin-top: var(--space-20);
}

@media (min-width: 861px) {
  .book-grid--flip .book-copy {
    order: 2;
  }
  .book-grid--flip .book-cover {
    order: 1;
  }
}

.book-points {
  list-style: none;
  margin: 0 0 var(--space-6);
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.book-points li {
  position: relative;
  padding-left: var(--space-5);
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.book-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  background: var(--mark);
  box-shadow: 0 0 0 1px rgba(16, 22, 18, 0.55);
}

/* ═══ MID-ARTICLE ASIDE — one editorial line inside long posts ═══
   Newspaper pull-line: hairlines above and below, no card chrome, so it
   reads as part of the article rather than an injected ad. */
.rv-mid {
  margin: var(--space-8) 0;
  padding: var(--space-4) 0;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.rv-mid-kicker {
  font-family: var(--font-label);
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--mark);
  color: var(--ink);
  padding: 1px 6px;
  margin-right: var(--space-2);
}

.rv-mid a {
  font-weight: 600;
}

/* ═══ SLIM AUTHOR LINE — catalog asides, blog index, errors ═══
   Lowest-density variant: a quiet text line for pages whose job is
   lookup, not reading. Never a card, never an image. */
.rv-line {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.rv-line a {
  font-weight: 600;
}

.catalog-aside .rv-line {
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.blog-list-note {
  margin: var(--space-6) 0 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.error-note {
  margin-top: var(--space-8);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ═══ STORE WIDGET — pinned featured row ═══ */
.sw-row--featured {
  background: var(--mark-dim);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}

.sw-row--featured + .sw-row {
  border-top: 0;
}

.sw-featured-tag {
  font-family: var(--font-label);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-primary);
}


/* Titles that live outside a .serif/.section-title element. */
.blog-article-header h1,
.blog-title-link h2,
.catalog-header h1 {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 800;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

/* ═══ SIZE BARS (per-dataset byte sizes, catalog pages) ═══ */
.size-bars {
  display: grid;
  gap: 6px;
  margin: var(--space-5) 0 0;
  padding: var(--space-3) var(--space-4);
  max-width: 560px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
}

.size-row {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 9.5rem;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-label);
  font-size: 0.74rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.size-track {
  height: 10px;
  background: var(--elevated);
}

.size-fill {
  display: block;
  height: 100%;
  background: #7f9486;
}

.size-row[data-fmt="json"] .size-fill {
  background: var(--ember);
}

.size-row[data-fmt="toon"] .size-fill {
  background: var(--mark);
  box-shadow: inset 0 0 0 1px rgba(16, 22, 18, 0.6);
}

.size-row[data-fmt="toon"] {
  color: var(--text-primary);
  font-weight: 600;
}

.size-val {
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .size-row {
    grid-template-columns: 2.6rem minmax(0, 1fr) 8.4rem;
    gap: var(--space-2);
    font-size: 0.7rem;
  }
}

/* ═══ SECOND BOOK ROW (compact) ═══ */
.book-grid--second {
  grid-template-columns: minmax(0, 0.45fr) minmax(0, 1fr);
  gap: var(--space-10);
  align-items: center;
}

.book-cover--small {
  width: min(100%, 200px);
  margin: 0 auto 0 0;
  transform: perspective(1200px) rotateY(8deg);
  transform-origin: 40% 50%;
}

.book-cover--small:hover,
.book-cover--small:focus-visible {
  transform: perspective(1200px) rotateY(2deg) translateY(-3px);
}

.book-cover--small img {
  box-shadow: 8px 8px 0 var(--elevated), 8px 8px 0 1px var(--border-hover);
}

.book-title-sm {
  font-size: clamp(2rem, 3.6vw, 2.8rem);
  margin-bottom: var(--space-3);
}

.book-grid--second .book-pull {
  font-size: 1.05rem;
  font-weight: 500;
  max-width: 52ch;
}

@media (max-width: 860px) {
  .book-grid--second {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-6);
  }
  .book-cover--small {
    width: min(48%, 180px);
    order: -1;
    transform: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   V3 — color by category, motion by scroll
   What changed and why:
   · Every category owns one color (css/palette.css, from content/palette.json)
     and that color follows it everywhere it appears: spine, panel, page
     header, table head, cube, search row. Color is information, not paint.
   · Lime still means "saved", vermilion still means "spent" (token bars).
   · Mono type is for real code only; labels are Archivo.
   · Scroll does work: the top bar fills with the spectrum, spines rise onto
     the shelf, and one pinned scene shows what TOON removes from JSON.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --ink-2: #1a231d;
  --spent: #ee6a50; /* vermilion, lifted to read on ink */
  --header-h: 60px;
  --tile-line: 1.5px solid var(--ink);
}

/* ═══ SCROLL PROGRESS — the spectrum, revealed as you read ═══ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--spectrum);
  clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0);
  z-index: 999;
  pointer-events: none;
}

/* ═══ REVEAL — only hides content when JS and IntersectionObserver are present ═══ */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform 620ms var(--ease-out);
  transition-delay: calc(var(--d, 0) * 70ms);
}
.js-reveal [data-reveal].visible {
  opacity: 1;
  transform: none;
}

/* ═══ SECTION KICKER — a small tab in the category color when one applies ═══ */
.section-kicker {
  font-family: var(--font-label);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}
.section-kicker::before {
  width: 12px;
  height: 12px;
  background: var(--cat, var(--mark));
  box-shadow: 0 0 0 1.5px var(--ink);
  border-radius: 2px;
}

/* ═══ HERO ═══ */
.hero {
  position: relative;
  padding: var(--space-8) 0 0;
  background: var(--canvas);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: var(--space-16);
  align-items: center;
  padding-top: var(--space-10);
  padding-bottom: var(--space-16);
}

.hero h1 {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-size: clamp(3.3rem, 7vw, 6.6rem);
  font-weight: 800;
  letter-spacing: -0.018em;
  line-height: 0.98;
  margin-bottom: var(--space-6);
  color: var(--text-primary);
  text-wrap: balance;
}

/* The one claim, drawn as a highlighter pass that sweeps in left to right. */
.hero h1 em {
  font-style: normal;
  padding: 0 0.1em;
  margin: 0 -0.04em;
  background: linear-gradient(var(--mark), var(--mark)) no-repeat 0 100% / 0% 100%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  animation: mark-sweep 900ms 650ms var(--ease-out) forwards;
}
@keyframes mark-sweep {
  to {
    background-size: 100% 100%;
  }
}

.hero-description {
  font-size: 1.14rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-8);
  max-width: 46ch;
}
.hero-description strong {
  color: var(--text-primary);
}

.hero-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.hero-copy .micro-note {
  margin: 0;
}

/* Stats: three measured numbers, set as numerals — no box around them. */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-10);
  margin: var(--space-10) 0 0;
  padding: var(--space-5) 0 0;
  border-top: 1.5px solid var(--ink);
  max-width: 560px;
}
.hero-stats div {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  margin: 0;
}
.hero-stats dt {
  font-family: var(--font-label);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.hero-stats dd {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-size: 3.1rem;
  line-height: 0.95;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.hero-stats dd.is-saved span {
  background: var(--mark);
  padding: 0 0.08em;
}

/* Page heroes (API, error-adjacent): same voice, no split. */
.hero-page {
  padding-bottom: var(--space-12);
}
.hero-page .container {
  max-width: 1200px;
}
.hero-page h1 {
  font-size: clamp(3rem, 7vw, 5.6rem);
}
.hero-kicker {
  font-family: var(--font-label);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.hero-copy > *,
.playground {
  animation: rise-in 800ms var(--ease-out) both;
}
.hero-copy > :nth-child(1) { animation-delay: 60ms; }
.hero-copy > :nth-child(2) { animation-delay: 160ms; }
.hero-copy > :nth-child(3) { animation-delay: 260ms; }
.hero-copy > :nth-child(4) { animation-delay: 340ms; }
.hero-copy > :nth-child(5) { animation-delay: 420ms; }
.playground { animation-delay: 220ms; }

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

/* ═══ PLAYGROUND — ink panel in front of a block of the whole spectrum ═══ */
.playground {
  position: relative;
  box-shadow: none;
  border-radius: var(--radius-lg);
  isolation: isolate;
  overflow: visible;
  background: transparent;
  border: 0;
}
.playground::before {
  content: "";
  position: absolute;
  inset: 26px -26px -26px 26px;
  border-radius: var(--radius-lg);
  background: var(--spectrum);
  border: var(--tile-line);
  z-index: -2;
  transform: translateY(var(--par, 0px));
}
.playground::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: var(--ink);
  border: var(--tile-line);
  z-index: -1;
}
.playground > * {
  position: relative;
}
.playground-tabs {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.playground-bars .pb-fill {
  transition: width 900ms var(--ease-out);
}
.playground-bars [data-bar="json"] .pb-fill {
  background: var(--spent);
}

/* Popular: the same dot every category carries, so it doubles as the key. */
.popular {
  position: relative;
  border-top: var(--tile-line);
  border-bottom: var(--tile-line);
  background: var(--surface);
}
.popular-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
  font-size: 0.92rem;
}
.popular-label {
  font-family: var(--font-label);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}
.popular-row a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-weight: 700;
  text-decoration: none;
  border-radius: 99px;
  padding: 4px 12px 4px 8px;
  transition: background var(--duration-fast) var(--ease-smooth);
}
.popular-row a::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cat, var(--ink));
  box-shadow: 0 0 0 1.5px var(--ink);
}
.popular-row a:hover {
  background: color-mix(in srgb, var(--cat, var(--mark)) 45%, white);
  color: var(--ink);
}
.popular-row a.popular-all::before {
  background: var(--spectrum);
}

/* ═══ SHELF — 27 categories as spines; height is dataset count ═══ */
.shelf-section {
  padding: var(--space-20) 0 var(--space-20);
  background: var(--surface);
  border-bottom: var(--tile-line);
}
.shelf-section .section-subtitle {
  margin-bottom: var(--space-6);
}

.shelf-wrap {
  margin-top: var(--space-6);
  padding: 44px var(--space-6) 30px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.shelf {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-width: 1020px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 8px;
  list-style: none;
}
.shelf::after {
  content: "";
  position: absolute;
  left: -14px;
  right: -14px;
  bottom: -18px;
  height: 18px;
  background: var(--ink);
  border-radius: 0 0 4px 4px;
}
.shelf li {
  flex: 1 1 0;
  min-width: 30px;
  display: flex;
  align-items: flex-end;
}

.spine {
  --rise: 0px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: calc(150px + var(--n) * 26px);
  padding: 12px 0 16px;
  background: var(--cat);
  color: var(--ink);
  border: var(--tile-line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  text-decoration: none;
  transform: translateY(var(--rise));
  transition:
    transform var(--duration-normal) var(--ease-out),
    filter var(--duration-fast) var(--ease-smooth);
}
.spine::before,
.spine::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--ink);
  opacity: 0.55;
}
.spine::before { top: 38px; }
.spine::after { bottom: 12px; }

.spine-n {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.spine-name {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 800;
  font-size: 1.22rem;
  line-height: 1;
  letter-spacing: 0.005em;
  white-space: nowrap;
  margin-bottom: 14px;
}
.spine:hover,
.spine:focus-visible,
.spine.keyboard-focused {
  --rise: -14px;
  color: var(--ink);
}
.spine:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.spine[aria-current="true"] {
  --rise: -26px;
  box-shadow: 0 -6px 0 var(--ink);
}

.js-reveal .shelf .spine {
  --rise: 180px;
  opacity: 0;
}
.js-reveal .shelf.is-in .spine {
  --rise: 0px;
  opacity: 1;
  transition:
    transform 700ms var(--ease-out),
    opacity 400ms var(--ease-out);
  transition-delay: calc(var(--i) * 26ms);
}
.js-reveal .shelf.is-in .spine:hover,
.js-reveal .shelf.is-in .spine:focus-visible {
  --rise: -14px;
  transition-delay: 0ms;
}
.js-reveal .shelf.is-in .spine[aria-current="true"] {
  --rise: -26px;
  transition-delay: 0ms;
}

/* The reader: the selected category, flooded with its own color. */
.shelf-reader {
  margin-top: var(--space-12);
}
.reader {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  background: var(--cat, var(--elevated));
  color: var(--ink);
  border: var(--tile-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 10px 10px 0 var(--ink);
}
.js .reader[hidden] {
  display: none;
}
.reader.is-swapping {
  animation: reader-in 380ms var(--ease-out) both;
}
@keyframes reader-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.reader-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-8);
}
.reader-family {
  font-family: var(--font-label);
  font-size: 0.82rem;
  font-weight: 700;
  padding-bottom: 2px;
  border-bottom: 1.5px solid var(--ink);
}
.reader h3 {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: 0.92;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.reader-desc {
  max-width: 40ch;
  font-size: 1.04rem;
  line-height: 1.55;
}
.reader-go {
  margin-top: auto;
  background: var(--ink);
  color: #fff;
  border: 1.5px solid var(--ink);
}
.reader-go:hover {
  background: var(--surface);
  color: var(--ink);
}
.reader-list {
  background: var(--surface);
  border-left: var(--tile-line);
  padding: var(--space-6) var(--space-8);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--space-8);
  align-content: start;
  list-style: none;
  margin: 0;
}
.reader-list li {
  border-bottom: 1px solid var(--border);
}
.reader-list a {
  display: block;
  padding: var(--space-3) 0;
  color: var(--ink);
  text-decoration: none;
}
.reader-list a strong {
  display: block;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.3;
}
.reader-list a span {
  display: block;
  margin-top: 2px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary);
}
.reader-list a:hover strong {
  text-decoration: underline;
  text-decoration-color: var(--cat-deep);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}
.search-results {
  margin-top: var(--space-8);
}
.search-results[hidden] {
  display: none;
}

/* Search + result rows (also used by the blog teaser). */
.card-grid {
  display: flex;
  flex-direction: column;
  border-top: var(--tile-line);
}
.card {
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: var(--space-1) var(--space-4);
  align-items: baseline;
  padding: var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease-smooth);
}
a.card:hover,
.card.keyboard-focused {
  background: color-mix(in srgb, var(--cat, var(--mark)) 30%, white);
  color: inherit;
}
.card.keyboard-focused {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}
.card:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}
.row-index {
  align-self: center;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--cat, var(--ink));
  box-shadow: 0 0 0 1.5px var(--ink);
  font-size: 0;
}
.card h3 {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 800;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}
.card h3 .row-arrow {
  display: inline-block;
  margin-left: var(--space-2);
  opacity: 0;
  transform: translateX(-8px);
  transition:
    opacity var(--duration-fast) var(--ease-smooth),
    transform var(--duration-normal) var(--ease-out);
}
.card:hover h3 .row-arrow,
.card.keyboard-focused h3 .row-arrow {
  opacity: 1;
  transform: none;
}
.card p {
  grid-column: 2;
  margin: 2px 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 66ch;
}
.card-meta {
  grid-column: 3;
  grid-row: 1;
  font-family: var(--font-label);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.search-section-label {
  margin: 0 0 var(--space-3);
  font-weight: 700;
  font-size: 0.86rem;
}

.tag {
  display: inline-flex;
  padding: 1px 9px;
  background: transparent;
  border: 1.5px solid var(--ink);
  border-radius: 99px;
  font-family: var(--font-label);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-primary);
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-12);
  }
  .hero-description {
    max-width: 100%;
  }
  .playground::before {
    inset: 16px -12px -16px 16px;
  }
  .playground-file {
    display: none;
  }
  .reader {
    grid-template-columns: minmax(0, 1fr);
    box-shadow: 6px 6px 0 var(--ink);
  }
  .reader-list {
    border-left: 0;
    border-top: var(--tile-line);
  }
}
@media (max-width: 640px) {
  .hero {
    padding-top: var(--space-4);
  }
  .hero-stats dd {
    font-size: 2.4rem;
  }
  .hero-stats {
    gap: var(--space-4) var(--space-6);
  }
  .reader-main,
  .reader-list {
    padding: var(--space-5);
  }
  .reader-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .shelf-wrap {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
  .card {
    grid-template-columns: 14px minmax(0, 1fr);
  }
  .card-meta {
    grid-column: 2;
    grid-row: auto;
  }
}

/* ═══ SCENE — one pinned section: what TOON removes from JSON ═══
   Scroll position drives three variables on .scene (set by js/scene.js):
     --hl  how strongly the redundant syntax is marked (0–1)
     --k   how far the repeated keys have collapsed (0–1)
     --q   how far the braces, quotes and trailing commas have collapsed (0–1)
   With no JS, on small screens, or with reduced motion the section is static
   and shows the finished TOON, so nothing depends on the animation. */
.scene {
  --hl: 0;
  --k: 1;
  --q: 1;
  --hd: 1;
  --saved: var(--saved-final, 0.6);
  position: relative;
  background: var(--ink);
  color: #e4ece4;
  border-bottom: var(--tile-line);
}
.scene[data-pinned] {
  height: 360vh;
  --hl: 0;
  --k: 0;
  --q: 0;
  --hd: 0;
  --saved: 0;
}
.scene-stick {
  padding: var(--space-20) 0;
}
.scene[data-pinned] .scene-stick {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + var(--space-4)) 0 var(--space-6);
}
.scene-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--space-12);
  align-items: center;
}
.scene .section-kicker {
  color: #e4ece4;
}
.scene .section-kicker::before {
  box-shadow: 0 0 0 1.5px #e4ece4;
}
.scene .section-title {
  color: #fff;
}
.scene-lede {
  color: #b4bfb6;
  max-width: 46ch;
  line-height: 1.6;
  margin-bottom: var(--space-8);
}
.scene-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}
.scene-steps li {
  position: relative;
  padding-left: var(--space-5);
  border-left: 4px solid rgba(228, 236, 228, 0.18);
  color: #9db0a2;
  transition:
    color var(--duration-normal) var(--ease-smooth),
    border-color var(--duration-normal) var(--ease-smooth);
}
.scene-steps li strong {
  display: block;
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.1;
  color: inherit;
}
.scene-steps li span {
  display: block;
  margin-top: 2px;
  font-size: 0.92rem;
  line-height: 1.5;
}
.scene-steps li.is-on {
  color: #fff;
  border-left-color: var(--mark);
}
.scene:not([data-pinned]) .scene-steps li {
  color: #d5ddd7;
}
.scene-steps li[data-step="0"].is-on {
  border-left-color: #e4ece4;
}
.scene-steps li[data-step="1"].is-on,
.scene-steps li[data-step="2"].is-on {
  border-left-color: var(--spent);
}

.scene-panel {
  margin: 0;
  min-width: 0;
  background: var(--ink-2);
  border: 1.5px solid #e4ece4;
  border-radius: var(--radius-lg);
  box-shadow: 10px 10px 0 var(--mark);
  overflow: hidden;
}
.scene-panel figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid rgba(228, 236, 228, 0.16);
  font-size: 0.82rem;
  font-weight: 600;
  color: #9db0a2;
}
.scene-count {
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.scene-count b {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 1;
  margin-right: 4px;
  color: var(--mark);
}

.scene-code {
  margin: 0;
  padding: var(--space-6) var(--space-5);
  font-family: var(--font-code);
  font-stretch: 80%;
  font-size: clamp(0.72rem, 1.15vw, 0.92rem);
  line-height: 1.85;
  color: #e4ece4;
  overflow-x: auto;
  white-space: pre;
  min-height: 15.5em;
}
.tl {
  display: block;
}
.tk {
  display: inline-block;
  overflow: hidden;
  white-space: pre;
  vertical-align: top;
}
.tk-k {
  max-width: calc(var(--len) * 1ch * (1 - var(--k)));
  opacity: calc(1 - var(--k));
  color: color-mix(in srgb, var(--spent) calc(var(--hl) * 100%), #e4ece4);
}
.tk-p {
  max-width: calc(var(--len) * 1ch * (1 - var(--q)));
  opacity: calc(1 - var(--q));
  color: color-mix(in srgb, var(--spent) calc(var(--hl) * 70%), #9db0a2);
}
.tk-v {
  color: #e4ece4;
}
.tk-head-json {
  max-width: calc(var(--len) * 1ch * (1 - var(--q)));
  opacity: calc(1 - var(--q));
  color: color-mix(in srgb, var(--spent) calc(var(--hl) * 70%), #9db0a2);
}
.tk-head-toon {
  max-width: calc(var(--len) * 1ch * var(--hd));
  opacity: var(--hd);
  color: var(--mark);
}
.tl-end {
  max-height: calc(1.85em * (1 - var(--q)));
  opacity: calc(1 - var(--q));
  overflow: hidden;
  color: color-mix(in srgb, var(--spent) calc(var(--hl) * 70%), #9db0a2);
}
.tl-row {
  padding-left: 2ch;
}

.scene-meter {
  height: 12px;
  margin: 0 var(--space-5);
  background: var(--spent);
  border-radius: 99px;
  overflow: hidden;
}
.scene-meter-fill {
  display: block;
  height: 100%;
  width: calc(var(--saved, 0) * 100%);
  background: var(--mark);
}
.scene-foot {
  margin: 0;
  padding: var(--space-3) var(--space-5) var(--space-5);
  font-size: 0.8rem;
  line-height: 1.55;
  color: #9db0a2;
}

@media (max-width: 900px) {
  .scene-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-8);
  }
  .scene-stick {
    padding: var(--space-12) 0;
  }
}

/* ═══ JOBS — what it's for, as a sticky title beside a list of statements ═══ */
.jobs-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: var(--space-12);
  align-items: start;
}
.jobs-head {
  position: sticky;
  top: calc(var(--header-h) + var(--space-8));
}
.jobs-head .section-subtitle {
  margin-bottom: 0;
}
.jobs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: var(--tile-line);
}
.job {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-8) var(--space-6);
  border-top: var(--tile-line);
  color: var(--ink);
  text-decoration: none;
  position: relative;
  transition: background-color var(--duration-fast) var(--ease-smooth);
}
.job:hover {
  background: var(--mark);
  color: var(--ink);
}
.job-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.job-tag::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--cat, var(--ink));
  box-shadow: 0 0 0 1.5px var(--ink);
}
.job:hover .job-tag {
  color: var(--ink);
}
.job h3 {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  max-width: 18ch;
  text-wrap: balance;
}
.job p {
  margin: 0;
  max-width: 54ch;
  color: var(--text-secondary);
  line-height: 1.6;
}
.job:hover p {
  color: var(--ink);
}
.job-go {
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-flex;
  gap: 6px;
  transition: transform var(--duration-normal) var(--ease-out);
}
.job:hover .job-go {
  transform: translateX(6px);
}
@media (max-width: 860px) {
  .jobs-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-8);
  }
  .jobs-head {
    position: static;
  }
  .job {
    padding: var(--space-6) var(--space-4);
  }
}

/* ═══ FORMAT BARS — measured tokens, drawn to scale ═══ */
.fmt-card {
  margin-top: var(--space-8);
  padding: var(--space-6);
  background: var(--surface);
  border: var(--tile-line);
  border-radius: var(--radius-lg);
  box-shadow: 8px 8px 0 var(--ink);
}
.fmt-card h3 {
  font-family: var(--font-label);
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 0 var(--space-4);
  color: var(--text-secondary);
}
.fmt-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}
.fmt-bar {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr) 7.5rem;
  gap: var(--space-4);
  align-items: center;
  font-variant-numeric: tabular-nums;
}
.fmt-bar-label {
  font-weight: 700;
  font-size: 0.92rem;
}
.fmt-bar-label small {
  display: block;
  font-weight: 500;
  font-size: 0.74rem;
  color: var(--text-muted);
}
.fmt-track {
  height: 34px;
  background: var(--elevated);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  overflow: hidden;
}
.fmt-fill {
  display: block;
  height: 100%;
  width: calc(var(--w) * 1%);
  background: var(--fill, var(--ink));
  border-right: 1.5px solid var(--ink);
  transform-origin: left;
}
.js-reveal .fmt-fill {
  transform: scaleX(0);
}
.js-reveal .fmt-bars.visible .fmt-fill {
  transform: none;
  transition: transform 1100ms var(--ease-out);
  transition-delay: calc(var(--i) * 140ms);
}
.fmt-bar[data-fmt="json"] { --fill: var(--spent); }
.fmt-bar[data-fmt="yaml"] { --fill: #9fb09a; }
.fmt-bar[data-fmt="min"] { --fill: #cbd5c6; }
.fmt-bar[data-fmt="toon"] { --fill: var(--mark); }
.fmt-bar-val {
  text-align: right;
  font-weight: 700;
  font-size: 0.92rem;
}
.fmt-bar-val small {
  display: block;
  font-weight: 600;
  font-size: 0.76rem;
  color: var(--text-muted);
}
@media (max-width: 720px) {
  .fmt-card {
    padding: var(--space-4);
    box-shadow: 5px 5px 0 var(--ink);
  }
  .fmt-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-1) var(--space-3);
  }
  .fmt-track {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 26px;
  }
}

/* Tables on paper: hairlines, no banding. */
.compare-table tbody tr:nth-child(even) th,
.compare-table tbody tr:nth-child(even) td {
  background: transparent;
}
.compare-table tbody tr:hover th,
.compare-table tbody tr:hover td {
  background: color-mix(in srgb, var(--mark) 35%, white);
}
.compare-table tbody th,
.compare-table td {
  border-bottom: 1px solid var(--border);
}
.table-scroll {
  border: var(--tile-line);
  border-radius: var(--radius-lg);
}

/* ═══ ABOUT ═══ */
.about-statement mark {
  background: linear-gradient(var(--mark), var(--mark)) no-repeat 0 90% / 0% 70%;
  color: var(--ink);
  padding: 0 0.06em;
  transition: background-size 900ms var(--ease-out) 200ms;
}
.js-reveal [data-reveal].visible mark,
.about-statement:not([data-reveal]) mark {
  background-size: 100% 70%;
}

/* ═══ FAQ ═══ */
.faq-list {
  border-top: var(--tile-line);
}
.faq-item {
  border-bottom: 1.5px solid var(--ink);
}
.faq-item summary::after {
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  transition: transform var(--duration-normal) var(--ease-out), background var(--duration-fast) var(--ease-smooth);
}
.faq-item[open] summary::after {
  content: "+";
  transform: rotate(45deg);
  background: var(--mark);
}

/* ═══ FOOTER — closes on the spectrum ═══ */
.site-footer {
  position: relative;
  margin-top: var(--space-20);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: var(--spectrum);
}
.footer-status {
  font-family: var(--font-label);
}

/* ═══ CATALOG PAGES — the header takes the category's color ═══ */
.cat-hero {
  position: relative;
  overflow: hidden;
  background: var(--cat, var(--elevated));
  color: var(--ink);
  border-bottom: var(--tile-line);
  padding: var(--space-10) 0 var(--space-12);
}
.cat-hero.catalog-header {
  padding-top: var(--space-10);
}
.cat-hero .catalog-crumbs {
  color: var(--ink);
  font-family: var(--font-label);
  font-size: 0.86rem;
  font-weight: 600;
}
.cat-hero .catalog-crumbs a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.cat-hero .catalog-crumbs a:hover {
  background: rgba(255, 255, 255, 0.55);
}
.cat-hero .catalog-crumbs span[aria-hidden] {
  color: var(--ink);
  opacity: 0.55;
}
.cat-hero h1 {
  font-size: clamp(3rem, 7.4vw, 6.4rem);
  line-height: 0.88;
  letter-spacing: -0.016em;
  max-width: 16ch;
  margin-bottom: var(--space-5);
  text-wrap: balance;
}
.cat-hero .catalog-lede {
  color: var(--ink);
  font-size: 1.12rem;
  max-width: 62ch;
}
.cat-hero .catalog-meta li {
  background: transparent;
  border: 1.5px solid var(--ink);
  border-radius: 99px;
  color: var(--ink);
  font-weight: 600;
  padding: 2px 12px;
}
.cat-hero .catalog-meta a {
  color: inherit;
}
/* The count, as a giant outline numeral — it is the real number of datasets/rows. */
.cat-hero-num {
  position: absolute;
  right: -0.04em;
  bottom: -0.22em;
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 800;
  font-size: clamp(11rem, 26vw, 24rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
  opacity: 0.2;
  pointer-events: none;
  user-select: none;
}
.cat-hero .container {
  position: relative;
}
.cat-hero .format-links a,
.cat-hero .size-bars {
  position: relative;
}
.cat-hero .format-links a {
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 99px;
  font-family: var(--font-label);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 16px;
}
.cat-hero .format-links a:hover {
  background: var(--ink);
  color: #fff;
}

.size-bars {
  max-width: 560px;
  margin-top: var(--space-5);
}
.cat-hero .size-bars {
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.62);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-md);
}

/* Datasets in a category: tiles with the category's color on top. */
.dataset-list {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}
.dataset-list a {
  position: relative;
  height: 100%;
  padding: var(--space-5) var(--space-5) var(--space-5);
  background: var(--surface);
  border: var(--tile-line);
  border-top: 8px solid var(--cat, var(--ink));
  border-radius: var(--radius-md);
  transition:
    transform var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out),
    background var(--duration-fast) var(--ease-smooth);
}
.dataset-list a:hover {
  background: color-mix(in srgb, var(--cat, var(--mark)) 22%, white);
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 var(--ink);
}
.dataset-list h3 {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.02;
  margin-bottom: 8px;
  letter-spacing: -0.006em;
}
.dataset-list p {
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Data tables: header takes the deep tone, hover takes the tile tone, hairlines between rows. */
.data-table-wrap {
  border: var(--tile-line);
  border-radius: var(--radius-md);
}
.data-table thead th {
  background: var(--cat-deep, var(--ink));
  border-bottom: 0;
  font-family: var(--font-label);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}
.data-table td {
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr:nth-child(even) td {
  background: transparent;
}
.data-table tbody tr:hover td {
  background: color-mix(in srgb, var(--cat, var(--mark)) 26%, white);
}
.data-table td:first-child {
  font-weight: 700;
}
.data-block > h3 {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 800;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: 10px;
}
.data-block > h3::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--cat, var(--ink));
  box-shadow: 0 0 0 1.5px var(--ink);
}
.data-dl {
  border: var(--tile-line);
  background: var(--border);
}
.data-dl > div:nth-child(even) {
  background: var(--surface);
}
.data-dl dt {
  font-family: var(--font-label);
  font-size: 0.82rem;
  color: var(--cat-deep, var(--text-secondary));
}
.catalog-section > h2 {
  border-bottom: var(--tile-line);
}
.catalog-aside .section-kicker {
  margin-bottom: var(--space-2);
}

/* ═══ CATALOG INDEX — a family of tiles per part of the library ═══ */
.cx-hero {
  background: var(--ink);
  color: #e4ece4;
  padding: var(--space-12) 0 0;
  border-bottom: var(--tile-line);
}
.cx-hero .catalog-crumbs,
.cx-hero .catalog-crumbs a {
  color: #b4bfb6;
}
.cx-hero h1 {
  color: #fff;
  font-size: clamp(3.4rem, 9vw, 8rem);
  line-height: 0.86;
  margin-bottom: var(--space-5);
}
.cx-hero .catalog-lede {
  color: #c9d3cb;
  font-size: 1.12rem;
}
.cx-hero .catalog-meta li {
  background: transparent;
  border: 1.5px solid #e4ece4;
  border-radius: 99px;
  color: #e4ece4;
  font-weight: 600;
}
.cx-hero .format-links a {
  background: transparent;
  color: #fff;
  border: 1.5px solid #e4ece4;
  border-radius: 99px;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 16px;
}
.cx-hero .format-links a:hover {
  background: var(--mark);
  color: var(--ink);
  border-color: var(--mark);
}
.cx-spectrum {
  display: flex;
  height: 54px;
  margin-top: var(--space-10);
  border-top: 1.5px solid #e4ece4;
}
.cx-spectrum a {
  flex: var(--n) 1 0;
  background: var(--cat);
  border-right: 1.5px solid var(--ink);
  transition: flex-grow var(--duration-slow) var(--ease-out);
  position: relative;
}
.cx-spectrum a:last-child {
  border-right: 0;
}
.cx-spectrum a:hover,
.cx-spectrum a:focus-visible {
  flex-grow: calc(var(--n) * 2.4);
}
.cx-spectrum a span {
  position: absolute;
  inset: auto 0 100% 0;
  padding-bottom: 6px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-smooth);
}
.cx-spectrum a:hover span,
.cx-spectrum a:focus-visible span {
  opacity: 1;
}

.family {
  margin-top: var(--space-12);
}
.family:first-child {
  margin-top: 0;
}
.family-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: var(--tile-line);
}
.family-head h2 {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  line-height: 1;
}
.family-head p {
  margin: 0;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text-muted);
}
.tile-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-4);
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  height: 100%;
  min-height: 190px;
  padding: var(--space-5);
  background: var(--cat);
  color: var(--ink);
  border: var(--tile-line);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition:
    transform var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}
.tile:hover,
.tile:focus-visible {
  color: var(--ink);
  transform: translate(-4px, -4px);
  box-shadow: 8px 8px 0 var(--ink);
}
.tile h3 {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 0.96;
  letter-spacing: -0.008em;
}
.tile p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}
.tile-count {
  margin-top: auto;
  font-weight: 700;
  font-size: 0.86rem;
  display: flex;
  justify-content: space-between;
}
.tile-count::after {
  content: "→";
  transition: transform var(--duration-normal) var(--ease-out);
}
.tile:hover .tile-count::after {
  transform: translateX(5px);
}

.index-block {
  margin-top: var(--space-10);
  break-inside: avoid;
}
.index-block h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
}
.index-block h3::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--cat);
  box-shadow: 0 0 0 1.5px var(--ink);
}
.index-block h3 a {
  color: inherit;
  text-decoration: none;
}
.index-block h3 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--cat-deep);
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}
.index-cols {
  columns: 3 260px;
  column-gap: var(--space-8);
}
.index-cols .index-block {
  margin-top: 0;
  margin-bottom: var(--space-8);
}
.index-block ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.index-block li {
  border-bottom: 1px solid var(--border);
}
.index-block li a {
  display: block;
  padding: 6px 0;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}
.index-block li a:hover {
  background: color-mix(in srgb, var(--cat) 28%, white);
}

@media (max-width: 640px) {
  .cx-spectrum {
    height: 40px;
  }
  .cat-hero {
    padding-bottom: var(--space-8);
  }
}

/* ═══ BLOG — rows on paper, hover in lime ═══ */
.blog-list {
  background: transparent;
  border-top: var(--tile-line);
  border-bottom: var(--tile-line);
}
.blog-card:hover {
  background: color-mix(in srgb, var(--mark) 30%, white);
}
.blog-article-header {
  position: relative;
}
.blog-article-header::after {
  content: "";
  display: block;
  height: 8px;
  margin-top: var(--space-6);
  background: var(--spectrum);
  border: 1.5px solid var(--ink);
  border-radius: 99px;
}
.breadcrumb {
  border: 1.5px solid var(--ink);
  border-radius: 99px;
  font-weight: 600;
}

/* ═══ VOXEL — the stage sits on the page, not in a box of its own ═══ */
.voxel {
  background: var(--canvas);
  border-top: 0;
}
.voxel-stage {
  border: var(--tile-line);
  border-radius: var(--radius-lg);
  box-shadow: 8px 8px 0 var(--ink);
}
.voxel-legend a::before {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  box-shadow: 0 0 0 1.5px var(--ink);
}
.voxel-legend a:hover,
.voxel-legend a:focus-visible {
  background: color-mix(in srgb, var(--swatch, var(--mark)) 35%, white);
}

/* ═══ BUTTONS — pills for primary actions ═══ */
.btn-primary,
.btn-secondary {
  border-radius: 99px;
  padding: 10px 26px;
}
.btn-primary:hover {
  background: var(--mark);
  color: var(--ink);
}
.btn-secondary:hover {
  background: var(--surface);
  box-shadow: 4px 4px 0 var(--ink);
}

/* ═══ DISPLAY-VOICE — condensed type needs a wider word space ═══ */
.serif,
.hero h1,
.section-title,
.card h3,
.logo-text,
.footer-word,
.hero-stats dd,
.book-facts dd,
.post-cta-title,
.job h3,
.faq-item summary,
.dataset-header h2,
.api-section-title,
.blog-article-header h1,
.blog-title-link h2,
.blog-content h2,
.catalog-section > h2,
.tile h3,
.reader h3,
.spine-name,
.sw-title,
.about-statement,
.scene-steps li strong,
.family-head h2,
.dataset-list h3,
.index-block h3 {
  word-spacing: 0.12em;
}
.about-statement a,
.section-title a,
.card h3 .row-arrow {
  font-stretch: 100%;
  word-spacing: normal;
}

/* Floating "Ebooks" tab: on phones it sits low and small instead of
   covering the reading column at mid-height. */
@media (max-width: 719px) {
  .sw-toggle {
    top: auto !important;
    bottom: 12px;
    right: 10px;
    transform: none !important;
    flex-direction: row;
    width: auto;
    gap: 8px;
    padding: 8px 12px;
  }
  .sw-toggle-label {
    writing-mode: horizontal-tb;
    letter-spacing: 0.08em;
  }
  .sw-panel {
    bottom: 64px;
    max-height: min(68vh, 560px);
  }
}

/* ═══ REDUCED MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
  .js-reveal [data-reveal],
  .js-reveal .shelf .spine,
  .js-reveal .fmt-fill {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero h1 em,
  .about-statement mark {
    background-size: 100% 100% !important;
    animation: none !important;
  }
  .hero-copy > *,
  .playground {
    animation: none !important;
  }
  .scroll-progress {
    display: none;
  }
}

/* ═══ TOPIC GUIDE (category pages) ═══ */
.topic {
  border-bottom: var(--tile-line);
  background: var(--surface);
}
.topic-overview {
  max-width: 68ch;
  font-size: clamp(1.02rem, 1.25vw, 1.2rem);
  line-height: 1.55;
  color: var(--text-primary);
  margin: 0 0 var(--space-10);
}
.topic-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--space-10);
  align-items: start;
}
.topic h3 {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
  margin: 0 0 var(--space-4);
  word-spacing: 0.12em;
}
.ideas {
  margin: 0;
  border-top: var(--tile-line);
}
.ideas > div {
  display: grid;
  grid-template-columns: minmax(130px, 0.34fr) minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.ideas dt {
  font-weight: 800;
  color: var(--cat-deep, var(--ink));
  line-height: 1.35;
}
.ideas dd {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.55;
  font-size: 0.95rem;
}
.topic-notes {
  display: grid;
  gap: var(--space-5);
}
.callout {
  padding: var(--space-5);
  background: var(--canvas);
  border: var(--tile-line);
  border-left: 8px solid var(--cat, var(--ink));
  border-radius: var(--radius-md);
}
.callout--agent {
  background: color-mix(in srgb, var(--cat, var(--mark)) 16%, white);
}
.callout h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-3);
}
.callout ul {
  margin: 0;
  padding-left: var(--space-5);
  color: var(--text-primary);
  font-size: 0.93rem;
  line-height: 1.55;
}
.callout li + li {
  margin-top: var(--space-2);
}
.topic-start {
  margin: var(--space-8) 0 0;
  font-size: 0.95rem;
}
.topic-start a {
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--cat-deep, var(--accent));
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}
.topic-start a:hover {
  background: color-mix(in srgb, var(--cat, var(--mark)) 35%, white);
}
.ds-count {
  display: inline-block;
  margin-top: var(--space-3);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 1px 9px;
  border: 1.5px solid var(--ink);
  border-radius: 99px;
}

/* ═══ ABOUT THIS DATASET (dataset pages) ═══ */
.about-card {
  padding: var(--space-6) var(--space-8);
  background: var(--surface);
  border: var(--tile-line);
  border-left: 10px solid var(--cat, var(--ink));
  border-radius: var(--radius-md);
}
.about-summary {
  margin: 0 0 var(--space-5);
  max-width: 70ch;
  font-size: 1.12rem;
  line-height: 1.6;
}
.about-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-6) var(--space-8);
}
.about-cols h2 {
  font-family: var(--font-label);
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--cat-deep, var(--ink));
  margin: 0 0 var(--space-2);
}
.about-cols ul {
  margin: 0;
  padding-left: var(--space-5);
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.about-cols li + li {
  margin-top: var(--space-1);
}
.fields-table td:nth-child(3) {
  white-space: nowrap;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .topic-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-8);
  }
  .ideas > div {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
  }
  .about-card {
    padding: var(--space-5);
  }
}

/* ═══ FILMS ═══════════════════════════════════════════════
   The player is the one dark object on a paper page. Its colors are the film's
   own (a navy ground and one hue per agent), scoped to .film so nothing else on
   the site changes. Everything around it is the site: ink rules, the lime
   highlighter for "where you are", green-bar banding for the chapter table. */

.film {
  --film-bg: #0b0e16;
  --film-line: #283149;
  --film-ink: #f2f0ea;
  --film-mute: #9aa3b8;
  margin: 0;
  background: var(--film-bg);
  color: var(--film-ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.film-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--film-bg);
}

.film-video {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--film-bg);
  object-fit: contain;
}

/* The big play control exists only when the script does (it is created there).
   A lime square with an ink triangle: the site's "saved" marker, as a button. */
.film-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(44px, 10%, 72px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--mark);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-smooth);
}

/* The triangle is sized in percent of the button, so it scales with it. */
.film-play::after,
.film-card-play::after {
  content: "";
  position: absolute;
  inset: 31% 29% 31% 38%;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.film-play:hover {
  background: #fff;
}

.film-play:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.film.is-started .film-play {
  display: none;
}

/* Timeline: one segment per chapter, as wide as the chapter is long. */
.film-bar {
  padding: var(--space-3) var(--space-4) var(--space-2);
  border-top: 1px solid var(--film-line);
}

.film-now {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  margin: 0 0 2px;
  font-family: var(--font-label);
  font-size: 0.875rem;
}

.film-now-ch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  font-weight: 700;
  color: var(--film-ink);
}

.film-now-ch::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: none;
  background: var(--c, var(--mark));
}

.film-now-clock {
  flex: none;
  color: var(--film-mute);
  font-variant-numeric: tabular-nums;
}

.film-segs {
  display: flex;
  gap: 3px;
  list-style: none;
}

.film-segs li {
  flex: 1 1 0;
  min-width: 0;
}

.film-segs a {
  --h: 6px;
  position: relative;
  display: block;
  height: 28px;
}

.film-segs a::before,
.film-segs i {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: var(--h);
  margin-top: calc(var(--h) / -2);
  background: var(--c);
  transition:
    height var(--duration-fast) var(--ease-smooth),
    margin-top var(--duration-fast) var(--ease-smooth),
    opacity var(--duration-fast) var(--ease-smooth);
}

.film-segs a::before {
  content: "";
  opacity: 0.3;
}

.film-segs i {
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
}

.film-segs a:hover,
.film-segs a:focus-visible,
.film-segs a[aria-current="true"] {
  --h: 10px;
}

.film-segs a:hover::before,
.film-segs a:focus-visible::before,
.film-segs a[aria-current="true"]::before {
  opacity: 0.5;
}

.film-segs a:focus-visible {
  outline: 2px solid var(--mark);
  outline-offset: 1px;
}

/* Links inside prose or other containers keep their own look. */
.blog-content :is(.film, .film-chapters, .film-card, .film-agents) a,
.blog-content :is(.film, .film-chapters, .film-card, .film-agents) a:hover {
  text-decoration: none;
  background: none;
}

/* .blog-content styles every ol, ul, li, p and th inside it; the film parts opt out. */
.blog-content :is(.film-segs, .film-chapters, .film-agents, .film-sources) {
  padding: 0;
  margin: 0;
}

.blog-content :is(.film-segs, .film-chapters, .film-agents, .film-sources) > li {
  margin: 0;
}

.blog-content .film-sources {
  margin-bottom: 1.1em;
}

.blog-content .film-now {
  margin: 0 0 2px;
}

.film--inline {
  margin: var(--space-8) 0;
}

@media (min-width: 1000px) {
  .blog-content .film--inline {
    margin-left: -80px;
    margin-right: -80px;
  }
}

/* ── Watch page ── */
.film-page .film-head {
  padding: var(--space-12) 0 var(--space-6);
}

.film-head h1 {
  max-width: 22em;
  margin: 0 0 var(--space-4);
  font-size: clamp(2.1rem, 4.8vw, 3.4rem);
}

.film-lede {
  max-width: 66ch;
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.film-facts {
  display: flex;
  flex-wrap: wrap;
  margin: var(--space-5) 0 0;
  list-style: none;
  font-family: var(--font-label);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.film-facts li + li::before {
  content: "·";
  margin: 0 var(--space-3);
}

.film-stage {
  padding-bottom: var(--space-4);
}

.film-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.film-actions .btn-mini {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.film-block {
  padding: var(--space-12) 0 0;
}

.film-block:last-child {
  padding-bottom: var(--space-20);
}

.film-h2 {
  margin: 0 0 var(--space-3);
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 800;
  line-height: 1;
}

.film-note {
  max-width: 66ch;
  margin: 0 0 var(--space-6);
  line-height: 1.65;
  color: var(--text-secondary);
}

.film-follow {
  margin: var(--space-6) 0 0;
  max-width: 66ch;
  color: var(--text-secondary);
}

.film-follow a,
.film-note a {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.film-follow a:hover,
.film-note a:hover {
  background: var(--mark);
  text-decoration-color: var(--ink);
}

/* Chapter table: green-bar paper. The current chapter takes the highlighter. */
.film-chapters {
  margin: 0;
  list-style: none;
  border-top: 2px solid var(--ink);
}

.film-chapters li {
  border-bottom: 1px solid var(--border);
}

.film-chapters li:nth-child(even) a {
  background: var(--elevated);
}

.film-chapters a {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr) 3.5rem;
  gap: var(--space-1) var(--space-4);
  align-items: baseline;
  padding: var(--space-3) var(--space-4);
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease-smooth);
}

.film-chapters a:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.film-chapters a[aria-current="true"],
.film-chapters li:nth-child(even) a[aria-current="true"] {
  background: var(--mark);
}

.fc-time,
.fc-len {
  font-family: var(--font-label);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.fc-time {
  font-weight: 700;
}

.fc-len {
  text-align: right;
  color: var(--text-muted);
}

.film-chapters a[aria-current="true"] .fc-len {
  color: var(--text-primary);
}

.fc-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
}

.fc-title::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: none;
  background: var(--c);
  box-shadow: 0 0 0 1px rgba(16, 22, 18, 0.55);
}

.fc-sum {
  display: block;
  margin-top: 2px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.film-chapters a[aria-current="true"] .fc-sum {
  color: var(--text-primary);
}

.film-chapters--compact .fc-sum {
  display: none;
}

/* Comparison table */
.film-table-wrap {
  overflow-x: auto;
  margin: 0 0 var(--space-4);
}

.film-table-wrap .film-compare {
  display: table;
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  border-top: 2px solid var(--ink);
  font-size: 0.94rem;
  line-height: 1.5;
}

.film-compare caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.film-table-wrap .film-compare th,
.film-table-wrap .film-compare td {
  padding: var(--space-3) var(--space-3);
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  color: var(--text-primary);
  text-align: left;
  vertical-align: top;
}

.film-table-wrap .film-compare thead th {
  padding-bottom: var(--space-2);
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--ink);
}

.film-table-wrap .film-compare tbody tr:nth-child(even) > * {
  background: var(--elevated);
}

.film-table-wrap .film-compare tbody th {
  white-space: nowrap;
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
}

.film-compare mark {
  padding: 0 0.3em;
  background: var(--mark);
  color: var(--ink);
}

.film-compare .fa-name {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.film-compare .fa-name::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--c);
  box-shadow: 0 0 0 1px rgba(16, 22, 18, 0.55);
}

/* Transcript */
.film-transcript {
  border: 1px solid var(--ink);
  background: var(--surface);
}

.film-transcript > summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-size: 1.1rem;
  font-weight: 700;
  list-style: none;
}

.film-transcript > summary::-webkit-details-marker {
  display: none;
}

.film-transcript > summary::after {
  content: "+";
  margin-left: auto;
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-family: var(--font-label);
  font-size: 1rem;
  border: 1px solid var(--ink);
}

.film-transcript[open] > summary::after {
  content: "–";
  background: var(--mark);
}

.film-transcript > summary:hover {
  background: var(--mark-dim);
}

.film-transcript > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.film-transcript-body {
  max-width: 74ch;
  padding: var(--space-2) var(--space-5) var(--space-8);
}

.film-transcript-body h3 {
  margin: var(--space-8) 0 var(--space-2);
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.1;
}

.film-transcript-body h3 a {
  color: var(--text-primary);
  text-decoration: none;
}

.film-transcript-body h3 a:hover {
  background: var(--mark);
}

.ft-time {
  margin-right: var(--space-2);
  font-family: var(--font-label);
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.film-transcript-body p {
  margin: 0 0 var(--space-3);
  padding: 2px var(--space-2);
  margin-left: calc(var(--space-2) * -1);
  line-height: 1.7;
  color: var(--text-secondary);
}

.film-transcript-body p[aria-current="true"] {
  background: var(--mark-dim);
  color: var(--text-primary);
}

.film-sources {
  list-style: none;
  max-width: 66ch;
  border-top: 2px solid var(--ink);
}

.film-sources li {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.film-sources a {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.film-sources a:hover {
  background: var(--mark);
  text-decoration-color: var(--ink);
}

/* ── Promo cards: films index, blog index, related posts, catalog ── */
.film-card {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--space-6);
  align-items: center;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
  transition:
    box-shadow var(--duration-fast) var(--ease-smooth),
    transform var(--duration-fast) var(--ease-smooth);
}

.film-card:hover {
  color: inherit;
  box-shadow: 5px 5px 0 var(--mark), 5px 5px 0 1px var(--ink);
  transform: translate(-2px, -2px);
}

.film-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.film-card-art {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0b0e16;
  border-radius: 2px;
}

.film-card-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.film-card-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  background: var(--mark);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
}

.film-card-time {
  position: absolute;
  right: var(--space-2);
  bottom: var(--space-2);
  padding: 1px 6px;
  background: rgba(11, 14, 22, 0.88);
  color: #f2f0ea;
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

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

.film-card-kicker {
  display: block;
  font-family: var(--font-label);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.film-card-title {
  display: block;
  margin: var(--space-1) 0 var(--space-2);
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.012em;
  color: var(--text-primary);
  text-wrap: balance;
}

.film-card-text {
  display: block;
  max-width: 60ch;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.film-card-go {
  display: inline-block;
  margin-top: var(--space-3);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.film-card--compact {
  grid-template-columns: 116px minmax(0, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-8);
  padding: var(--space-3);
}

.film-card--compact .film-card-title {
  margin: 2px 0 0;
  font-size: 1.1rem;
}

.film-card--compact .film-card-play {
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
}

.film-card--compact .film-card-time {
  display: none;
}

.film-card--compact .film-card-go {
  margin-top: var(--space-1);
  font-size: 0.82rem;
}

.catalog-aside .film-card--compact {
  margin-top: 0;
}

.film-list {
  display: grid;
  gap: var(--space-6);
}

.blog-list-film {
  margin: var(--space-4) 0 var(--space-8);
}

/* ── Home section ── */
.film-feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--space-10);
  align-items: start;
}

.film-feature .section-title {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
}

.film-agents {
  margin: var(--space-5) 0 var(--space-6);
  list-style: none;
  border-top: 2px solid var(--ink);
}

.film-agents li {
  border-bottom: 1px solid var(--border);
}

.film-agents a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 3rem;
  gap: var(--space-3);
  align-items: baseline;
  padding: var(--space-2) var(--space-2);
  color: var(--text-primary);
  text-decoration: none;
}

.film-agents a:hover {
  background: var(--mark);
  color: var(--ink);
}

.film-agents a[aria-current="true"] {
  background: var(--mark);
}

.fg-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
}

.fg-name::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: none;
  background: var(--c);
  box-shadow: 0 0 0 1px rgba(16, 22, 18, 0.55);
}

.fg-own,
.fg-time {
  font-family: var(--font-label);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.fg-time {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 960px) {
  .film-feature-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-6);
  }
}

@media (max-width: 720px) {
  .film-facts {
    gap: var(--space-1) var(--space-4);
  }

  .film-facts li + li::before {
    content: none;
  }

  .film-card {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }

  .film-card--compact {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .film-chapters a {
    grid-template-columns: 3.4rem minmax(0, 1fr);
    padding: var(--space-3);
  }

  .fc-len {
    display: none;
  }

  .film-head h1 {
    max-width: none;
  }

  /* The five-column table becomes one labeled block per agent: nothing scrolls sideways. */
  .film-table-wrap .film-compare,
  .film-table-wrap .film-compare tbody,
  .film-table-wrap .film-compare tr,
  .film-table-wrap .film-compare th,
  .film-table-wrap .film-compare td {
    display: block;
  }

  .film-table-wrap .film-compare thead {
    display: none;
  }

  .film-table-wrap .film-compare tbody tr {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
  }

  .film-table-wrap .film-compare tbody tr:nth-child(even) > * {
    background: none;
  }

  .film-table-wrap .film-compare tbody tr:nth-child(even) {
    background: var(--elevated);
  }

  .film-table-wrap .film-compare tbody th,
  .film-table-wrap .film-compare td {
    padding: var(--space-1) var(--space-3);
    border: 0;
  }

  .film-table-wrap .film-compare td {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: var(--space-3);
  }

  .film-table-wrap .film-compare td::before {
    content: attr(data-label);
    font-family: var(--font-label);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
  }

  .film-bar {
    padding: var(--space-2) var(--space-3) var(--space-1);
  }

}

@media (prefers-reduced-motion: reduce) {
  .film-segs a::before,
  .film-segs i,
  .film-card {
    transition: none;
  }

  .film-card:hover {
    transform: none;
  }
}
