/* ═══════════════════════════════════════════════════════════════════════════
   style.css — the shared design system.

   An editorial spread: full-bleed illustrations on solid colour grounds with
   the text cut into them, sharp corners, one red accent, and type doing the
   rest. Libre Franklin sets everything you read; Doto, a dot-matrix face,
   only the big words — section names, page titles, "Follow along." Labels
   are italic sentence case rather than tracked capitals.

   Page stylesheets in css/pages/ add layouts only. Every style lives in a
   stylesheet: the Content-Security-Policy forbids style attributes, so
   components are classes, never inline styles.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Fonts ─────────────────────────────────────────────────────────────────
   Served from this origin (no request to a font CDN). Variable fonts in Latin
   and Latin Extended subsets; the browser only fetches the ones a page uses.
   Licences: /fonts/licenses/ (SIL Open Font License 1.1). */
@font-face {
  font-family: 'Libre Franklin';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/libre-franklin-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Libre Franklin';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/libre-franklin-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Libre Franklin';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/libre-franklin-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Libre Franklin';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/libre-franklin-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Doto';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/doto-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Doto';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/doto-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ─── Tokens ────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;

  --bg: #FFFFFF;
  --ink: #111111;
  --ink2: #3A3A3A;
  --muted: #666666;
  --rule: #E6E6E6;
  --dots: #DCDCD5;        /* the pale dot-matrix words */
  --panel: #F4F4F1;       /* inline code */
  --accent: #C8102E;      /* links that lead on, the current place — nothing else */
  --on-accent: #FFFFFF;
  --band: #111111;        /* the follow band and the footer */
  --on-band: #FFFFFF;
  --band-rule: rgba(255, 255, 255, 0.16);
  --code-bg: #111111;
  --code-ink: #EDEDEA;

  --font-sans: 'Libre Franklin', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Doto', ui-monospace, monospace;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  --wrap: 1360px;
  --gutter: clamp(16px, 4vw, 48px);
  --gap: 32px;
  --section: 150px;
  --ease: cubic-bezier(0.2, 0.8, 0.1, 1);
}

/* Dark mode follows the system setting unless the visitor picked a scheme
   with the header switch, which sets data-theme on <html>. The declarations
   are repeated because a media query cannot share a block with a selector. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F0F0F; --ink: #F2F2EF; --ink2: #CFCFCA; --muted: #9C9C96; --rule: #272727; --dots: #2C2C2B; --panel: #1C1C1B;
  --accent: #E0646F; --on-accent: #0F0F0F;
  --band: #191918; --on-band: #F2F2EF; --band-rule: rgba(255, 255, 255, 0.12);
  --code-bg: #1C1C1B;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0F0F0F; --ink: #F2F2EF; --ink2: #CFCFCA; --muted: #9C9C96; --rule: #272727; --dots: #2C2C2B; --panel: #1C1C1B;
    --accent: #E0646F; --on-accent: #0F0F0F;
    --band: #191918; --on-band: #F2F2EF; --band-rule: rgba(255, 255, 255, 0.12);
    --code-bg: #1C1C1B;
  }
}

/* ─── Base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
time { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.main { padding-top: 56px; }

/* Keyboard and screen-reader users get past the header. */
.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  padding: 10px 16px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 14px;
}
.skip-link:focus { left: 8px; }

/* ─── Type ──────────────────────────────────────────────────────────────── */
/* The small line above a title: italic, sentence case, quiet. */
.label { font-style: italic; font-size: 15px; font-weight: 400; color: var(--muted); }
.link-accent { color: var(--accent); font-weight: 700; font-size: 15px; white-space: nowrap; }
.link-accent:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* The dot-matrix face, for the big words only. */
.display,
.ghost {
  font-family: var(--font-display);
  font-weight: 900;
  font-variation-settings: 'ROND' 100;
  letter-spacing: -0.02em;
}
/* A large pale word behind a section: decoration, never the heading itself. */
.ghost {
  color: var(--dots);
  font-size: clamp(76px, 13.2vw, 196px);
  line-height: 0.82;
  white-space: nowrap;
  user-select: none;
}

