/* Lucky4.tech — "field guide" design system. One stylesheet for every page. */

/* Self-hosted Google Fonts (SIL OFL), Latin subset. Literata and Atkinson Next are preloaded in shared.ts. */
@font-face { font-family: 'Literata'; font-style: normal; font-weight: 500 700; font-display: swap; src: url(/fonts/literata.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Literata'; font-style: italic; font-weight: 500 700; font-display: swap; src: url(/fonts/literata-italic.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/atkinson-next.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-style: italic; font-weight: 400; font-display: swap; src: url(/fonts/atkinson-next-italic.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Atkinson Hyperlegible Mono'; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/fonts/atkinson-mono.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --paper: #f5f0e6;
  --paper-deep: #ece4d4;
  --card: #fffdf8;
  --ink: #1c2230;
  --ink-soft: #4a5263;
  --ink-faint: #5f6577;
  --line: #d8cfbc;
  --line-strong: #bfb39b;
  --accent: #c2410c;
  --accent-ink: #9a330a;
  --accent-wash: #fbe3d6;
  --green: #1f6b52;
  --green-wash: #dcefe5;
  --marker: #fde8a0;

  --tab-1: #c2410c;
  --tab-2: #1f6b52;
  --tab-3: #2f5d8a;
  --tab-4: #8a4f9e;
  --tab-5: #a06a12;
  --tab-6: #3d6b6b;

  --font-display: 'Literata', Georgia, 'Times New Roman', serif;
  --font-body: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', system-ui, sans-serif;
  --font-mono: 'Atkinson Hyperlegible Mono', ui-monospace, 'SFMono-Regular', monospace;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 0 rgba(28, 34, 48, 0.04), 0 8px 24px -12px rgba(28, 34, 48, 0.18);
  --wrap: 1180px;
  --measure: 68ch;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.13 0 0 0 0 0.19 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); text-decoration-thickness: 2px; }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
}

p, li { text-wrap: pretty; }

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 12px; color: var(--paper); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px;
  border-radius: 999px; border: 2px solid var(--ink);
  font: 700 1rem/1.2 var(--font-body);
  text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-ink); }
.btn-primary:hover { color: #fff; background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-secondary { background: transparent; color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--paper); }
.btn-small { min-height: 40px; padding: 8px 16px; font-size: 0.95rem; }
.btn .arrow { transition: transform 0.15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.link-button {
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--accent-ink);
  text-decoration: underline; text-underline-offset: 0.18em;
}
.link-button:hover { color: var(--accent); }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(245, 240, 230, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.35rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.02em;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  width: 36px; height: 34px; letter-spacing: -0.04em;
  border-radius: 9px; background: var(--ink); color: var(--paper);
  font: 700 0.95rem/1 var(--font-mono);
  transform: rotate(-4deg);
}
.brand-mark b { color: #ffb28f; font-weight: 700; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.site-nav a, .site-nav button.nav-link {
  padding: 8px 12px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 1rem;
  background: none; border: 0; cursor: pointer; font-family: inherit;
}
.site-nav a:hover, .site-nav button.nav-link:hover { background: var(--paper-deep); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--paper-deep); }
.site-nav .btn { margin-left: 8px; }

.nav-toggle {
  display: none; margin-left: auto;
  width: 44px; height: 44px; border-radius: 10px;
  border: 1.5px solid var(--line-strong); background: var(--card); cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 18px; height: 2px; background: var(--ink); margin: 0 auto; position: relative; content: '';
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px 20px 20px; background: var(--paper); border-bottom: 1px solid var(--line);
  }
  .site-nav.open { display: flex; }
  .site-nav a, .site-nav button.nav-link { padding: 12px; font-size: 1.1rem; text-align: left; }
  .site-nav .btn { margin: 8px 0 0; }
}

/* ---------- Reading progress ---------- */

.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 60;
  background: transparent; pointer-events: none;
}
.progress span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- Generic sections ---------- */

