/* ==========================================================================
   Learning Hub — shared stylesheet
   Aesthetic: editorial workbook. Warm paper, ink lines, terracotta accents.
   ========================================================================== */

:root,
:root[data-theme="light"] {
  /* palette — light (cream paper) */
  --bg:         #f4efe6;
  --surface:    #faf6ed;
  --surface-2:  #ece4d2;
  --surface-3:  #e2d8c0;
  --ink:        #1a1613;
  --ink-soft:   #3d352d;
  --muted:      #7a6f5f;
  --line:       #1a1613;
  --line-soft:  rgba(26, 22, 19, 0.18);

  --accent:     #d0451b;   /* terracotta */
  --accent-2:   #2b4b3c;   /* forest */
  --accent-3:   #8a6b2b;   /* ochre */
  --accent-4:   #4a5d8a;   /* ink-blue */
  --accent-5:   #6b3d5d;   /* plum */

  --pre-bg:     #1a1613;
  --pre-fg:     #f4efe6;

  --bg-glow-1:  rgba(208, 69, 27, 0.04);
  --bg-glow-2:  rgba(43, 75, 60, 0.05);
}

:root[data-theme="dark"] {
  /* palette — dark slate (cool blue-slate, gold accent, no green) */
  --bg:         #0d1319;
  --surface:    #171e25;
  --surface-2:  #222c35;
  --surface-3:  #2e3a44;
  --ink:        #e8e6e0;
  --ink-soft:   #c4c2ba;
  --muted:      #7a8089;
  --line:       #e8e6e0;
  --line-soft:  rgba(232, 230, 224, 0.18);

  --accent:     #d8ad3f;   /* gold / mustard — primary */
  --accent-2:   #5690b0;   /* steel-teal blue (replaces forest) */
  --accent-3:   #e0764a;   /* warm terracotta — contrast pop */
  --accent-4:   #8aa4c8;   /* periwinkle */
  --accent-5:   #b590b0;   /* dusty rose */

  --pre-bg:     #05090c;
  --pre-fg:     #e8e6e0;

  --bg-glow-1:  rgba(216, 173, 63, 0.06);
  --bg-glow-2:  rgba(86, 144, 176, 0.07);
}

:root {
  /* type */
  --font-display: 'Fraunces', 'EB Garamond', Georgia, serif;
  --font-body:    'Work Sans', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* scale */
  --step--2: clamp(0.69rem, 0.66rem + 0.15vw, 0.76rem);
  --step--1: clamp(0.83rem, 0.80rem + 0.17vw, 0.92rem);
  --step-0:  clamp(1.00rem, 0.96rem + 0.22vw, 1.13rem);
  --step-1:  clamp(1.20rem, 1.14rem + 0.32vw, 1.38rem);
  --step-2:  clamp(1.44rem, 1.35rem + 0.46vw, 1.69rem);
  --step-3:  clamp(1.73rem, 1.60rem + 0.66vw, 2.07rem);
  --step-4:  clamp(2.07rem, 1.89rem + 0.94vw, 2.54rem);
  --step-5:  clamp(2.49rem, 2.23rem + 1.32vw, 3.11rem);
  --step-6:  clamp(2.99rem, 2.62rem + 1.85vw, 3.82rem);

  --rad: 2px;
  --rad-lg: 4px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 20% 10%, var(--bg-glow-1), transparent 50%),
    radial-gradient(circle at 90% 80%, var(--bg-glow-2), transparent 45%);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 300ms ease, color 300ms ease;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

/* ---------- grain overlay ---------- */
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.10 0 0 0 0 0.08 0 0 0 0 0.07 0 0 0 0.35 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
[data-theme="dark"] .grain {
  mix-blend-mode: screen;
  opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.95 0 0 0 0 0.90 0 0 0 0 0.80 0 0 0 0.45 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- layout ---------- */
.shell {
  position: relative;
  z-index: 2;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 32px 80px;
}

@media (max-width: 720px) {
  .shell { padding: 18px 18px 60px; }
}

/* ---------- site header ---------- */
.site-header__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-1);
  letter-spacing: -0.01em;
}
.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--accent);
  color: var(--bg);
  transform: rotate(-12deg);
}
.brand__name em {
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  color: var(--accent);
}
.nav {
  display: flex;
  gap: 2px;
}
.nav__link {
  padding: 8px 14px;
  font-size: var(--step--1);
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  border-bottom: 1.5px solid transparent;
  transition: all 160ms ease;
}
.nav__link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.nav__link--active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }

