@charset "utf-8";
/* ==========================================================================
   rudra0x01 — "FIELD MANUAL"
   A technical-editorial theme: numbered manifest index, hairline schematics,
   ember accent, dual Ink / Paper modes.

   Plain CSS on purpose — GitHub Pages compiles .scss with end-of-life Ruby
   Sass 3.7, which mangles min()/max() and modern colour syntax. This file is
   copied verbatim, so modern CSS is safe here.

   0. Tokens            5. Manifest index
   1. Reset & base      6. Article
   2. Layout            7. Code & syntax
   3. Masthead & nav    8. Pagination, footer, 404
   4. Hero              9. Motion, print, a11y
   ========================================================================== */

/* ==========================================================================
   0. TOKENS
   ========================================================================== */

:root {
  /* --- Type ------------------------------------------------------------ */
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI",
    Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --font-display:
    -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono:
    ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, "Cascadia Mono",
    "Segoe UI Mono", "Roboto Mono", Consolas, "Liberation Mono", monospace;

  /* Fluid type scale — 320px … 1440px viewport */
  --step--2: clamp(0.6875rem, 0.665rem + 0.11vw, 0.75rem);
  --step--1: clamp(0.8125rem, 0.783rem + 0.15vw, 0.875rem);
  --step-0:  clamp(1rem, 0.978rem + 0.11vw, 1.0625rem);
  --step-1:  clamp(1.125rem, 1.06rem + 0.33vw, 1.3125rem);
  --step-2:  clamp(1.3125rem, 1.17rem + 0.72vw, 1.75rem);
  --step-3:  clamp(1.5rem, 1.21rem + 1.45vw, 2.375rem);
  --step-4:  clamp(1.875rem, 1.3rem + 2.87vw, 3.5rem);
  --step-5:  clamp(2.5rem, 1.32rem + 5.9vw, 6rem);

  /* --- Space ----------------------------------------------------------- */
  --gutter: clamp(1.125rem, 4vw, 2.75rem);
  --wrap: 1200px;
  --measure: 70ch;
  --rail: 15rem;              /* article table-of-contents rail */
  --header-h: 4rem;

  /* --- Shape ----------------------------------------------------------- */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --hair: 1px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 180ms;

  color-scheme: light;
}

/* --- PAPER (light) — warm archival stock, the default -------------------- */
:root,
:root[data-theme="light"] {
  --bg:        #f4f0e8;
  --bg-sunk:   #ece7dc;
  --bg-raise:  #fffdf8;
  --bg-code:   #fbf8f1;

  --fg:        #14151a;
  --fg-2:      #47484e;
  --fg-3:      #616269;   /* AA (>=4.5:1) on both --bg and --bg-sunk */

  --rule:        rgba(20, 21, 26, 0.13);
  --rule-strong: rgba(20, 21, 26, 0.26);

  --accent:       #c0330a;   /* AA on --bg for body-size text */
  --accent-vivid: #e8471a;   /* decorative fills only */
  --accent-soft:  rgba(224, 71, 26, 0.10);
  --accent-ring:  rgba(224, 71, 26, 0.42);

  --shadow-1: 0 1px 2px rgba(20, 21, 26, 0.05), 0 6px 20px rgba(20, 21, 26, 0.06);
  --shadow-2: 0 2px 6px rgba(20, 21, 26, 0.07), 0 18px 44px rgba(20, 21, 26, 0.10);

  --syn-comment: #6e6c64;   /* AA on --bg-code; muted without dropping below 4.5:1 */
  --syn-key:     #a3210f;
  --syn-str:     #2f6b3a;
  --syn-num:     #8a4b00;
  --syn-fn:      #1f5b96;
  --syn-var:     #7a3a9c;
  --syn-type:    #0a6a72;
  --syn-op:      #4a4b50;
  --syn-punc:    #6a6b70;
  --syn-err:     #b3261e;

  color-scheme: light;
}