.section { padding: clamp(56px, 8vw, 96px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(2rem, 4vw, 2.75rem); margin: 10px 0 12px; }
.section-head p { margin: 0; color: var(--ink-soft); font-size: 1.15rem; }
.section-head.center { margin-inline: auto; text-align: center; }

/* ---------- Home hero ---------- */

.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(48px, 7vw, 80px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.hero h1 {
  font-size: clamp(2.75rem, 6.4vw, 5rem);
  line-height: 1.06; margin: 18px 0 22px;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-lede { font-size: clamp(1.15rem, 1.6vw, 1.3rem); color: var(--ink-soft); max-width: 34em; margin: 0 0 30px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { margin-top: 22px; font-size: 0.95rem; color: var(--ink-faint); }

.problem-finder {
  background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius-lg);
  padding: 26px; box-shadow: 8px 8px 0 var(--ink);
  transform: rotate(0.6deg);
}
.problem-finder h2 { font-size: 1.5rem; margin: 6px 0 16px; }
.problem-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.problem-list a {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius);
  border: 1.5px solid var(--line); background: var(--paper);
  color: var(--ink); text-decoration: none; font-weight: 500; line-height: 1.35;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}
.problem-list a small { display: block; margin-top: 3px; color: var(--ink-faint); font-weight: 400; font-size: 0.9rem; }
.problem-list a:hover { border-color: var(--accent); background: var(--accent-wash); transform: translateX(3px); }
.problem-list .go { font-family: var(--font-mono); color: var(--accent); font-weight: 600; }

@media (max-width: 880px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .problem-finder { transform: none; box-shadow: 5px 5px 0 var(--ink); }
}

/* ---------- Topic tabs (binder dividers) ---------- */

.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 980px) { .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .topic-grid { grid-template-columns: 1fr; } }

.topic-card {
  --tab: var(--tab-1);
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 1.5px solid var(--line-strong);
  border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
  padding: 30px 24px 22px; margin-top: 18px;
  box-shadow: var(--shadow);
}
.topic-card::before {
  content: '';
  position: absolute; top: -14px; left: -1.5px;
  width: 56px; height: 14px;
  background: var(--tab);
  border-radius: 8px 8px 0 0;
}
.topic-card h3 { font-size: 1.45rem; margin: 0 0 6px; }
.topic-card h3 a { color: var(--ink); text-decoration: none; }
.topic-card h3 a:hover { color: var(--tab); }
.topic-card .topic-summary { margin: 0 0 16px; color: var(--ink-soft); font-size: 1rem; }
.topic-card ul { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 2px; border-top: 1px dashed var(--line-strong); }
.topic-card li a {
  display: block; padding: 9px 0; border-bottom: 1px dashed var(--line);
  color: var(--ink); text-decoration: none; font-size: 0.98rem; line-height: 1.4;
}
.topic-card li a:hover { color: var(--tab); }
.topic-card .topic-more { margin-top: auto; font-weight: 700; color: var(--tab); text-decoration: none; font-size: 0.98rem; }
.topic-card .topic-more:hover { text-decoration: underline; }

.tab-1 { --tab: var(--tab-1); } .tab-2 { --tab: var(--tab-2); } .tab-3 { --tab: var(--tab-3); }
.tab-4 { --tab: var(--tab-4); } .tab-5 { --tab: var(--tab-5); } .tab-6 { --tab: var(--tab-6); }

.topic-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 0.78rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--tab, var(--accent)); text-decoration: none;
}
.topic-chip::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--tab, var(--accent)); }
a.topic-chip:hover { text-decoration: underline; color: var(--tab, var(--accent)); }

/* ---------- Guide cards ---------- */

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 980px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .card-grid { grid-template-columns: 1fr; } }

