/* clearcontext — warm paper editorial system. See DESIGN.md for tokens. */

:root {
  /* Warm paper palette */
  --paper: #F5EFE6;
  --paper-2: #EFE7DA;
  --ink: #1C1917;
  --ink-2: #2B2723;
  --muted: #7A7268;
  --rule: #D9CFBF;
  --accent: #B2432A;        /* rust */
  --accent-ink: #B05A48;

  /* Code-block frame — mode-aware. Overridden in the dark-mode block below. */
  --code-bg: #E3D9C6;       /* deeper paper for clear contrast vs body */
  --code-ink: #1C1917;
  --code-border: transparent;
  --code-muted: rgba(28,25,23,0.52);
  --code-accent: #B2432A;
  --code-ok: #4F6D3A;

  /* Type */
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --sans: "IBM Plex Sans", -apple-system, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

/* ---------- Nav ---------- */
.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px 48px;
  border-bottom: 1px solid var(--rule);
}
.nav-brand {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-brand .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  transform: translateY(-2px);
}
.nav-links {
  display: flex;
  gap: 28px;
  justify-content: center;
  font-size: 13px;
  font-family: var(--sans);
  letter-spacing: 0.02em;
}
.nav-links a {
  color: var(--ink-2);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: border-color .15s;
}
.nav-links a:hover { border-color: var(--ink); }
.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--paper-2);
  border-radius: 2px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  min-width: 180px;
  justify-self: end;
}
.nav-search span {
  min-width: 0;
}
.nav-search svg { opacity: .6; }
.nav-search kbd {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--rule);
  padding: 1px 5px;
  border-radius: 2px;
  background: var(--paper);
}

/* ---------- Meta bits ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow .accent { color: var(--accent); }
.dot-sep { margin: 0 8px; color: var(--rule); }
.byline {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ---------- Hero shared ---------- */
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin: 0;
}
.hero-deck {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  color: var(--ink-2);
  line-height: 1.35;
  letter-spacing: -0.005em;
}

/* ---------- Placeholder screenshot (striped) ---------- */
.shot {
  position: relative;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(28,25,23,0.04) 0 1px,
      transparent 1px 8px
    ),
    linear-gradient(180deg, #1A1714 0%, #0F0D0B 100%);
  color: #E8DFD1;
  overflow: hidden;
  border-radius: 2px;
}
.shot.light {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(28,25,23,0.06) 0 1px,
      transparent 1px 8px
    ),
    linear-gradient(180deg, #E9DFCE 0%, #D9CCB4 100%);
  color: var(--ink-2);
}
.shot-terminal {
  position: absolute;
  inset: 0;
  padding: 28px 32px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.shot-terminal .prompt { color: #C89A6B; }
.shot-terminal .cmd { color: #E8DFD1; }
.shot-terminal .comment { color: #6B655C; }
.shot-terminal .warn { color: #D97948; }
.shot-terminal .ok { color: #7FA06B; }
.shot-label {
  position: absolute;
  left: 16px; bottom: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(232, 223, 209, 0.5);
}
.shot.light .shot-label { color: rgba(28,25,23,0.5); }

/* ---------- Article grid (shared, magazine-asymmetric) ---------- */
.grid-section {
  padding: 72px 48px 96px;
  border-top: 1px solid var(--rule);
  margin-top: 40px;
}
.grid-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 40px;
}
.grid-section-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0;
}
.grid-section-head .see-all {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
}

/* Centered head: title sits on the viewport centerline, Archive link tucks below. */
.grid-section--centered .grid-section-head {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.mag-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 40px 32px;
}

/* 2x2 variant: four equal slots regardless of which span classes are present.
   Used by the "More writing" home shelf where slots are uniform.
   Cards are sized ~2/3 of the full column width and the grid centers as a block
   so they stay close together rather than spreading edge-to-edge. */
.mag-grid--2x2 {
  --more-card-w: clamp(220px, 28vw, 360px);
  grid-template-columns: repeat(2, var(--more-card-w));
  justify-content: center;
  gap: 40px 28px;
}
.mag-grid--2x2 > .card { grid-column: auto; }
.mag-grid--2x2 .card .shot { aspect-ratio: 16/10; }

/* Editorial empty slot — paper-toned scaffold, no shimmer, no animation. */
.card-empty { cursor: default; }
.shot-empty {
  width: 100%;
  aspect-ratio: 16/10;
  position: relative;
  background:
    repeating-linear-gradient(
      135deg,
      transparent 0 14px,
      rgba(217, 207, 191, 0.18) 14px 15px
    ),
    var(--paper-2);
  border: 1px dashed var(--rule);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 14px 16px;
}
.shot-empty-mark {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  opacity: 0.65;
}
.eyebrow-empty {
  color: var(--muted);
  opacity: 0.75;
}
.card-empty-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.012em;
  line-height: 1.15;
  color: var(--muted);
  margin: 4px 0 2px;
  opacity: 0.55;
}
.card-empty-deck {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  opacity: 0.7;
}

/* More list: brand-dot rows under the 2x2, centered to match the grid above. */
.more-list {
  margin: 56px auto 0;
  max-width: 760px;
  display: flex;
  flex-direction: column;
}
.more-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 14px;
  padding: 16px 4px;
  border-top: 1px solid var(--rule);
  color: inherit;
  text-decoration: none;
}
.more-list .more-row:last-child { border-bottom: 1px solid var(--rule); }
.more-row-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  transform: translateY(-1px);
  flex-shrink: 0;
}
.more-row-title {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: -0.005em;
  line-height: 1.3;
  color: var(--ink);
}
.more-row-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
a.more-row:hover .more-row-title { color: var(--accent-ink); transition: color 0.15s ease; }

.more-row-empty .more-row-dot { background: var(--rule); }
.more-row-empty .more-row-title { color: var(--muted); opacity: 0.55; }
.more-row-empty .more-row-meta { opacity: 0.55; }
.card { display: flex; flex-direction: column; gap: 12px; }
.card .shot { width: 100%; aspect-ratio: 16/10; }
.card h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.15;
  margin: 4px 0 2px;
}
.card p {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
  margin: 0;
}

/* Spans for asymmetric rhythm */
.c-full { grid-column: 1 / -1; }
.card.c-full .shot { aspect-ratio: 21/9; }
.card.c-full h3,
.card.c-full p { max-width: 56ch; }
.c-1of2 { grid-column: span 6; }
.c-5of12 { grid-column: span 5; }
.c-7of12 { grid-column: span 7; }
.c-1of3 { grid-column: span 4; }
.c-1of4 { grid-column: span 3; }
.c-2of3 { grid-column: span 8; }

.card.featured h3 { font-size: 32px; }
.card.large h3 { font-size: 26px; }
.card.medium h3 { font-size: 20px; }
.card.small h3 { font-size: 17px; }
.card.small .shot { aspect-ratio: 4/3; }

/* List row (no image) for secondary items */
.row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}
.row:last-child { border-bottom: 1px solid var(--rule); }
.row .num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.row h4 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  margin: 0 0 4px;
  letter-spacing: -0.005em;
}
.row .meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Footer ---------- */
.foot {
  padding: 48px 48px 56px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.foot .foot-brand {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
}
.foot ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 24px; }

