/* =========================================================
   CONCRETE: a brutalist-postmodern design system
   v0.5  ·  zero dependencies  ·  one file
   palette: warm newsprint + ochre + deep teal + oxblood
            (civic-institutional, no fluorescents)
   theme:   light by default · .theme-dark opts in
   ========================================================= */

/* ---------- 1. TOKENS · LIGHT (default) ---------------- */
:root {
  /* type
     body    → Spectral (Production Type, characterful screen serif)
     display → Fraunces (expressive variable serif for H1)
     mono    → JetBrains Mono (UI, labels, code, H2/H3)
     fallbacks: nice system serifs before generic. No Times. */
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-body:    "Spectral", "Iowan Old Style", "Charter", "Sitka Text", Georgia, serif;
  --font-display: "Fraunces", "Iowan Old Style", "Charter", Georgia, serif;
  --font-serif:   var(--font-body); /* legacy alias */
  --font-sans:    -apple-system, "Helvetica Neue", Arial, sans-serif;

  /* scale: modular, raised floor (no sub-14px text anywhere) */
  --t-xs: 0.875rem;   /* 14px (was 12) */
  --t-sm: 1rem;       /* 16px (was 14) */
  --t-base: 1.125rem; /* 18px (was 16) */
  --t-md: 1.375rem;   /* 22px (was 20) */
  --t-lg: 1.875rem;   /* 30px (was 28) */
  --t-xl: 2.75rem;    /* 44px (was 40) */
  --t-xxl: 4.25rem;   /* 68px (was 64) */
  --t-mega: 7rem;     /* 112px (was 104) */

  /* space: 4px grid */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  /* surface: warm newsprint over inkstone */
  --ink:     #141210;             /* near-black, slightly warm */
  --paper:   #f1ece1;             /* warm newsprint */
  --paper-2: #d9d0bb;             /* recessed surface (deeper for clear separation) */
  --rule:    #141210;

  /* voltage: civic/institutional palette.
     warm + cool + alert. nothing fluorescent, nothing candy. */
  --accent:        #9a6a14;       /* ochre · primary accent (slightly deeper for fill use) */
  --accent-soft:   #b88a26;       /* mid ochre · for soft fills (deeper than before) */
  --link:          #1d4f4a;       /* deep teal · links, callouts (library-card civic) */
  --alert:         #7a2a23;       /* oxblood · stamps, warnings (dried, not fire-engine) */

  /* fixed contrast: these NEVER flip with theme.
     use --on-accent on any voltage background. */
  --on-accent: #141210;           /* always-dark text on bright accents */
  --on-alert:  #f1ece1;           /* always-light text on alert red */

  /* structure */
  --border-w: 2px;
  --border-w-fat: 6px;
  --radius: 0;                    /* never round. */
  --shadow-hard: 6px 6px 0 0 var(--ink);
  --shadow-fat:  10px 10px 0 0 var(--ink);
  --shadow-accent: 6px 6px 0 0 var(--accent);
}

/* ---------- 1b. TOKENS · DARK (opt-in) ----------------- */
.theme-dark {
  --ink:     #ede7d8;
  --paper:   #131210;
  --paper-2: #28241d;             /* deeper separation from --paper in dark too */
  --rule:    #ede7d8;

  /* accents bumped slightly for dark-bg legibility */
  --accent:      #d49a2f;         /* ochre +luminance */
  --accent-soft: #e3b357;
  --link:        #6ab4ac;         /* lifted deep teal → aqua */
  --alert:       #b8443a;         /* lifted oxblood */
  /* --on-accent / --on-alert intentionally NOT overridden; they stay fixed */
}

/* ---------- 2. RESET (light) --------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;       /* anchor jumps glide (used by .pagination) */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 19px;            /* body reads at 19 (raised floor for comfortable serif body) */
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "ss01", "onum"; /* old-style figures where supported */
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }

/* ---------- 3. TYPE ------------------------------------ */
h1, .h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(var(--t-xl), 8vw, var(--t-mega));
  line-height: 0.88;
  letter-spacing: -0.035em;
  margin: 0 0 var(--s-5);
  /* Fraunces optical sizing + slight expressive SOFT axis */
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 1;
}
h2, .h2 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--t-lg);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: var(--s-7) 0 var(--s-4);
  border-bottom: var(--border-w) solid var(--rule);
  padding-bottom: var(--s-2);
  position: relative;
}
/* editor's mark: small ochre square preceding every H2 */
h2::before {
  content: "";
  display: inline-block;
  width: 0.55em; height: 0.55em;
  background: var(--accent);
  margin-right: var(--s-3);
  transform: translateY(-0.05em);
}
h3, .h3 {
  font-family: var(--font-mono);
  font-size: var(--t-md);
  margin: var(--s-5) 0 var(--s-3);
  text-transform: uppercase;
}
p { margin: 0 0 var(--s-4); max-width: 68ch; }

