/* Shared static blog chrome — riso design tokens + editorial layout */
@import url("https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400;1,6..72,500;1,6..72,600&family=Space+Grotesk:wght@400;500;600;700&family=Hanken+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap");

/* ── Riso tokens (paper / hard ink offset) ── */
:root {
  --paper: #eee6d2;
  --paper-2: #e7ddc5;
  --paper-3: #f1eada;
  --ink: #1b1917;
  --fg-muted: #5b554a;
  --fg-dim: #8c8474;
  --blue: #274690;
  --blue-2: #1c3268;
  --blue-soft: rgba(39, 70, 144, 0.1);
  --rust: #c1471e;
  --rust-2: #a2380f;
  --ochre: #c2802a;
  --line: rgba(27, 25, 23, 0.16);
  --line-strong: rgba(27, 25, 23, 0.3);
  --line-blue: rgba(39, 70, 144, 0.5);
  --card: #f6f0e1;
  --card-border: 2px solid var(--ink);
  --card-shadow: 6px 6px 0 var(--ink);
  --grid-rgb: 39, 70, 144;
  --grid-fine: 13px;
  --grid-major: 65px;
  --grid-opacity: 0.26;
  --grain-opacity: 0.1;
  --paper-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  /* Aliases used by existing blog chrome */
  --bg: var(--paper);
  --bg-2: var(--paper-2);
  --surface: var(--card);
  --border: var(--line);
  --border-strong: var(--line-strong);
  --fg: var(--ink);
  --brand: var(--rust);
  --brand-2: var(--rust-2);
  --brand-ink: var(--rust);
  --grad-brand: var(--rust);
  --r-2xl: 3px;
  --r-lg: 3px;
  --r-pill: 999px;
  --shadow-glass: var(--card-shadow);
  --maxw: 1120px;
  --prose: 720px;
  --gutter: clamp(20px, 5vw, 64px);
  --font-display: "Oswald", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-serif: "Newsreader", Georgia, serif;
  --header-bg: rgba(238, 230, 210, 0.9);
  --btn-hover-bg: #fff;
  --blockquote-bg: rgba(255, 255, 255, 0.45);
  --callout-bg: rgba(246, 240, 225, 0.85);
  --selection-fg: var(--ink);
  --toggle-bg: rgba(255, 255, 255, 0.55);
  --active-fill: rgba(193, 71, 30, 0.12);
  --active-border: rgba(193, 71, 30, 0.34);
  --ambient: transparent;
  color-scheme: light;
}

/* ── Dark companion (ink night) — preserves existing theme toggle ── */
:root[data-theme="dark"] {
  --grain-opacity: 0.06;
  --grid-opacity: 0.14;
  --paper: #14110e;
  --paper-2: #1a1612;
  --paper-3: #1c1916;
  --ink: #f2ede6;
  --fg-muted: #a8a299;
  --fg-dim: #7c756c;
  --blue: #6b8fd4;
  --blue-2: #8aa4db;
  --blue-soft: rgba(107, 143, 212, 0.12);
  --rust: #ef5a4f;
  --rust-2: #f07a70;
  --ochre: #d4a04a;
  --line: rgba(245, 240, 232, 0.1);
  --line-strong: rgba(245, 240, 232, 0.18);
  --line-blue: rgba(107, 143, 212, 0.35);
  --card: #1f1b17;
  --card-border: 2px solid rgba(245, 240, 232, 0.22);
  --card-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55);
  --bg: var(--paper);
  --bg-2: var(--paper-2);
  --surface: var(--card);
  --border: var(--line);
  --border-strong: var(--line-strong);
  --fg: var(--ink);
  --brand: var(--rust);
  --brand-2: var(--rust-2);
  --brand-ink: #e0a89c;
  --grad-brand: var(--rust);
  --shadow-glass: var(--card-shadow);
  --header-bg: rgba(20, 17, 14, 0.9);
  --btn-hover-bg: #2a2622;
  --blockquote-bg: rgba(255, 255, 255, 0.04);
  --callout-bg: rgba(42, 38, 34, 0.85);
  --selection-fg: #f2ede6;
  --toggle-bg: rgba(255, 255, 255, 0.06);
  --active-fill: rgba(239, 90, 79, 0.16);
  --active-border: rgba(239, 90, 79, 0.4);
  --ambient: transparent;
  color-scheme: dark;
}