.guide-card {
  display: flex; flex-direction: column;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  color: var(--ink); text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.guide-card:hover { transform: translateY(-3px); border-color: var(--ink); box-shadow: 6px 6px 0 var(--ink); color: var(--ink); text-decoration: none; }
.guide-card .thumb { aspect-ratio: 3 / 2; background: var(--paper-deep); border-bottom: 1.5px solid var(--line); }
.guide-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.guide-card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.guide-card h3 { font-size: 1.3rem; margin: 0; }
.guide-card p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; line-height: 1.55; }
.guide-card .meta { margin-top: auto; padding-top: 6px; font-size: 0.88rem; color: var(--ink-faint); }

.guide-list { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.guide-row { border-bottom: 1px solid var(--line); }
.guide-row a {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 20px; align-items: center;
  padding: 18px 4px; color: var(--ink); text-decoration: none;
}
.guide-row a:hover h3 { color: var(--accent); }
.guide-row img { width: 120px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.guide-row h3 { font-size: 1.25rem; margin: 0 0 4px; transition: color 0.15s ease; }
.guide-row p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; line-height: 1.5; }
.guide-row .meta { font-size: 0.85rem; color: var(--ink-faint); white-space: nowrap; }
@media (max-width: 680px) {
  .guide-row a { grid-template-columns: 84px minmax(0, 1fr); gap: 14px; }
  .guide-row img { width: 84px; }
  .guide-row .meta { grid-column: 2; white-space: normal; }
}

/* ---------- Picks ---------- */

.picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 820px) { .picks { grid-template-columns: 1fr; } }
.pick {
  position: relative; background: var(--card); border: 1.5px solid var(--ink);
  border-radius: var(--radius-lg); padding: 30px 28px 24px;
  display: flex; flex-direction: column;
}
.pick-for {
  display: inline-block; align-self: flex-start;
  background: var(--green-wash); color: var(--green);
  padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: 0.9rem;
}
.pick h3 { font-size: 2rem; margin: 14px 0 6px; }
.pick .pick-line { margin: 0 0 16px; color: var(--ink-soft); font-size: 1.05rem; }
.pick ul { margin: 0 0 22px; padding: 0; list-style: none; display: grid; gap: 10px; }
.pick li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; line-height: 1.45; }
.pick li::before { content: '✓'; color: var(--green); font-weight: 700; }
.pick li.skip::before { content: '–'; color: var(--accent); }
.pick-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding-top: 18px; border-top: 1px dashed var(--line-strong); }
.price { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; line-height: 1; }
.price small { display: block; margin-top: 6px; font: 400 0.88rem/1.3 var(--font-body); color: var(--ink-faint); }
.disclosure { margin: 14px 0 0; font-size: 0.85rem; color: var(--ink-faint); }

/* ---------- Comparison table ---------- */

.table-scroll { overflow-x: auto; border: 1.5px solid var(--ink); border-radius: var(--radius-lg); background: var(--card); }
.compare { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 1rem; }
.compare th, .compare td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { font-family: var(--font-display); font-size: 1.1rem; background: var(--paper-deep); border-bottom: 1.5px solid var(--ink); }
.compare thead th.ours { background: var(--green-wash); }
.compare tbody th { font-weight: 700; width: 18%; }
.compare tr:last-child td, .compare tr:last-child th { border-bottom: 0; }
.compare .good { color: var(--green); font-weight: 700; }
.compare .bad { color: var(--accent-ink); }
.table-note { margin: 12px 0 0; font-size: 0.9rem; color: var(--ink-faint); }

/* ---------- Details / disclosure widgets ---------- */

.fold { border: 1.5px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--card); }
.fold + .fold { margin-top: 12px; }
.fold > summary {
  list-style: none; cursor: pointer; padding: 18px 22px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-weight: 700; font-size: 1.08rem;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: '+'; font: 600 1.5rem/1 var(--font-mono); color: var(--accent); transition: transform 0.2s ease; }
.fold[open] > summary::after { transform: rotate(45deg); }
.fold > .fold-body { padding: 0 22px 20px; color: var(--ink-soft); }
.fold > .fold-body p { margin: 0 0 10px; }