/* ---------- Hero variant A: full-bleed, title centered overlay ---------- */
.heroA {
  position: relative;
  height: 620px;
  margin: 0;
  overflow: hidden;
}
.heroA .shot { position: absolute; inset: 0; border-radius: 0; }
.heroA .scrim {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(15,13,11,0.1) 0%, rgba(15,13,11,0.55) 100%);
}
.heroA-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 48px;
  color: #F5EFE6;
}
.heroA-content .eyebrow { color: rgba(245,239,230,0.75); margin-bottom: 24px; }
.heroA-content .eyebrow .accent { color: #E89B7A; }
.heroA-content .hero-title {
  font-size: 76px;
  max-width: 960px;
  color: #F5EFE6;
}
.heroA-content .hero-deck {
  margin-top: 20px;
  max-width: 640px;
  font-size: 19px;
  color: rgba(245,239,230,0.82);
}
.heroA-content .byline {
  margin-top: 28px;
  color: rgba(245,239,230,0.6);
}

/* ---------- Hero A1: Letterbox bars ---------- */
.heroA1 {
  position: relative;
  height: 620px;
  overflow: hidden;
  background: #0F0D0B;
}
.heroA1-imgwrap {
  position: absolute;
  left: 0; right: 0;
  top: 150px; bottom: 150px;
  overflow: hidden;
}
.heroA1-imgwrap .shot { position: absolute; inset: 0; border-radius: 0; }
.heroA1-top, .heroA1-bot {
  position: absolute;
  left: 0; right: 0;
  height: 150px;
  background: #0F0D0B;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 48px;
  color: #F5EFE6;
  z-index: 2;
}
.heroA1-top { top: 0; align-items: flex-end; padding-bottom: 22px; }
.heroA1-bot { bottom: 0; align-items: flex-start; padding-top: 22px; flex-direction: column; gap: 10px; }
.heroA1 .hero-title {
  font-size: 56px;
  color: #F5EFE6;
  text-align: center;
  max-width: 1040px;
  line-height: 1.05;
}
.heroA1 .eyebrow { color: rgba(245,239,230,0.75); }
.heroA1 .eyebrow .accent { color: #E89B7A; }
.heroA1 .hero-deck { color: rgba(245,239,230,0.82); font-size: 16px; text-align: center; max-width: 680px; }
.heroA1 .byline { color: rgba(245,239,230,0.55); }

/* ---------- Hero A2: Title card inset (plaque) ---------- */
.heroA2 {
  position: relative;
  height: 620px;
  overflow: hidden;
}
.heroA2 .shot { position: absolute; inset: 0; border-radius: 0; }
.heroA2 .scrim {
  position: absolute; inset: 0;
  background: rgba(15,13,11,0.35);
}
.heroA2-plaque {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #0F0D0B;
  color: #F5EFE6;
  padding: 40px 56px 36px;
  max-width: 860px;
  text-align: center;
  border: 1px solid rgba(245,239,230,0.08);
}
.heroA2-plaque .eyebrow { color: rgba(245,239,230,0.7); margin-bottom: 18px; }
.heroA2-plaque .eyebrow .accent { color: #E89B7A; }
.heroA2-plaque .hero-title {
  font-size: 52px;
  color: #F5EFE6;
  max-width: 760px;
  line-height: 1.05;
}
.heroA2-plaque .hero-deck {
  margin-top: 18px;
  font-size: 16px;
  color: rgba(245,239,230,0.82);
  max-width: 620px;
  margin-left: auto; margin-right: auto;
}
.heroA2-plaque .byline { margin-top: 22px; color: rgba(245,239,230,0.55); }

/* ---------- Hero A3: Localized darken + blur under title ---------- */
.heroA3 {
  position: relative;
  height: 620px;
  overflow: hidden;
}
.heroA3 .shot { position: absolute; inset: 0; border-radius: 0; }
.heroA3 .scrim {
  position: absolute; inset: 0;
  background: radial-gradient(
    ellipse 70% 55% at center,
    rgba(15,13,11,0.85) 0%,
    rgba(15,13,11,0.55) 40%,
    rgba(15,13,11,0.3) 100%
  );
}
.heroA3-blur {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 1000px;
  height: 360px;
  backdrop-filter: blur(14px) brightness(0.55);
  -webkit-backdrop-filter: blur(14px) brightness(0.55);
  border-radius: 2px;
  mask-image: radial-gradient(ellipse 60% 55% at center, black 40%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at center, black 40%, transparent 90%);
}
.heroA3-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 48px;
  color: #F5EFE6;
  z-index: 2;
}
.heroA3-content .eyebrow { color: rgba(245,239,230,0.8); margin-bottom: 22px; }
.heroA3-content .eyebrow .accent { color: #E89B7A; }
.heroA3-content .hero-title {
  font-size: 66px;
  max-width: 920px;
  color: #F5EFE6;
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
.heroA3-content .hero-deck {
  margin-top: 18px;
  font-size: 17px;
  max-width: 620px;
  color: rgba(245,239,230,0.9);
}
.heroA3-content .byline { margin-top: 24px; color: rgba(245,239,230,0.65); }

/* ---------- Hero A4: Bottom-anchored with gradient floor ---------- */
.heroA4 {
  position: relative;
  height: 640px;
  overflow: hidden;
}
.heroA4 .shot { position: absolute; inset: 0; border-radius: 0; }
.heroA4 .scrim {
  position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15,13,11,0.05) 0%,
    rgba(15,13,11,0.15) 45%,
    rgba(15,13,11,0.85) 85%,
    rgba(15,13,11,0.95) 100%
  );
}
.heroA4-content {
  position: absolute;
  left: 48px; right: 48px;
  bottom: 44px;
  color: #F5EFE6;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.heroA4-content .eyebrow { color: rgba(245,239,230,0.8); margin-bottom: 18px; }
.heroA4-content .eyebrow .accent { color: #E89B7A; }
.heroA4-content .hero-title {
  font-size: 58px;
  max-width: 1000px;
  color: #F5EFE6;
  line-height: 1.05;
}
.heroA4-content .hero-deck {
  margin-top: 16px;
  font-size: 16px;
  max-width: 640px;
  color: rgba(245,239,230,0.85);
}
.heroA4-content .byline { margin-top: 20px; color: rgba(245,239,230,0.6); }

/* ---------- Hero variant B: bottom-left caption over image ---------- */
.heroB {
  padding: 0 48px;
  margin-top: 40px;
}
.heroB-frame {
  position: relative;
  height: 560px;
  border-radius: 2px;
  overflow: hidden;
}
.heroB-frame .shot { position: absolute; inset: 0; }
.heroB-frame .scrim {
  position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15,13,11,0) 40%,
    rgba(15,13,11,0.75) 100%
  );
}
.heroB-content {
  position: absolute;
  left: 40px;
  right: 40px;
  bottom: 36px;
  color: #F5EFE6;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: end;
}
.heroB-content .eyebrow { color: rgba(245,239,230,0.75); margin-bottom: 14px; }
.heroB-content .eyebrow .accent { color: #E89B7A; }
.heroB-content .hero-title {
  font-size: 56px;
  color: #F5EFE6;
  max-width: 720px;
}
.heroB-content .hero-deck {
  font-size: 16px;
  color: rgba(245,239,230,0.85);
  padding-bottom: 6px;
}
.heroB-content .byline {
  margin-top: 14px;
  color: rgba(245,239,230,0.6);
}

/* ---------- Hero variant C: split — image left, text right ---------- */
.heroC {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  min-height: 620px;
  border-bottom: 1px solid var(--rule);
}
.heroC-image {
  position: relative;
  min-height: 620px;
}
.heroC-image .shot { position: absolute; inset: 0; border-radius: 0; }
.heroC-text {
  padding: 80px 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--paper);
}
.heroC-text .eyebrow { margin-bottom: 28px; }
.heroC-text .hero-title {
  font-size: 58px;
  max-width: 560px;
}
.heroC-text .hero-deck {
  margin-top: 28px;
  font-size: 19px;
  max-width: 520px;
  color: var(--ink-2);
  font-style: normal;
  font-family: var(--sans);
  font-weight: 400;
}
.heroC-text .cta-row {
  margin-top: 44px;
  display: flex;
  align-items: center;
  gap: 24px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.heroC-text .cta {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 3px;
}
.heroC-text .byline { margin-top: 40px; }

/* ---------- Hero Split: contained 1100, image-left 3:2, text-right ---------- */
.hero-split {
  padding: 40px 32px 24px;
}
.hero-split-inner {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 56px;
  max-width: 1560px;
  margin: 0 auto;
  align-items: start;
  color: inherit;
  text-decoration: none;
}
.hero-split-shot {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 2px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  box-shadow: 0 24px 48px -32px rgba(28, 25, 23, 0.25);
}
.hero-split-shot .shot {
  position: absolute;
  inset: 0;
  border-radius: 0;
}
.hero-split-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-split-text {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.hero-split-title {
  font-size: clamp(38px, 4.3vw, 58px);
  margin: 0;
  color: var(--accent-ink);
}
.hero-split-deck {
  font-size: 22px;
  margin: 0;
}
.hero-split-byline {
  padding-top: 8px;
}
a.hero-split-inner:hover .hero-split-title {
  color: var(--accent-ink);
  transition: color 0.15s ease;
}

.hero-split-large .hero-split-inner {
  grid-template-columns: minmax(0, 800px) 1fr;
  max-width: 1400px;
}
.hero-split-large .hero-split-title {
  font-size: clamp(40px, 4.2vw, 56px);
}
.hero-split-large .hero-split-deck {
  font-size: 19px;
}

.hero-split-stack .hero-split-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: none;
  gap: 40px;
}
.hero-split-stack .hero-split-text {
  order: 0;
  width: 100%;
  max-width: 760px;
  text-align: center;
  align-items: center;
  padding: 0 32px;
}
.hero-split-stack .hero-split-shot {
  order: 1;
  width: 100%;
  max-width: 1300px;
}
.hero-split-stack .hero-split-byline {
  padding-top: 16px;
}

@media (max-width: 980px) {
  .hero-split { padding: 24px 24px 32px; }
  .hero-split-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: none;
  }
  .hero-split-shot {
    aspect-ratio: 16 / 10;
    min-height: 220px;
    max-height: 520px;
    border-radius: 2px;
    box-shadow: 0 12px 28px -22px rgba(28, 25, 23, 0.2);
  }
  .hero-split-shot img,
  .hero-split-shot .shot {
    object-fit: cover;
  }
  .hero-split-text {
    padding: 0;
  }
  .hero-split-title { font-size: 30px; }
  .hero-split-deck { font-size: 16px; }
}

/* ---------- Placeholder variants ---------- */

/* App UI mock */
.shot.app-ui {
  background: #1A1714;
  color: #E8DFD1;
  display: flex;
  flex-direction: column;
}
.app-ui-chrome {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: #141210;
  border-bottom: 1px solid rgba(232,223,209,0.08);
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(232,223,209,0.5);
}
.app-ui-chrome .tl { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.app-ui-chrome .tl.r { background: #D97948; }
.app-ui-chrome .tl.y { background: #C89A6B; }
.app-ui-chrome .tl.g { background: #7FA06B; }
.app-ui-chrome .app-ui-title { margin-left: 14px; }
.app-ui-body {
  flex: 1; display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 0;
}
.app-ui-side {
  padding: 16px 14px;
  font-family: var(--mono);
  font-size: 11px;
  border-right: 1px solid rgba(232,223,209,0.06);
  display: flex; flex-direction: column; gap: 5px;
}
.app-ui-side .s-item {
  padding: 5px 8px;
  color: rgba(232,223,209,0.65);
  border-radius: 2px;
}
.app-ui-side .s-item.active {
  background: rgba(232,223,209,0.06);
  color: #E8DFD1;
}
.app-ui-side .s-sect {
  margin-top: 18px; margin-bottom: 4px;
  font-size: 9px; letter-spacing: 0.16em;
  color: rgba(232,223,209,0.35);
}
.app-ui-main {
  padding: 22px 28px;
  display: flex; flex-direction: column; gap: 16px;
  min-height: 0;
}
.app-ui-preview {
  flex: 1;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 0;
}
.preview-frame {
  flex: 1;
  background:
    repeating-linear-gradient(135deg, rgba(232,223,209,0.06) 0 1px, transparent 1px 10px),
    linear-gradient(180deg, #2A2521 0%, #1A1714 100%);
  border-radius: 2px;
  border: 1px solid rgba(232,223,209,0.06);
  min-height: 0;
}
.preview-scrub {
  height: 22px;
  background: rgba(232,223,209,0.06);
  border-radius: 2px;
  position: relative;
}
.scrub-handle {
  position: absolute;
  left: 38%;
  top: 50%; transform: translateY(-50%);
  width: 3px; height: 14px;
  background: #E89B7A;
}
.app-ui-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  font-family: var(--mono);
  font-size: 11px;
  padding-top: 8px;
  border-top: 1px solid rgba(232,223,209,0.06);
}
.app-ui-stats .stat-k {
  display: block;
  font-size: 9px; letter-spacing: 0.16em;
  color: rgba(232,223,209,0.45);
  margin-bottom: 4px;
}
.app-ui-stats .stat-v { color: #E8DFD1; font-size: 12px; }

/* Photo placeholder — warm stripe + grain */
.shot.photo {
  background:
    radial-gradient(ellipse at 30% 30%, #5A4A3C 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, #2A1F18 0%, transparent 60%),
    linear-gradient(140deg, #3C2F25 0%, #1A120D 100%);
}
.photo-grain {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(135deg, rgba(255,240,220,0.04) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(45deg, rgba(0,0,0,0.06) 0 1px, transparent 1px 3px);
}
.photo-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.45) 100%);
}

/* Abstract / art placeholder */
.shot.art {
  background: #E9DFCE;
  overflow: hidden;
}
.shot.art .art-bg {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(28,25,23,0.04) 0 1px,
    transparent 1px 14px
  );
}
.shot.art .art-disc {
  position: absolute;
  border-radius: 50%;
}
.shot.art .art-disc.a {
  width: 62%;
  aspect-ratio: 1;
  right: -10%;
  top: -15%;
  background: #B2432A;
  mix-blend-mode: multiply;
}
.shot.art .art-disc.b {
  width: 44%;
  aspect-ratio: 1;
  left: 12%;
  bottom: -20%;
  background: #1C1917;
}
.shot.art .art-bar {
  position: absolute;
  left: 0; right: 0;
  top: 62%;
  height: 2px;
  background: #1C1917;
  opacity: 0.35;
}
.shot.art .shot-label { color: rgba(28,25,23,0.55); }

/* Typographic-only (no image) */
.shot.type-shot {
  background: #EFE7DA;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shot.type-shot .big-glyph {
  font-family: var(--serif);
  font-size: 620px;
  line-height: 0.8;
  color: #1C1917;
  opacity: 0.08;
  font-weight: 400;
  user-select: none;
  transform: translateY(6%);
}
.shot.type-shot .shot-label { color: rgba(28,25,23,0.55); }

/* A3 layered on a light shot needs a stronger light-friendly scrim variant.
   Add a class we can toggle: `.heroA3.light-shot` */
.heroA3.light-shot .scrim {
  background: radial-gradient(
    ellipse 70% 55% at center,
    rgba(15,13,11,0.6) 0%,
    rgba(15,13,11,0.3) 40%,
    rgba(15,13,11,0.15) 100%
  );
}

/* ---------- A3 variants for light-background images ---------- */

/* Inverted: bright frosted blur, dark text. For light images. */
.heroA3.invert .scrim {
  background: radial-gradient(
    ellipse 70% 55% at center,
    rgba(245,239,230,0.55) 0%,
    rgba(245,239,230,0.25) 45%,
    rgba(245,239,230,0.08) 100%
  );
}
.heroA3.invert .heroA3-blur {
  backdrop-filter: blur(18px) brightness(1.2) saturate(0.7);
  -webkit-backdrop-filter: blur(18px) brightness(1.2) saturate(0.7);
}
.heroA3.invert .heroA3-content { color: var(--ink); }
.heroA3.invert .heroA3-content .hero-title { color: var(--ink); text-shadow: none; }
.heroA3.invert .heroA3-content .eyebrow { color: var(--muted); }
.heroA3.invert .heroA3-content .eyebrow .accent { color: var(--accent); }
.heroA3.invert .heroA3-content .hero-deck { color: var(--ink-2); }
.heroA3.invert .heroA3-content .byline { color: var(--muted); }

/* Frosted card: neutral warm-paper translucent card, works on any bg. */
.heroA3.frosted .scrim { background: transparent; }
.heroA3.frosted .heroA3-blur {
  width: 1040px; height: 420px;
  background: rgba(245,239,230,0.72);
  backdrop-filter: blur(20px) saturate(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  mask-image: none;
  -webkit-mask-image: none;
  border: 1px solid rgba(28,25,23,0.06);
  box-shadow: 0 2px 24px rgba(28,25,23,0.06);
}
.heroA3.frosted .heroA3-content { color: var(--ink); }
.heroA3.frosted .heroA3-content .hero-title { color: var(--ink); text-shadow: none; }
.heroA3.frosted .heroA3-content .eyebrow { color: var(--muted); }
.heroA3.frosted .heroA3-content .eyebrow .accent { color: var(--accent); }
.heroA3.frosted .heroA3-content .hero-deck { color: var(--ink-2); }
.heroA3.frosted .heroA3-content .byline { color: var(--muted); }

/* Solid plaque: compact, always-legible, drop the blur. */
.heroA3.solid .scrim { background: rgba(15,13,11,0.2); }
.heroA3.solid .heroA3-blur {
  width: 980px; height: 360px;
  background: var(--paper);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  mask-image: none; -webkit-mask-image: none;
  border: 1px solid var(--rule);
  box-shadow: 0 6px 32px rgba(28,25,23,0.1);
}
.heroA3.solid .heroA3-content { color: var(--ink); }
.heroA3.solid .heroA3-content .hero-title { color: var(--ink); text-shadow: none; }
.heroA3.solid .heroA3-content .eyebrow { color: var(--muted); }
.heroA3.solid .heroA3-content .eyebrow .accent { color: var(--accent); }
.heroA3.solid .heroA3-content .hero-deck { color: var(--ink-2); }
.heroA3.solid .heroA3-content .byline { color: var(--muted); }

/* Offset: move the title to a top band so blur-over-image isn't needed. */
.heroA3.offset .scrim { background: transparent; }
.heroA3.offset .heroA3-blur { display: none; }
.heroA3.offset .heroA3-content {
  inset: auto 0 0 0;
  top: auto;
  height: 230px;
  background: #0F0D0B;
  justify-content: center;
  padding: 0 48px;
}
.heroA3.offset { height: 720px; }
.heroA3.offset .heroA3-content .hero-title {
  font-size: 46px;
  text-shadow: none;
  color: #F5EFE6;
}
.heroA3.offset .heroA3-content .hero-deck { color: rgba(245,239,230,0.82); font-size: 15px; }
.heroA3.offset .heroA3-content .eyebrow { color: rgba(245,239,230,0.75); margin-bottom: 14px; }
.heroA3.offset .heroA3-content .byline { color: rgba(245,239,230,0.6); margin-top: 14px; }

/* ---------- Frosted variants (show more image) ---------- */

/* F1: narrow horizontal strip across the middle */
.heroA3.f-strip .scrim { background: transparent; }
.heroA3.f-strip .heroA3-blur {
  width: 100%; left: 0; transform: translate(0, -50%);
  height: 220px;
  background: rgba(245,239,230,0.78);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  mask-image: none; -webkit-mask-image: none;
  border-top: 1px solid rgba(28,25,23,0.08);
  border-bottom: 1px solid rgba(28,25,23,0.08);
  box-shadow: none;
}
.heroA3.f-strip .heroA3-content { color: var(--ink); }
.heroA3.f-strip .heroA3-content .hero-title { color: var(--ink); text-shadow: none; font-size: 52px; }
.heroA3.f-strip .heroA3-content .eyebrow { color: var(--muted); margin-bottom: 14px; }
.heroA3.f-strip .heroA3-content .eyebrow .accent { color: var(--accent); }
.heroA3.f-strip .heroA3-content .hero-deck { color: var(--ink-2); font-size: 15px; }
.heroA3.f-strip .heroA3-content .byline { color: var(--muted); margin-top: 16px; }

/* F2: compact centered card — just big enough */
.heroA3.f-compact .scrim { background: transparent; }
.heroA3.f-compact .heroA3-blur {
  width: 640px; height: 300px;
  background: rgba(245,239,230,0.78);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  mask-image: none; -webkit-mask-image: none;
  border: 1px solid rgba(28,25,23,0.08);
  box-shadow: 0 2px 24px rgba(28,25,23,0.1);
}
.heroA3.f-compact .heroA3-content { color: var(--ink); padding: 0 80px; }
.heroA3.f-compact .heroA3-content .hero-title { color: var(--ink); text-shadow: none; font-size: 38px; max-width: 540px; }
.heroA3.f-compact .heroA3-content .eyebrow { color: var(--muted); margin-bottom: 12px; }
.heroA3.f-compact .heroA3-content .eyebrow .accent { color: var(--accent); }
.heroA3.f-compact .heroA3-content .hero-deck { display: none; }
.heroA3.f-compact .heroA3-content .byline { color: var(--muted); margin-top: 16px; font-size: 10px; }

/* F3: left-third card, image visible on the right */
.heroA3.f-left .scrim { background: transparent; }
.heroA3.f-left .heroA3-blur {
  left: 0; top: 0;
  transform: none;
  width: 46%; height: 100%;
  background: rgba(245,239,230,0.82);
  backdrop-filter: blur(20px) saturate(1.05);
  -webkit-backdrop-filter: blur(20px) saturate(1.05);
  mask-image: none; -webkit-mask-image: none;
  border-right: 1px solid rgba(28,25,23,0.08);
  box-shadow: none;
}
.heroA3.f-left .heroA3-content {
  align-items: flex-start;
  text-align: left;
  padding-left: 64px;
  padding-right: 54%;
}
.heroA3.f-left .heroA3-content .hero-title {
  color: var(--ink); text-shadow: none;
  font-size: 48px;
  max-width: 500px;
}
.heroA3.f-left .heroA3-content .eyebrow { color: var(--muted); }
.heroA3.f-left .heroA3-content .eyebrow .accent { color: var(--accent); }
.heroA3.f-left .heroA3-content .hero-deck {
  color: var(--ink-2);
  font-size: 16px;
  max-width: 440px;
  text-align: left;
}
.heroA3.f-left .heroA3-content .byline { color: var(--muted); }

/* F4: title-only top strip, summary sits on paper below hero */
.heroA3.f-title-only { height: 560px; }
.heroA3.f-title-only .scrim { background: transparent; }
.heroA3.f-title-only .heroA3-blur {
  left: 0;
  top: 0;
  transform: none;
  width: 100%; height: 200px;
  background: rgba(245,239,230,0.78);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  mask-image: none; -webkit-mask-image: none;
  border-bottom: 1px solid rgba(28,25,23,0.08);
  box-shadow: none;
}
.heroA3.f-title-only .heroA3-content {
  inset: 0 0 auto 0;
  height: 200px;
  justify-content: center;
  padding: 0 48px;
  color: var(--ink);
}
.heroA3.f-title-only .heroA3-content .hero-title {
  color: var(--ink); text-shadow: none;
  font-size: 40px;
  max-width: 900px;
  line-height: 1.1;
}
.heroA3.f-title-only .heroA3-content .eyebrow { color: var(--muted); margin-bottom: 10px; }
.heroA3.f-title-only .heroA3-content .eyebrow .accent { color: var(--accent); }
.heroA3.f-title-only .heroA3-content .hero-deck { display: none; }
.heroA3.f-title-only .heroA3-content .byline { display: none; }

/* Companion paper strip below F4 for summary + meta */
.f-title-only-foot {
  padding: 28px 48px 36px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
}
.f-title-only-foot .hero-deck {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--ink-2);
  line-height: 1.4;
  margin: 0;
  max-width: 680px;
}
.f-title-only-foot .byline {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

/* F5: no card — highlighter-style backbar on each text line */
.heroA3.f-nocard .scrim { background: transparent; }
.heroA3.f-nocard .heroA3-blur { display: none; }
.heroA3.f-nocard .heroA3-content { color: var(--ink); }
.heroA3.f-nocard .heroA3-content .eyebrow {
  background: rgba(245,239,230,0.88);
  padding: 4px 10px;
  color: var(--muted);
  margin-bottom: 18px;
  border-radius: 2px;
}
.heroA3.f-nocard .heroA3-content .eyebrow .accent { color: var(--accent); }
.heroA3.f-nocard .heroA3-content .hero-title {
  color: var(--ink);
  text-shadow: none;
  font-size: 58px;
  max-width: 900px;
  line-height: 1.1;
}
.heroA3.f-nocard .heroA3-content .hero-title span.bar {
  background: rgba(245,239,230,0.9);
  padding: 0 12px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.heroA3.f-nocard .heroA3-content .hero-deck {
  background: rgba(245,239,230,0.88);
  padding: 6px 14px;
  color: var(--ink-2);
  margin-top: 22px;
  max-width: 640px;
  border-radius: 2px;
}
.heroA3.f-nocard .heroA3-content .byline {
  background: rgba(245,239,230,0.88);
  padding: 4px 10px;
  color: var(--muted);
  margin-top: 20px;
  border-radius: 2px;
}

/* ---------- Article page ---------- */

.article-page { background: var(--paper); color: var(--ink); min-height: 100%; }

/* Article hero — compact, paper-on-paper, no image.
   Differentiates arrival from the dark full-bleed home hero. The terminal
   shot moves into the body as the lead figure. */
.article-hero-compact {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 96px 32px 56px;
}
.article-hero-compact-inner {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}
.article-hero-compact .eyebrow {
  color: var(--muted);
  margin-bottom: 24px;
  text-align: center;
}
.article-hero-compact .eyebrow .accent { color: var(--accent); }
.article-hero-compact .article-title {
  font-family: var(--serif);
  font-size: 52px;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 auto 28px;
  max-width: 22ch;
  text-wrap: balance;
}
.article-hero-compact .byline {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* When a lead figure is the first child, tighten the body's top padding so
   the figure reads as part of the hero region rather than floating in space. */
.article-body:has(> .article-lead-fig:first-child) {
  padding-top: 32px;
}
.article-body > .article-lead-fig:first-child {
  margin-top: 0;
  margin-bottom: 32px;
}

/* =======================================================================
   ARTICLE BODY — long-form editorial typography
   Set in Source Serif, 19/1.7, measure ~65ch, 8px rhythm.
   ======================================================================= */
.article-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 80px 32px 24px;
  counter-reset: section;
  font-family: var(--serif);
  color: var(--ink);
}
.article-body-repo {
  /* No top padding: the first H2 brings its own 64px margin + 32px padding,
     and the meta strip above sits with its own margin. Adding more here
     stacks dead whitespace between the meta strip and the first section. */
  padding-top: 0;
}

/* Lede — the first paragraph, larger, no drop cap */
.article-body .article-lede {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.42;
  letter-spacing: -0.008em;
  color: var(--ink);
  margin: 0 0 40px;
  font-weight: 400;
  text-wrap: pretty;
}

/* Body paragraphs — serif, generous measure */
.article-body p {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 24px;
  text-wrap: pretty;
  hanging-punctuation: first last;
}

/* Drop cap on the first paragraph after the lede */
.article-body > .article-lede + p::first-letter {
  font-family: var(--serif);
  float: left;
  font-size: 72px;
  line-height: 0.85;
  font-weight: 500;
  color: var(--ink);
  margin: 8px 10px 0 -2px;
  padding: 0;
}

/* Section headings — thin rule + auto-numbered overline + title */
.article-body h2 {
  counter-increment: section;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin: 64px 0 20px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  text-wrap: balance;
  position: relative;
}
.article-body h2::before {
  content: counter(section, upper-roman);
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.article-body h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 40px 0 12px;
  text-wrap: balance;
}

/* Pull-quote — centered, oversized, no border accent.
   Use <blockquote class="pullquote"> for the big treatment. */
.article-body blockquote {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.4;
  font-style: italic;
  color: var(--ink);
  margin: 40px 0;
  padding-left: 24px;
  border-left: 2px solid var(--accent);
  text-wrap: pretty;
}
.article-body blockquote.pullquote {
  text-align: center;
  font-size: 30px;
  line-height: 1.28;
  letter-spacing: -0.015em;
  font-style: normal;
  color: var(--ink);
  margin: 56px -48px;
  padding: 0 24px;
  border: 0;
  max-width: none;
  position: relative;
}
.article-body blockquote.pullquote::before,
.article-body blockquote.pullquote::after {
  content: "";
  display: block;
  width: 48px;
  height: 1px;
  background: var(--accent);
  margin: 0 auto;
}
.article-body blockquote.pullquote::before { margin-bottom: 28px; }
.article-body blockquote.pullquote::after { margin-top: 28px; }
.article-body blockquote.pullquote cite {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-style: normal;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 20px;
}

/* Inline emphasis */
.article-body em { font-style: italic; }
.article-body strong { font-weight: 600; color: var(--ink); }

/* Links — no border-bottom hack, use text-decoration with offset */
.article-body a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-thickness 0.12s ease;
}
.article-body a:hover {
  text-decoration-thickness: 2px;
  color: var(--accent);
}

/* Inline code — one step darker than the code-block frame in light mode so
   the chip reads as a distinct token against the body AND against
   surrounding code blocks. Dark-mode override lives in the dark block. */
.article-body code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: #E2DDC4;
  padding: 2px 7px;
  border-radius: 3px;
  color: var(--ink);
  white-space: nowrap;
}
.article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  white-space: pre;
  font-size: inherit;
}

/* Code blocks — framed, mode-aware via --code-* tokens */
.article-body pre {
  background: var(--code-bg);
  color: var(--code-ink);
  border: 1px solid var(--code-border);
  padding: 22px 24px;
  border-radius: 3px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  margin: 32px -32px;
  max-width: none;
}
.article-body pre .c-muted { color: var(--code-muted); }
.article-body pre .c-accent { color: var(--code-accent); }
.article-body pre .c-ok { color: var(--code-ok); }

/* Inline images / <picture> blocks — fit the column, breathe, never overflow.
   READMEs commonly ship large screenshots without width/height attributes;
   without this rule a 1600px screenshot would blow out the 616px column. */
.article-body img,
.article-body picture {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 40px auto;
  border-radius: 3px;
}
.article-body picture img { margin: 0; }
.article-body ul,
.article-body ol {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 24px;
  padding-left: 0;
  list-style: none;
}
.article-body ul li,
.article-body ol li {
  margin-bottom: 10px;
  padding-left: 28px;
  position: relative;
  text-wrap: pretty;
}
.article-body ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 500;
}
.article-body ol {
  counter-reset: li;
}
.article-body ol li {
  counter-increment: li;
}
.article-body ol li::before {
  content: counter(li) ".";
  position: absolute;
  left: 0;
  width: 24px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  top: 4px;
}

/* Horizontal rule — asterism */
.article-body hr {
  border: 0;
  text-align: center;
  margin: 48px 0;
  overflow: visible;
}
.article-body hr::before {
  content: "⁂";
  font-size: 20px;
  color: var(--muted);
  letter-spacing: 0.5em;
  padding-left: 0.5em;
}

/* Figures — inline figures stay at measure; .wide breaks out */
.article-fig {
  margin: 40px -32px;
  position: relative;
}
.article-fig.wide {
  margin: 48px calc(-1 * (100vw - 680px) / 2 + 80px);
  margin-left: -120px;
  margin-right: -120px;
}
.article-fig .shot {
  aspect-ratio: 16/9;
  width: 100%;
}
.article-fig figcaption {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
  max-width: 54ch;
  margin-left: auto;
  margin-right: auto;
  text-wrap: balance;
}

/* "Aside" callout — smaller serif block, left-indented, muted */
.article-aside {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  font-style: italic;
  margin: 32px 0;
  padding: 0 32px;
  border-left: 2px solid var(--rule);
}
.article-aside::before {
  content: "Aside";
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-style: normal;
  margin-bottom: 8px;
}

/* Article meta strip under hero.
   No bottom border — the first H2's own ::before rule does the dividing
   work, so adding one here just stacks two rules with dead space between. */
.article-meta-strip {
  max-width: 720px;
  margin: 48px auto 0;
  padding: 24px 32px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.article-meta-strip .share { display: flex; gap: 16px; }
.article-meta-strip .share a { color: var(--muted); }
.article-meta-strip .share a:hover { color: var(--ink); }
.article-repo-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.article-chip {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-2);
}
.article-chip-link { color: var(--accent); border-color: var(--accent); }
.article-chip-link:hover { background: var(--accent); color: var(--paper); }
.article-updated { font-size: 10px; color: var(--muted); }

/* End-of-article author card */
.author-card {
  max-width: 720px;
  margin: 56px auto 0;
  padding: 32px;
  background: var(--paper-2);
  border-radius: 2px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 22px;
  align-items: center;
}
.author-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background:
    repeating-linear-gradient(135deg, rgba(28,25,23,0.08) 0 1px, transparent 1px 6px),
    linear-gradient(135deg, var(--accent), var(--ink));
}
.author-card h4 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18px;
  margin: 0 0 4px;
}
.author-card p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
}

/* Next-up row on the article page */
.next-up {
  max-width: 1080px;
  margin: 96px auto 0;
  padding: 0 32px;
}
.next-up h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  margin: 0 0 32px;
  letter-spacing: -0.01em;
}
.next-up-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
.related-reading-topics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-bottom: 24px;
}
.related-reading-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.related-reading .tag-strip {
  padding-bottom: 0;
}
.related-card {
  min-height: 100%;
  padding: 24px;
  border: 1px solid var(--rule);
  background: linear-gradient(180deg, color-mix(in oklab, var(--paper) 96%, white), var(--paper));
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.related-card:hover {
  border-color: var(--ink);
  background: var(--paper-2);
  transform: translateY(-2px);
}
.related-card .eyebrow {
  margin-bottom: 2px;
}
.related-card h3,
.related-card p {
  margin: 0;
}
.page {
  background: var(--paper);
  color: var(--ink);
  min-height: 100%;
}


/* =======================================================================
   ABOUT page
   ======================================================================= */
.about-page { min-height: 100%; }
.about-hero {
  max-width: 980px;
  margin: 0 auto;
  padding: 96px 32px 64px;
  text-align: left;
}
.about-hero .eyebrow { margin-bottom: 24px; }
.about-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 64px;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  max-width: 14ch;
  text-wrap: balance;
}
.about-deck {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 58ch;
  margin: 0;
}