/* --- INK (dark) — near-black with a cool cast ---------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0a0b0d;
    --bg-sunk:   #060709;
    --bg-raise:  #101216;
    --bg-code:   #0e1013;

    --fg:        #edeae4;
    --fg-2:      #a9a7a0;
    --fg-3:      #85837c;

    --rule:        rgba(237, 234, 228, 0.11);
    --rule-strong: rgba(237, 234, 228, 0.24);

    --accent:       #ff5b29;
    --accent-vivid: #ff6b3d;
    --accent-soft:  rgba(255, 91, 41, 0.13);
    --accent-ring:  rgba(255, 91, 41, 0.55);

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.55), 0 6px 20px rgba(0, 0, 0, 0.45);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.6), 0 18px 44px rgba(0, 0, 0, 0.55);

    --syn-comment: #87857c;   /* AA on --bg-code */
    --syn-key:     #ff7b6b;
    --syn-str:     #9fd67f;
    --syn-num:     #ffb443;
    --syn-fn:      #6fc2ff;
    --syn-var:     #d3a4ff;
    --syn-type:    #5fd9c8;
    --syn-op:      #c8c5be;
    --syn-punc:    #908e87;
    --syn-err:     #ff6b6b;

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg:        #0a0b0d;
  --bg-sunk:   #060709;
  --bg-raise:  #101216;
  --bg-code:   #0e1013;

  --fg:        #edeae4;
  --fg-2:      #a9a7a0;
  --fg-3:      #85837c;

  --rule:        rgba(237, 234, 228, 0.11);
  --rule-strong: rgba(237, 234, 228, 0.24);

  --accent:       #ff5b29;
  --accent-vivid: #ff6b3d;
  --accent-soft:  rgba(255, 91, 41, 0.13);
  --accent-ring:  rgba(255, 91, 41, 0.55);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.55), 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.6), 0 18px 44px rgba(0, 0, 0, 0.55);

  --syn-comment: #87857c;   /* AA on --bg-code */
  --syn-key:     #ff7b6b;
  --syn-str:     #9fd67f;
  --syn-num:     #ffb443;
  --syn-fn:      #6fc2ff;
  --syn-var:     #d3a4ff;
  --syn-type:    #5fd9c8;
  --syn-op:      #c8c5be;
  --syn-punc:    #908e87;
  --syn-err:     #ff6b6b;

  color-scheme: dark;
}

/* ==========================================================================
   1. RESET & BASE
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
  overflow-x: clip;
}

body {
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, video, canvas, picture {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select { font: inherit; color: inherit; }

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

a { color: var(--accent); text-decoration: none; }

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

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

hr {
  border: 0;
  border-top: var(--hair) solid var(--rule);
  margin: 3rem 0;
}

/* Utility ------------------------------------------------------------------ */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -120%);
  z-index: 200;
  background: var(--accent);
  color: #fff;
  padding: 0.7rem 1.25rem;
  font: 600 var(--step--1)/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 0 0 var(--r-md) var(--r-md);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* Mono micro-label — a core motif of the theme */
.label {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}

.label--accent { color: var(--accent); }

/* ==========================================================================
   2. LAYOUT
   ========================================================================== */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.wrap--narrow { max-width: 900px; }

main { flex: 1 0 auto; }

/* Section header with schematic corner ticks ------------------------------- */

.section {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  border-top: var(--hair) solid var(--rule);
}
.section:first-of-type { border-top: 0; }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.section__title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

/* the small ember square that prefixes every section title */
.section__title::before {
  content: "";
  width: 0.55em;
  height: 0.55em;
  flex: none;
  background: var(--accent);
  transform: translateY(-0.06em);
}

.section__link {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.05em;
  color: var(--fg-2);
  border-bottom: var(--hair) solid var(--rule-strong);
  padding-bottom: 2px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.section__link:hover { color: var(--accent); border-color: var(--accent); }

/* ==========================================================================
   3. MASTHEAD & NAV
   ========================================================================== */

.masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: var(--hair) solid var(--rule);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}

/* Browsers without color-mix keep a solid bar rather than a transparent one */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .masthead { background: var(--bg); }
}

.masthead__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Wordmark ---------------------------------------------------------------- */

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.1em;
  font-family: var(--font-mono);
  font-size: clamp(1rem, 0.94rem + 0.28vw, 1.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  white-space: nowrap;
}
.brand__hex { color: var(--accent); }
.brand__caret {
  width: 0.5em;
  height: 1em;
  margin-left: 0.35em;
  background: var(--accent);
  transform: translateY(0.1em);
  animation: blink 1.4s steps(1) infinite;
}
@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }

/* Desktop nav ------------------------------------------------------------- */

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2rem);
}

.nav__link {
  position: relative;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--fg-2);
  padding-block: 0.5rem;
  transition: color var(--dur) var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.15rem;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.nav__link:hover { color: var(--fg); }
.nav__link:hover::after,
.nav__link[aria-current="page"]::after { transform: scaleX(1); }
.nav__link[aria-current="page"] { color: var(--fg); }

/* Controls (theme toggle + hamburger) ------------------------------------- */

.controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-btn {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-sm);
  color: var(--fg-2);
  background: transparent;
  transition: color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              background var(--dur) var(--ease);
}
.icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.icon-btn svg { width: 1.05rem; height: 1.05rem; }

/* Theme toggle shows the icon for the mode it will switch *to*. */
.icon-btn .i-sun,
.icon-btn .i-system { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun  { display: block; }
:root[data-theme="dark"]  .theme-toggle .i-moon { display: block; }
:root[data-theme="dark"]  .theme-toggle .i-sun  { display: none; }
:root[data-theme="system"] .theme-toggle .i-moon,
:root[data-theme="system"] .theme-toggle .i-sun { display: none; }
:root[data-theme="system"] .theme-toggle .i-system { display: block; }

.nav-toggle { display: none; }

/* Mobile ------------------------------------------------------------------ */

@media (max-width: 860px) {
  .nav-toggle { display: grid; }

  /* IMPORTANT: backdrop-filter on an ancestor makes it the containing block
     for position:fixed descendants, which would collapse the nav panel into
     the 4rem header instead of filling the screen. Drop the blur here — it is
     also the cheaper choice on phones. */
  .masthead {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg);
  }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 99;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 1.25rem var(--gutter) calc(2rem + env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: var(--hair) solid var(--rule);
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.75rem);
    transition: opacity var(--dur) var(--ease),
                transform var(--dur) var(--ease),
                visibility 0s linear var(--dur);
  }

  .nav[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
  }

  .nav__link {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    font-family: var(--font-display);
    font-size: var(--step-2);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--fg);
    padding-block: 0.85rem;
    border-bottom: var(--hair) solid var(--rule);
    min-height: 3.25rem;
  }
  /* numbered like the manifest rows */
  .nav__link::before {
    content: attr(data-idx);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--accent);
    flex: none;
  }
  .nav__link::after { display: none; }
  .nav__link[aria-current="page"] { color: var(--accent); }
}

/* ==========================================================================
   4. HERO
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-bottom: var(--hair) solid var(--rule);
}

/* schematic graph-paper texture, faded out */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--rule) var(--hair), transparent var(--hair)),
    linear-gradient(90deg, var(--rule) var(--hair), transparent var(--hair));
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 15% 0%, #000 5%, transparent 72%);
  mask-image: radial-gradient(ellipse 85% 75% at 15% 0%, #000 5%, transparent 72%);
  pointer-events: none;
}

/* ember bloom */
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -35%;
  right: -12%;
  width: min(46rem, 85vw);
  aspect-ratio: 1;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 68%);
  pointer-events: none;
}

.hero__inner {
  padding-block: clamp(3rem, 9vw, 7rem) clamp(2.5rem, 6vw, 4.5rem);
}

/* the ticker strip above the headline */
.hero__strip {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}
.hero__pulse {
  width: 0.5rem;
  height: 0.5rem;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-ring);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-ring); }
  70%  { box-shadow: 0 0 0 0.6rem rgba(0, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--step-5);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.045em;
  text-wrap: balance;
  max-width: 16ch;
}
.hero__title em {
  font-style: normal;
  color: var(--accent);
}

.hero__lede {
  margin-top: clamp(1.25rem, 3vw, 1.75rem);
  max-width: 52ch;
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--fg-2);
  text-wrap: pretty;
}

/* Stat manifest ------------------------------------------------------------ */

/* Hairline rules come from each cell's outer shadow rather than a coloured
   container behind a 1px gap — otherwise a part-filled final row shows the
   container colour as a grey block. */
.stats {
  margin-top: clamp(2rem, 5vw, 3.25rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr));
  gap: var(--hair);
}