.reject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; padding: 0 22px 22px; }
.reject { padding: 14px 16px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.reject strong { display: block; font-size: 1.02rem; margin-bottom: 4px; }
.reject span { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.5; }

/* ---------- Calculator ---------- */

.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
@media (max-width: 720px) { .calc { grid-template-columns: 1fr; } }
.calc-inputs, .calc-result { background: var(--card); border: 1.5px solid var(--line-strong); border-radius: var(--radius-lg); padding: 24px; }
.calc label { display: block; font-weight: 700; margin-bottom: 8px; }
.calc .field + .field { margin-top: 18px; }
.calc-result { background: var(--ink); color: var(--paper); border-color: var(--ink); display: flex; flex-direction: column; justify-content: center; }
.calc-result .eyebrow { color: #c9c2b4; }
.calc-result output { display: block; font-family: var(--font-display); font-size: clamp(2.5rem, 6vw, 3.75rem); line-height: 1.05; margin: 8px 0; }
.calc-result p { margin: 0; color: #c9c2b4; }

/* ---------- Forms ---------- */

.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  font: 400 1.05rem/1.4 var(--font-body); color: var(--ink);
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: var(--radius);
}
.textarea { min-height: 130px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 3px solid var(--accent-wash); border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.form-stack { display: grid; gap: 12px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form .input { flex: 1 1 220px; }
.form-status { min-height: 1.4em; margin: 10px 0 0; font-size: 0.95rem; }
.form-status.success { color: var(--green); }
.form-status.error { color: var(--accent-ink); }
.download-card { display: none; margin-top: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--green-wash); color: var(--green); }
.download-card.show { display: block; }
.download-card a { color: var(--green); font-weight: 700; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }
.panel { background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius-lg); padding: clamp(24px, 4vw, 36px); }
.panel h2, .panel h3 { margin: 8px 0 10px; font-size: clamp(1.6rem, 3vw, 2.1rem); }
.panel > p { color: var(--ink-soft); margin: 0 0 18px; }
.panel ul.ticks { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.panel ul.ticks li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; }
.panel ul.ticks li::before { content: '✓'; color: var(--green); font-weight: 700; }
.panel.dark { background: var(--ink); color: var(--paper); }
.panel.dark h2, .panel.dark h3 { color: var(--paper); }
.panel.dark > p, .panel.dark .eyebrow { color: #c9c2b4; }

/* ---------- Dialog ---------- */

.guide-dialog {
  width: min(560px, calc(100% - 32px)); padding: 0; border: 1.5px solid var(--ink);
  border-radius: var(--radius-lg); background: var(--card); color: var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
}
.guide-dialog::backdrop { background: rgba(28, 34, 48, 0.55); }
.guide-dialog .dialog-body { padding: 32px 28px 26px; }
.guide-dialog h2 { font-size: 1.9rem; margin: 8px 0 10px; }
.guide-dialog p { color: var(--ink-soft); margin: 0 0 16px; }
.dialog-close {
  position: absolute; top: 12px; right: 12px; width: 40px; height: 40px;
  border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--paper);
  font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink);
}
body.modal-open { overflow: hidden; }

.zoom { display: block; cursor: zoom-in; }
.zoom-dialog {
  width: min(1200px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 16px;
  border: 1.5px solid var(--ink); border-radius: var(--radius-lg); background: var(--card); cursor: zoom-out;
}
.zoom-dialog::backdrop { background: rgba(28, 34, 48, 0.75); }
.zoom-dialog img { display: block; width: 100%; height: auto; max-height: calc(100vh - 140px); object-fit: contain; }
.zoom-dialog p { margin: 10px 48px 0 4px; color: var(--ink-soft); font-size: 0.95rem; }
.zoom-dialog p:empty { display: none; }
.zoom-dialog .dialog-close { top: auto; bottom: 10px; }

.share-button {
  min-height: 36px; padding: 4px 14px; border: 1.5px solid var(--line-strong); border-radius: 999px;
  background: var(--card); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer;
}
.share-button:hover { border-color: var(--ink); }

/* ---------- Page heads (archive / topic) ---------- */

.page-head { padding: clamp(36px, 6vw, 72px) 0 clamp(24px, 4vw, 40px); }
.page-head h1 { font-size: clamp(2.5rem, 5.5vw, 4.25rem); margin: 14px 0 16px; }
.page-head p.lede { max-width: 42em; font-size: 1.2rem; color: var(--ink-soft); margin: 0; }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.92rem; color: var(--ink-faint); margin: 0; padding: 0; list-style: none; }
.crumbs li + li::before { content: '/'; margin-right: 6px; color: var(--line-strong); }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--card);
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.98rem;
}
.chip::before { content: ''; width: 9px; height: 9px; border-radius: 3px; background: var(--tab, var(--ink)); }
.chip:hover { border-color: var(--tab, var(--ink)); color: var(--ink); }
.chip .count { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-faint); }