.about-body {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 32px 32px;
  border-top: 1px solid var(--rule);
}
.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 64px;
  padding-top: 48px;
}
.about-portrait {
  position: sticky;
  top: 48px;
  align-self: start;
}
.portrait {
  width: 240px;
  height: 300px;
  background:
    linear-gradient(135deg, var(--accent) 0%, var(--paper-2) 70%),
    var(--paper-2);
  border: 1px solid var(--rule);
  position: relative;
  display: block;
  object-fit: cover;
}
.portrait::after {
  content: "portrait";
  position: absolute;
  bottom: 10px; left: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
  mix-blend-mode: difference;
}
.portrait-caption {
  margin-top: 16px;
}
.portrait-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}
.portrait-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 4px;
}
.about-copy h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}
.about-copy h2:not(:first-child) { margin-top: 40px; }
.about-copy p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  margin: 0;
  color: var(--ink-2);
  max-width: 62ch;
}
.about-copy a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.about-credentials {
  max-width: 1080px;
  margin: 32px auto 0;
  padding: 40px 32px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.credentials-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.cred-k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.cred-v {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
}


/* =======================================================================
   LEGAL pages
   ======================================================================= */
.legal-page { min-height: 100%; }
.legal-head {
  max-width: 1080px;
  margin: 0 auto;
  padding: 96px 32px 48px;
}
.legal-head .eyebrow { margin-bottom: 24px; }
.legal-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 64px;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  max-width: 12ch;
  text-wrap: balance;
}
.legal-deck {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 58ch;
  margin: 0;
}
.legal-body {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px 96px;
  border-top: 1px solid var(--rule);
}
.legal-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 64px;
  padding-top: 48px;
}
.legal-meta {
  position: sticky;
  top: 48px;
  align-self: start;
  display: grid;
  gap: 16px;
}
.legal-meta-card {
  padding: 18px 18px 20px;
  border: 1px solid var(--rule);
  background: color-mix(in oklab, var(--paper-2) 52%, white);
}
.legal-meta-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.legal-meta-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
}
.legal-copy {
  display: grid;
  gap: 36px;
}
.legal-section {
  max-width: 62ch;
}
.legal-section h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.legal-section p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.68;
  color: var(--ink-2);
  margin: 0;
}
.legal-section p + p {
  margin-top: 16px;
}
.legal-copy a,
.legal-meta-card a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* =======================================================================
   ARCHIVE page
   ======================================================================= */