.stat {
  background: var(--bg);
  box-shadow: 0 0 0 var(--hair) var(--rule);
  padding: clamp(0.9rem, 2.2vw, 1.25rem) clamp(0.9rem, 2vw, 1.35rem);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.stat__num {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat__num span { color: var(--accent); }

/* ==========================================================================
   5. MANIFEST INDEX  — the signature component
   ========================================================================== */

.manifest {
  border-top: var(--hair) solid var(--rule-strong);
}

.entry {
  position: relative;
  display: grid;
  align-items: center;
  column-gap: clamp(0.85rem, 2vw, 1.75rem);
  row-gap: 0.55rem;
  padding-block: clamp(1.1rem, 2.4vw, 1.6rem);
  padding-inline: clamp(0.5rem, 1.5vw, 1rem);
  margin-inline: clamp(-1rem, -1.5vw, -0.5rem);
  border-bottom: var(--hair) solid var(--rule);
  grid-template-columns: 3.25rem minmax(0, 1fr);
  grid-template-areas:
    "idx  meta"
    "title title"
    "tags tags";
  transition: background var(--dur) var(--ease);
}

/* growing ember bar on the left edge */
.entry::before {
  content: "";
  position: absolute;
  left: 0;
  top: var(--hair);
  bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--dur) var(--ease);
}

.entry:hover,
.entry:focus-within { background: var(--accent-soft); }
.entry:hover::before,
.entry:focus-within::before { transform: scaleY(1); }

.entry__idx {
  grid-area: idx;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.entry__meta {
  grid-area: meta;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--fg-3);
}

.entry__read {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--fg-3);
}

.entry__title {
  grid-area: title;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}
.entry__title a {
  color: var(--fg);
  transition: color var(--dur) var(--ease);
}
/* full-row hit area, without nesting links */
.entry__title a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.entry:hover .entry__title a,
.entry__title a:focus-visible { color: var(--accent); }

.entry__tags {
  grid-area: tags;
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.entry__go {
  grid-area: go;
  display: none;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-0.4rem);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.entry:hover .entry__go { opacity: 1; transform: none; }

@media (min-width: 861px) {
  .entry {
    grid-template-columns: 3.25rem 6.5rem minmax(0, 1fr) auto 1.5rem;
    grid-template-areas: "idx meta title tags go";
    row-gap: 0;
  }
  .entry__title { font-size: var(--step-2); }
  .entry__go { display: block; }
  .entry__tags { justify-content: flex-end; gap: 0.6rem; }
}

/* Chips -------------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 0.4em 0.65em;
  border: var(--hair) solid var(--rule-strong);
  border-radius: var(--r-sm);
  color: var(--fg-2);
  white-space: nowrap;
  transition: color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              background var(--dur) var(--ease);
}
.chip::before { content: "/"; opacity: 0.45; margin-right: 0.15em; }

a.chip:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.chip--solid {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
a.chip--solid:hover { background: var(--accent-vivid); border-color: var(--accent-vivid); color: #fff; }

/* Topic grid --------------------------------------------------------------- */

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: var(--hair);
}

.topic-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.35rem;
  min-height: 8.5rem;
  padding: clamp(1.15rem, 3vw, 1.7rem);
  background: var(--bg);
  box-shadow: 0 0 0 var(--hair) var(--rule);
  color: var(--fg);
  transition: background var(--dur) var(--ease);
}
.topic-card:hover { background: var(--accent-soft); }

