/* Quizboard blog — standalone stylesheet for the pre-rendered /blog pages.
   Always dark, matching the main site (src/index.css + SiteNav/Footer):
   ink #14141F, card #1F1F33, cream #F7F5EF, body #B5B2C2, muted #9B98A8, periwinkle #7C88D9, lime #C1F752.
   There is deliberately no light theme: the React site is dark-only, so the blog is too. */

@font-face { font-family: 'Gudlak'; src: url('/fonts/gc-gudlak-demo/GCGudlakDemo-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gudlak'; src: url('/fonts/gc-gudlak-demo/GCGudlakDemo-Medium.ttf') format('truetype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gudlak'; src: url('/fonts/gc-gudlak-demo/GCGudlakDemo-SemiBold.ttf') format('truetype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gudlak'; src: url('/fonts/gc-gudlak-demo/GCGudlakDemo-Bold.ttf') format('truetype'); font-weight: 700 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Tinta Arabic'; src: url('/fonts/tinta-arabic/TintaArabic-Bold.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --bg: #14141f;
  --bg-2: #191927;
  --surface: #1f1f33;
  --surface-2: #29293f;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(247, 245, 239, 0.2);
  --text: #b5b2c2;
  --text-strong: #f7f5ef;
  --muted: #9b98a8;
  --accent: #c1f752;
  --accent-hover: #d4fa7a;
  --accent-shade: #a4d83b;
  --accent-ink: #14141f;
  --accent-soft: rgba(193, 247, 82, 0.1);
  --brand: #7c88d9;
  --link: #a9b2f0;
  --brand-soft: rgba(124, 136, 217, 0.14);
  --warn: #ffb547;
  --warn-soft: rgba(255, 181, 71, 0.1);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  /* Gudlak has no digits — Outfit supplies them (same stack as the React app). */
  --font-body: 'Gudlak', 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Tinta Arabic', 'Gudlak', 'Outfit', Georgia, serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; background: var(--bg); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.75 var(--font-body);
  font-variant-numeric: lining-nums;
  /* Scale fallback glyphs (digits from Outfit) to Gudlak's cap height, as the React app does. */
  font-size-adjust: cap-height from-font;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--text-strong); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }
.narrow { max-width: 800px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* Display headings use Tinta Arabic like the React pages (`font-serif`). It has its own digits
   and unreliable cap-height metrics, so font-size-adjust is switched off for it. */
h1, h2, h3, h4 { color: var(--text-strong); line-height: 1.2; font-family: var(--font-body); font-weight: 700; letter-spacing: -0.01em; }
.post-hero h1, .index-hero h1, .prose h2, .related > h2, .cta-band h2 {
  font-family: var(--font-display); font-weight: 700; font-size-adjust: none; letter-spacing: -0.005em;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 12px; border: 1px solid transparent;
  font: 700 1rem/1 var(--font-body); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .2s ease, transform .1s ease, box-shadow .1s ease;
}
.btn-sm { min-height: 44px; padding: 0 20px; border-radius: 8px; font-size: .875rem; }
.btn-lg { min-height: 48px; font-size: 1rem; font-weight: 600; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-shade); box-shadow: 0 4px 0 var(--accent-shade); }
.btn-sm.btn-primary { box-shadow: 0 2px 0 var(--accent-shade); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-primary:active { transform: translateY(2px); box-shadow: none; }
.btn-outline { border-color: var(--border-strong); color: rgba(247, 245, 239, 0.9); font-weight: 600; }
.btn-outline:hover { background: rgba(247, 245, 239, 0.1); color: var(--text-strong); }

/* ── Reading progress ── */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; background: transparent; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--accent)); }

