/* ============================================================
   BEHAVIOR OPS LEARNING GUIDE — Cognitive Blueprint Design System
   Based on The Behavior Ops Manual by Chase Hughes
   ============================================================ */

:root {
  --bg: oklch(0.14 0.04 252);
  --bg-sidebar: oklch(0.17 0.04 252 / 0.94);
  --bg-card: oklch(0.19 0.04 252 / 0.85);
  --bg-card-hover: oklch(0.23 0.04 252 / 0.90);
  --gold: oklch(0.78 0.12 75);
  --gold-dim: oklch(0.65 0.10 75);
  --gold-bg: oklch(0.20 0.04 75);
  --text-primary: oklch(0.94 0.015 80);
  --text-secondary: oklch(0.75 0.015 80);
  --text-muted: oklch(0.52 0.01 80);
  --border: oklch(0.28 0.03 252);
  --border-light: oklch(0.32 0.03 252);
  --stage-foundation: oklch(0.62 0.10 210);
  --stage-interpretation: oklch(0.78 0.12 75);
  --stage-social: oklch(0.70 0.10 140);
  --stage-control: oklch(0.65 0.12 30);
  --stage-application: oklch(0.72 0.08 300);
  --sidebar-width: 288px;
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 8px oklch(0.08 0.02 252 / 0.6);
  --shadow-lg: 0 8px 32px oklch(0.08 0.02 252 / 0.8);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.6;
  background-color: oklch(0.12 0.04 252);
}

/* ── SIDEBAR ── */

#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
  transition: transform 0.3s ease;
}

#sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.sidebar-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
}

.sidebar-logo-text strong {
  font-family: var(--font-heading);
  font-size: 15px;
  color: var(--gold);
  line-height: 1.2;
}

.sidebar-logo-text span {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

.sidebar-progress-wrap {
  margin-top: 12px;
}

.sidebar-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-family: var(--font-mono);
}

.progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 99px;
  transition: width 0.4s ease;
}

#sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

#sidebar-nav::-webkit-scrollbar { width: 4px; }
#sidebar-nav::-webkit-scrollbar-track { background: transparent; }
#sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.nav-section {
  padding: 0 12px;
  margin-bottom: 4px;
}

.nav-section-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 8px 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-link:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-link.active { background: var(--gold-bg); color: var(--gold); }

.nav-link svg { flex-shrink: 0; opacity: 0.7; }
.nav-link.active svg { opacity: 1; }

.nav-chapter-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  min-width: 28px;
}

.nav-chapter-title {
  flex: 1;
  line-height: 1.3;
  font-size: 12.5px;
}

.nav-chapter-check {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-chapter-check.done {
  background: var(--gold);
  border-color: var(--gold);
}

.nav-chapter-check.done::after {
  content: '';
  display: block;
  width: 5px;
  height: 3px;
  border-left: 1.5px solid var(--bg);
  border-bottom: 1.5px solid var(--bg);
  transform: rotate(-45deg) translate(0.5px, -0.5px);
}

.stage-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

#sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  flex-shrink: 0;
}

#sidebar-footer a {
  color: var(--gold-dim);
  text-decoration: none;
}
#sidebar-footer a:hover { text-decoration: underline; color: var(--gold); }

/* ── MAIN CONTENT ── */

#main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#mobile-header {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 90;
}

#hamburger {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius);
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

#mobile-title {
  font-family: var(--font-heading);
  font-size: 15px;
  color: var(--gold);
}

#content {
  flex: 1;
  padding: 0;
  overflow-y: auto;
}

/* ── OVERLAY (mobile) ── */

#overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: oklch(0.05 0.02 252 / 0.7);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* ── PAGE SECTIONS ── */

.page-hero {
  position: relative;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 48px;
  overflow: hidden;
}

/* Hero image — near-full brightness so neural network glows */
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--hero-img);
  background-size: cover;
  background-position: center;
  filter: brightness(0.88) saturate(1.15);
}