/* mono-body override: for paragraphs that need to feel like terminal text */
.p-mono { font-family: var(--font-mono); font-size: var(--t-base); }

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}
a:hover {
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
}

code, kbd, pre, samp { font-family: var(--font-mono); font-size: 0.95em; }
code { background: var(--paper-2); padding: 2px 6px; border: 1px solid var(--rule); }
pre {
  background: var(--ink); color: var(--paper);
  padding: var(--s-4); overflow-x: auto;
  border: var(--border-w) solid var(--rule);
}
pre code { background: transparent; border: 0; padding: 0; color: inherit; }

::selection { background: var(--accent); color: var(--on-accent); }

/* postmodern wink: serif drop-cap */
.dropcap::first-letter {
  font-family: var(--font-serif);
  font-size: 5em;
  float: left;
  line-height: 0.85;
  padding: 6px 10px 0 0;
  font-weight: 900;
  color: var(--accent);
}

blockquote {
  margin: var(--s-5) 0;
  padding: var(--s-3) var(--s-5);
  border-left: var(--border-w-fat) solid var(--accent);
  font-family: var(--font-serif);
  font-size: var(--t-md);
  font-style: italic;
  max-width: 60ch;
}

/* ---------- 4. LAYOUT ---------------------------------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--s-6) var(--s-5);
}
.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-12 { grid-template-columns: repeat(12, 1fr); }
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-12 { grid-template-columns: 1fr; }
}

.offset-up   { transform: translateY(-12px); }
.offset-down { transform: translateY(12px); }
.tilt-l      { transform: rotate(-1.2deg); }
.tilt-r      { transform: rotate(1.2deg); }

hr.rule      { border: 0; border-top: var(--border-w-fat) solid var(--rule); margin: var(--s-7) 0; }
hr.rule-thin { border: 0; border-top: 1px solid var(--rule); margin: var(--s-5) 0; }

/* ---------- 5. COMPONENTS ------------------------------ */

/* 5.1 BOX */
.box {
  background: var(--paper);
  border: var(--border-w) solid var(--rule);
  padding: var(--s-5);
}
.box-fat        { border-width: var(--border-w-fat); }
.box-shadow     { box-shadow: var(--shadow-hard); }
.box-shadow-fat { box-shadow: var(--shadow-fat); }
.box-shadow-accent { box-shadow: var(--shadow-accent); }
.box-invert     { background: var(--ink); color: var(--paper); }
.box-accent     { background: var(--accent); color: var(--on-accent); }
.box-soft       { background: var(--accent-soft); color: var(--on-accent); }
.box-paper-2    { background: var(--paper-2); }

/* 5.2 BUTTON */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--t-base);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--s-3) var(--s-5);
  background: var(--paper);
  color: var(--ink);
  border: var(--border-w) solid var(--rule);
  box-shadow: var(--shadow-hard);
  text-decoration: none;
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 80ms ease, background 80ms ease;
  /* room for the 6px hard shadow when buttons sit next to each other */
  margin: 0 6px 6px 0;
}
.btn-ghost { margin: 0; }                  /* no shadow → no shadow margin */
.btn:hover      { background: var(--accent); color: var(--on-accent); }
.btn:active     { transform: translate(4px, 4px); box-shadow: 2px 2px 0 0 var(--ink); }

/* .btn-primary and .btn-accent are bright-on-dark in light mode and stay
   bright in dark mode too — their border + shadow must stay dark so the
   stamp reads in both themes (not flip to cream with the rest of --rule). */
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--on-accent);
  box-shadow: 6px 6px 0 0 var(--on-accent);
}
.btn-primary:hover { background: var(--accent); color: var(--on-accent); }
.btn-primary:active { box-shadow: 2px 2px 0 0 var(--on-accent); }

.btn-accent {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--on-accent);
  box-shadow: 6px 6px 0 0 var(--on-accent);
}
.btn-accent:hover { background: var(--ink); color: var(--paper); }
.btn-accent:active { box-shadow: 2px 2px 0 0 var(--on-accent); }

.btn-ghost      { box-shadow: none; }