.search-box { position: relative; max-width: 520px; margin-top: 24px; }
.search-box .input { padding-left: 44px; border-color: var(--ink); }
.search-box svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); }
.search-empty { display: none; padding: 24px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg); color: var(--ink-soft); }
.search-empty.show { display: block; }

.topic-block { padding: 28px 0 8px; }
.topic-block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.topic-block-head h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); margin: 6px 0 0; }
.topic-block-head p { width: 100%; margin: 4px 0 8px; color: var(--ink-soft); }

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

.article-head { padding: clamp(28px, 5vw, 56px) 0 clamp(28px, 4vw, 44px); }
.article-head .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.article-head h1 { font-size: clamp(2.2rem, 4.4vw, 3.5rem); margin: 16px 0 16px; }
.article-dek { font-size: clamp(1.1rem, 1.6vw, 1.25rem); color: var(--ink-soft); margin: 0 0 22px; max-width: 40em; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 0.95rem; color: var(--ink-faint); }
.article-meta .byline { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.article-meta .byline .brand-mark { width: 32px; height: 30px; font-size: 0.82rem; }
.article-hero { margin: 0; }
.article-hero img { width: 100%; border-radius: var(--radius-lg); border: 1.5px solid var(--ink); background: var(--paper-deep); box-shadow: 8px 8px 0 var(--paper-deep); }
@media (max-width: 900px) {
  .article-head .wrap { grid-template-columns: 1fr; }
  .article-hero { max-width: 640px; }
}

.article-layout { display: grid; grid-template-columns: 250px minmax(0, var(--measure)); justify-content: center; gap: clamp(32px, 5vw, 72px); padding-bottom: 40px; }
@media (max-width: 1040px) { .article-layout { grid-template-columns: minmax(0, var(--measure)); } }

.toc { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; }
.toc .eyebrow { display: block; margin-bottom: 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a {
  display: block;
  padding: 7px 0 7px 14px; margin-left: -2px; border-left: 2px solid transparent;
  color: var(--ink-soft); text-decoration: none; font-size: 0.93rem; line-height: 1.35;
}
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--ink); border-left-color: var(--accent); font-weight: 700; }
.toc-cta { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 0.93rem; color: var(--ink-soft); }
.toc-cta a { font-weight: 700; }
.toc-mobile { display: none; }
@media (max-width: 1040px) {
  .toc { display: none; }
  .toc-mobile { display: block; margin: 0 0 28px; }
  .toc-mobile ol { margin: 0; padding: 0 22px 18px 44px; }
  .toc-mobile li { padding: 4px 0; }
  .toc-mobile a { color: var(--ink); }
}

.short-version {
  position: relative; margin: 0 0 36px; padding: 24px 24px 20px 26px;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius-lg);
  box-shadow: 6px 6px 0 var(--marker);
}
.short-version h2 { font-size: 1.35rem; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.short-version h2 .tag { font: 600 0.72rem/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; background: var(--marker); padding: 5px 8px; border-radius: 6px; }
.short-version ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.short-version li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; line-height: 1.5; }
.short-version li::before { content: '→'; color: var(--accent); font-weight: 700; }