/* Gradient: opaque on far left (text readable), fades to fully transparent by 55% */
.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to right,
      oklch(0.08 0.04 252 / 0.96) 0%,
      oklch(0.08 0.04 252 / 0.82) 18%,
      oklch(0.08 0.04 252 / 0.45) 38%,
      oklch(0.08 0.04 252 / 0.10) 55%,
      oklch(0.08 0.04 252 / 0.0)  72%
    ),
    linear-gradient(to top, oklch(0.08 0.04 252) 0%, transparent 14%);
}

.page-hero-content {
  position: relative;
  z-index: 1;
  max-width: 620px;
}

/* Eyebrow label with trailing gold line */
.page-hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 22px;
}

.page-hero-eyebrow::after {
  content: '';
  display: block;
  height: 1px;
  width: 120px;
  background: var(--gold);
  opacity: 0.55;
  flex-shrink: 0;
}

/* Two-tone heading: cream text with gold italic second line */
.page-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(32px, 4.2vw, 54px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.page-hero h1 em {
  color: var(--gold);
  font-style: italic;
  display: block;
}

.page-hero p {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.7;
  margin-bottom: 32px;
}

/* Hero CTA buttons */
.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-hero-primary {
  background: var(--gold);
  color: oklch(0.12 0.04 252);
  border-color: var(--gold);
  font-weight: 600;
  padding: 12px 26px;
  font-size: 14px;
}
.btn-hero-primary:hover {
  background: oklch(0.84 0.13 75);
  border-color: oklch(0.84 0.13 75);
  color: oklch(0.10 0.04 252);
}

.btn-hero-secondary {
  background: transparent;
  border-color: oklch(0.45 0.02 80);
  color: var(--text-secondary);
  padding: 12px 26px;
  font-size: 14px;
}
.btn-hero-secondary:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  background: oklch(0.18 0.03 252 / 0.6);
}

.page-body {
  padding: 32px 40px;
  max-width: 1100px;
}

/* ── CARDS ── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.card-clickable {
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
}

.card-clickable:hover { transform: translateY(-2px); }

/* ── CHAPTER GRID ── */

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

.chapter-card {
  position: relative;
  overflow: hidden;
}

.chapter-card-stage {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chapter-card h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.chapter-card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.4;
}

.chapter-card-summary {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chapter-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.chapter-card-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* ── SEARCH / FILTERS ── */

.search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-input {
  flex: 1;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 9px 14px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--gold-dim); }

.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.chip:hover { border-color: var(--border-light); color: var(--text-primary); }
.chip.active { background: var(--gold-bg); border-color: var(--gold-dim); color: var(--gold); }

/* ── SECTION HEADERS ── */

.section-header {
  margin-bottom: 24px;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.section-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
}

/* ── DIVIDERS ── */

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

/* ── CHAPTER PAGE ── */

.chapter-hero {
  padding: 40px 40px 28px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, var(--bg-card) 0%, var(--bg) 100%);
}

.chapter-stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px 4px 8px;
  border-radius: 99px;
  background: oklch(from var(--stage-color, var(--gold)) l c h / 0.12);
  color: var(--stage-color, var(--gold));
  border: 1px solid oklch(from var(--stage-color, var(--gold)) l c h / 0.25);
  margin-bottom: 14px;
}

.chapter-number {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.chapter-title {
  font-family: var(--font-heading);
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.chapter-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 20px;
}

.chapter-mark-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.15s;
  text-decoration: none;
  font-weight: 500;
}

.btn-gold {
  background: var(--gold-bg);
  border-color: var(--gold-dim);
  color: var(--gold);
}
.btn-gold:hover { background: oklch(0.23 0.05 75); border-color: var(--gold); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}
.btn-ghost:hover { border-color: var(--border-light); color: var(--text-primary); background: var(--bg-card); }

.chapter-content {
  padding: 36px 40px;
  max-width: 860px;
}

/* ── CONTENT BLOCKS ── */