/* 5.3 INPUT */
.input, textarea.input, select.input {
  font-family: var(--font-mono);
  font-size: var(--t-base);
  padding: var(--s-3);
  background: var(--paper);
  color: var(--ink);
  border: var(--border-w) solid var(--rule);
  width: 100%;
}
.input:focus {
  outline: 0;
  background: var(--paper);
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}

/* 5.4 BADGE / STAMP */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px var(--s-2);
  border: 1px solid var(--rule);
  background: var(--paper);
}
.badge-accent {
  background: var(--accent);
  color: var(--paper);          /* paper flips with theme: white-ish in light, dark in dark */
  border-color: var(--accent);
  font-weight: 700;             /* bolder than default badge */
}
.badge-soft   { background: var(--accent-soft); color: var(--on-accent); border-color: var(--accent-soft); }

.stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--s-2) var(--s-4);
  color: var(--alert);
  border: 3px solid var(--alert);
  transform: rotate(-6deg);
}

/* 5.5 NAV */
.nav {
  display: flex; flex-wrap: wrap; gap: var(--s-4);
  border-bottom: var(--border-w-fat) solid var(--rule);
  padding-bottom: var(--s-3);
  margin-bottom: var(--s-6);
  align-items: baseline;
}
.nav .brand {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: var(--t-lg);
  margin-right: auto;
}
.nav a {
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  font-size: var(--t-sm);
  letter-spacing: 0.05em;
  padding: 2px 4px;
}
.nav a:hover { background: var(--accent); color: var(--on-accent); }

/* 5.6 TABLE (styles both .table and native <table>) */
table, .table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-sm);
  table-layout: fixed;             /* equal columns so cells align with headers */
  margin: 0 0 var(--s-5);
}
table th, table td,
.table th, .table td {
  border: 1px solid var(--rule);
  padding: var(--s-2) var(--s-3);
  text-align: left;
  vertical-align: top;
  word-wrap: break-word;
}
table th, .table th {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}
table tbody tr:nth-child(even) td,
.table tbody tr:nth-child(even) td { background: var(--paper-2); }

/* 5.7 CALLOUT */
.callout {
  border-left: var(--border-w-fat) solid var(--link);
  background: var(--paper-2);
  padding: var(--s-4) var(--s-5);
  margin: var(--s-5) 0;
}
.callout-warn { border-left-color: var(--alert); }
.callout-yay  { border-left-color: var(--accent-soft); }

/* 5.8 BAND */
.band {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  padding: var(--s-2) var(--s-4);
  overflow: hidden;
  white-space: nowrap;
}
.band-accent { background: var(--accent); color: var(--on-accent); }
.band-soft   { background: var(--accent-soft); color: var(--on-accent); }

/* 5.9 SWATCH (color spec component) */
.swatch {
  display: flex; align-items: stretch;
  border: var(--border-w) solid var(--rule);
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  min-height: 64px;
}
.swatch-chip { width: 64px; flex-shrink: 0; }
.swatch-meta { padding: var(--s-2) var(--s-3); display: flex; flex-direction: column; justify-content: center; }
.swatch-meta strong { letter-spacing: 0.04em; }
.swatch-meta span { opacity: 0.7; font-size: var(--t-xs); }

/* 5.10 THEME TOGGLE */
.theme-toggle {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--paper);
  color: var(--ink);
  border: var(--border-w) solid var(--rule);
  padding: 4px 10px;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--accent); color: var(--on-accent); }

/* 5.11 FIELD (form group: label + input + hint/error) */
.field { display: block; margin-bottom: var(--s-4); }
.field > label,
.field > .label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--s-2);
}
.field .hint {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  opacity: 0.7;
  margin-top: var(--s-2);
}
.field .error {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--alert);
  margin-top: var(--s-2);
}

/* 5.12 CHECK / RADIO (square, brutalist) */
.check, .radio {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--t-sm);
  user-select: none;
}
.check input[type="checkbox"],
.radio input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border: var(--border-w) solid var(--rule);
  background: var(--paper);
  margin: 0;
  display: inline-block;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}
.check input[type="checkbox"]:checked,
.radio input[type="radio"]:checked {
  background: var(--accent);
}
.check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 6px; height: 11px;
  border-right: 3px solid var(--on-accent);
  border-bottom: 3px solid var(--on-accent);
  transform: rotate(45deg);
}
.radio input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--on-accent);
}
.check input:focus-visible,
.radio input:focus-visible {
  outline: 0;
  box-shadow: var(--shadow-accent);
}