.archive-page { min-height: 100%; }
.archive-head {
  max-width: 1080px;
  margin: 0 auto;
  padding: 96px 32px 48px;
}
.archive-head .eyebrow { margin-bottom: 24px; }
.archive-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 72px;
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
}
.archive-deck {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink-2);
  margin: 0;
}

.archive-body {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px 96px;
  border-top: 1px solid var(--rule);
}
.arc-year {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 48px 0 16px;
  font-weight: 400;
}
.arc-list {
  display: flex;
  flex-direction: column;
}
.arc-row {
  display: grid;
  grid-template-columns: 80px 1fr 140px 60px;
  gap: 24px;
  align-items: baseline;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  transition: background 0.15s ease;
}
.arc-row:hover { background: color-mix(in oklab, var(--paper-2) 60%, transparent); cursor: pointer; }
.arc-date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}
.arc-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.arc-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
  text-align: left;
}
.arc-time {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-align: right;
}


/* =======================================================================
   TAG page
   ======================================================================= */
.tag-page { min-height: 100%; }
.tag-head {
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 32px 48px;
}
.tag-head .eyebrow { margin-bottom: 20px; }
.tag-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 88px;
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}
.tag-deck {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink-2);
  margin: 0 0 40px;
  max-width: 62ch;
}
.tag-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 32px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--paper);
  transition: all 0.15s ease;
  cursor: pointer;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}