/* Unset preference defaults to light (riso paper). Only data-theme="dark" enables night. */
:root[data-theme="light"] {
  color-scheme: light;
}


*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  font-size: 17px;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grid-opacity);
  background-image:
    linear-gradient(rgba(var(--grid-rgb), 0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--grid-rgb), 0.55) 1px, transparent 1px),
    linear-gradient(rgba(var(--grid-rgb), 1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--grid-rgb), 1) 1px, transparent 1px);
  background-size:
    var(--grid-fine) var(--grid-fine),
    var(--grid-fine) var(--grid-fine),
    var(--grid-major) var(--grid-major),
    var(--grid-major) var(--grid-major);
  background-position: -1px -1px;
  -webkit-mask: radial-gradient(120% 82% at 84% -6%, #000 0%, rgba(0, 0, 0, 0.42) 32%, transparent 64%);
  mask: radial-gradient(120% 82% at 84% -6%, #000 0%, rgba(0, 0, 0, 0.42) 32%, transparent 64%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
  background-image: var(--paper-noise);
  background-size: 180px 180px;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  display: block;
  max-width: 100%;
}
::selection {
  background: color-mix(in srgb, var(--brand) 22%, transparent);
  color: var(--selection-fg);
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 0;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-blue);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.wordmark .mark {
  width: 38px;
  height: 38px;
  border-radius: 3px;
  flex: none;
  background: radial-gradient(125% 120% at 32% 20%, #2b2622, #131110);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow:
    0 6px 16px -9px rgba(26, 23, 20, 0.7),
    0 0 0 1px var(--line-blue);
}
.wordmark .mark img {
  width: 84%;
  height: 84%;
  object-fit: contain;
}
.wordmark .tld {
  color: var(--fg-dim);
  font-weight: 500;
}
.wordmark .wordmark-sub {
  display: block;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--fg-dim);
  margin-top: 1px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.nav a {
  font-size: 14.5px;
  color: var(--fg-muted);
  transition: color 0.18s ease;
}
.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--fg);
}
.nav a[aria-current="page"] {
  font-weight: 600;
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 2px;
  border: 1px solid var(--line-blue);
  background: var(--toggle-bg);
  color: var(--fg-muted);
  cursor: pointer;
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}
.theme-toggle:hover {
  color: var(--fg);
  border-color: var(--border-strong);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
}
.theme-toggle .icon-sun {
  display: none;
}
.theme-toggle .icon-moon {
  display: block;
}
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

main {
  flex: 1;
  position: relative;
  z-index: 1;
  padding-block: clamp(40px, 6vw, 72px);
}

/* ── Shared editorial atoms ── */
.card {
  border-radius: var(--r-2xl);
  background: var(--surface);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}
.pill-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(193, 71, 30, 0.34);
  background: rgba(193, 71, 30, 0.1);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rust);
}
.pill-eyebrow--inline {
  padding: 0;
  border: none;
  background: none;
  gap: 10px;
  flex-wrap: wrap;
}
.pill-eyebrow--inline .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--fg-dim);
  flex: none;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-blue);
  background: transparent;
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}
a.tag-chip:hover {
  color: var(--fg);
  border-color: var(--active-border);
  background: var(--active-fill);
}
a.tag-chip:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.stat-card {
  flex: 1 1 0;
  min-width: 0;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.stat-card .stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 6px;
}
.stat-card .stat-value {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--fg);
  line-height: 1.3;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 12px 20px;
  border-radius: 2px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--fg);
  transition:
    transform 0.15s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  cursor: pointer;
}
.btn:hover {
  transform: translateY(-1px);
  background: var(--btn-hover-bg);
  border-color: var(--blue);
}
.btn--primary {
  color: #fff;
  border-color: transparent;
  background: var(--rust);
  box-shadow: 4px 4px 0 var(--ink);
}
.btn--primary:hover {
  background: var(--rust-2);
  filter: none;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}
.btn--sm {
  padding: 10px 16px;
  font-size: 13.5px;
}
.read-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--fg);
  transition: color 0.15s ease;
}
.read-link:hover {
  color: var(--brand-2);
}
.side-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 10px;
}