/* 5.13 LIST (native ul/ol with bar-bullets) */
ul, ol { padding-left: var(--s-5); margin: 0 0 var(--s-4); }
ul li, ol li { margin-bottom: var(--s-2); }
ul { list-style: none; padding-left: 0; }
ul > li { padding-left: var(--s-5); position: relative; }
ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: var(--s-3);
  height: 2px;
  background: var(--accent);
}
ol { list-style: none; counter-reset: ol; padding-left: 0; }
ol > li { padding-left: var(--s-7); position: relative; counter-increment: ol; }
ol > li::before {
  content: counter(ol, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--t-sm);
  color: var(--accent);
  letter-spacing: 0.05em;
}
/* nested lists: don't compound padding */
li > ul, li > ol { margin-top: var(--s-2); margin-bottom: 0; }

/* 5.14 DETAILS / SUMMARY (accordion via native element) */
details {
  border: var(--border-w) solid var(--rule);
  margin-bottom: var(--s-4);
  background: var(--paper);
}
details summary {
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  background: var(--paper-2);
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: "+";
  display: inline-block;
  width: 1em;
  font-weight: 900;
  color: var(--accent);
  font-size: 1.2em;
  line-height: 1;
}
details[open] summary::before { content: "−"; }
details[open] summary { border-bottom: var(--border-w) solid var(--rule); }
details .details-body { padding: var(--s-4); }
details .details-body > *:last-child { margin-bottom: 0; }

/* 5.15 HERO */
.hero {
  padding: var(--s-8) 0 var(--s-7);
  border-bottom: var(--border-w-fat) solid var(--rule);
  margin-bottom: var(--s-7);
}
.hero h1 { margin-bottom: var(--s-4); }
.hero .lede {
  font-family: var(--font-body);
  font-size: var(--t-md);
  max-width: 50ch;
  line-height: 1.4;
  margin-bottom: var(--s-5);
}
.hero .meta {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

/* 5.16 FOOTER */
.footer {
  border-top: var(--border-w-fat) solid var(--rule);
  padding: var(--s-6) 0;
  margin-top: var(--s-8);
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  justify-content: space-between;
  align-items: baseline;
}
.footer a { color: var(--ink); }

/* 5.17 PAGINATION */
.pagination {
  display: inline-flex;
  gap: 0;
  font-family: var(--font-mono);
  font-size: var(--t-sm);
}
.pagination a,
.pagination span {
  padding: var(--s-2) var(--s-3);
  border: var(--border-w) solid var(--rule);
  border-right-width: 0;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  min-width: 40px;
  text-align: center;
  font-weight: 700;
}
.pagination > :last-child { border-right-width: var(--border-w); }
.pagination a:hover { background: var(--accent); color: var(--on-accent); }
.pagination [aria-current="page"],
.pagination .current { background: var(--ink); color: var(--paper); }

/* 5.18 BREADCRUMB */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--s-4);
  padding: var(--s-2) 0;
}
.breadcrumb a {
  color: var(--ink);
  text-decoration: none;
  padding: 2px 4px;
}
.breadcrumb a:hover { background: var(--accent); color: var(--on-accent); }
.breadcrumb [aria-current="page"] { opacity: 0.6; }
.breadcrumb > :not(:last-child)::after {
  content: "/";
  display: inline-block;
  margin: 0 var(--s-2);
  color: var(--accent);
  font-weight: 700;
}

/* 5.19 KBD (keyboard key) */
kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-weight: 700;
  padding: 1px 8px;
  border: var(--border-w) solid var(--rule);
  background: var(--paper);
  box-shadow: 2px 2px 0 0 var(--ink);
  margin: 0 2px;
  line-height: 1.4;
  vertical-align: 1px;
}

/* 5.20 PLATE (modular frame for images, SVG drawings, canvases, swatches)
   The unit a Fig. number attaches to. Discrete widths snap to the grid;
   ratio is the source's natural ratio unless a modifier sets one. The
   body hosts <img>, <svg>, <canvas>, <video>, or arbitrary content. */
.plate {
  display: inline-block;
  width: 320px;                    /* .plate-md (default) — small-web, instruction-manual scale */
  max-width: 100%;
  margin: var(--s-3) 0;
  vertical-align: top;
  position: relative;
}
.plate-xs { width: 160px; }
.plate-sm { width: 224px; }
.plate-md { width: 320px; }
.plate-lg { width: 400px; }
.plate-xl { width: 512px; }

.plate-body {
  position: relative;
  border: 1px solid var(--rule);
  padding: 4px;
  background: var(--paper);
  box-sizing: border-box;
  overflow: hidden;
}
.plate-body > img,
.plate-body > svg,
.plate-body > canvas,
.plate-body > video {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}