/* =======================================================================
   DARK MODE
   Applied via [data-mode="dark"] on <html>.
   A true dark mode — not a tinted paper — but keeps the editorial feel.
   ======================================================================= */
html[data-mode="dark"], [data-mode-scope="dark"] {
  --paper: #241B14;
  --paper-2: #2C231B;
  --ink: #F2EBDD;
  --ink-2: #D5CDBC;
  --muted: #8F857A;
  --rule: #2A2521;
  --accent: #E07A5F;
  --accent-ink: #F5A58A;

  --raised: #332821;           /* one step lighter than --paper-2 — used by code blocks + author card in dark mode */
  --raised-border: rgba(232,223,209,0.08);
  --code-bg: var(--raised);
  --code-ink: #E8DFD1;
  --code-border: var(--raised-border);
  --code-muted: rgba(232,223,209,0.42);
  --code-accent: #E89B7A;
  --code-ok: #9AB883;
}
html[data-mode="dark"], [data-mode-scope="dark"] body { background: var(--paper); color: var(--ink); }

/* Author card adopts the same raised surface + hairline border as the code
   block in dark mode, so the two read as the same family of editorial panel.
   Light mode is intentionally untouched. */
html[data-mode="dark"] .author-card,
[data-mode-scope="dark"] .author-card {
  background: var(--raised);
  border: 1px solid var(--raised-border);
}