.topic-card::after {
  content: "";
  position: absolute;
  right: clamp(1.15rem, 3vw, 1.7rem);
  bottom: clamp(1.15rem, 3vw, 1.7rem);
  width: 0.55rem;
  height: 0.55rem;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  transform: rotate(45deg) translate(-0.2rem, 0.2rem);
  opacity: 0;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.topic-card:hover::after { opacity: 1; transform: rotate(45deg); }

.topic-card__idx {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.topic-card__name {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.topic-card__count {
  margin-top: 0.15rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.06em;
  color: var(--fg-3);
}

/* Awards / credentials ----------------------------------------------------- */

.awards {
  display: grid;
  gap: clamp(0.85rem, 2vw, 1.25rem);
}

.award {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  padding: clamp(1.15rem, 3vw, 1.9rem);
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-md);
  background: var(--bg-raise);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.award:hover,
.award:focus-within { border-color: var(--accent); }

/* the ember index sits above the text on narrow screens, beside it when there
   is room for a gutter */
.award__idx {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

@media (min-width: 720px) {
  .award {
    grid-template-columns: 3.25rem minmax(0, 1fr);
    gap: clamp(1rem, 2.5vw, 1.75rem);
  }
  .award__idx { padding-top: 0.2rem; }
}

.award__kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.award__sep {
  width: 0.3rem;
  height: 0.3rem;
  flex: none;
  border-radius: 50%;
  background: var(--rule-strong);
}

.award__title {
  margin-top: 0.55rem;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.award__abbr {
  font-family: var(--font-mono);
  font-size: 0.62em;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  white-space: nowrap;
}

.award__summary {
  margin-top: 0.6rem;
  max-width: 62ch;
  color: var(--fg-2);
  line-height: 1.6;
  text-wrap: pretty;
}

.award__facts {
  list-style: none;
  padding: 0;
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.award__facts .chip::before { content: none; }

.award__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.1rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.95rem;
  border: var(--hair) solid var(--rule-strong);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.05em;
  color: var(--fg);
  transition: color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              background var(--dur) var(--ease);
}
.award__cta:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.award__cta svg { flex: none; }

/* Empty state -------------------------------------------------------------- */

.empty {
  border: var(--hair) dashed var(--rule-strong);
  border-radius: var(--r-md);
  padding: clamp(2rem, 6vw, 3.5rem);
  text-align: center;
  color: var(--fg-2);
}
.empty__mark {
  font-family: var(--font-mono);
  font-size: var(--step-3);
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   6. ARTICLE
   ========================================================================== */

.reading-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--accent);
  z-index: 120;
  will-change: transform;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.crumbs a { color: var(--fg-3); transition: color var(--dur) var(--ease); }
.crumbs a:hover { color: var(--accent); }
.crumbs li { display: flex; align-items: center; gap: 0.45rem; }
.crumbs li + li::before { content: "/"; opacity: 0.5; }
.crumbs [aria-current] { color: var(--fg-2); }

/* On narrow screens keep the trail on one line and ellipsise the current page
   rather than wrapping it under a dangling separator. Only the last crumb may
   shrink — letting the ancestors shrink makes them collide with the "/". */
@media (max-width: 720px) {
  .crumbs { flex-wrap: nowrap; }
  .crumbs li { flex: 0 0 auto; white-space: nowrap; }
  .crumbs li:last-child { flex: 0 1 auto; min-width: 0; }
  .crumbs [aria-current] {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.post-head {
  padding-block: clamp(2rem, 5vw, 3.25rem) clamp(1.5rem, 3.5vw, 2.25rem);
  border-bottom: var(--hair) solid var(--rule);
}

.post-title {
  margin-top: clamp(1rem, 2.5vw, 1.5rem);
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.035em;
  text-wrap: balance;
  max-width: 20ch;
}

.post-meta {
  margin-top: clamp(1rem, 2.5vw, 1.5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}
.post-meta .dot { opacity: 0.5; }
.post-meta__author {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--fg-2);
}
.post-meta__author img {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  border: var(--hair) solid var(--rule-strong);
}

/* Body + optional TOC rail ------------------------------------------------- */

.post-body {
  padding-block: clamp(2rem, 5vw, 3.5rem);
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1080px) {
  .post-body {
    grid-template-columns: minmax(0, 1fr) var(--rail);
    align-items: start;
  }
}

/* ---- TOC ---- */

.toc {
  font-size: var(--step--1);
}

.toc__title {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 0.85rem;
}

.toc ol { list-style: none; padding: 0; margin: 0; }

.toc a {
  display: block;
  padding: 0.35rem 0 0.35rem 0.85rem;
  border-left: 2px solid var(--rule);
  color: var(--fg-3);
  line-height: 1.35;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.toc a:hover { color: var(--fg); border-color: var(--rule-strong); }
.toc a[data-active="true"] { color: var(--accent); border-color: var(--accent); }
.toc .lvl-3 a { padding-left: 1.7rem; font-size: 0.94em; }
.toc .lvl-4 a { padding-left: 2.4rem; font-size: 0.9em; }

/* desktop: sticky rail */
@media (min-width: 1080px) {
  .toc {
    position: sticky;
    top: calc(var(--header-h) + 1.75rem);
    max-height: calc(100svh - var(--header-h) - 4rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .toc__details > summary { display: none; }
  .toc__details { display: block; }
}

/* mobile: collapsed disclosure above the article */
@media (max-width: 1079px) {
  .toc { order: -1; }
  .toc__title { display: none; }
  .toc__details {
    border: var(--hair) solid var(--rule);
    border-radius: var(--r-md);
    background: var(--bg-raise);
  }
  .toc__details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    min-height: 3rem;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: var(--step--2);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--fg-2);
    list-style: none;
  }
  .toc__details > summary::-webkit-details-marker { display: none; }
  .toc__details > summary::after {
    content: "";
    width: 0.5rem; height: 0.5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-0.1rem);
    transition: transform var(--dur) var(--ease);
  }
  .toc__details[open] > summary::after { transform: rotate(-135deg) translateY(-0.15rem); }
  .toc__details > ol { padding: 0 1.1rem 1rem; }
}

/* ---- Prose ---- */

.prose {
  max-width: var(--measure);
  font-size: var(--step-0);
  line-height: 1.72;
  color: var(--fg);
  overflow-wrap: break-word;
}

.prose > * + * { margin-top: 1.4em; }

.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  text-wrap: balance;
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}
.prose h2 {
  margin-top: 2em;
  font-size: var(--step-3);
  padding-top: 0.9rem;
  border-top: var(--hair) solid var(--rule);
}
.prose h3 { margin-top: 2em; font-size: var(--step-2); }
.prose h4 { margin-top: 1.9em; font-size: var(--step-1); }
.prose h5, .prose h6 {
  margin-top: 1.8em;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-2);
}
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; border-top: 0; padding-top: 0; }

/* anchor affordance on headings */
.prose .anchor {
  float: left;
  width: 1em;
  margin-left: -1em;
  color: var(--accent);
  opacity: 0;
  text-align: left;
  font-weight: 400;
  transition: opacity var(--dur) var(--ease);
}
.prose h2:hover .anchor,
.prose h3:hover .anchor,
.prose .anchor:focus-visible { opacity: 1; }
@media (max-width: 720px) { .prose .anchor { display: none; } }

.prose p { text-wrap: pretty; }

.prose a:not(.chip):not(.anchor) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--accent-ring);
  transition: text-decoration-color var(--dur) var(--ease),
              background var(--dur) var(--ease);
}
.prose a:not(.chip):not(.anchor):hover {
  text-decoration-color: var(--accent);
  background: var(--accent-soft);
}

.prose strong { font-weight: 680; color: var(--fg); }
.prose em { font-style: italic; }

.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.5em; }
.prose li::marker { color: var(--accent); }
.prose ul { list-style: square; }
.prose li > ul, .prose li > ol { margin-top: 0.5em; }

.prose blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 1.1rem 1.35rem;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--fg-2);
  font-style: italic;
}
.prose blockquote > * + * { margin-top: 0.8em; }

