/* ==========================================================================
   Seeing Deep Learning — 3Blue1Brown-Inspired Visual Book Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&display=swap');

:root {
  /* Core Palette */
  --bg-page: #0b0e17;
  --bg-surface: #121726;
  --bg-elevated: #181f33;
  --bg-canvas: #070a12;
  --border-subtle: rgba(140, 165, 210, 0.14);
  --border-strong: rgba(140, 165, 210, 0.28);

  /* Manim-Inspired Accents */
  --blue: #58c4dd;
  --blue-dim: rgba(88, 196, 221, 0.16);
  --gold: #f7c948;
  --gold-dim: rgba(247, 201, 72, 0.16);
  --coral: #fc6255;
  --coral-dim: rgba(252, 98, 85, 0.16);
  --green: #83c167;
  --green-dim: rgba(131, 193, 103, 0.16);
  --violet: #b18cfe;
  --violet-dim: rgba(177, 140, 254, 0.16);

  /* Typography Colors */
  --text-primary: #eaf0f9;
  --text-secondary: #a8b5cc;
  --text-muted: #6f7e99;

  /* Fonts */
  --font-serif: 'Newsreader', Georgia, Cambria, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --sidebar-width: 290px;
  --content-max: 820px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 12px 36px rgba(0, 0, 0, 0.42);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 60% -10%, rgba(88, 196, 221, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 40% at 15% 90%, rgba(177, 140, 254, 0.06), transparent 60%),
    var(--bg-page);
  line-height: 1.7;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.18s ease;
}

a:hover {
  color: var(--gold);
}

/* ==========================================================================
   Layout Shell (Sidebar + Main)
   ========================================================================== */

.book-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: rgba(14, 19, 32, 0.94);
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-header {
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
}

.brand-link:hover {
  color: var(--text-primary);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  color: #070a12;
  box-shadow: 0 0 20px rgba(88, 196, 221, 0.35);
  flex-shrink: 0;
}

.brand-title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-progress {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-family: var(--font-mono);
}

.progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 24px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.35;
  margin-bottom: 3px;
  transition: background 0.16s ease, color 0.16s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--blue-dim);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(88, 196, 221, 0.35);
}

.nav-num {
  font-family: var(--font-mono);
  font-size: 11px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.nav-item.active .nav-num {
  background: var(--blue);
  color: #070a12;
  font-weight: 700;
}

.nav-item.completed .nav-num {
  background: var(--green-dim);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(131, 193, 103, 0.4);
}

.nav-check {
  margin-left: auto;
  font-size: 12px;
  color: var(--green);
  opacity: 0;
}

.nav-item.completed .nav-check {
  opacity: 1;
}

/* Mobile Topbar */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(11, 14, 23, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
}

.menu-toggle {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 95;
}

.sidebar-backdrop.open {
  display: block;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  padding: 48px 40px 96px;
}

.chapter-container {
  max-width: var(--content-max);
  margin: 0 auto;
}

/* ==========================================================================
   Chapter Header & Prose Typography
   ========================================================================== */

.chapter-header {
  margin-bottom: 42px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-subtle);
}

.chapter-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  background: var(--blue-dim);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.chapter-title {
  font-size: clamp(2rem, 4vw, 2.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 14px;
  background: linear-gradient(135deg, #ffffff 30%, #b8d8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.chapter-lead {
  font-family: var(--font-serif);
  font-size: 1.28rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 18px;
}

.chapter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.chapter-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Prose */
.prose h2 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 52px 0 16px;
  color: #ffffff;
}

.prose h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 34px 0 12px;
  color: var(--blue);
}

.prose p {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.82;
  color: #dce4f2;
  margin: 0 0 20px;
}

.prose ul, .prose ol {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.78;
  color: #dce4f2;
  margin: 0 0 22px;
  padding-left: 24px;
}

.prose li {
  margin-bottom: 8px;
}