/* Inline `code` in dark mode — one step brighter than --raised so the chip
   reads distinctly against the body AND against the surrounding code block. */
html[data-mode="dark"] .article-body code,
[data-mode-scope="dark"] .article-body code {
  background: #3D2F25;
  color: var(--ink);
}
html[data-mode="dark"] .article-body pre code,
[data-mode-scope="dark"] .article-body pre code {
  background: none;
  color: inherit;
}

/* Things that had hardcoded light-bg assumptions get retuned */
html[data-mode="dark"] .shot-terminal,
[data-mode-scope="dark"] .shot-terminal {
  background: #0B0908;
  border-color: #2A2521;
}
html[data-mode="dark"] .shot-terminal .term-head,
[data-mode-scope="dark"] .shot-terminal .term-head { background: #141110; border-bottom-color: #2A2521; }
html[data-mode="dark"] .shot-terminal .term-body,
[data-mode-scope="dark"] .shot-terminal .term-body { color: #E8DFCE; }

html[data-mode="dark"] .shot.app-ui,
[data-mode-scope="dark"] .shot.app-ui {
  background: #1A1714;
  border-color: #2A2521;
}
html[data-mode="dark"] .shot.app-ui .app-ui-side,
[data-mode-scope="dark"] .shot.app-ui .app-ui-side { background: #14110E; border-right-color: #2A2521; }
html[data-mode="dark"] .shot.app-ui .app-ui-main,
[data-mode-scope="dark"] .shot.app-ui .app-ui-main { background: #0F0D0B; }

html[data-mode="dark"] .shot.photo,
[data-mode-scope="dark"] .shot.photo {
  background: linear-gradient(150deg, #2A241E 0%, #1A1613 60%, #100D0B 100%);
}

html[data-mode="dark"] .shot.art,
[data-mode-scope="dark"] .shot.art {
  background:
    radial-gradient(circle at 30% 30%, #5E6B3B 0%, transparent 50%),
    radial-gradient(circle at 70% 70%, #8A3420 0%, transparent 50%),
    #1C1815;
}

html[data-mode="dark"] .shot.type-shot,
[data-mode-scope="dark"] .shot.type-shot {
  background: #1A1714;
  color: #F2EBDD;
}

/* Scrim on the F4 hero needs to flip from dark-gradient-to-light to the reverse-ish */
html[data-mode="dark"] .heroA3 .scrim,
[data-mode-scope="dark"] .heroA3 .scrim {
  background:
    radial-gradient(ellipse 70% 50% at 50% 20%, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 70%),
    linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 50%);
}
html[data-mode="dark"] .heroA3-blur,
[data-mode-scope="dark"] .heroA3-blur {
  background: rgba(20, 17, 14, 0.28);
  backdrop-filter: blur(8px) saturate(1.1);
}
html[data-mode="dark"] .heroA3-content .hero-title,
[data-mode-scope="dark"] .heroA3-content .hero-title { color: #F7F1E4; }
html[data-mode="dark"] .heroA3-content .eyebrow,
[data-mode-scope="dark"] .heroA3-content .eyebrow { color: rgba(247,241,228,0.82); }

html[data-mode="dark"] .f-title-only-foot,
[data-mode-scope="dark"] .f-title-only-foot { background: var(--paper-2); border-color: var(--rule); }

/* Portrait gradient re-balanced for dark */
html[data-mode="dark"] .portrait,
[data-mode-scope="dark"] .portrait {
  background:
    linear-gradient(135deg, var(--accent) 0%, #2A2521 70%),
    #2A2521;
  border-color: #2A2521;
}

/* Nav toggle button */
.mode-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  color: var(--ink-2);
  font-size: 14px;
  transition: all 0.15s ease;
  margin-left: 8px;
}
.mode-toggle:hover { border-color: var(--ink); color: var(--ink); }


/* =======================================================================
   SINGLE-POST TEMPLATE
   More modest than the featured Article page:
   - Typographic masthead (no image hero)
   - Sticky right-margin TOC
   - Same long-form body typography (.article-body rules apply)
   - Post-specific chrome: author strip, prev/next, table, bench bars
   ======================================================================= */

.post-page { min-height: 100%; }

/* Masthead — typographic, no image */
.post-masthead {
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 32px 48px;
  border-bottom: 1px solid var(--rule);
}
.post-masthead-inner {
  max-width: 760px;
}
.post-masthead .eyebrow {
  margin-bottom: 24px;
}
.post-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 56px;
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  text-wrap: balance;
  color: var(--ink);
}
.post-deck {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0 0 32px;
  max-width: 58ch;
  text-wrap: pretty;
}
.post-byline {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Grid: body + sticky toc */
.post-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  column-gap: 72px;
  align-items: start;
}
/* Narrow variant — no TOC, body centered */
.post-grid-narrow {
  grid-template-columns: minmax(0, 720px);
  justify-content: center;
  column-gap: 0;
}

.post-body {
  /* reuses .article-body typography — we add a matching class on the article below */
  max-width: 720px;
  justify-self: end;
  padding: 56px 0 48px;
  color: var(--ink);
  font-family: var(--serif);
}
.post-grid-narrow .post-body { justify-self: center; }

/* All the .article-body typography rules apply to .post-body too */
.post-body { /* inherit structure; we duplicate the key paragraph rules */ }
.post-body .article-lede {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.42;
  letter-spacing: -0.008em;
  color: var(--ink);
  margin: 0 0 36px;
  font-weight: 400;
  text-wrap: pretty;
}
.post-body p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 22px;
  text-wrap: pretty;
  hanging-punctuation: first last;
}
.post-body h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 48px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  text-wrap: balance;
}
.post-body h2::before { content: none; }  /* no roman numerals on single-posts */

.post-body h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.25;
  margin: 32px 0 10px;
}

.post-body a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.post-body a:hover {
  text-decoration-thickness: 2px;
  color: var(--accent);
}

.post-body code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--paper-2);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--ink);
  white-space: nowrap;
}

.post-body pre {
  background: #141210;
  color: #E8DFD1;
  padding: 20px 22px;
  border-radius: 3px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  margin: 28px 0;
  white-space: pre;
}