.icon { width: 16px; height: 16px; flex: none; }

/* ─── Header ────────────────────────────────────────────────────────────── */
.site-header { position: relative; z-index: 3; }
.site-header__inner {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 14px 40px; padding-top: 24px; padding-bottom: 24px;
}
.logo { font-weight: 700; font-size: 26px; line-height: 1; letter-spacing: -0.03em; white-space: nowrap; }
.logo__dot { color: var(--accent); }
.site-nav { margin-right: auto; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 30px; list-style: none; }
.site-nav a {
  display: block; padding: 6px 0;
  border-bottom: 2px solid transparent;
  font-weight: 600; font-size: 15px;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { border-bottom-color: currentColor; }
.header-tools { display: flex; align-items: center; gap: 14px; }
.header-link { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 15px; }
.header-link:hover span { text-decoration: underline; text-underline-offset: 4px; }
.theme-toggle {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--rule); background: transparent; color: inherit;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.theme-toggle:hover { border-color: currentColor; }
.theme-toggle[hidden] { display: none; }
/* Show the sun while dark (it switches to light) and the moon while light. */
.theme-toggle .icon--sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon--sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon--moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon--sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon--moon { display: none; }
}

/* On a page that opens with a picture the header sits on top of it: white
   over the dark grounds and photos, ink over the light grounds. The grounds
   are artwork and keep their colours in dark mode, so these are fixed too.
   On a wide screen the tools sit over the hero's second half, so they follow
   that half's ground. */
.site-header--over {
  position: absolute; top: 0; left: 0; right: 0;
  color: #FFFFFF;
  --over-dot: #FF6A57;
  --over-ring: rgba(255, 255, 255, 0.55);
}
.site-header--over.is-light-start { color: #111111; --over-dot: #C8102E; --over-ring: rgba(17, 17, 17, 0.4); }
.site-header--over .logo__dot { color: var(--over-dot); }
.site-header--over .theme-toggle { border-color: var(--over-ring); }
@media (min-width: 901px) {
  .site-header--over .header-tools { color: #FFFFFF; --over-ring: rgba(255, 255, 255, 0.55); }
  .site-header--over.is-light-end .header-tools { color: #111111; --over-ring: rgba(17, 17, 17, 0.4); }
}

/* ─── Follow band and footer ────────────────────────────────────────────── */
.follow-band { margin-top: var(--section); background: var(--band); color: var(--on-band); }
.follow-band__inner {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap);
  align-items: end; padding-top: 110px; padding-bottom: 110px;
}
.follow-band__title { grid-column: 1 / span 7; font-size: clamp(52px, 7.2vw, 112px); line-height: 0.98; letter-spacing: -0.01em; }
.follow-band__dot { color: var(--accent); }
.follow-band__body { grid-column: 9 / span 4; }
.follow-band__body p { font-size: 18px; line-height: 1.55; opacity: 0.86; }
.follow-band .btn-row { margin-top: 26px; }
.follow-band .btn--solid { background: var(--on-band); color: var(--band); border-color: var(--on-band); }
.follow-band .btn--outline { border-color: var(--on-band); color: var(--on-band); }

.site-footer { background: var(--band); color: var(--on-band); }
.site-footer--alone { margin-top: var(--section); }
.site-footer__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px 32px; padding-top: 28px; padding-bottom: 40px;
  border-top: 1px solid var(--band-rule); font-size: 14px;
}
.site-footer--alone .site-footer__inner { border-top: 0; padding-top: 40px; }
.site-footer__nav ul { display: flex; flex-wrap: wrap; gap: 10px 24px; list-style: none; }
.site-footer__nav a { opacity: 0.82; }
.site-footer__nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.site-footer__copy { opacity: 0.6; }

/* ─── Buttons and links ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 22px; border: 2px solid var(--ink);
  font-weight: 700; font-size: 15px; line-height: 1.2; cursor: pointer; white-space: nowrap;
}
.btn--solid { background: var(--ink); color: var(--bg); }
.btn--solid:hover { background: transparent; color: var(--ink); }
.btn--outline { background: transparent; color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--bg); }
.follow-band .btn--solid:hover { background: transparent; color: var(--on-band); }
.follow-band .btn--outline:hover { background: var(--on-band); color: var(--band); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* "All 8 articles →": the one solid accent surface. */
.all-bar {
  display: flex; justify-content: flex-end; align-items: center; gap: 10px;
  margin-top: 56px; padding: 20px 28px;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 17px;
}
.all-bar:hover .icon { transform: translateX(4px); }
.all-bar .icon { transition: transform 0.3s var(--ease); }

.link-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; list-style: none; font-weight: 700; font-size: 16px; }
.link-row a { display: inline-flex; align-items: center; gap: 6px; }
.link-row a:not(.link-accent):hover { text-decoration: underline; text-underline-offset: 4px; }