/* ── Header (mirrors SiteNav.jsx) ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(20, 20, 31, 0.9);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand .brand-logo { width: 40px; height: 40px; object-fit: contain; transition: transform .2s ease; }
.brand:hover .brand-logo { transform: scale(1.05); }
.site-header .brand-text { height: 32px; width: auto; display: none; }
@media (min-width: 640px) { .site-header .brand-text { display: block; } }
.nav { display: none; align-items: center; gap: 28px; }
.nav-link { position: relative; padding: 8px 0; color: var(--text); text-decoration: none; font-weight: 600; font-size: .875rem; transition: color .2s ease; }
.nav-link:hover { color: var(--text-strong); }
.nav-link[aria-current='page'] { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.btn-join { display: none; min-height: 44px; padding: 0 16px; border-radius: 8px; font-size: .875rem; }
.nav-login { display: none; align-items: center; min-height: 44px; padding: 0 8px; color: rgba(247, 245, 239, 0.9); text-decoration: none; font-weight: 600; font-size: .875rem; }
.nav-login:hover { color: var(--text-strong); }
.menu-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px;
  border: 1px solid rgba(247, 245, 239, 0.15); background: transparent; color: var(--text-strong); cursor: pointer;
}
.menu-btn:hover { background: rgba(247, 245, 239, 0.1); }
.menu-btn .i-x, .menu-btn[aria-expanded='true'] .i-menu { display: none; }
.menu-btn[aria-expanded='true'] .i-x { display: block; }
@media (min-width: 640px) { .header-actions { gap: 12px; } .nav-login { display: inline-flex; } }
@media (min-width: 1024px) {
  .nav { display: flex; }
  .btn-join { display: inline-flex; }
  .menu-btn, .mobile-menu { display: none !important; }
}

.mobile-menu { max-height: calc(100vh - 68px); max-height: calc(100dvh - 68px); overflow-y: auto; padding: 16px 0 24px; }
.mobile-links { display: flex; flex-direction: column; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.mobile-link { display: flex; align-items: center; min-height: 56px; color: var(--text-strong); text-decoration: none; font-weight: 600; font-size: 1.125rem; }
.mobile-link + .mobile-link { border-top: 1px solid var(--border); }
.mobile-link[aria-current='page'] { color: var(--accent); }
.mobile-actions { display: grid; gap: 12px; margin-top: 20px; }
.mobile-login { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; color: rgba(247, 245, 239, 0.9); text-decoration: none; font-weight: 600; }
@media (min-width: 640px) { .mobile-login { display: none; } }
@media (prefers-reduced-motion: no-preference) {
  .mobile-menu:not([hidden]) { animation: menu-in .28s cubic-bezier(.22, 1, .36, 1); }
  @keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
}

.draft-banner { background: var(--warn); color: #14141f; text-align: center; padding: 10px 16px; font-weight: 600; font-size: .9375rem; }

/* ── Cover images ──
   The covers are 1600×840 artwork with the post title baked in (left) and a product mock-up (right).
   On phones the baked-in title shrinks to ~7px and duplicates the real H1, so below 640px we
   crop to the mock-up instead of showing the whole image at a tiny scale. */
.cover { position: relative; overflow: hidden; aspect-ratio: 1600 / 840; background: var(--surface-2); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 639px) {
  .cover { aspect-ratio: 16 / 10; }
  .cover img { position: absolute; left: -95%; top: 50%; width: 195%; max-width: none; height: auto; transform: translateY(-57%); }
}

/* ── Post hero ── */
.post-hero { padding: 40px 0 8px; background: radial-gradient(900px 380px at 50% -80px, var(--brand-soft), transparent 70%); }
.breadcrumb { display: flex; gap: 8px; font-size: .875rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text-strong); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tag {
  display: inline-block; align-self: flex-start; width: fit-content; padding: 5px 12px; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid rgba(193, 247, 82, 0.25); color: var(--accent);
  font: 700 .75rem/1.4 var(--font-body); letter-spacing: .06em; text-transform: uppercase;
}
.post-hero h1 { font-size: clamp(2.1rem, 6.5vw, 3.5rem); line-height: 1.12; margin: 0 0 16px; }
.lede { font-size: clamp(1.0625rem, 2.4vw, 1.25rem); color: var(--text); margin: 0 0 22px; line-height: 1.6; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: .9375rem; color: var(--muted); }
.author-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--text-strong); font-weight: 600; }
.author-chip img { width: 28px; height: 28px; object-fit: contain; }
.hero-media { margin-top: 32px; }
.hero-media .cover { max-width: 1100px; margin: 0 auto; border-radius: 20px; border: 1px solid var(--border); box-shadow: var(--shadow); }