/* ════════════════════════════════════════
   INDEX PAGE
   ════════════════════════════════════════ */
.blog-index {
  display: flex;
  flex-direction: column;
  gap: clamp(36px, 5vw, 52px);
}

.blog-index-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}

.blog-index-hero {
  min-width: 0;
  padding-top: 8px;
}
.blog-index-hero .pill-eyebrow {
  margin-bottom: 22px;
}
.blog-index-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 5.6vw, 64px);
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  max-width: 14ch;
  margin-bottom: 20px;
}
.blog-index-hero .lede {
  color: var(--fg-muted);
  font-size: clamp(16.5px, 1.5vw, 18.5px);
  line-height: 1.6;
  max-width: 40ch;
  margin-bottom: 28px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.blog-index-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.latest-card {
  padding: 22px 22px 20px;
}
.latest-card h2 {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 20px;
  letter-spacing: 0.01em;
  line-height: 1.25;
  margin-bottom: 10px;
}
.latest-card h2 a:hover {
  color: var(--brand-2);
}
.latest-card .excerpt {
  color: var(--fg-muted);
  font-size: 14.5px;
  line-height: 1.5;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat-row .stat-card {
  padding: 14px 12px;
}
.stat-row .stat-value {
  font-size: 14px;
}

.topics-card {
  padding: 18px 20px;
}
.topics-card .tag-row {
  margin-top: 4px;
}

/* Featured note */
.featured-card {
  display: block;
  padding: clamp(28px, 3.5vw, 40px) clamp(28px, 3.5vw, 40px) clamp(24px, 3vw, 32px);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.25s ease;
}
.featured-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-glass), 0 24px 60px -30px color-mix(in srgb, var(--brand) 22%, transparent);
}
.featured-card .meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.featured-card .meta-row .pill-eyebrow {
  margin: 0;
}
.featured-card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 36px);
  letter-spacing: 0.01em;
  line-height: 1.15;
  margin-bottom: 14px;
  max-width: 28ch;
}
.featured-card .card-title-link,
.post-card .card-title-link {
  color: inherit;
  text-decoration: none;
}
.featured-card .card-title-link:hover,
.post-card .card-title-link:hover {
  color: var(--brand);
}
.featured-card .excerpt {
  color: var(--fg-muted);
  font-size: 17px;
  line-height: 1.55;
  max-width: 58ch;
  margin-bottom: 18px;
}
.featured-card .tag-row {
  margin-bottom: 4px;
}

/* Post grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.post-card {
  display: flex;
  flex-direction: column;
  padding: 26px 28px 24px;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.25s ease;
  min-height: 100%;
}
.post-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-glass), 0 24px 60px -30px color-mix(in srgb, var(--brand) 18%, transparent);
}
.post-card .meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.post-card h2 {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(20px, 2.2vw, 24px);
  letter-spacing: 0.01em;
  line-height: 1.2;
  margin-bottom: 12px;
}
.post-card .excerpt {
  color: var(--fg-muted);
  font-size: 15.5px;
  line-height: 1.5;
  flex: 1;
  margin-bottom: 16px;
}
.post-card .tag-row {
  margin-bottom: 4px;
}
.post-card .read-link {
  margin-top: auto;
  padding-top: 14px;
}

/* ════════════════════════════════════════
   POST PAGE
   ════════════════════════════════════════ */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
  gap: clamp(24px, 3.5vw, 40px);
  align-items: start;
}
.post-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Hero card */
.hero-card {
  padding: clamp(28px, 3.5vw, 36px) clamp(28px, 3.5vw, 36px) clamp(24px, 3vw, 28px);
}
.hero-card .pill-eyebrow {
  margin-bottom: 18px;
}
.hero-card h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 4.2vw, 44px);
  line-height: 1.08;
  letter-spacing: 0.01em;
  margin-bottom: 16px;
  max-width: 18ch;
}
.hero-card .dek {
  color: var(--fg-muted);
  font-size: clamp(16.5px, 1.5vw, 18.5px);
  line-height: 1.55;
  max-width: 48ch;
  margin-bottom: 20px;
}
.hero-card .tag-row {
  margin-bottom: 22px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* Section cards */
.section-card {
  padding: clamp(26px, 3vw, 32px) clamp(26px, 3vw, 34px);
  scroll-margin-top: 96px;
}
.section-card h2 {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(22px, 2.4vw, 26px);
  letter-spacing: 0.01em;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--fg);
}
.section-card .prose p {
  margin-top: 0;
  margin-bottom: 1.1em;
  color: var(--fg-muted);
  font-size: 16.5px;
  line-height: 1.65;
}
.section-card .prose p:last-child {
  margin-bottom: 0;
}