/* opt-in aspect ratios (none by default) */
.plate-1x1  .plate-body > * { aspect-ratio: 1 / 1;  height: auto; }
.plate-4x3  .plate-body > * { aspect-ratio: 4 / 3;  height: auto; }
.plate-3x4  .plate-body > * { aspect-ratio: 3 / 4;  height: auto; }
.plate-3x2  .plate-body > * { aspect-ratio: 3 / 2;  height: auto; }
.plate-2x3  .plate-body > * { aspect-ratio: 2 / 3;  height: auto; }
.plate-16x9 .plate-body > * { aspect-ratio: 16 / 9; height: auto; }
.plate-9x16 .plate-body > * { aspect-ratio: 9 / 16; height: auto; }
.plate-cover .plate-body > * { object-fit: cover; }

/* corner tag: a small ochre number/label sitting over the top-left edge */
.plate-tag {
  position: absolute;
  top: -10px;
  left: 8px;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--on-accent);
  padding: 2px 8px;
  border: 1px solid var(--rule);
}

/* caption strip */
.plate-cap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-3);
  margin-top: 6px;
  padding: 0 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.01em;
  line-height: 1.4;
}
.plate-num  { font-weight: 700; margin-right: 6px; }
.plate-url  {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}
.plate-url strong { font-weight: 700; }
.plate-url span   { opacity: 0.5; font-weight: 400; }
.plate-meta { opacity: 0.55; font-weight: 400; }
.plate-dl {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
}
.plate-dl:hover {
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
}

/* numbered callout pin — place on the body with inline style for top/left */
.plate-pin {
  position: absolute;
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  transform: translate(-50%, -50%);
  z-index: 1;
  user-select: none;
}

/* row + stack composition helpers */
.plate-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  margin: var(--s-4) 0;
  align-items: flex-start;
}
.plate-row > .plate { margin: 0; }
.plate-stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  margin: var(--s-4) 0;
}
.plate-stack > .plate { margin: 0; }

/* .plate-row-match — plates stretch to the tallest sibling's height.
   Pair this with explicit, matching dimensions on each plate (a fixed
   size class + ratio class on plate 1, an inline width + ratio class on
   plate 2) so the layout is deterministic. The system does NOT derive
   widths dynamically — that path turned out to be too fragile. */
.plate-row-match {
  align-items: stretch;
  flex-wrap: nowrap;
}
.plate-row-match > .plate {
  display: flex;
  flex-direction: column;
}
.plate-row-match > .plate > .plate-body { flex: 1 1 auto; min-height: 0; }

/* legend: numbered key beside a tagged plate */
.plate-legend {
  font-family: var(--font-mono);
  font-size: 12px;
  padding-left: var(--s-4);
  border-left: 1px solid var(--rule);
  min-width: 180px;
  flex: 1 1 200px;
}
.plate-legend ol { padding-left: 0; margin: 0; }
.plate-legend li { padding-left: var(--s-5); margin-bottom: var(--s-2); }

/* swatch body — when the plate contains a flat color instead of a visual */
.plate-swatch {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
}

/* native <figure> stays minimal — no heavy frame, no caption strip */
figure { margin: var(--s-4) 0; }
figure img, figure video { max-width: 100%; height: auto; display: block; }
figcaption {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  margin-top: var(--s-2);
  opacity: 0.7;
}

/* ---------- 6. UTIL ------------------------------------ */
.mono   { font-family: var(--font-mono); }
.serif  { font-family: var(--font-serif); }
.upper  { text-transform: uppercase; letter-spacing: 0.05em; }
.center { text-align: center; }
.right  { text-align: right; }
.muted  { opacity: 0.65; }
.invert { background: var(--ink); color: var(--paper); padding: 2px 6px; }
.mark   { background: var(--accent-soft); color: var(--on-accent); padding: 0 4px; }

.mt-0{margin-top:0}.mt-4{margin-top:var(--s-4)}.mt-6{margin-top:var(--s-6)}.mt-8{margin-top:var(--s-8)}
.mb-0{margin-bottom:0}.mb-4{margin-bottom:var(--s-4)}.mb-6{margin-bottom:var(--s-6)}.mb-8{margin-bottom:var(--s-8)}

/* ---------- 7. MOTION (sparingly) ---------------------- */
@media (prefers-reduced-motion: no-preference) {
  .hover-jitter:hover { animation: jitter 220ms steps(3) infinite; }
  @keyframes jitter {
    0%   { transform: translate(0,0); }
    33%  { transform: translate(-1px, 1px); }
    66%  { transform: translate(1px, -1px); }
    100% { transform: translate(0,0); }
  }
}