.content-block {
  margin-bottom: 36px;
}

.block-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.content-block p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.content-block p:last-child { margin-bottom: 0; }

.content-block ul, .content-block ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.content-block li {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.insight-quote {
  border-left: 3px solid var(--gold);
  padding: 16px 20px;
  background: var(--gold-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 17px;
  color: var(--text-primary);
  line-height: 1.55;
  margin: 20px 0;
}

.quote-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.quote-block::before { content: '\201C'; color: var(--gold); margin-right: 4px; }
.quote-block::after  { content: '\201D'; color: var(--gold); margin-left: 4px; }

.takeaway-box {
  background: linear-gradient(135deg, oklch(0.22 0.05 252), var(--bg-card));
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.takeaway-box p {
  font-size: 15.5px;
  color: var(--text-primary);
  line-height: 1.65;
  font-weight: 500;
}

.question-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.question-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.question-box p {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.6;
  font-style: italic;
}

/* ── TAGS ── */

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
}
.tag:hover { border-color: var(--border-light); color: var(--text-secondary); }

/* ── DATA TABLES ── */

.data-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th {
  background: oklch(0.19 0.03 252);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
  line-height: 1.5;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-card-hover); }

.data-table td:first-child {
  color: var(--text-primary);
  font-weight: 500;
}

/* ── CHAPTER NAV ── */

.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 40px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.chapter-nav-item {
  flex: 1;
  min-width: 200px;
  max-width: 48%;
}

.chapter-nav-item.next { text-align: right; }

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

.chapter-nav-link {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 15px;
  color: var(--gold);
  text-decoration: none;
  line-height: 1.3;
  transition: color 0.15s;
}
.chapter-nav-link:hover { color: var(--text-primary); }

/* ── SEQUENCE PAGE ── */

.stage-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

.stage-card-header {
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.stage-card-header:hover { background: var(--bg-card-hover); }

.stage-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  background: oklch(from var(--scolor) l c h / 0.15);
  color: var(--scolor);
  border: 2px solid oklch(from var(--scolor) l c h / 0.3);
}

.stage-card-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.2;
}

.stage-card-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.stage-card-body {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  background: var(--bg-card);
  display: none;
}

.stage-card.open .stage-card-body { display: block; }