.prose strong {
  color: #ffffff;
  font-weight: 600;
}

.prose em {
  color: var(--gold);
  font-style: italic;
}

/* Relationship Pills inside prose */
.rel {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(88, 196, 221, 0.14);
  color: var(--blue);
  border: 1px solid rgba(88, 196, 221, 0.28);
  vertical-align: baseline;
}

.rel.gold {
  background: var(--gold-dim);
  color: var(--gold);
  border-color: rgba(247, 201, 72, 0.32);
}

.rel.coral {
  background: var(--coral-dim);
  color: var(--coral);
  border-color: rgba(252, 98, 85, 0.32);
}

.rel.green {
  background: var(--green-dim);
  color: var(--green);
  border-color: rgba(131, 193, 103, 0.32);
}

.rel.violet {
  background: var(--violet-dim);
  color: var(--violet);
  border-color: rgba(177, 140, 254, 0.32);
}

/* ==========================================================================
   Callouts (Intuition / Try This / Key Insight)
   ========================================================================== */

.callout {
  margin: 28px 0;
  padding: 20px 22px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--blue);
}

.callout.gold {
  border-left-color: var(--gold);
  background: linear-gradient(135deg, rgba(247, 201, 72, 0.07), var(--bg-surface) 60%);
}

.callout.green {
  border-left-color: var(--green);
  background: linear-gradient(135deg, rgba(131, 193, 103, 0.07), var(--bg-surface) 60%);
}

.callout.violet {
  border-left-color: var(--violet);
  background: linear-gradient(135deg, rgba(177, 140, 254, 0.07), var(--bg-surface) 60%);
}

.callout-title {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--blue);
  margin-bottom: 8px;
}

.callout.gold .callout-title { color: var(--gold); }
.callout.green .callout-title { color: var(--green); }
.callout.violet .callout-title { color: var(--violet); }

.callout p {
  font-family: var(--font-sans);
  font-size: 0.98rem;
  line-height: 1.65;
  margin: 0;
  color: var(--text-secondary);
}

/* ==========================================================================
   Interactive Visual Stage (3Blue1Brown Canvas Widget)
   ========================================================================== */

.interactive-card {
  margin: 34px 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.interactive-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--border-subtle);
}

.interactive-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
}

.interactive-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--gold-dim);
  color: var(--gold);
}

.canvas-stage {
  position: relative;
  width: 100%;
  background:
    radial-gradient(circle at 50% 45%, rgba(88, 196, 221, 0.05), transparent 70%),
    var(--bg-canvas);
  overflow: hidden;
}

.canvas-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.canvas-hint {
  position: absolute;
  bottom: 12px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(232, 237, 245, 0.55);
  background: rgba(7, 10, 18, 0.72);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

/* Controls Panel */
.controls-panel {
  padding: 18px 20px;
  background: rgba(10, 14, 24, 0.65);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.slider-group {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.slider-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid #070a12;
  box-shadow: 0 0 12px rgba(88, 196, 221, 0.6);
  transition: transform 0.14s ease, background 0.14s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.16);
  background: var(--gold);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid #070a12;
  box-shadow: 0 0 12px rgba(88, 196, 221, 0.6);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.btn:hover {
  border-color: var(--blue);
  background: rgba(88, 196, 221, 0.14);
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--blue);
  color: #070a12;
  border-color: transparent;
}

.btn.primary:hover {
  background: #7ad5ea;
  box-shadow: 0 0 18px rgba(88, 196, 221, 0.4);
}

.btn.gold {
  background: var(--gold);
  color: #070a12;
  border-color: transparent;
}

.btn.gold:hover {
  background: #ffda6e;
}

.btn.active {
  background: var(--blue-dim);
  border-color: var(--blue);
  color: var(--blue);
}

.btn-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Relationship Readout Strip */
.readout-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding-top: 6px;
}

.readout-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
}