/* ── Layout ── */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; padding-top: 36px; padding-bottom: 56px; }
.post-main { min-width: 0; max-width: 740px; width: 100%; margin: 0 auto; }
.toc { display: none; }
@media (min-width: 1080px) {
  .post-layout { grid-template-columns: 240px minmax(0, 740px); justify-content: center; }
  .post-main { margin: 0; }
  .toc { display: block; position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; font-size: .875rem; }
  .toc-mobile { display: none; }
}
.toc-title { font: 700 .75rem/1 var(--font-body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.toc ol, .toc-mobile ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li a, .toc-mobile li a {
  display: block; padding: 7px 12px; border-left: 2px solid var(--border);
  color: var(--muted); text-decoration: none; line-height: 1.4;
}
.toc li a:hover, .toc li a.on { color: var(--text-strong); border-left-color: var(--accent); background: var(--accent-soft); }
.toc-cta { margin-top: 20px; width: 100%; }
.toc-mobile { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; margin-bottom: 28px; }
.toc-mobile summary { cursor: pointer; padding: 14px 16px; font-weight: 700; color: var(--text-strong); min-height: 44px; }
.toc-mobile ol { padding: 0 8px 12px; }
.toc-mobile li a { min-height: 40px; display: flex; align-items: center; }

/* ── Article typography ── */
.prose > * + * { margin-top: 1.15em; }
.prose p, .prose li { color: var(--text); }
/* Bare URLs (e.g. reference lists) must wrap instead of widening the page on phones. */
.prose a, .prose code, .prose figcaption, .callout, .prose li, .prose td { overflow-wrap: anywhere; }
.prose a { color: var(--link); }
.prose strong { color: var(--text-strong); font-weight: 650; }
.prose h2 {
  font-size: clamp(1.65rem, 4.5vw, 2.1rem); line-height: 1.2; margin-top: 2.4em; margin-bottom: .6em;
  padding-top: .9em; border-top: 1px solid var(--border); position: relative;
}
.prose h3 { font-size: clamp(1.2rem, 3vw, 1.35rem); font-weight: 700; margin-top: 1.8em; margin-bottom: .4em; position: relative; }
.prose h2 + *, .prose h3 + * { margin-top: 0; }
.anchor { position: absolute; left: -1.1em; color: var(--muted); opacity: 0; text-decoration: none; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
@media (max-width: 800px) { .anchor { display: none; } }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--brand); font-weight: 700; }
.prose hr { border: 0; height: 1px; background: var(--border); margin: 2.5em 0; }
.prose code { font-size: .9em; background: var(--surface-2); padding: .15em .4em; border-radius: 6px; }
.prose blockquote { margin-left: 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--brand); color: var(--text); font-style: italic; }

/* Task-list checklist */
.prose li:has(> input[type='checkbox']) { list-style: none; margin-left: -1.4em; display: flex; gap: 12px; align-items: flex-start; }
.prose input[type='checkbox'] {
  appearance: none; -webkit-appearance: none; flex: 0 0 22px; width: 22px; height: 22px; margin-top: .25em;
  border: 2px solid var(--brand); border-radius: 6px; background: var(--surface);
}

/* Figures */
.prose figure { margin: 2em 0; }
.prose figure img {
  width: 100%; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  box-shadow: var(--shadow); cursor: zoom-in;
}
.prose figcaption { margin-top: 10px; font-size: .9rem; color: var(--muted); line-height: 1.55; text-align: center; }
.prose figcaption .credit { display: block; font-size: .78rem; margin-top: 2px; opacity: .85; }
.prose figcaption a { color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); -webkit-overflow-scrolling: touch; }
.prose table { border-collapse: collapse; width: 100%; min-width: 720px; font-size: .9375rem; line-height: 1.5; }
.prose th { text-align: left; background: var(--surface-2); color: var(--text-strong); font-weight: 700; }
.prose th, .prose td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }

/* Callouts */
.callout { border-radius: 14px; padding: 18px 20px; border: 1px solid var(--border); background: var(--surface); }
.callout > :first-child { margin-top: 0; }
.callout > * + * { margin-top: .7em; }
.callout-title { font: 700 .8125rem/1 var(--font-body); text-transform: uppercase; letter-spacing: .08em; color: var(--text-strong); margin-bottom: 10px; }
.callout-summary { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); border-left: 5px solid var(--accent); }
.callout-summary ol { margin-bottom: 0; }
.callout-tip { border-left: 5px solid var(--brand); background: var(--brand-soft); }
.callout-note { border-left: 5px solid var(--muted); }
.callout-warning { border-left: 5px solid var(--warn); background: var(--warn-soft); }
.callout-research { border-left: 5px solid var(--brand); }
.callout-cta {
  text-align: center; padding: 32px 22px; border-radius: 20px;
  background: radial-gradient(500px 200px at 50% 0, var(--brand-soft), transparent), var(--surface);
}
.callout-cta h3, .callout-cta p:first-child strong { font-size: 1.4rem; }
.callout-cta a[href='/signup'] {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 26px; margin-top: 6px; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink); font: 700 1.05rem/1 var(--font-body); text-decoration: none; border: 1px solid var(--accent-shade); box-shadow: 0 4px 0 var(--accent-shade);
}

/* Step badges: H2s starting with "Step N:" */
.prose h2 .step { display: inline-grid; place-items: center; min-width: 2.1em; height: 2.1em; margin-right: .5em; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-size: .7em; vertical-align: .2em; }

/* FAQ */
.prose details { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 0 18px; }
.prose details + details { margin-top: 10px; }
.prose summary { cursor: pointer; padding: 15px 0; font-weight: 700; color: var(--text-strong); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.prose summary::-webkit-details-marker { display: none; }
.prose summary::after { content: '+'; color: var(--brand); font-size: 1.4em; line-height: 1; }
.prose details[open] summary::after { content: '–'; }
.prose details > :not(summary) { margin: 0 0 16px; }

/* Inline diagram blocks (SVG) */
.diagram { margin: 2em 0; padding: 20px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram figcaption { margin-top: 12px; }

/* ── Author / share ── */
.author-box { display: flex; gap: 16px; align-items: flex-start; margin-top: 48px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.author-box img { width: 56px; height: 56px; object-fit: contain; flex: none; }
.author-name { font: 700 1.05rem/1.3 var(--font-body); color: var(--text-strong); }
.author-box p { margin: 4px 0 0; font-size: .9375rem; line-height: 1.6; }
.share { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 22px; font-size: .9375rem; }
.share a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border); text-decoration: none; color: var(--text-strong); font-weight: 600; }
.share a:hover { background: var(--surface-2); }

/* ── Cards (index + related) ──
   1 column on phones, 2 from 760px. With an odd post count the first card is featured across
   both columns (image beside text), so 1–3 posts never leave a hole. */
.index-hero { padding: 64px 0 36px; text-align: center; background: radial-gradient(900px 380px at 50% -80px, var(--brand-soft), transparent 70%); }
.index-hero h1 { font-size: clamp(2.5rem, 8vw, 4rem); line-height: 1.1; margin: 0 0 14px; }
.index-hero .lede { margin: 0 auto; max-width: 640px; }
.related { padding-bottom: 56px; }
.related > h2 { font-size: clamp(1.6rem, 4vw, 2rem); margin: 0 0 4px; }
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin: 20px 0 56px; }
.card {
  display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border); border-radius: 20px; overflow: hidden;
  background: var(--surface); text-decoration: none; color: inherit; transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: rgba(124, 136, 217, 0.55); color: inherit; }