/* ─── Pictures ──────────────────────────────────────────────────────────── */
/* Every picture sits on a solid ground; the drawings take their colours from
   it (they are inlined, and colour themselves by class, see lib/projects.php). */
.media { position: relative; overflow: hidden; background: var(--art-bg); }
.media > img,
.media > .art { position: absolute; inset: 0; width: 100%; height: 100%; }
.media > img { object-fit: cover; }
.media--card { aspect-ratio: 4 / 3; }

/* No cover and no drawing: the title is the picture. */
.media--text { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 20px 22px 18px; }
.media__label { font-style: italic; font-size: 15px; color: var(--art-text); }
.media__title {
  font-weight: 700; font-size: clamp(26px, 2.6vw, 40px); line-height: 1; letter-spacing: -0.028em;
  color: var(--art-ink); overflow-wrap: break-word; hyphens: auto;
}

.ground-green  { --art-bg: #1D4433; --art-grid: rgba(255, 255, 255, 0.06); --art-board: #245440; --art-line: rgba(255, 255, 255, 0.22); --art-ink: #F2EFE6; --art-tie: #86AA95; --art-text: #CFE0D4; --art-frame: #0E2419; --art-soft: rgba(255, 255, 255, 0.08); --art-ground: rgba(0, 0, 0, 0.2); --art-accent: #FF6A57; }
.ground-tomato { --art-bg: #C2402B; --art-grid: rgba(255, 255, 255, 0.07); --art-board: #CF5440; --art-line: rgba(255, 255, 255, 0.26); --art-ink: #FFF6EE; --art-tie: #F0B4A2; --art-text: #FFE6DA; --art-frame: #76220F; --art-soft: rgba(255, 255, 255, 0.1); --art-ground: rgba(0, 0, 0, 0.14); --art-accent: #FFD247; }
.ground-cobalt { --art-bg: #1E3A96; --art-grid: rgba(255, 255, 255, 0.06); --art-board: #2747AB; --art-line: rgba(255, 255, 255, 0.22); --art-ink: #F3F5FF; --art-tie: #9BAEEC; --art-text: #D9E1FF; --art-frame: #0D1B4D; --art-soft: rgba(255, 255, 255, 0.08); --art-ground: rgba(0, 0, 0, 0.18); --art-accent: #FFB23F; }
.ground-night  { --art-bg: #141414; --art-grid: rgba(255, 255, 255, 0.05); --art-board: #1D1D1C; --art-line: rgba(255, 255, 255, 0.16); --art-ink: #EDEDEA; --art-tie: #6B6B66; --art-text: #B5B5AE; --art-frame: #000000; --art-soft: rgba(255, 255, 255, 0.07); --art-ground: rgba(0, 0, 0, 0.3); --art-accent: #FF5A4E; }
.ground-sand   { --art-bg: #E4D7BF; --art-grid: rgba(0, 0, 0, 0.05); --art-board: #F3EBDC; --art-line: rgba(0, 0, 0, 0.16); --art-ink: #1A1A1A; --art-tie: #9A8B71; --art-text: #5A5143; --art-frame: #1A1A1A; --art-soft: rgba(0, 0, 0, 0.07); --art-ground: rgba(255, 255, 255, 0.4); --art-accent: #C4161C; }
.ground-sky    { --art-bg: #CADCEB; --art-grid: rgba(0, 0, 0, 0.05); --art-board: #ECF3FA; --art-line: rgba(16, 32, 46, 0.18); --art-ink: #10202E; --art-tie: #7D92A5; --art-text: #3B5063; --art-frame: #10202E; --art-soft: rgba(16, 32, 46, 0.07); --art-ground: rgba(255, 255, 255, 0.45); --art-accent: #D9381E; }

/* The drawings (art.svg in the content repository) colour themselves by class. */
.art .f-accent { fill: var(--art-accent); }
.art .f-art-bg { fill: var(--art-bg); }
.art .f-art-board { fill: var(--art-board); }
.art .f-art-frame { fill: var(--art-frame); }
.art .f-art-ground { fill: var(--art-ground); }
.art .f-art-ink { fill: var(--art-ink); }
.art .f-art-line { fill: var(--art-line); }
.art .f-art-soft { fill: var(--art-soft); }
.art .f-art-text { fill: var(--art-text); }
.art .f-art-tie { fill: var(--art-tie); }
.art .s-accent { stroke: var(--art-accent); }
.art .s-art-bg { stroke: var(--art-bg); }
.art .s-art-board { stroke: var(--art-board); }
.art .s-art-grid { stroke: var(--art-grid); }
.art .s-art-ink { stroke: var(--art-ink); }
.art .s-art-line { stroke: var(--art-line); }
.art .s-art-soft { stroke: var(--art-soft); }
.art .s-art-text { stroke: var(--art-text); }
.art .s-art-tie { stroke: var(--art-tie); }

/* A link around a picture: the picture leans in, the title underlines. */
.lift .media > .art,
.lift .media > img { transition: transform 0.7s var(--ease); }
.lift:hover .media > .art,
.lift:hover .media > img { transform: scale(1.035); }
.lift:hover .lift-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* The ASCII portrait, always light on black: it was drawn as a negative. */
.portrait-box { background: #0B0B0B; padding: 26px; }
.portrait { width: 100%; height: auto; aspect-ratio: 1500 / 1632; }
.portrait text { font-family: var(--font-mono); font-size: 10px; fill: #EEEAE2; white-space: pre; }

/* ─── Sections ──────────────────────────────────────────────────────────── */
.section { margin-top: var(--section); }
.section--tight { margin-top: 72px; }

/* A section's head: a small title over a heavy rule, or, with a pale word
   above, the title tucked under that word. */
.section-head { margin-bottom: 32px; }
.section-head__bar {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding-top: 14px; border-top: 2px solid var(--ink);
}
.section-head__title { font-style: italic; font-weight: 600; font-size: 15px; color: var(--ink); }
.section-head--ghost { position: relative; margin-bottom: 40px; }
.section-head--ghost .section-head__bar { position: absolute; left: 0; right: 0; bottom: 6px; padding-top: 0; border-top: 0; }

/* A page's own title, in the dot-matrix face. */
.page-intro { display: flex; flex-direction: column; gap: 22px; }
.page-intro__title { font-size: clamp(56px, 10vw, 150px); line-height: 0.9; overflow-wrap: break-word; hyphens: auto; }
.page-intro__title--long { font-size: clamp(40px, 7vw, 104px); }
.page-intro__lead { max-width: 640px; font-size: 20px; line-height: 1.55; color: var(--ink2); }

/* Filters on the listing pages: plain links, the current one underlined. */
.filter { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 44px; font-weight: 600; font-size: 16px; }
.filter a { padding: 4px 0; border-bottom: 2px solid transparent; }
.filter a:hover { border-bottom-color: var(--rule); }
.filter a[aria-current="page"] { border-bottom-color: var(--accent); }
.filter__count { margin-left: 2px; font-style: italic; font-weight: 400; font-size: 14px; color: var(--muted); }

/* ─── Cards ─────────────────────────────────────────────────────────────── */
.card-grid { display: grid; gap: 56px 28px; }
.card-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px var(--gap); }

.post-card { display: block; }
.post-card__label { margin-top: 18px; }
.post-card__title { margin-top: 8px; font-weight: 700; font-size: 20px; line-height: 1.3; }
.post-card__label + .post-card__title { margin-top: 8px; }
.post-card .media + .post-card__title { margin-top: 18px; }
.post-card__excerpt { margin-top: 10px; font-size: 16px; line-height: 1.55; color: var(--ink2); }
.post-card__meta { margin-top: 10px; font-size: 14px; color: var(--muted); }

/* A label/value row over a heavy rule. */
.facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px;
  border-top: 2px solid var(--ink);
}
.facts > div { padding-top: 14px; }
.facts dd { margin-top: 6px; font-weight: 700; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.facts dd a { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.facts--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.facts--stack { grid-template-columns: minmax(0, 1fr); gap: 0; }
.facts--stack > div { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.facts--stack dd { font-size: 16px; }

/* Numbered list of write-ups: a series, a project's articles. */
.parts { list-style: none; border-bottom: 1px solid var(--rule); }
.parts li { border-top: 1px solid var(--rule); }
.parts a,
.parts--plain li {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px; align-items: baseline; padding: 10px 0; font-weight: 600; font-size: 16px; line-height: 1.35;
}
.parts--plain li { grid-template-columns: 28px minmax(0, 1fr); }
.parts a:hover .parts__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.parts__num { font-weight: 700; color: var(--accent); }
.parts__date,
.parts__here { font-style: italic; font-weight: 400; font-size: 14px; color: var(--muted); white-space: nowrap; }
.parts__here { color: var(--accent); }
.parts--quiet a { grid-template-columns: 24px minmax(0, 1fr); padding: 9px 0; font-weight: 400; font-size: 15px; color: var(--ink2); }
.parts--quiet .parts__num { color: var(--muted); }
.parts--quiet .parts__date,
.parts--quiet .parts__here { display: none; }
.parts--quiet .is-current a { font-weight: 700; color: var(--ink); }
.parts--quiet .is-current .parts__num { color: var(--accent); }
.parts-empty {
  padding: 10px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font-style: italic; font-size: 16px; color: var(--muted);
}

.empty-state { padding: 24px 0; font-size: 18px; color: var(--muted); }

/* ─── 404 ───────────────────────────────────────────────────────────────── */
.not-found__code { font-size: clamp(120px, 30vw, 360px); }
.not-found__title { margin-top: 8px; font-weight: 700; font-size: clamp(36px, 4vw, 56px); line-height: 1.05; letter-spacing: -0.028em; }
.not-found__text { margin-top: 16px; max-width: 640px; font-size: 20px; line-height: 1.55; color: var(--ink2); }
.not-found .btn-row { margin-top: 32px; }

/* ─── Page transitions ──────────────────────────────────────────────────────
   Following a card morphs its picture and title into the page it opens, the
   way a printed spread turns into the article. js/modules/common.js names the
   two elements on both pages; browsers without the API simply navigate. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
::view-transition-group(hero-art),
::view-transition-group(hero-title) { animation-duration: 0.6s; animation-timing-function: var(--ease); }
::view-transition-old(hero-art),
::view-transition-new(hero-art) { width: 100%; height: 100%; object-fit: cover; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.35s; }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .card-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root { --section: 96px; --gap: 24px; }
  .main { padding-top: 32px; }
  /* Logo and tools share the first line; the menu gets its own below. */
  .site-nav { order: 3; width: 100%; margin-right: 0; }
  .header-tools { margin-left: auto; }
  .follow-band__inner { padding-top: 72px; padding-bottom: 72px; }
  .follow-band__title,
  .follow-band__body { grid-column: 1 / -1; }
  .card-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .card-grid--4,
  .card-grid--3 { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .facts > div + div { border-top: 1px solid var(--rule); margin-top: 14px; }
  .site-nav ul { gap: 22px; }
  .header-link span { display: none; }
  .all-bar { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}