/* ---------- masthead ---------- */
.masthead {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: end;
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--line);
}
.masthead__kicker {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 24px;
}
.masthead__kicker::before { content: ""; display: inline-block; width: 28px; height: 1px; background: var(--muted); vertical-align: middle; margin-right: 10px; }
.masthead__title {
  font-family: var(--font-display);
  font-size: var(--step-6);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-weight: 400;
  margin: 0;
  color: var(--ink);
}
.masthead__title em {
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  color: var(--accent);
}
.masthead__lede {
  max-width: 52ch;
  margin: 28px 0 0;
  font-size: var(--step-0);
  color: var(--ink-soft);
  line-height: 1.55;
}
.stats {
  display: grid;
  gap: 22px;
  margin: 0;
  min-width: 180px;
}
.stat { margin: 0; display: grid; gap: 4px; }
.stat dt {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.stat dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 500;
  letter-spacing: -0.01em;
}

@media (max-width: 820px) {
  .masthead { grid-template-columns: 1fr; gap: 32px; padding: 40px 0 36px; }
  .stats { grid-template-columns: repeat(3, 1fr); min-width: 0; }
}

/* ---------- learning paths ---------- */
.paths {
  grid-column: 1 / -1;
  margin-bottom: 72px;
}
.paths__intro {
  max-width: 62ch;
  margin: -8px 0 32px;
  color: var(--ink-soft);
  font-size: var(--step--1);
  line-height: 1.6;
}
.paths__list {
  display: grid;
  gap: 12px;
}
.path-strip {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 24px;
  padding: 14px 20px 14px 24px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.path-strip::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: var(--path-accent, var(--accent));
}
.path-strip__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--ink);
}
.path-strip__dots {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 8px;
}
.path-strip__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  background: transparent;
  transition: transform 160ms ease;
}
.path-strip__dot--done {
  background: var(--accent-2);
  border-color: var(--accent-2);
}
.path-strip__dot--current {
  background: var(--path-accent, var(--accent));
  border-color: var(--path-accent, var(--accent));
  animation: pulse 1.6s ease-in-out infinite;
}
.path-strip__dot--linked { cursor: pointer; }
.path-strip__dot--linked:hover { transform: scale(1.3); }
.path-strip__count {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--muted);
  letter-spacing: 0.08em;
  min-width: 36px;
  text-align: right;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

@media (max-width: 620px) {
  .path-strip {
    grid-template-columns: 1fr auto;
    row-gap: 8px;
  }
  .path-strip__dots {
    grid-column: 1 / -1;
  }
}

/* ---------- main layout ---------- */
.hub {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 64px;
  padding-top: 64px;
}
@media (max-width: 980px) {
  .hub { grid-template-columns: 1fr; gap: 48px; }
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--step-3);
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.section-title::before {
  content: "";
  width: 14px; height: 14px;
  background: var(--accent);
  display: inline-block;
}
.section-title__count {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--muted);
  letter-spacing: 0.14em;
  margin-left: auto;
}