/* Long-form reading treatment shared by every published article. */
.post-main > .section-card .prose {
  max-width: 42rem;
}

.post-main > .section-card .prose p {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(18px, 1.7vw, 20px);
  line-height: 1.68;
}

.post-main > .section-card .prose > p:first-child::first-letter {
  float: left;
  margin: 0.06em 0.1em 0 0;
  color: var(--brand-2);
  font-family: "Newsreader", Georgia, serif;
  font-size: 4.2em;
  font-weight: 600;
  line-height: 0.78;
}

.post-main > .section-card h2 {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(27px, 3vw, 35px);
  font-weight: 600;
}

.post-main > .section-card .prose blockquote {
  margin: 2em 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.post-main > .section-card .prose blockquote p {
  color: var(--fg);
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: 0.01em;
}

.post-visual {
  margin: 28px 0 34px;
}

.post-visual img {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--surface);
  box-shadow: 4px 4px 0 var(--ink);
}

.post-visual figcaption {
  margin-top: 10px;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
}

/* Editorial treatment for the flagship story series. */
.editorial-section {
  padding: clamp(30px, 4vw, 46px) clamp(26px, 5vw, 58px);
}

.editorial-section .prose {
  max-width: 42rem;
}

.editorial-section .prose p {
  color: var(--fg-muted);
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(19px, 1.8vw, 21px);
  line-height: 1.64;
}

.editorial-section--lead .prose > p:first-child::first-letter {
  float: left;
  margin: 0.06em 0.1em 0 0;
  color: var(--brand-2);
  font-family: "Newsreader", Georgia, serif;
  font-size: 4.5em;
  font-weight: 600;
  line-height: 0.78;
}

.editorial-kicker {
  margin: 0 0 12px;
  color: var(--brand-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.editorial-section h2 {
  max-width: 42rem;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 600;
}

.editorial-pullquote {
  margin: 2.1em 0;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.section-card .prose .editorial-pullquote p {
  color: var(--fg) !important;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(27px, 3.2vw, 37px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: 0.01em;
}

.editorial-aside {
  margin: 2.2em 0;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  background: var(--callout-bg);
}

.editorial-aside-label {
  margin: 0 0 8px !important;
  color: var(--brand-2) !important;
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.editorial-aside p:last-child {
  margin-bottom: 0 !important;
  font-size: 18px !important;
  line-height: 1.5 !important;
}
.section-card .prose h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18.5px;
  letter-spacing: 0.01em;
  margin: 1.4em 0 0.65em;
  color: var(--fg);
}
.section-card .prose ul,
.section-card .prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.25em;
  color: var(--fg-muted);
}
.section-card .prose li {
  margin-top: 0.4em;
  line-height: 1.6;
}
.section-card .prose li::marker {
  color: var(--brand);
}
.section-card .prose a {
  color: var(--brand-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.section-card .prose a:hover {
  color: var(--brand);
}
.section-card .prose strong {
  font-weight: 650;
  color: var(--fg);
}
.section-card .prose blockquote {
  margin: 1.2em 0;
  padding: 16px 20px;
  border-left: 3px solid var(--brand);
  background: var(--blockquote-bg);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  color: var(--fg-muted);
  font-size: 16px;
}
.section-card .prose .callout {
  margin: 1.3em 0;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--callout-bg);
}
.section-card .prose .callout strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-ink);
  margin-bottom: 8px;
}
.section-card .prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: color-mix(in srgb, var(--fg) 6%, transparent);
}

/* Next note CTA */
.next-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 22px 26px;
}
.next-note .next-copy .side-label {
  margin-bottom: 6px;
}
.next-note .next-copy p {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 18px;
  letter-spacing: 0.01em;
}
.next-note .next-copy a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.next-note .next-copy a:hover {
  color: var(--rust);
  border-bottom-color: color-mix(in srgb, var(--rust) 55%, transparent);
}
.next-note .next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Related notes */
.related-block {
  margin-top: 8px;
}
.related-block > .side-label {
  margin-bottom: 14px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* ── Right rail (sticky) ── */
.post-rail {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  align-self: start;
}
.chapter-toc {
  padding: 20px 18px;
}
.chapter-toc .toc-progress {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-dim);
  margin: -4px 0 14px;
  letter-spacing: 0.02em;
}
.chapter-toc nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chapter-toc a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 3px;
  font-size: 13.5px;
  line-height: 1.3;
  color: var(--fg-muted);
  border: 1px solid transparent;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}