.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; flex: 1; }
.card h3 { margin: 2px 0 0; font-size: 1.25rem; line-height: 1.3; }
.card p { margin: 0; color: var(--text); font-size: .9375rem; line-height: 1.6; }
.card time { font-size: .8125rem; color: var(--muted); margin-top: auto; padding-top: 4px; }
@media (min-width: 760px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
  .cards.has-featured > .card:first-child { grid-column: 1 / -1; }
}
@media (min-width: 960px) {
  .cards.has-featured > .card:first-child { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .cards.has-featured > .card:first-child .card-body { padding: 36px 36px 36px 32px; justify-content: center; gap: 14px; }
  .cards.has-featured > .card:first-child h3 { font-size: 1.75rem; }
  .cards.has-featured > .card:first-child p { font-size: 1.0625rem; }
  .cards.has-featured > .card:first-child time { margin-top: 4px; }
}

.cta-band {
  display: flex; flex-direction: column; gap: 20px; align-items: flex-start; padding: 32px 24px; margin-bottom: 72px;
  border-radius: 20px; border: 1px solid var(--border);
  background: radial-gradient(600px 220px at 0 0, var(--brand-soft), transparent), var(--surface);
}
.cta-band h2 { margin: 0 0 8px; font-size: clamp(1.6rem, 4vw, 2.1rem); }
.cta-band p { margin: 0; color: var(--text); }
@media (min-width: 760px) { .cta-band { flex-direction: row; align-items: center; justify-content: space-between; padding: 40px; } }

/* ── Footer (mirrors Footer.jsx) ── */
.site-footer { border-top: 1px solid var(--border); background: var(--bg); padding: 56px 0 24px; }
.footer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; }
.footer-brand { grid-column: span 2; }
.footer-brand .brand { margin-bottom: 20px; gap: 14px; }
.footer-brand .brand-logo { width: 44px; height: 44px; }
.footer-brand .brand-text { height: 36px; width: auto; }
.footer-brand p { max-width: 20rem; margin: 0; color: var(--muted); font-weight: 500; line-height: 1.65; font-size: 1rem; }
.footer-col h2 { margin: 0 0 12px; font: 700 .875rem/1.4 var(--font-body); text-transform: uppercase; letter-spacing: .05em; color: var(--text-strong); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col a { display: inline-flex; align-items: center; min-height: 40px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: .875rem; transition: color .2s ease; }
.footer-col a:hover { color: var(--text-strong); }
.footer-bottom {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); font-size: .875rem; font-weight: 500; color: var(--muted);
}
.footer-bottom p { margin: 0; }
.footer-bottom a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--text-strong); }
@media (min-width: 768px) {
  .site-footer { padding-top: 64px; }
  .footer-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 40px; }
  .footer-bottom { flex-direction: row; }
}
/* The border line should span the content width, not the padded .wrap box. */
.footer-bottom.wrap { width: calc(100% - 32px); padding-left: 0; padding-right: 0; }
@media (min-width: 640px) { .footer-bottom.wrap { width: calc(100% - 48px); } }
@media (min-width: 1228px) { .footer-bottom.wrap { width: 1132px; } }

/* ── Zoom overlay ── */
.zoom { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; padding: 16px; background: rgba(8, 8, 14, 0.92); cursor: zoom-out; }
.zoom.open { display: grid; }
.zoom img { max-width: min(1400px, 100%); max-height: 92vh; border-radius: 10px; width: auto; }
.zoom button { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }

@media print {
  .site-header, .toc, .toc-mobile, .share, .site-footer, .progress, .related { display: none !important; }
  body { background: #fff; color: #000; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Step flow strip */
.flow { display: flex; flex-wrap: wrap; gap: 8px; margin: 1.6em 0; padding: 0; }
.flow > div {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  font: 600 .9375rem/1 var(--font-body); color: var(--text-strong);
}
.flow b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: .8125rem; }

/* "Read the spread" cards */
.spread-cards { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 1.6em 0; }
@media (min-width: 640px) { .spread-cards { grid-template-columns: repeat(3, 1fr); } }
.spread-card { padding: 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); border-top: 5px solid var(--c); }
.spread-card.good { --c: #3ecf8e; }
.spread-card.split { --c: var(--warn); }
.spread-card.wrong { --c: #e85d75; }
.spread-card .bars { display: flex; align-items: flex-end; gap: 6px; height: 64px; margin-bottom: 12px; }
.spread-card .bars span { flex: 1; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--c) 30%, transparent); }
.spread-card.good .bars span:nth-child(2), .spread-card.split .bars span:nth-child(-n+2), .spread-card.wrong .bars span:nth-child(1) { background: var(--c); }
.spread-card h4 { margin: 0 0 6px; font-size: 1.05rem; }
.spread-card p { margin: 0; font-size: .9375rem; line-height: 1.55; color: var(--muted); }
.diagram { color: var(--text); }