/* ---------- controls ---------- */
.controls {
  display: grid;
  grid-template-columns: 260px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 18px;
  margin-bottom: 48px;
  background: var(--surface);
  border: 1px solid var(--line);
}
@media (max-width: 820px) {
  .controls { grid-template-columns: 1fr; gap: 14px; }
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search::before {
  content: "⌕";
  position: absolute;
  left: 12px;
  font-size: 18px;
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  padding: 10px 12px 10px 34px;
  border: 1px solid var(--line);
  background: var(--bg);
  font: inherit;
  font-size: var(--step--1);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease;
}
.search input:focus { border-color: var(--accent); }
.search input::placeholder { color: var(--muted); font-style: italic; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  padding: 6px 12px;
  border: 1px solid var(--line-soft);
  background: var(--bg);
  font-size: var(--step--2);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 120ms ease;
  user-select: none;
}
.chip:hover { border-color: var(--ink); }
.chip--active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.chip__dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.controls__count {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--muted);
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.controls__count strong {
  color: var(--ink);
  font-weight: 500;
}

/* ---------- collections rail ---------- */
.collections {
  grid-column: 1 / -1;
  margin-bottom: 64px;
}
.collections__rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.collection {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.collection::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--collection-color, var(--accent));
}
.collection:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}
.collection__kicker {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 10px;
  display: flex;
  justify-content: space-between;
}
.collection__status {
  padding: 2px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 10px;
}
.collection__status--in-progress { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.collection__status--done { background: var(--accent-2); color: var(--bg); border-color: var(--accent-2); }
.collection__status--planned { color: var(--muted); }
.collection__title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  line-height: 1.1;
}
.collection__lede {
  font-size: var(--step--1);
  color: var(--ink-soft);
  margin: 0 0 16px;
  line-height: 1.5;
}
.collection__meta {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ---------- notes list ---------- */
.notes { position: relative; }
.notes__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0;
}
.note {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 160ms ease, padding-left 200ms ease;
  align-items: start;
}
.note:last-child { border-bottom: 1px solid var(--line-soft); }
.note:hover { background: var(--surface); padding-left: 16px; padding-right: 16px; }
.note__num {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--muted);
  letter-spacing: 0.08em;
  padding-top: 4px;
}
.note__body { min-width: 0; }
.note__title {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 10px;
}
.note__title em {
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  color: var(--accent);
}
.note:hover .note__title { color: var(--accent); }
.note__lede {
  font-size: var(--step-0);
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0 0 16px;
  max-width: 60ch;
}
.note__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.note__tag {
  padding: 3px 10px;
  border: 1px solid var(--line-soft);
  background: var(--bg);
  font-size: var(--step--2);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.note__meta {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--muted);
  letter-spacing: 0.08em;
  text-align: right;
  padding-top: 4px;
  white-space: nowrap;
  display: grid;
  gap: 4px;
}
.note__meta__arrow {
  font-family: var(--font-display);
  font-size: var(--step-3);
  color: var(--ink-soft);
  line-height: 1;
  transition: transform 200ms ease, color 200ms ease;
}
.note:hover .note__meta__arrow { transform: translateX(6px); color: var(--accent); }

@media (max-width: 720px) {
  .note { grid-template-columns: 1fr; gap: 10px; padding: 24px 0; }
  .note__num { padding-top: 0; }
  .note__meta { text-align: left; }
}

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
  display: grid;
  gap: 32px;
  padding-left: 32px;
  border-left: 1px solid var(--line-soft);
}
.sidebar__block {
  display: grid;
  gap: 12px;
}
.sidebar__kicker {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0;
}
.sidebar__title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
}
.sidebar__body {
  font-size: var(--step--1);
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
}
.sidebar__quote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.45;
}
.sidebar__quote cite {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-style: normal;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-top: 6px;
}
@media (max-width: 980px) {
  .sidebar { padding-left: 0; border-left: 0; border-top: 1px solid var(--line-soft); padding-top: 32px; }
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: 96px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--muted);
  letter-spacing: 0.06em;
  flex-wrap: wrap;
}

/* ---------- empty state ---------- */
.empty {
  padding: 72px 24px;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--step-1);
  color: var(--muted);
  border: 1px dashed var(--line-soft);
}

/* ==========================================================================
   Post page
   ========================================================================== */

.post-page {
  background: var(--bg);
}

.post-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 100;
  transition: width 80ms linear;
}

.post {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px 120px;
  position: relative;
  z-index: 2;
}

.post__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 56px;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 160ms ease;
}
.post__back:hover { color: var(--accent); }

.post__meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-soft);
}

.post__title {
  font-family: var(--font-display);
  font-size: var(--step-6);
  line-height: 0.98;
  letter-spacing: -0.03em;
  font-weight: 400;
  margin: 0 0 24px;
}
.post__title em {
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  color: var(--accent);
}

.post__lede {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.3;
  color: var(--ink-soft);
  font-weight: 300;
  margin: 0 0 64px;
  max-width: 32ch;
}