.prose img {
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-md);
  background: var(--bg-raise);
  margin-inline: auto;
}

.prose figure > figcaption,
.prose img + em {
  display: block;
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.04em;
  color: var(--fg-3);
  text-align: center;
}

.prose hr {
  margin-block: 2.6em;
  border-top: var(--hair) solid var(--rule);
}

.prose kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.15em 0.45em;
  border: var(--hair) solid var(--rule-strong);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  background: var(--bg-raise);
}

/* Tables — always scrollable inside their own container */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-md);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
  min-width: 30rem;
}
.prose th, .prose td {
  padding: 0.7rem 0.95rem;
  text-align: left;
  border-bottom: var(--hair) solid var(--rule);
  vertical-align: top;
}
.prose thead th {
  background: var(--bg-sunk);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fg-2);
  white-space: nowrap;
}
.prose tbody tr:last-child td { border-bottom: 0; }

/* Footnotes */
.prose .footnotes {
  margin-top: 3em;
  padding-top: 1.5em;
  border-top: var(--hair) solid var(--rule);
  font-size: var(--step--1);
  color: var(--fg-2);
}

/* Article footer ----------------------------------------------------------- */

.post-foot {
  max-width: var(--measure);
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: var(--hair) solid var(--rule-strong);
  display: grid;
  gap: 1.5rem;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }

.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.author-card {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  padding: clamp(1.1rem, 3vw, 1.5rem);
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-md);
  background: var(--bg-raise);
}
.author-card img {
  width: 3.25rem;
  height: 3.25rem;
  flex: none;
  border-radius: 50%;
  border: var(--hair) solid var(--rule-strong);
}
.author-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-1);
  letter-spacing: -0.02em;
}
.author-card p {
  margin-top: 0.3rem;
  font-size: var(--step--1);
  color: var(--fg-2);
  line-height: 1.55;
}

/* Prev / next -------------------------------------------------------------- */

/* auto-fit so a first/last post with only one neighbour fills the row instead
   of leaving a coloured empty cell. */
.post-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: var(--hair);
  background: var(--rule);
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-md);
  overflow: hidden;
}

.post-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: clamp(1rem, 2.5vw, 1.35rem);
  background: var(--bg);
  color: var(--fg);
  min-height: 5rem;
  transition: background var(--dur) var(--ease);
}
.post-nav a:hover { background: var(--accent-soft); }
.post-nav .nav-label {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.post-nav .nav-title {
  font-weight: 620;
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.post-nav .next { text-align: right; align-items: flex-end; }

/* ==========================================================================
   7. CODE & SYNTAX
   ========================================================================== */

/* Inline code */
.prose :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  padding: 0.15em 0.4em;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  border: var(--hair) solid var(--rule);
  color: var(--fg);
  word-break: break-word;
}

/* Block. Only the OUTER wrapper takes the margin — targeting the inner
   `pre.highlight` here would outrank the `.prose pre { margin: 0 }` reset
   below and open a phantom gap under every code-block header bar. */
.prose > div.highlighter-rouge,
.prose > figure.highlight,
.prose > .code-block {
  margin-top: 1.8em;
}

.code-block {
  position: relative;
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-md);
  background: var(--bg-code);
  overflow: hidden;
}

.code-block__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.5rem 0.5rem 0.9rem;
  border-bottom: var(--hair) solid var(--rule);
  background: var(--bg-sunk);
}

.code-block__lang {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  min-height: 2rem;
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  transition: color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              background var(--dur) var(--ease);
}
.code-copy:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.code-copy svg { width: 0.85rem; height: 0.85rem; }
.code-copy[data-copied="true"] { color: var(--accent); border-color: var(--accent); }

/* the <pre> itself */
.prose pre {
  margin: 0;
  padding: clamp(0.9rem, 2.5vw, 1.15rem);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: transparent;
  border: 0;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  line-height: 1.6;
  tab-size: 2;
  color: var(--fg);
}
.prose pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
  white-space: pre;
  word-break: normal;
}

/* bare <pre> not wrapped by JS (no-JS fallback) */
.prose div.highlighter-rouge:not(.code-block__mounted),
.prose > pre:not(.code-block__mounted) {
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-md);
  background: var(--bg-code);
  overflow: hidden;
}

/* --- Rouge tokens (theme-aware via custom properties) --------------------- */

.highlight .c, .highlight .ch, .highlight .cd, .highlight .cm,
.highlight .cpf, .highlight .c1, .highlight .cs { color: var(--syn-comment); font-style: italic; }
.highlight .cp { color: var(--syn-comment); }

.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn,
.highlight .kp, .highlight .kr, .highlight .kv { color: var(--syn-key); }
.highlight .kt { color: var(--syn-type); }

.highlight .o, .highlight .ow { color: var(--syn-op); }
.highlight .p, .highlight .pi { color: var(--syn-punc); }

.highlight .s, .highlight .sa, .highlight .sb, .highlight .sc, .highlight .dl,
.highlight .sd, .highlight .s2, .highlight .sh, .highlight .sx,
.highlight .s1, .highlight .ss { color: var(--syn-str); }
.highlight .se, .highlight .si { color: var(--syn-num); }
.highlight .sr { color: var(--syn-type); }

.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh,
.highlight .mi, .highlight .il, .highlight .mo, .highlight .mx { color: var(--syn-num); }