.prose { font-size: 1.1875rem; line-height: 1.72; }
.prose > .intro { font-size: 1.28rem; line-height: 1.65; margin: 0 0 36px; }
.prose section { margin: 0 0 48px; }
.prose h2 {
  font-size: clamp(1.65rem, 3vw, 2.1rem); margin: 0 0 18px;
}
.prose h2 a.anchor { color: inherit; text-decoration: none; }
.prose h2 a.anchor:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.prose p { margin: 0 0 1.05em; }
.prose ul { margin: 1.2em 0; padding: 18px 22px 18px 44px; background: var(--paper-deep); border-radius: var(--radius); }
.prose ul li { margin: 0 0 0.5em; padding-left: 4px; }
.prose ul li:last-child { margin-bottom: 0; }
.prose ul li::marker { color: var(--accent); }
.prose figure { margin: 30px 0; }
.prose figure img { width: 100%; border-radius: var(--radius); border: 1.5px solid var(--line-strong); background: var(--card); }
.prose figcaption { margin-top: 10px; font-size: 0.98rem; color: var(--ink-soft); line-height: 1.5; padding-left: 14px; border-left: 3px solid var(--accent); }
.prose a { font-weight: 500; }

.cta-box {
  margin: 48px 0; padding: clamp(24px, 4vw, 34px);
  background: var(--ink); color: var(--paper); border-radius: var(--radius-lg);
}
.cta-box h2 { color: var(--paper); font-size: clamp(1.6rem, 3vw, 2rem); margin: 6px 0 10px; }
.cta-box p { color: #d8d2c4; margin: 0 0 20px; }
.cta-box .eyebrow { color: #ffb28f; }
.cta-box .btn-secondary { color: var(--paper); border-color: var(--paper); }
.cta-box .btn-secondary:hover { background: var(--paper); color: var(--ink); }
.cta-box .actions { display: flex; flex-wrap: wrap; gap: 12px; }

.method {
  margin: 40px 0 0; padding: 18px 20px; border-radius: var(--radius);
  border: 1px dashed var(--line-strong); font-size: 0.98rem; color: var(--ink-soft);
}
.method strong { color: var(--ink); }

.next-reads { padding: 48px 0 72px; border-top: 1px solid var(--line); }
.next-reads h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); margin: 0 0 22px; }

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

.site-footer { background: var(--ink); color: #d8d2c4; padding: 64px 0 36px; margin-top: 0; }
.site-footer a { color: var(--paper); text-decoration: none; }
.site-footer a:hover { color: #ffb28f; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
.site-footer .brand { color: var(--paper); }
.site-footer .brand-mark { background: var(--paper); color: var(--ink); }
.site-footer .brand-mark b { color: var(--accent); }
.site-footer h2 { font: 600 0.78rem/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: #a39d90; margin: 0 0 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer p { margin: 14px 0 0; max-width: 34em; font-size: 0.98rem; }
.footer-bottom { margin-top: 44px; padding-top: 20px; border-top: 1px solid #343b4c; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 0.9rem; color: #a39d90; }

/* ---------- Small pages ---------- */

.center-page { min-height: 60vh; display: grid; place-items: center; padding: 64px 0; text-align: center; }
.center-page .panel { max-width: 640px; margin: 0 auto; }
.center-page h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin: 12px 0 14px; }
.big-404 { font: 600 clamp(4rem, 14vw, 8rem)/1 var(--font-display); color: var(--accent); margin: 0; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .rise-2 { animation-delay: 0.08s; }
  .rise-3 { animation-delay: 0.16s; }
  .rise-4 { animation-delay: 0.24s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .site-footer, .toc, .toc-mobile, .cta-box, .next-reads, .progress { display: none !important; }
  body { background: #fff; }
}

/* The TL;DR list sits inside .prose but shouldn't get the body-list panel styling. */
.prose .short-version ul { margin: 0; padding: 0; background: none; border-radius: 0; }
.prose .short-version li { margin: 0; padding: 0; }