.post-body ul {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 22px;
  padding-left: 0;
  list-style: none;
}
.post-body ul li {
  margin-bottom: 8px;
  padding-left: 24px;
  position: relative;
  text-wrap: pretty;
}
.post-body ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.post-body blockquote.pullquote {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-align: center;
  margin: 40px 0;
  padding: 0 16px;
  border: 0;
  font-style: normal;
  text-wrap: balance;
  position: relative;
}
.post-body blockquote.pullquote::before,
.post-body blockquote.pullquote::after {
  content: "";
  display: block;
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin: 0 auto;
}
.post-body blockquote.pullquote::before { margin-bottom: 22px; }
.post-body blockquote.pullquote::after { margin-top: 22px; }

.post-body .article-aside {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  font-style: italic;
  margin: 28px 0;
  padding: 0 24px;
  border-left: 2px solid var(--rule);
}
.post-body .article-aside::before {
  content: "Aside";
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-style: normal;
  margin-bottom: 6px;
}

.post-body hr {
  border: 0;
  text-align: center;
  margin: 48px 0;
}
.post-body hr::before {
  content: "⁂";
  font-size: 18px;
  color: var(--muted);
  letter-spacing: 0.5em;
  padding-left: 0.5em;
}


/* ---- Sticky TOC ---- */
.post-toc {
  position: sticky;
  top: 48px;
  align-self: start;
  padding: 56px 0 0 0;
  font-family: var(--sans);
}
.post-toc-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.post-toc-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  border-left: 1px solid var(--rule);
}
.post-toc-list li {
  margin: 0;
}
.post-toc-list li a {
  display: block;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  padding: 6px 0 6px 16px;
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.post-toc-list li a:hover { color: var(--ink-2); }
.post-toc-list li.active a {
  color: var(--ink);
  border-left-color: var(--accent);
  font-weight: 500;
}
.post-toc-foot {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-toc-foot a { color: var(--muted); }
.post-toc-foot a:hover { color: var(--ink); }
.post-toc-sep { margin: 0 8px; }


/* ---- Author strip ---- */
.post-author-strip {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: center;
  padding: 20px 0;
  margin-top: 32px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.post-author-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background:
    repeating-linear-gradient(135deg, rgba(28,25,23,0.08) 0 1px, transparent 1px 6px),
    linear-gradient(135deg, var(--accent), var(--ink));
}
.post-author-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
}
.post-author-blurb {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}
.post-author-blurb a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 2px;
}


/* ---- Prev / Next ---- */
.post-prevnext {
  max-width: 1200px;
  margin: 48px auto 0;
  padding: 32px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.pn {
  display: block;
  padding: 16px 0;
  font-family: var(--sans);
}
.pn-next { text-align: right; }
.pn-dir {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.pn-title {
  display: block;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.3;
  color: var(--ink);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.pn:hover .pn-title { color: var(--accent); }


/* ---- Comparison table ---- */
.post-table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-family: var(--sans);
  font-size: 14px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.post-table th,
.post-table td {
  text-align: left;
  padding: 14px 16px 14px 0;
  vertical-align: top;
  border-top: 1px solid var(--rule);
}
.post-table thead th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  padding: 14px 16px 14px 0;
  border-top: 0;
}
.post-table tbody th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  width: 28%;
}
.post-table td {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
  line-height: 1.45;
}


/* ---- Benchmark bars ---- */
.bench {
  margin: 20px 0 28px;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
}
.bench-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: center;
  padding: 8px 0;
}
.bench-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
.bench-track {
  position: relative;
  height: 22px;
  background: var(--paper-2);
  border-radius: 2px;
  display: flex;
  align-items: center;
}
.bench-bar {
  height: 100%;
  background: var(--muted);
  border-radius: 2px;
  transition: width 0.25s ease;
}
.bench-bar.good {
  background: var(--accent);
}
.bench-value {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  font-weight: 500;
}
.bench-note {
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  color: var(--muted);
  margin: 0 0 8px;
}


/* =======================================================================
   RESPONSIVE LAYOUT
   First pass for tablet + phone readability and overflow control.
   ======================================================================= */