.chapter-toc a .num {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 2px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  background: color-mix(in srgb, var(--fg) 5%, transparent);
  border: 1px solid var(--border);
  color: var(--fg-dim);
}
.chapter-toc a:hover {
  color: var(--fg);
  background: color-mix(in srgb, var(--fg) 3%, transparent);
}
.chapter-toc a.active {
  color: var(--fg);
  background: var(--active-fill);
  border-color: var(--active-border);
}
.chapter-toc a.active .num {
  background: color-mix(in srgb, var(--brand) 22%, transparent);
  border-color: var(--active-border);
  color: var(--brand-2);
}

.about-studio {
  padding: 18px 20px;
}
.about-studio p {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--fg-muted);
  margin-bottom: 12px;
}
.about-studio .contact-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg);
  transition: color 0.15s ease;
}
.about-studio .contact-link:hover {
  color: var(--brand-2);
}

.chapter-toc-mobile {
  display: none;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--line-blue);
  padding: 28px 0 36px;
  margin-top: auto;
  background: var(--bg-2);
  position: relative;
  z-index: 1;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  align-items: center;
  justify-content: space-between;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.footer-links a {
  font-size: 14px;
  color: var(--fg-muted);
}
.footer-links a:hover {
  color: var(--fg);
}
.legal {
  font-size: 13px;
  color: var(--fg-dim);
}
.footer-tagline {
  font-size: 13.5px;
  color: var(--fg-muted);
  max-width: 48ch;
  line-height: 1.45;
}

/* ── Topic pages ── */
.topic-back {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--fg-muted);
}
.topic-back a {
  color: var(--fg-muted);
  text-decoration: none;
  font-weight: 600;
}
.topic-back a:hover {
  color: var(--brand);
}
.topic-back-sep {
  color: var(--fg-dim);
}
.topic-hero {
  margin-bottom: 8px;
}
.topic-grid {
  margin-top: 8px;
}
.topic-empty {
  grid-column: 1 / -1;
  color: var(--fg-muted);
  font-size: 16px;
  padding: 12px 0 28px;
}
.topic-empty a {
  color: var(--brand);
  font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 980px) {
  .blog-index-top {
    grid-template-columns: 1fr;
  }
  .blog-index-hero h1 {
    max-width: none;
  }
  .post-layout {
    grid-template-columns: 1fr;
  }
  .post-rail {
    position: static;
    order: -1;
  }
  .chapter-toc {
    display: none;
  }
  .about-studio {
    display: none;
  }
  .chapter-toc-mobile {
    display: block;
    padding: 18px;
  }
  .chapter-toc-mobile summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 14px;
  }
  .chapter-toc-mobile summary::-webkit-details-marker {
    display: none;
  }
  .chapter-toc-mobile nav {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .chapter-toc-mobile a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 3px;
    font-size: 13.5px;
    color: var(--fg-muted);
  }
  .chapter-toc-mobile a .num {
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 2px;
    display: grid;
    place-items: center;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    background: color-mix(in srgb, var(--fg) 5%, transparent);
    border: 1px solid var(--border);
    color: var(--fg-dim);
  }
}

@media (max-width: 720px) {
  .nav {
    gap: 14px;
  }
  .post-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }
  .stat-row {
    grid-template-columns: 1fr;
  }
  .hero-stats {
    grid-template-columns: 1fr;
  }
  .featured-card,
  .post-card,
  .hero-card,
  .section-card {
    padding: 22px;
  }
  .next-note {
    flex-direction: column;
    align-items: flex-start;
  }
}