.readout-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.readout-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.readout-value.good { color: var(--green); }
.readout-value.warn { color: var(--gold); }
.readout-value.bad { color: var(--coral); }
.readout-value.info { color: var(--blue); }

/* ==========================================================================
   Intuition Check (End-of-Chapter Quiz)
   ========================================================================== */

.quiz-card {
  margin: 44px 0 32px;
  padding: 26px 26px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, rgba(177, 140, 254, 0.08), var(--bg-surface) 55%);
  border: 1px solid rgba(177, 140, 254, 0.28);
}

.quiz-kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--violet);
  margin-bottom: 8px;
}

.quiz-question {
  font-size: 1.12rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 16px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option {
  text-align: left;
  padding: 13px 16px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.96rem;
  cursor: pointer;
  transition: all 0.16s ease;
}

.quiz-option:hover {
  border-color: var(--violet);
  background: rgba(177, 140, 254, 0.1);
}

.quiz-option.correct {
  border-color: var(--green);
  background: var(--green-dim);
  color: #ffffff;
}

.quiz-option.wrong {
  border-color: var(--coral);
  background: var(--coral-dim);
  color: #ffd6d2;
}

.quiz-feedback {
  margin-top: 14px;
  font-size: 0.95rem;
  line-height: 1.6;
  padding: 12px 15px;
  border-radius: 10px;
  display: none;
}

.quiz-feedback.show {
  display: block;
}

.quiz-feedback.correct {
  background: rgba(131, 193, 103, 0.12);
  border: 1px solid rgba(131, 193, 103, 0.35);
  color: #d7f2ca;
}

.quiz-feedback.wrong {
  background: rgba(252, 98, 85, 0.12);
  border: 1px solid rgba(252, 98, 85, 0.35);
  color: #ffd5d1;
}

/* ==========================================================================
   Chapter Footer Navigation
   ========================================================================== */

.chapter-footer {
  margin-top: 52px;
  padding-top: 28px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.complete-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 18px 22px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.complete-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.chapter-nav-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.chapter-nav-card {
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: all 0.18s ease;
}

.chapter-nav-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  background: var(--bg-elevated);
}

.chapter-nav-card.next {
  text-align: right;
  align-items: flex-end;
}

.nav-card-dir {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.nav-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
   Landing Page (index.html)
   ========================================================================== */

.hero-section {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-canvas);
  margin-bottom: 44px;
  box-shadow: var(--shadow-card);
}

.hero-canvas-wrap {
  position: relative;
  height: 360px;
  width: 100%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 10, 18, 0.25) 0%, rgba(7, 10, 18, 0.88) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 36px 36px 32px;
  pointer-events: none;
}

.hero-overlay > * {
  pointer-events: auto;
}

.hero-title {
  font-size: clamp(2.2rem, 4.6vw, 3.3rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin: 0 0 12px;
  color: #ffffff;
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: 1.22rem;
  color: #c8d5ea;
  max-width: 620px;
  margin: 0 0 22px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 28px 0 44px;
}

.principle-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
}

.principle-icon {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.principle-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #ffffff;
}

.principle-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.toc-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
  color: inherit;
}

.toc-card:hover {
  border-color: var(--blue);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  color: inherit;
}

.toc-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toc-num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--blue);
  background: var(--blue-dim);
  padding: 3px 9px;
  border-radius: 6px;
}

.toc-status {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green);
}

.toc-card h3 {
  margin: 4px 0 2px;
  font-size: 1.12rem;
  color: #ffffff;
}

.toc-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.toc-widget-tag {
  margin-top: auto;
  padding-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-topbar {
    display: flex;
  }
  .main-content {
    margin-left: 0;
    padding: 28px 18px 72px;
  }
  .chapter-nav-links {
    grid-template-columns: 1fr;
  }
  .hero-canvas-wrap {
    height: 320px;
  }
  .hero-overlay {
    padding: 24px 20px;
  }
}