@media (max-width: 900px) {
  .nav {
    grid-template-columns: auto auto;
    gap: 14px 24px;
    padding: 18px 24px;
  }
  .nav-links {
    grid-column: 1 / -1;
    order: 2;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 14px 18px;
  }
  .nav-search {
    grid-column: 1 / -1;
    order: 3;
    width: 100%;
    min-width: 0;
    justify-self: stretch;
  }

  .grid-section,
  .foot,
  .heroB,
  .about-hero,
  .about-body,
  .about-credentials,
  .legal-head,
  .legal-body,
  .archive-head,
  .archive-body,
  .tag-head,
  .article-meta-strip,
  .next-up,
  .post-masthead,
  .post-grid,
  .post-prevnext {
    padding-left: 24px;
    padding-right: 24px;
  }

  .grid-section {
    padding-top: 56px;
    padding-bottom: 72px;
    margin-top: 56px;
  }

  .mag-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 32px 24px;
  }
  .mag-grid--2x2 {
    --more-card-w: minmax(0, 280px);
    grid-template-columns: repeat(2, var(--more-card-w));
    justify-content: center;
    gap: 32px 20px;
  }
  .c-1of2,
  .c-5of12,
  .c-7of12,
  .c-2of3 {
    grid-column: span 6;
  }
  .c-1of3,
  .c-1of4 {
    grid-column: span 3;
  }

  .heroA3,
  .article-hero {
    height: 520px;
  }
  .heroA3-blur,
  .article-hero .article-blur {
    width: min(90vw, 720px);
    height: 300px;
  }
  .heroA3-content,
  .article-hero-content {
    padding: 0 24px;
  }
  .heroA3-content .hero-title,
  .article-hero-content .hero-title {
    font-size: clamp(40px, 7vw, 56px);
  }

  .article-hero-compact {
    padding: 40px 24px 28px;
  }
  .article-hero-compact .article-title {
    font-size: clamp(32px, 6vw, 44px);
  }

  .heroA3.f-title-only {
    height: 420px;
  }
  .heroA3.f-title-only .heroA3-blur,
  .heroA3.f-title-only .heroA3-content {
    height: 160px;
  }
  .heroA3.f-title-only .heroA3-content .hero-title {
    font-size: 32px;
  }
  .f-title-only-foot {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 24px;
  }
  .f-title-only-foot .hero-deck {
    font-size: 18px;
  }

  .article-body {
    padding: 64px 24px 24px;
  }
  .article-body .article-lede,
  .post-body .article-lede {
    font-size: 22px;
  }
  .article-body p,
  .article-body ul,
  .article-body ol,
  .post-body p,
  .post-body ul {
    font-size: 18px;
  }
  .article-body pre {
    margin: 28px 0;
  }
  .article-body blockquote.pullquote {
    margin-left: 0;
    margin-right: 0;
  }
  .article-fig,
  .article-fig.wide {
    margin-left: 0;
    margin-right: 0;
  }
  .article-meta-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .next-up-grid {
    grid-template-columns: 1fr;
  }

  .about-title {
    font-size: 48px;
    max-width: 10ch;
  }
  .about-deck {
    font-size: 19px;
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 32px;
  }
  .about-portrait {
    position: static;
  }
  .portrait {
    width: 200px;
    height: 250px;
  }
  .credentials-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .legal-title {
    font-size: 48px;
    max-width: 11ch;
  }
  .legal-deck {
    font-size: 19px;
  }
  .legal-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 32px;
  }
  .legal-meta {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .legal-section {
    max-width: 100%;
  }

  .archive-title {
    font-size: 52px;
  }
  .archive-deck,
  .tag-deck {
    font-size: 18px;
  }

  .tag-title {
    font-size: 60px;
  }

  .post-title {
    font-size: 42px;
  }
  .post-deck {
    font-size: 20px;
  }
  .post-grid {
    grid-template-columns: 1fr;
    row-gap: 24px;
  }
  .post-grid-narrow {
    grid-template-columns: 1fr;
    row-gap: 24px;
  }
  .post-body {
    max-width: 100%;
    justify-self: stretch;
    padding-top: 40px;
  }
  .post-toc {
    position: static;
    order: -1;
    padding-top: 24px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--rule);
  }
  .post-prevnext {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 24px;
    padding-bottom: 24px;
  }
  .pn-next {
    text-align: left;
  }

  .app-ui-body {
    grid-template-columns: 180px 1fr;
  }
  .app-ui-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  html, body {
    font-size: 15px;
    overflow-x: hidden;
  }

  .nav {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 14px;
    padding: 16px 20px;
  }
  .nav-brand {
    font-size: 16px;
  }
  .nav-links {
    gap: 12px 16px;
    font-size: 12px;
  }
  .nav-search {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 8px 10px;
    font-size: 11px;
  }
  .nav-search span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0;
  }
  .nav-search span::after {
    content: "Search";
    font-size: 11px;
  }
  .mode-toggle {
    margin-left: 0;
  }
  .nav-search kbd {
    display: none;
  }

  .grid-section {
    padding: 40px 20px 56px;
    margin-top: 40px;
  }
  .grid-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
  }
  .mag-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .mag-grid--2x2 {
    --more-card-w: 1fr;
    grid-template-columns: 1fr;
    justify-content: stretch;
    gap: 28px;
  }
  .more-list { margin-top: 40px; max-width: none; }
  .more-row {
    grid-template-columns: auto 1fr;
    gap: 10px 12px;
    padding: 14px 0;
  }
  .more-row-meta { grid-column: 2 / -1; }
  .more-row-title { font-size: 16px; }
  .c-1of2,
  .c-5of12,
  .c-7of12,
  .c-1of3,
  .c-1of4,
  .c-2of3 {
    grid-column: 1 / -1;
  }

  .row {
    grid-template-columns: 40px 1fr auto;
    gap: 12px;
    padding: 14px 0;
  }
  .row h4 {
    font-size: 17px;
  }

  .card.featured h3 { font-size: 28px; }
  .card.large h3 { font-size: 24px; }
  .card.medium h3 { font-size: 19px; }
  .card.small h3 { font-size: 18px; }
  .card p { font-size: 15px; }

  .shot-terminal {
    padding: 18px 16px 28px;
    font-size: 10px;
    line-height: 1.55;
  }
  .shot-label {
    left: 12px;
    bottom: 10px;
    font-size: 9px;
  }
  .app-ui-body {
    grid-template-columns: 1fr;
  }
  .app-ui-side {
    display: none;
  }
  .app-ui-main {
    padding: 16px;
  }

  .heroA3,
  .article-hero {
    height: 420px;
  }
  .heroA3-blur,
  .article-hero .article-blur {
    width: calc(100% - 40px);
    height: 240px;
  }
  .heroA3-content,
  .article-hero-content {
    padding: 0 20px;
  }
  .heroA3-content .eyebrow,
  .article-hero-content .eyebrow {
    margin-bottom: 14px;
  }
  .heroA3-content .hero-title,
  .article-hero-content .hero-title {
    font-size: clamp(21px, 8vw, 30px);
    line-height: 1.06;
    max-width: 8.2ch;
    margin-left: auto;
    margin-right: auto;
    text-wrap: balance;
  }
  .heroA3-content .hero-deck,
  .article-hero-content .hero-deck {
    font-size: 15px;
    margin-top: 12px;
  }
  .heroA3-content .byline,
  .article-hero-content .byline {
    margin-top: 16px;
    font-size: 10px;
  }

  .article-hero-compact {
    padding: 28px 20px 22px;
  }
  .article-hero-compact .eyebrow {
    margin-bottom: 14px;
  }
  .article-hero-compact .article-title {
    font-size: clamp(26px, 7vw, 34px);
    line-height: 1.1;
    margin-bottom: 16px;
  }

  .heroA3.f-title-only {
    height: 340px;
  }
  .heroA3.f-title-only .heroA3-blur,
  .heroA3.f-title-only .heroA3-content {
    height: 136px;
  }
  .heroA3.f-title-only .heroA3-content .hero-title {
    font-size: 21px;
  }
  .f-title-only-foot {
    padding: 20px;
    gap: 12px;
  }
  .f-title-only-foot .hero-deck {
    font-size: 15px;
    max-width: 17rem;
  }
  .f-title-only-foot .byline {
    font-size: 10px;
    line-height: 1.6;
    letter-spacing: 0.08em;
    max-width: 17rem;
  }

  .foot,
  .about-hero,
  .about-body,
  .about-credentials,
  .legal-head,
  .legal-body,
  .archive-head,
  .archive-body,
  .tag-head,
  .article-meta-strip,
  .next-up,
  .post-masthead,
  .post-grid,
  .post-prevnext {
    padding-left: 20px;
    padding-right: 20px;
  }
  .foot {
    padding-top: 24px;
    padding-bottom: 32px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .foot ul {
    flex-wrap: wrap;
    gap: 12px 16px;
  }

  .about-hero {
    padding-top: 56px;
    padding-bottom: 40px;
  }
  .about-title {
    font-size: 34px;
    max-width: none;
  }
  .about-deck {
    font-size: 17px;
  }
  .about-body {
    padding-top: 32px;
  }
  .portrait {
    width: 160px;
    height: 200px;
  }
  .about-copy p {
    font-size: 17px;
  }
  .credentials-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .legal-head {
    padding-top: 56px;
    padding-bottom: 32px;
  }
  .legal-title {
    font-size: 34px;
    max-width: none;
  }
  .legal-deck {
    font-size: 17px;
  }
  .legal-body {
    padding-bottom: 64px;
  }
  .legal-grid {
    gap: 24px;
  }
  .legal-meta {
    grid-template-columns: 1fr;
  }
  .legal-meta-card {
    padding: 16px;
  }
  .legal-section h2 {
    font-size: 21px;
  }
  .legal-section p {
    font-size: 17px;
  }

  .archive-head {
    padding-top: 56px;
    padding-bottom: 32px;
  }
  .archive-title {
    font-size: 38px;
  }
  .archive-deck {
    font-size: 17px;
  }
  .arc-row {
    grid-template-columns: 1fr auto;
    gap: 6px 14px;
    padding: 14px 0;
  }
  .arc-date {
    grid-column: 1;
    grid-row: 1;
  }
  .arc-time {
    grid-column: 2;
    grid-row: 1;
  }
  .arc-title {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 18px;
  }
  .arc-tag {
    grid-column: 1 / -1;
    grid-row: 3;
    font-size: 10px;
  }

  .tag-head {
    padding-top: 56px;
    padding-bottom: 32px;
  }
  .tag-title {
    font-size: 40px;
  }
  .tag-deck {
    font-size: 17px;
    margin-bottom: 24px;
  }
  .chip {
    padding: 6px 10px;
    font-size: 10px;
  }

  .article-body {
    padding: 48px 20px 16px;
    max-width: 17rem;
    margin-left: auto;
    margin-right: auto;
  }
  .article-body .article-lede {
    font-size: 18px;
    margin-bottom: 28px;
  }
  .article-body p,
  .article-body ul,
  .article-body ol {
    font-size: 16px;
  }
  .article-body code,
  .post-body code {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .article-body > .article-lede + p::first-letter {
    font-size: 56px;
    margin-top: 4px;
  }
  .article-body h2 {
    font-size: 28px;
    margin-top: 48px;
    padding-top: 24px;
  }
  .article-body h3 {
    font-size: 20px;
  }
  .article-body blockquote {
    font-size: 22px;
    padding-left: 16px;
  }
  .article-body blockquote.pullquote {
    font-size: 24px;
    padding: 0 8px;
    margin: 40px 0;
  }
  .article-body pre {
    margin: 24px 0;
    padding: 18px 16px;
    font-size: 12px;
  }
  .article-fig,
  .article-fig.wide {
    margin: 28px 0;
  }
  .article-aside {
    padding: 0 16px;
  }
  .article-meta-strip {
    margin-top: 32px;
    padding-top: 16px;
    padding-bottom: 16px;
    gap: 8px;
    max-width: 17rem;
  }
  .article-meta-strip .share {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
  }
  .author-card {
    grid-template-columns: 56px 1fr;
    padding: 20px;
    gap: 16px;
  }
  .author-avatar {
    width: 56px;
    height: 56px;
  }
  .next-up {
    margin-top: 56px;
    max-width: 17rem;
  }
  .next-up-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .post-masthead {
    padding-top: 56px;
    padding-bottom: 32px;
  }
  .post-masthead-inner {
    max-width: 17rem;
  }
  .post-masthead .eyebrow {
    margin-bottom: 18px;
    font-size: 10px;
  }
  .post-title {
    font-size: 29px;
    margin-bottom: 18px;
    max-width: 8.6ch;
  }
  .post-deck {
    font-size: 17px;
    margin-bottom: 24px;
    max-width: 17rem;
  }
  .post-byline {
    line-height: 1.6;
  }
  .post-grid,
  .post-grid-narrow {
    display: block;
    padding-left: 20px;
    padding-right: 20px;
  }
  .post-body {
    padding-top: 32px;
    padding-bottom: 32px;
    max-width: none;
    width: auto;
    margin-left: auto;
    margin-right: auto;
  }
  .post-body .article-lede {
    font-size: 18px;
    margin-bottom: 28px;
  }
  .post-body p,
  .post-body ul {
    font-size: 16px;
  }
  .post-body h2 {
    font-size: 24px;
    margin-top: 40px;
  }
  .post-body h3 {
    font-size: 19px;
  }
  .post-body pre {
    padding: 16px;
    font-size: 12px;
  }
  .post-body blockquote.pullquote {
    font-size: 23px;
    padding: 0 8px;
  }
  .post-toc {
    display: none;
  }
  .post-author-strip {
    grid-template-columns: 40px 1fr;
    gap: 12px;
  }
  .post-author-avatar {
    width: 40px;
    height: 40px;
  }
  .post-prevnext {
    gap: 8px;
    padding-top: 20px;
  }
  .pn-title {
    font-size: 18px;
  }

  .post-table {
    display: block;
    overflow-x: auto;
  }
  .post-table th,
  .post-table td {
    min-width: 160px;
  }

  .bench-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