.highlight .na { color: var(--syn-var); }
.highlight .nb, .highlight .bp { color: var(--syn-type); }
.highlight .nc, .highlight .nn { color: var(--syn-type); }
.highlight .no { color: var(--syn-num); }
.highlight .nd { color: var(--syn-var); }
.highlight .ni, .highlight .ne { color: var(--syn-key); }
.highlight .nf, .highlight .fm { color: var(--syn-fn); }
.highlight .nl { color: var(--syn-var); }
.highlight .nt { color: var(--syn-key); }
.highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi, .highlight .nx { color: var(--syn-var); }
.highlight .n, .highlight .py, .highlight .w { color: inherit; }

.highlight .err { color: var(--syn-err); }
.highlight .gd { color: var(--syn-err); }
.highlight .gi { color: var(--syn-str); }
.highlight .ge { font-style: italic; }
.highlight .gs { font-weight: 700; }
.highlight .gh, .highlight .gu { color: var(--syn-fn); font-weight: 700; }
.highlight .gp { color: var(--syn-comment); }
.highlight .gr, .highlight .gt { color: var(--syn-err); }
.highlight .gl { color: var(--syn-comment); }

/* ==========================================================================
   8. PAGINATION · FOOTER · 404
   ========================================================================== */

.pager {
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-top: 1.5rem;
  border-top: var(--hair) solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pager__nums { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.pager a, .pager span.pager__item {
  display: inline-grid;
  place-items: center;
  min-width: 2.6rem;
  min-height: 2.6rem;
  padding-inline: 0.7rem;
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  color: var(--fg-2);
  transition: color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              background var(--dur) var(--ease);
}
.pager a:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.pager [aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.pager .is-disabled { opacity: 0.4; }

/* Footer ------------------------------------------------------------------- */

.site-foot {
  margin-top: auto;
  border-top: var(--hair) solid var(--rule-strong);
  background: var(--bg-sunk);
  padding-block: clamp(2.5rem, 6vw, 4rem) calc(clamp(1.5rem, 4vw, 2.5rem) + env(safe-area-inset-bottom));
}

.foot-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3rem);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 720px) {
  .foot-grid { grid-template-columns: 1.5fr 1fr 1fr; }
}

.foot-blurb {
  margin-top: 0.9rem;
  max-width: 34ch;
  font-size: var(--step--1);
  color: var(--fg-2);
  line-height: 1.6;
}

.foot-col h2 {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 0.9rem;
}
.foot-col ul { list-style: none; padding: 0; display: grid; gap: 0.15rem; }
.foot-col a {
  display: inline-block;
  padding-block: 0.4rem;
  font-size: var(--step--1);
  color: var(--fg-2);
  transition: color var(--dur) var(--ease);
}
.foot-col a:hover { color: var(--accent); }

.foot-social { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.foot-social a {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-sm);
  color: var(--fg-2);
  transition: color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              background var(--dur) var(--ease);
}
.foot-social a:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.foot-social svg { width: 1.05rem; height: 1.05rem; }

.foot-base {
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-top: 1.25rem;
  border-top: var(--hair) solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.06em;
  color: var(--fg-3);
}

/* 404 ---------------------------------------------------------------------- */

.notfound {
  padding-block: clamp(3rem, 10vw, 7rem);
  text-align: center;
}
.notfound__code {
  font-family: var(--font-display);
  font-size: var(--step-5);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--accent);
}

/* Simple page -------------------------------------------------------------- */

.page-head {
  padding-block: clamp(2.5rem, 6vw, 4rem) clamp(1.25rem, 3vw, 2rem);
  border-bottom: var(--hair) solid var(--rule);
}
.page-title {
  margin-top: clamp(0.75rem, 2vw, 1.15rem);
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
  max-width: 18ch;
}
.page-lede {
  margin-top: clamp(1rem, 2.5vw, 1.4rem);
  max-width: 58ch;
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--fg-2);
  text-wrap: pretty;
}

/* ==========================================================================
   9. MOTION · PRINT · A11Y
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: more) {
  :root { --rule: currentColor; --rule-strong: currentColor; }
}

@media print {
  .masthead, .site-foot, .toc, .post-nav, .pager,
  .reading-bar, .share, .skip-link, .code-copy { display: none !important; }
  body { background: #fff; color: #000; }
  .prose { max-width: none; }
  .prose a::after { content: " (" attr(href) ")"; font-size: 0.85em; word-break: break-all; }
  .code-block { border: 1px solid #bbb; }
}