.post__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 64px;
}
.post__tag {
  padding: 4px 10px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  font-size: var(--step--2);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.prose {
  font-size: calc(var(--step-1) * var(--reading-font-scale, 1));
  line-height: var(--reading-line-height, 1.5);
  color: var(--ink-soft);
}
.prose > * + * { margin-top: calc(var(--reading-line-height, 1.5) * 12px); }
.prose h2 {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.15;
  margin-top: 64px;
}
.prose h2 em {
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  color: var(--accent);
}
.prose h3 {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 500;
  color: var(--ink);
  margin-top: 48px;
}
.prose p { margin: 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { color: var(--ink); }
.prose a { color: var(--accent); border-bottom: 1px solid currentColor; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li + li { margin-top: 10px; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  padding: 2px 6px;
  border: 1px solid var(--line-soft);
}

.prose pre {
  background: var(--pre-bg);
  color: var(--pre-fg);
  padding: 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  line-height: 1.55;
  border: 1px solid var(--pre-bg);
  box-shadow: 6px 6px 0 var(--accent);
  margin-left: -12px;
  margin-right: -12px;
}
.prose pre code { background: transparent; border: 0; padding: 0; color: inherit; }

.callout {
  margin: 48px -12px;
  padding: 28px 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  position: relative;
}
.callout::before {
  content: attr(data-label);
  position: absolute;
  top: -11px;
  left: 20px;
  padding: 2px 10px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.callout--forest::before { background: var(--accent-2); }
.callout--ochre::before { background: var(--accent-3); }
.callout p { margin: 0; }
.callout p + p { margin-top: 12px; }

.post__followups {
  margin-top: 96px;
  padding-top: 48px;
  border-top: 1px solid var(--line);
}
.post__followups__title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
}
.followup-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.followup {
  padding: 16px 20px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: all 160ms ease;
  cursor: pointer;
}
.followup:hover {
  border-color: var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--ink);
}
.followup__title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 500;
  margin: 0 0 2px;
}
.followup__kicker {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.followup__arrow { font-family: var(--font-display); font-size: var(--step-2); color: var(--ink-soft); }
.followup--planned { opacity: 0.55; cursor: default; }
.followup--planned:hover { transform: none; box-shadow: none; border-color: var(--line-soft); }

/* ---------- theme toggle ---------- */
.theme-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  background: var(--surface);
  margin-left: 14px;
  padding: 2px;
  gap: 0;
  align-self: center;
}
.theme-toggle__btn {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  transition: all 140ms ease;
  display: inline-grid;
  place-items: center;
  min-width: 28px;
}
.theme-toggle__btn:hover { color: var(--ink); }
.theme-toggle__btn--active {
  background: var(--ink);
  color: var(--bg);
}
.theme-toggle__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle--floating {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 60;
  margin-left: 0;
  box-shadow: 3px 3px 0 var(--line);
}

/* ---------- reading toggle (font size + line spacing) ---------- */
.reading-toggle {
  position: fixed;
  top: 20px;
  right: 96px;
  z-index: 60;
}
.reading-toggle__btn {
  appearance: none;
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--line);
  transition: color 140ms ease, border-color 140ms ease;
}
.reading-toggle__btn:hover { color: var(--ink); border-color: var(--ink-soft); }
.reading-toggle__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.reading-toggle__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  display: grid;
  gap: 14px;
  padding: 14px 14px 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 5px 5px 0 var(--line);
}
.reading-toggle__panel[hidden] { display: none; }

.reading-toggle__group {
  display: grid;
  gap: 6px;
}
.reading-toggle__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.reading-toggle__row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0;
  border: 1px solid var(--line);
}
.reading-toggle__row button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  font: inherit;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
  border-right: 1px solid var(--line);
  transition: background 140ms ease, color 140ms ease;
  line-height: 1;
}
.reading-toggle__row button:last-child { border-right: 0; }
.reading-toggle__row button:hover { background: var(--bg); color: var(--ink); }
.reading-toggle__row button.is-active {
  background: var(--ink);
  color: var(--bg);
}
.reading-toggle__row button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ---------- entrance animation ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(12px);
    animation: reveal 700ms cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
    animation-delay: var(--reveal-delay, 0ms);
  }
  @keyframes reveal {
    to { opacity: 1; transform: translateY(0); }
  }
}
