:root {
  --primary: #B64B28;
  --primary-ink: #5C2414;
  --accent: #0B6E69;
  --accent-ink: #043A38;
  --background: #FFF8F2;
  --surface: #FFFFFF;
  --surface-2: #FCE8D7;
  --surface-3: #F4D7C2;
  --text: #312019;
  --muted: #5C463A;
  --muted-2: #745D50;
  --border: #EBCDBA;
  --border-strong: #D9A888;
  --ink: #1C120E;
  --paper: #FFF8F2;
  --poster: #2A1812;
  --poster-paper: #FFF1E4;
  --focus: #0B6E69;
  --danger: #8A2A1B;
  --ok: #0B6E69;
  --shadow: 0 10px 28px rgba(49, 32, 25, 0.08);
  --radius: 2px;
  --header-h: 68px;
  --sticky-h: 76px;
  --max: 1180px;
  --gutter: 22px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Devanagari", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-display: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Devanagari", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --lh: 1.7;
}

*,
*::before,
*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: clip; max-width: 100%; }
body {
  font-family: var(--font);
  font-size: 18px;
  line-height: var(--lh);
  color: var(--text);
  background: var(--background);
  min-width: 0;
}
html.is-drawer-open,
html.is-drawer-open body { overflow: hidden; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--primary-ink); text-underline-offset: 2px; }
a:hover { color: var(--primary-ink); }
button, input, textarea, select { font: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 0.6em; }
h1 { font-size: clamp(32px, 4.4vw, 56px); font-weight: 720; }
h2 { font-size: clamp(26px, 2.6vw, 36px); font-weight: 680; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 400;
  background: var(--ink); color: #fff; padding: 8px 12px; white-space: nowrap;
}
.skip-link:focus { top: 10px; }
.container { width: min(var(--max), calc(100% - 2 * var(--gutter))); margin-inline: auto; min-width: 0; }
.container-wide { width: min(1280px, calc(100% - 2 * var(--gutter))); margin-inline: auto; min-width: 0; }
.prose { max-width: 70ch; }
.prose a { text-decoration: underline; }
section[id] { scroll-margin-top: 84px; }
.band { padding: 56px 0; }
.band-paper { background: var(--paper); }
.band-warm { background: var(--surface-2); }
.band-white { background: var(--surface); }
.band-ink { background: var(--poster); color: #F7E7D8; }
.band-ink h2, .band-ink h3 { color: #FFF8F2; }
.band-ink p, .band-ink li { color: #F0DCC8; }
.hairline { height: 1px; background: var(--border); border: 0; margin: 0; }

/* Header: centered nav, sticky, opaque sandstone */
.site-header {
  position: sticky; top: 0; z-index: 320;
  height: var(--header-h);
  background: rgba(255, 248, 242, 0.96);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  height: var(--header-h);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink); min-width: 0;
}
.brand-mark {
  width: 34px; height: 34px; flex: 0 0 34px;
  display: grid; place-items: center;
  background: var(--primary); color: #fff;
  font-weight: 800; font-size: 13px; letter-spacing: 0.04em;
}
.brand-name { font-weight: 750; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; }
.brand-tag { display: block; font-size: 11px; color: var(--muted); font-weight: 550; letter-spacing: 0.04em; }
.main-nav {
  display: flex; align-items: center; justify-content: center; gap: 2px;
}
.main-nav a {
  color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 8px 10px; white-space: nowrap; border-bottom: 2px solid transparent;
}
.main-nav a[aria-current="page"],
.main-nav a.is-active { border-bottom-color: var(--primary); color: var(--primary-ink); }
.header-right { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.header-cta, .btn, .btn-primary, .btn-ghost, .btn-ink {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; padding: 0 16px; text-decoration: none;
  font-weight: 750; font-size: 13px; letter-spacing: 0.06em;
  text-transform: uppercase; white-space: nowrap; border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary, .header-cta {
  background: var(--primary); color: #fff;
}
.btn-primary:hover, .header-cta:hover { background: #9A3D1F; color: #fff; }
.btn-ghost {
  background: transparent; color: var(--ink); border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-ink { background: #fff; color: var(--poster); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hamburger {
  display: none;
  position: fixed;
  top: 12px;
  right: max(12px, var(--gutter));
  z-index: 500;
  width: 44px; height: 44px; padding: 0; border: 0; background: transparent;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.hamburger span {
  display: block; width: 20px; height: 2px; background: var(--ink);
}
body.nav-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .hamburger span:nth-child(2) { opacity: 0; }
body.nav-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-drawer {
  display: none;
  position: fixed; inset: 0; z-index: 400;
  background: rgba(28, 18, 14, 0.42);
}
.mobile-drawer.open, .mobile-drawer.is-open { display: block; }
.drawer-panel {
  position: absolute; top: 0; right: 0; height: 100dvh; width: min(360px, 92vw);
  background: var(--paper); padding: 20px 20px 32px;
  overflow: auto; border-left: 1px solid var(--border);
}
.drawer-head { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.drawer-close {
  width: 44px; height: 44px; border: 1px solid var(--border); background: #fff; color: var(--ink);
  position: relative; z-index: 2; pointer-events: auto; touch-action: manipulation;
}
.drawer-nav { list-style: none; padding: 0; margin: 0 0 18px; }
.drawer-nav a {
  display: block; padding: 12px 0; text-decoration: none; color: var(--ink);
  border-bottom: 1px solid var(--border); font-weight: 650;
}
.drawer-cta { width: 100%; }

/* Cover: sidebar-led cinematic split + hanging data poster */
.cover {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 0;
  min-height: calc(100dvh - var(--header-h));
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}
.cover-media { min-width: 0; position: relative; background: var(--surface-2); }
.cover-media img {
  width: 100%; height: 100%; object-fit: cover; min-height: 420px;
}
.cover-copy {
  min-width: 0;
  padding: 36px 40px 40px;
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
  background: var(--paper);
}
.cover-copy h1 { margin: 0; max-width: 16ch; }
.cover-lede { font-size: 1.05rem; color: var(--muted); max-width: 38ch; margin: 0; }
.data-poster, .typographic-data-poster {
  background: var(--poster);
  color: var(--poster-paper);
  padding: 18px 18px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: end;
}
.data-poster .fig, .poster-fig {
  font-family: var(--font-mono);
  font-size: clamp(42px, 6vw, 68px);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: #fff;
}
.data-poster p, .poster-note { margin: 0; font-size: 14px; line-height: 1.45; color: #F0DCC8; }
.data-poster small { display: block; margin-top: 6px; color: #C9A48A; letter-spacing: 0.08em; text-transform: uppercase; font-size: 11px; }

.status-strip {
  display: flex; flex-wrap: wrap; gap: 18px 28px;
  padding: 14px 0;
  font-size: 13px; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.status-strip strong { color: var(--ink); font-weight: 700; margin-right: 6px; }

/* Story rail: numbered horizontal beats */
.story-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.story-beat {
  min-width: 0; padding: 28px 22px;
  border-right: 1px solid var(--border);
}
.story-beat:last-child { border-right: 0; }
.story-num {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em;
  color: var(--primary-ink); margin-bottom: 10px;
}
.story-beat h2, .story-beat h3 { font-size: 1.05rem; margin-bottom: 8px; }
.story-beat p { font-size: 0.95rem; color: var(--muted); }

/* Choice path */
.choice-path {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr) minmax(0, 1fr);
  gap: 18px;
}
.choice {
  min-width: 0; padding: 22px 20px;
  background: var(--surface);
  border-top: 3px solid var(--primary);
}
.choice.alt { border-top-color: var(--accent); background: var(--surface-2); }
.choice.soft { border-top-color: var(--border-strong); }
.choice h3 { margin-bottom: 8px; }
.choice p { color: var(--muted); font-size: 0.98rem; }

/* Ledger / table */
.ledger-wrap, .data-table-wrap { overflow-x: auto; min-width: 0; width: 100%; max-width: 100%; }
.data-table, .ledger {
  min-width: 640px;
  font-size: 15px;
}
.data-table th, .ledger th {
  text-align: left; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border-strong);
}
.data-table td, .ledger td {
  padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top;
}
.data-table tr:nth-child(even) td { background: rgba(252, 232, 215, 0.35); }

/* Alternating split */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 36px;
  align-items: center;
}
.split.reverse { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }
.split.reverse .split-media { order: 2; }
.cutout, .split-media {
  min-width: 0;
  background: var(--surface-2);
  padding: 14px;
}
.cutout img, .split-media img, .inline-image-row img, .page-hero img, .figure img {
  width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover;
}
.caption, figcaption {
  margin-top: 8px; font-size: 13px; color: var(--muted);
}

/* Voices: stacked notes, not cards */
.voices { display: grid; gap: 0; border-top: 1px solid var(--border); }
.voice {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.voice-meta { font-size: 13px; color: var(--muted); }
.voice-meta strong { display: block; color: var(--ink); font-size: 14px; }

/* Toolkit uneven shelf */
.shelf {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}
.shelf-item {
  min-width: 0; background: var(--surface); padding: 0 0 16px;
}
.shelf-item img { width: 100%; aspect-ratio: 16 / 11; object-fit: cover; }
.shelf-item h3 { padding: 14px 4px 6px; font-size: 1.05rem; }
.shelf-item p { padding: 0 4px; color: var(--muted); font-size: 0.95rem; }

/* Feed list */
.feed { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; }
.feed-lead img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.feed-lead h2 { margin-top: 12px; }
.feed-list { list-style: none; padding: 0; margin: 0; }
.feed-list li { border-top: 1px solid var(--border); padding: 14px 0; }
.feed-list a { text-decoration: none; color: var(--ink); font-weight: 650; }
.feed-date { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; letter-spacing: 0.06em; }

/* Standards ledger */
.standards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  border: 1px solid var(--border);
}
.standard { padding: 22px; border-right: 1px solid var(--border); min-width: 0; }
.standard:last-child { border-right: 0; }
.standard h3 { font-size: 1rem; }

/* Page hero (child) */
.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 28px;
  align-items: end;
  padding: 36px 0 28px;
}
.page-hero .crumb { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.page-hero .crumb a { color: var(--muted); }
.page-hero-copy h1 { margin-bottom: 12px; }
.page-hero img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; }

.inline-image-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin: 28px 0;
}
.inline-image-row img {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
}
.figure { margin: 28px 0; }
.figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* Cards required by verify, used as academy tiles */
.card, .data-card, .step-card, .loose-card, .hub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 18px 18px 16px;
  min-width: 0;
}
.card-grid, .data-grid, .step-grid, .hub-grid, .faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.stat-tile, .data-card { background: var(--surface-2); border: 1px solid var(--border); padding: 16px; }
.stat-tile .num, .data-num, .step-num {
  font-family: var(--font-mono); color: var(--primary-ink); font-size: 22px; display: block; margin-bottom: 6px;
}
.step-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; }
.loose-card {
  background: linear-gradient(180deg, rgba(182, 75, 40, 0.06), rgba(255, 248, 242, 0.4));
  border: 1px solid rgba(182, 75, 40, 0.28);
}
.band { /* alias kept */ }

/* FAQ */
.faq, .community { display: grid; gap: 8px; }
.q-item, details.faq-item {
  background: var(--surface); border: 1px solid var(--border);
}
.q-item summary, details.faq-item summary {
  cursor: pointer; padding: 14px 16px; font-weight: 650; list-style: none;
}
.q-item summary::-webkit-details-marker { display: none; }
.q-body, .faq-item p { padding: 0 16px 14px; color: var(--muted); }

/* Sidebar stream for long child pages */
.stream {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}
.lesson-index {
  position: sticky; top: 88px;
  font-size: 13px;
}
.lesson-index ol { padding-left: 18px; margin: 0; }
.lesson-index a { color: var(--muted); text-decoration: none; }
.lesson-index a:hover { color: var(--primary-ink); }

.cta-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  gap: 18px;
  align-items: center;
  padding: 28px;
  background: var(--poster); color: #F7E7D8;
}
.cta-banner h2 { color: #fff; margin-bottom: 8px; }
.related { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.related a { text-decoration: none; color: var(--ink); display: block; padding: 16px; background: var(--surface); border-top: 2px solid var(--primary); }

/* Footer */
.site-footer {
  background: #2A1812; color: #E8D2C0; padding: 48px 0 28px;
  margin-bottom: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 28px;
}
.site-footer a { color: #F4E2D2; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer .brand-tag { color: #E8D2C0; }
.site-footer h2 { color: #fff; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0 0 8px; font-size: 14px; }
.footer-legal {
  margin-top: 28px; padding-top: 16px; border-top: 1px solid rgba(235, 205, 186, 0.2);
  font-size: 13px; color: #C9A48A;
}

/* Mobile sticky CTA: one full-width PLAY NOW */
.mobile-sticky {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 260;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 248, 242, 0.96);
  border-top: 1px solid var(--border);
}
.mobile-sticky a {
  display: flex; width: 100%; min-height: 48px;
  align-items: center; justify-content: center;
  background: var(--primary); color: #fff; text-decoration: none;
  font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap;
}

.disclaimer { font-size: 14px; color: var(--muted); }

@media (max-width: 1024px) {
  .main-nav { display: none; }
  .header-cta { display: none; }
  .hamburger { display: flex; }
  .header-inner { grid-template-columns: minmax(0, 1fr) auto; }
  .cover { grid-template-columns: 1fr; min-height: 0; }
  .cover-media img { min-height: 280px; max-height: 420px; }
  .cover-copy { padding: 28px var(--gutter) 36px; }
  .page-hero { padding-left: var(--gutter); padding-right: var(--gutter); }
  .story-rail { grid-template-columns: 1fr 1fr; }
  .story-beat:nth-child(2) { border-right: 0; }
  .choice-path, .shelf, .feed, .standards, .split, .split.reverse,
  .page-hero, .inline-image-row, .stream, .cta-banner, .related, .footer-grid,
  .card-grid, .data-grid, .step-grid, .hub-grid, .faq-grid {
    grid-template-columns: 1fr;
  }
  .split.reverse .split-media { order: 0; }
  .voice { grid-template-columns: 1fr; gap: 8px; }
  .lesson-index { position: static; }
  html.is-drawer-open .site-header { z-index: 550; }
  html.is-drawer-open .drawer-head { margin-top: calc(var(--header-h) - 8px); }
}

@media (max-width: 899px) {
  html, body { max-width: 100%; }
  .hero, .cover {
    min-height: 0;
    max-height: none;
  }
  .cover-copy { padding: 22px var(--gutter) 28px; }
  .cover-lede { font-size: 16px; }
  h1, #hero-h { font-size: 32px !important; line-height: 1.12 !important; }
  .mobile-sticky { display: block; }
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .story-rail { grid-template-columns: 1fr; }
  .story-beat { border-right: 0; border-bottom: 1px solid var(--border); }
  html.is-drawer-open .site-header {
    z-index: 550;
    backdrop-filter: none;
  }
  html.is-drawer-open .drawer-head {
    margin-top: calc(var(--header-h) - 8px);
  }
}

@media (max-width: 430px) {
  body { font-size: 17px; }
  .cover-media img { max-height: 260px; min-height: 200px; }
  .btn, .header-cta, .btn-primary, .btn-ghost { white-space: normal; text-align: center; }
}

@media (max-width: 640px) {
  .ledger-wrap, .data-table-wrap { overflow-x: visible; }
  table.data-table.ledger,
  table.data-table,
  table.ledger {
    min-width: 0;
    width: 100%;
  }
  table.data-table.ledger thead,
  table.data-table thead,
  table.ledger thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  table.data-table.ledger tr,
  table.data-table tr,
  table.ledger tr {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-strong);
  }
  table.data-table.ledger th,
  table.data-table.ledger td,
  table.data-table th,
  table.data-table td,
  table.ledger th,
  table.ledger td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    padding: 6px 0;
  }
  table.data-table.ledger td::before,
  table.data-table td::before,
  table.ledger td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    flex: 0 0 42%;
  }
}