.argument-steps {
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.argument-step {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.argument-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold-bg);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.argument-step-claim {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.argument-step-detail {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ── 7-LAYER MODEL ── */

.model-layer {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 3px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s;
}

.model-layer:hover { border-color: var(--border-light); }
.model-layer.open { border-color: var(--lcolor, var(--gold-dim)); }

.model-layer-accent {
  width: 6px;
  background: var(--lcolor, var(--gold));
  flex-shrink: 0;
}

.model-layer-content {
  flex: 1;
  padding: 16px 20px;
  background: var(--bg-card);
}

.model-layer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.model-layer-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.model-layer-name {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--lcolor, var(--text-primary));
}

.model-layer-question {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.model-layer-chevron {
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.model-layer.open .model-layer-chevron { transform: rotate(180deg); }

.model-layer-detail {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.model-layer.open .model-layer-detail { display: block; }

/* ── QUIZ ── */

.quiz-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px;
}

.quiz-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.quiz-progress-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.quiz-theme {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.quiz-question {
  font-family: var(--font-heading);
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 28px;
}

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

.quiz-option {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  cursor: pointer;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  transition: all 0.15s;
  text-align: left;
  width: 100%;
  font-family: var(--font-body);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.quiz-option:hover {
  border-color: var(--gold-dim);
  background: var(--gold-bg);
  color: var(--text-primary);
}

.quiz-option.selected {
  border-color: var(--gold);
  background: var(--gold-bg);
  color: var(--gold);
}

.quiz-option-letter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  width: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.quiz-option:hover .quiz-option-letter,
.quiz-option.selected .quiz-option-letter { color: var(--gold); }

/* ── QUIZ RESULTS ── */

.quiz-result {
  text-align: center;
  padding: 40px 20px;
}

.result-pattern-color {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.result-title {
  font-family: var(--font-heading);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  margin-bottom: 12px;
}

.result-description {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 540px;
  margin: 0 auto 28px;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  text-align: left;
  max-width: 560px;
  margin: 0 auto 28px;
}

.result-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.result-item-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.result-item-value {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── FLASHCARDS ── */

.flashcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 32px 40px;
}

.flashcard-scene {
  perspective: 1000px;
  height: 220px;
  cursor: pointer;
}

.flashcard-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.flashcard-scene.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.flashcard-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, oklch(0.21 0.04 252), oklch(0.18 0.05 75 / 0.3));
  border-color: var(--gold-dim);
}

.flashcard-stage {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.flashcard-ch {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.flashcard-question {
  flex: 1;
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.55;
}

.flashcard-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 8px;
}

.flashcard-back .flashcard-answer {
  flex: 1;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.flashcard-back .flashcard-takeaway {
  font-family: var(--font-heading);
  font-size: 13px;
  font-style: italic;
  color: var(--gold);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  line-height: 1.4;
}

/* ── EXPORT PAGE ── */

.export-chapter {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.export-chapter-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.export-chapter-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 10px;
  font-style: italic;
}

.export-summary {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.export-takeaway {
  background: var(--gold-bg);
  border-left: 3px solid var(--gold);
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text-primary);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ── HOME ARGUMENT GRID ── */

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

.argument-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.argument-card-step {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold-dim);
  margin-bottom: 4px;
}

.argument-card-claim {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.argument-card-detail {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── STAGES OVERVIEW (home) ── */

.stages-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.stage-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: all 0.15s;
}

.stage-chip:hover { border-color: var(--border-light); background: var(--bg-card-hover); }

.stage-chip-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
  line-height: 1.3;
}

.stage-chip-chapters {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* ── EMPTY STATE ── */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 40px; margin-bottom: 14px; }
.empty-state h3 { font-size: 16px; margin-bottom: 6px; color: var(--text-secondary); }
.empty-state p { font-size: 13.5px; }

/* ── UTILITY ── */

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

/* ── RESPONSIVE ── */

@media (max-width: 900px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100dvh;
    transform: translateX(-100%);
    z-index: 200;
  }
  #sidebar.open { transform: translateX(0); }
  #overlay.visible { display: block; }
  #mobile-header { display: flex; }
  .page-hero { padding: 24px 20px; min-height: 260px; }
  .page-body { padding: 24px 20px; }
  .chapter-hero { padding: 24px 20px 20px; }
  .chapter-content { padding: 24px 20px; }
  .chapter-nav { padding: 24px 20px; }
  .flashcard-grid { padding: 20px; }
  .quiz-container { padding: 24px 20px; }
  .result-grid { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .chapter-grid { grid-template-columns: 1fr; }
  .stages-row { grid-template-columns: 1fr 1fr; }
  .argument-grid { grid-template-columns: 1fr; }
  .flashcard-grid { grid-template-columns: 1fr; }
}

/* ── PRINT STYLES ── */

@media print {
  body { background: #fff; color: #000; display: block; }
  #sidebar, #mobile-header, .chapter-nav, .chapter-mark-row { display: none !important; }
  #main { width: 100%; }
  .chapter-hero { background: none; border-bottom: 2px solid #000; padding: 20px 0; }
  .chapter-title { color: #000; }
  .chapter-subtitle { color: #333; }
  .content-block p, .content-block li { color: #222; }
  .insight-quote { border-color: #888; background: #f5f5f5; color: #000; }
  .export-chapter { break-inside: avoid; }
  a { text-decoration: none; color: inherit; }
  .page-hero::before, .page-hero::after { display: none; }
  .card { border: 1px solid #ccc; break-inside: avoid; }
  .data-table th { background: #eee; color: #000; }
  .data-table td { color: #222; border-color: #ccc; }
}
