/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0F1117;
  --bg2: #1A1D2E;
  --bg3: #242840;
  --card: #1E2235;
  --card-hover: #242840;
  --border: #2D3250;
  --text: #E2E8F0;
  --text2: #94A3B8;
  --text3: #64748B;
  --purple: #6C63FF;
  --purple-light: #8B84FF;
  --teal: #00D4AA;
  --orange: #F7971E;
  --pink: #F953C6;
  --blue: #4FACFE;
  --green: #43E97B;
  --red: #E74C3C;
  --sidebar-w: 260px;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
}
body.light {
  --bg: #F0F4FF;
  --bg2: #FFFFFF;
  --bg3: #E8EEFF;
  --card: #FFFFFF;
  --card-hover: #F0F4FF;
  --border: #D1D9FF;
  --text: #1E2235;
  --text2: #4A5568;
  --text3: #718096;
  --shadow: 0 4px 24px rgba(108,99,255,0.1);
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width 0.3s;
  overflow: hidden;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--purple);
  white-space: nowrap;
}
.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
}
.nav-links {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
}
.nav-group-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text3);
  padding: 0.75rem 1.25rem 0.25rem;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  color: var(--text2);
  text-decoration: none;
  border-radius: 8px;
  margin: 0 0.5rem;
  transition: all 0.2s;
  font-size: 0.9rem;
  white-space: nowrap;
}
.nav-link:hover { background: var(--bg3); color: var(--text); }
.nav-link.active { background: rgba(108,99,255,0.15); color: var(--purple); font-weight: 600; }
.nav-link i { width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}
.theme-toggle {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  width: 100%;
  transition: all 0.2s;
}
.theme-toggle:hover { color: var(--purple); border-color: var(--purple); }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  overflow-y: auto;
}
.section {
  display: none;
  padding: 2rem 2.5rem 4rem;
  max-width: 1100px;
  animation: fadeIn 0.3s ease;
}
.section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== HERO ===== */
.hero {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-bottom: 3rem;
  padding: 2.5rem;
  background: linear-gradient(135deg, var(--bg2) 0%, var(--bg3) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.hero-text { flex: 1; }
.badge {
  display: inline-block;
  background: rgba(108,99,255,0.15);
  color: var(--purple);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.hero-text h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 0.75rem; line-height: 1.2; }
.hero-sub { color: var(--text2); font-size: 1.05rem; margin-bottom: 1.5rem; line-height: 1.6; }
.hero-actions { display: flex; gap: 1rem; }
.hero-visual { width: 220px; flex-shrink: 0; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary { background: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-light); transform: translateY(-1px); box-shadow: 0 4px 15px rgba(108,99,255,0.4); }
.btn-outline { background: transparent; color: var(--purple); border: 1.5px solid var(--purple); }
.btn-outline:hover { background: rgba(108,99,255,0.1); }
.btn-large { padding: 0.85rem 2rem; font-size: 1rem; }

/* ===== CARDS ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.2s;
}
.card-clickable { cursor: pointer; }
.card-clickable:hover { border-color: var(--purple); box-shadow: var(--shadow); transform: translateY(-2px); }
.card-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  color: white;
  margin-bottom: 1rem;
}
.card h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.5rem; }
.card p { color: var(--text2); font-size: 0.9rem; line-height: 1.5; margin-bottom: 0.75rem; }
.card-tag {
  font-size: 0.75rem;
  background: var(--bg3);
  color: var(--text3);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

/* ===== SECTION HEADER ===== */
.section-header { margin-bottom: 2rem; }
.section-header h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.75rem; }
.section-sub { color: var(--text2); font-size: 0.95rem; }

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  flex-wrap: wrap;
}
.tab {
  background: none;
  border: none;
  color: var(--text2);
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--purple); border-bottom-color: var(--purple); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== CONCEPT BLOCKS ===== */
.concept-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.concept-block h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; }
.concept-block h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--text); }

/* ===== HIGHLIGHT BOXES ===== */
.highlight-box {
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
}
.highlight-box.purple { background: rgba(108,99,255,0.12); border-left: 3px solid var(--purple); }
.highlight-box.teal { background: rgba(0,212,170,0.1); border-left: 3px solid var(--teal); }
.highlight-box.orange { background: rgba(247,151,30,0.1); border-left: 3px solid var(--orange); }
.highlight-box.pink { background: rgba(249,83,198,0.1); border-left: 3px solid var(--pink); }
.highlight-box.blue { background: rgba(79,172,254,0.1); border-left: 3px solid var(--blue); }

/* ===== FORMULAS ===== */
.formula {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  color: var(--teal);
  margin: 0.5rem 0;
  display: inline-block;
}
.formula.small { font-size: 0.82rem; }

/* ===== TWO COLUMN ===== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }

/* ===== INFO CARDS ===== */
.info-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}
.info-card h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.info-card p { color: var(--text2); font-size: 0.9rem; line-height: 1.5; }
.info-card.border-purple { border-left: 3px solid var(--purple); }
.info-card.border-teal { border-left: 3px solid var(--teal); }
.info-card.border-orange { border-left: 3px solid var(--orange); }

/* ===== COMPARISON TABLE ===== */
.comparison-table-wrap, .category-table-wrap { overflow-x: auto; }
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 0.75rem;
}
.comparison-table th {
  background: var(--bg3);
  color: var(--text);
  padding: 0.7rem 1rem;
  text-align: left;
  font-weight: 600;
  border: 1px solid var(--border);
}
.comparison-table td {
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  color: var(--text2);
  vertical-align: top;
  line-height: 1.5;
}
.comparison-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.comparison-table tr:hover td { background: rgba(108,99,255,0.05); }

/* ===== AGENT-ENVIRONMENT LOOP ===== */
.ae-loop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem;
  background: var(--bg2);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.ae-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
}
.ae-box i { font-size: 2.5rem; }
.agent-box i { color: var(--purple); }
.env-box i { color: var(--teal); }
.ae-arrows {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}
.ae-arrow { display: flex; flex-direction: column; align-items: center; }
.arrow-label {
  font-size: 0.8rem;
  color: var(--text2);
  text-align: center;
  white-space: nowrap;
}
.arrow-icon { color: var(--orange); font-size: 1.2rem; }
.arrow-line {
  width: 2px;
  height: 20px;
  background: var(--border);
}
.ae-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.step-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.85rem;
  color: var(--text2);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.step-num {
  background: var(--purple);
  color: white;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ===== GAMMA SLIDER ===== */
.slider-demo { margin-top: 1rem; }
.slider-demo label { font-size: 0.95rem; font-weight: 500; display: block; margin-bottom: 0.5rem; }
.slider {
  width: 100%;
  accent-color: var(--purple);
  cursor: pointer;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg3);
  border-radius: 3px;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--purple);
  cursor: pointer;
}
.gamma-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 80px;
  margin-top: 1rem;
  padding: 0.5rem;
  background: var(--bg2);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.gamma-bar {
  flex: 1;
  background: var(--purple);
  border-radius: 3px 3px 0 0;
  transition: height 0.3s;
  opacity: 0.8;
}
.slider-hint { font-size: 0.85rem; color: var(--text2); margin-top: 0.5rem; }

/* ===== PILLARS ===== */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.pillar-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.2s;
}
.pillar-card:hover { border-color: var(--purple); }
.pillar-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
.pillar-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.5rem; }
.pillar-card p { font-size: 0.875rem; color: var(--text2); line-height: 1.5; margin-bottom: 0.75rem; }
.pillar-example {
  background: var(--bg3);
  border-radius: 6px;
  padding: 0.5rem;
  font-size: 0.8rem;
  color: var(--text2);
}
.diff-list { display: flex; flex-direction: column; gap: 0.5rem; }
.diff-item { display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; }

/* ===== COMPONENTS ===== */
.components-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.component-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}
.comp-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--purple);
}
.comp-detail { margin-top: 0.5rem; }
.sub-item { font-size: 0.85rem; color: var(--text2); margin: 0.3rem 0; line-height: 1.5; }
.comp-note {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--orange);
  font-style: italic;
}
.badge-pill {
  display: inline-block;
  background: var(--bg3);
  color: var(--purple);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.5rem;
}
.example-tag {
  background: var(--bg3);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  color: var(--text2);
  margin-top: 0.5rem;
}

/* ===== EXPLORE DEMO ===== */
.epsilon-desc {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text2);
  min-height: 40px;
}
.bandit-demo {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}
.bandit-arm {
  flex: 1;
  min-width: 80px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
}
.bandit-arm-label { font-weight: 600; margin-bottom: 0.3rem; }
.bandit-arm-q { color: var(--teal); font-size: 1rem; font-weight: 700; }
.bandit-arm-n { color: var(--text3); font-size: 0.75rem; }
.bandit-result {
  background: var(--bg2);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text2);
  min-height: 50px;
}

/* ===== MDP COMPONENTS ===== */
.mdp-components { display: flex; flex-direction: column; gap: 0.75rem; }
.mdp-comp {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}
.mdp-sym {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--purple);
  width: 30px;
  text-align: center;
  flex-shrink: 0;
}
.mdp-comp div { font-size: 0.9rem; color: var(--text2); }

/* ===== FROZEN LAKE ===== */
.frozen-lake-container { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.frozen-lake {
  display: grid;
  grid-template-columns: repeat(4, 64px);
  gap: 4px;
}
.lake-cell {
  width: 64px; height: 64px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  border: 2px solid transparent;
  transition: all 0.2s;
  cursor: default;
}
.lake-cell.S { background: rgba(108,99,255,0.2); border-color: var(--purple); color: var(--purple); }
.lake-cell.F { background: rgba(79,172,254,0.15); border-color: rgba(79,172,254,0.3); color: var(--blue); }
.lake-cell.H { background: rgba(231,76,60,0.2); border-color: rgba(231,76,60,0.4); color: var(--red); }
.lake-cell.G { background: rgba(67,233,123,0.2); border-color: var(--green); color: var(--green); }
.lake-legend { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.legend-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--text2); }
.legend-box {
  width: 32px; height: 32px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.legend-box.s { background: rgba(108,99,255,0.2); color: var(--purple); }
.legend-box.f { background: rgba(79,172,254,0.15); color: var(--blue); }
.legend-box.h { background: rgba(231,76,60,0.2); color: var(--red); }
.legend-box.g { background: rgba(67,233,123,0.2); color: var(--green); }

/* ===== ALGORITHM FLOW ===== */
.algo-flow { display: flex; flex-direction: column; align-items: flex-start; }
.algo-step {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  width: 100%;
  font-size: 0.9rem;
  color: var(--text2);
}
.step-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: white;
  background: var(--purple);
  flex-shrink: 0;
  font-size: 0.85rem;
}
.eval-c { background: var(--blue); }
.impr-c { background: var(--green); }
.chk-c { background: var(--orange); }
.algo-arrow { display: flex; justify-content: flex-start; padding-left: 1.5rem; color: var(--text3); font-size: 1.1rem; margin: 0.25rem 0; }

/* ===== ASYNC TYPES ===== */
.async-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.async-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}
.async-card h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--orange); }
.async-card p { font-size: 0.83rem; color: var(--text2); line-height: 1.5; }

/* ===== LIMITATION LIST ===== */
.limitation-list { display: flex; flex-direction: column; gap: 0.5rem; }
.lim-item { display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; color: var(--text2); }

/* ===== BELLMAN VISUAL ===== */
.bellman-visual {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
.bv-part {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.bv-value { background: rgba(108,99,255,0.2); color: var(--purple); }
.bv-reward { background: rgba(0,212,170,0.2); color: var(--teal); }
.bv-discount { background: rgba(247,151,30,0.2); color: var(--orange); }
.bv-next { background: rgba(108,99,255,0.1); color: var(--purple-light); }
.bv-equals, .bv-plus { font-size: 1.5rem; font-weight: 700; color: var(--text2); }
.bv-labels {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text3);
}

/* ===== TD BREAKDOWN ===== */
.td-breakdown {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--bg2);
  border-radius: 10px;
  padding: 1.25rem;
}
.td-part { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.td-box {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.9rem;
}
.td-target { background: rgba(0,212,170,0.2); color: var(--teal); }
.td-current { background: rgba(247,151,30,0.2); color: var(--orange); }
.td-error { background: rgba(249,83,198,0.2); color: var(--pink); }
.td-label { font-size: 0.75rem; color: var(--text2); text-align: center; }
.td-minus, .td-equals { font-size: 1.5rem; font-weight: 700; color: var(--text2); }

/* ===== PSEUDO CODE ===== */
.algo-pseudocode {
  background: #0A0D1A;
  border-radius: 10px;
  padding: 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  margin-top: 1rem;
}
.pseudo-title { color: var(--purple); font-weight: 700; margin-bottom: 0.75rem; font-size: 0.9rem; }
.pseudo-line { color: #A8B3CF; margin: 0.2rem 0; }
.pseudo-line.indent { padding-left: 1.5rem; color: var(--text); }
.pseudo-line.indent2 { padding-left: 3rem; color: var(--teal); }

/* ===== QTABLE DEMO ===== */
.qtable-demo {
  background: var(--bg2);
  border-radius: 10px;
  padding: 1.25rem;
  margin-top: 1rem;
}
.qtable-world {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  justify-content: center;
}
.qw-cell {
  width: 80px; height: 80px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  border: 2px solid var(--border);
  transition: all 0.3s;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
}
.qw-cell.current { border-color: var(--orange); box-shadow: 0 0 12px rgba(247,151,30,0.3); }
.qtable-controls { display: flex; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.qtable-info { font-size: 0.85rem; color: var(--text2); margin-bottom: 0.75rem; min-height: 40px; }
.qtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  font-family: 'JetBrains Mono', monospace;
}
.qtable th { background: var(--bg3); padding: 0.5rem; border: 1px solid var(--border); color: var(--text2); }
.qtable td { padding: 0.5rem; border: 1px solid var(--border); text-align: center; transition: background 0.3s; }
.qtable td.updated { background: rgba(0,212,170,0.2); }

/* ===== DQN ARCH ===== */
.dqn-arch {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg2);
  border-radius: 10px;
  padding: 1.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.dqn-block {
  border-radius: 10px;
  padding: 1rem 1.25rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 120px;
}
.dqn-block small { display: block; font-weight: 400; color: var(--text2); font-size: 0.78rem; margin-top: 0.3rem; }
.dqn-block.input { background: rgba(108,99,255,0.2); color: var(--purple); border: 1px solid var(--purple); }
.dqn-block.hidden { background: rgba(247,151,30,0.15); color: var(--orange); border: 1px solid var(--orange); }
.dqn-block.output { background: rgba(0,212,170,0.15); color: var(--teal); border: 1px solid var(--teal); }
.dqn-arrow { font-size: 1.5rem; color: var(--text3); }

/* ===== INNOVATIONS GRID ===== */
.innovations-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.innov-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem;
}
.innov-card h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem; }
.innov-card p { font-size: 0.83rem; color: var(--text2); line-height: 1.5; }

/* ===== ACTOR-CRITIC ===== */
.ac-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: var(--bg2);
  border-radius: 12px;
  padding: 2rem;
  flex-wrap: wrap;
}
.ac-box {
  background: var(--bg3);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  min-width: 140px;
  border: 1px solid var(--border);
}
.ac-box h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.5rem; }
.ac-box p { font-size: 0.82rem; color: var(--text2); line-height: 1.4; }
.ac-box.actor { border-top: 3px solid var(--purple); }
.ac-box.critic { border-top: 3px solid var(--teal); }
.ac-center { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.ac-arrow { font-size: 0.78rem; color: var(--text2); text-align: center; }
.ac-env {
  background: rgba(247,151,30,0.15);
  border: 1px solid var(--orange);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--orange);
  font-weight: 600;
}

/* ===== APPROX TYPES ===== */
.approx-types { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.approx-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}
.approx-card h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.5rem; }
.approx-card p { font-size: 0.85rem; color: var(--text2); line-height: 1.5; }

/* ===== BACKUP DIAGRAMS ===== */
.backup-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.backup-item { text-align: center; }
.backup-item h4 { margin-bottom: 0.75rem; font-size: 1rem; }
.backup-item p { font-size: 0.82rem; color: var(--text2); margin-top: 0.75rem; line-height: 1.5; }
.backup-viz {
  background: var(--bg2);
  border-radius: 10px;
  padding: 1rem;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.bv-node {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
}
.bv-node.root { width: 36px; height: 36px; background: var(--purple); color: white; }
.bv-node.action { width: 28px; height: 28px; background: var(--orange); color: white; }
.bv-node.state { width: 24px; height: 24px; background: var(--teal); color: white; }
.bv-node.terminal { width: 24px; height: 24px; background: var(--red); color: white; }
.bv-branches { display: flex; gap: 8px; justify-content: center; }
.bv-branches.small { gap: 4px; }
.bv-branch { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bv-line-long { width: 2px; height: 20px; background: var(--border); }
.bv-dots { color: var(--text3); font-size: 1.2rem; }

/* ===== DP REQUIREMENTS ===== */
.dp-requirements { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.req-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.req-card i { font-size: 1.75rem; color: var(--purple); }
.req-card h4 { font-weight: 600; font-size: 0.95rem; }
.req-card p { font-size: 0.85rem; color: var(--text2); line-height: 1.5; }

/* ===== GLOSSARY ===== */
.glossary-search-wrap { margin-bottom: 1.5rem; }
.glossary-search {
  width: 100%;
  padding: 0.75rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
.glossary-search:focus { border-color: var(--purple); }
.glossary-list { display: flex; flex-direction: column; gap: 0.5rem; }
.glossary-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  transition: all 0.2s;
}
.glossary-item:hover { border-color: var(--purple); }
.glossary-term {
  font-weight: 700;
  font-size: 1rem;
  color: var(--purple);
  margin-bottom: 0.3rem;
}
.glossary-def { font-size: 0.9rem; color: var(--text2); line-height: 1.6; }
.glossary-tag {
  display: inline-block;
  font-size: 0.72rem;
  background: var(--bg3);
  color: var(--text3);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-top: 0.4rem;
}

/* ===== QUIZ ===== */
.quiz-start { text-align: center; padding: 3rem 2rem; }
.quiz-info-cards {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.qi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  min-width: 120px;
}
.qi-card i { font-size: 1.75rem; color: var(--purple); }
.quiz-progress-bar {
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  margin-bottom: 1rem;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--teal));
  border-radius: 3px;
  transition: width 0.4s;
}
.quiz-counter { font-size: 0.85rem; color: var(--text2); margin-bottom: 1.25rem; }
.quiz-question-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.quiz-q-text { font-size: 1.05rem; font-weight: 600; margin-bottom: 1.25rem; line-height: 1.6; }
.quiz-options { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.25rem; }
.quiz-option {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--text);
}
.quiz-option:hover:not(.disabled) { border-color: var(--purple); background: rgba(108,99,255,0.08); }
.quiz-option.correct { border-color: var(--green); background: rgba(67,233,123,0.1); color: var(--text); }
.quiz-option.wrong { border-color: var(--red); background: rgba(231,76,60,0.1); color: var(--text); }
.quiz-option.disabled { cursor: default; }
.opt-letter {
  font-weight: 700;
  color: var(--purple);
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
}
.quiz-result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
}
.result-score { font-size: 3.5rem; font-weight: 700; color: var(--purple); margin-bottom: 0.5rem; }
.result-grade { font-size: 1.2rem; font-weight: 600; color: var(--text); margin-bottom: 1.5rem; }
.result-breakdown { font-size: 0.9rem; color: var(--text2); margin-bottom: 1.5rem; }
.quiz-result-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ===== REVIEW ===== */
.review-item {
  background: var(--bg2);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 0.75rem 0;
  border-left: 4px solid;
  text-align: left;
}
.review-item.correct { border-color: var(--green); }
.review-item.wrong { border-color: var(--red); }
.review-q { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; }
.review-your { font-size: 0.85rem; color: var(--text2); }
.review-correct { font-size: 0.85rem; color: var(--green); }
.review-exp { font-size: 0.82rem; color: var(--text3); margin-top: 0.4rem; font-style: italic; }

/* ===== CHEAT SHEET ===== */
.cheat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.cheat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.cheat-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--purple);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cheat-card p { font-size: 0.85rem; color: var(--text2); line-height: 1.5; margin-top: 0.5rem; }

/* ===== ALGO DECISION ===== */
.algo-decision {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1rem;
}
.dec-node { font-size: 0.9rem; margin: 0.5rem 0; }
.dec-node > strong { color: var(--text); }
.dec-yes {
  margin-left: 1.5rem;
  margin-top: 0.4rem;
  color: var(--teal);
  font-weight: 500;
}
.dec-no {
  margin-left: 1.5rem;
  margin-top: 0.4rem;
  color: var(--orange);
  font-weight: 500;
}

/* ===== PROGRESS SECTION ===== */
.progress-section { margin-top: 2rem; }
.progress-section h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; }
.progress-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.progress-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}
.progress-item:hover { border-color: var(--purple); }
.progress-item-title { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.5rem; }
.progress-bar-wrap { height: 4px; background: var(--bg3); border-radius: 2px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 2px; transition: width 0.5s; }
.progress-status { font-size: 0.75rem; color: var(--text3); margin-top: 0.4rem; }

/* ===== STYLED LIST ===== */
.styled-list { list-style: none; padding: 0; margin-top: 0.5rem; }
.styled-list li {
  padding: 0.3rem 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  color: var(--text2);
  position: relative;
  line-height: 1.5;
}
.styled-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--purple);
}

/* ===== LECTURE 4 STYLES ===== */
.nstep-spectrum { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; }
.ns-item { display: flex; align-items: center; gap: 1rem; }
.ns-label { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; color: var(--text2); width: 100px; flex-shrink: 0; }
.ns-bar { height: 20px; border-radius: 4px; min-width: 4px; }
.ns-desc { font-size: 0.82rem; color: var(--text2); }
.glie-conditions { display: flex; flex-direction: column; gap: 1rem; margin-top: 0.75rem; }
.glie-cond { display: flex; gap: 1rem; align-items: flex-start; background: var(--bg2); border-radius: 10px; padding: 1rem; }
.glie-num { background: var(--teal); color: white; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; font-size: 0.85rem; }
.border-pink { border-left: 3px solid var(--pink); }

/* ===== LECTURE 5 STYLES ===== */
.four-problems { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-top: 1rem; }
.prob-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; text-align: center; }
.prob-card i { font-size: 1.5rem; margin-bottom: 0.5rem; display: block; }
.prob-card h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 0.4rem; }
.prob-card p { font-size: 0.78rem; color: var(--text2); line-height: 1.4; }
.three-steps { display: flex; flex-direction: column; gap: 0.75rem; }
.step-flow { display: flex; gap: 1rem; align-items: flex-start; background: var(--bg2); border-radius: 10px; padding: 1rem; }
.sf-num { background: var(--green); color: white; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; font-size: 0.85rem; }
.step-flow strong { display: block; color: var(--green); font-size: 0.9rem; margin-bottom: 0.2rem; }
.step-flow span { font-size: 0.85rem; color: var(--text2); line-height: 1.5; }
.deadly-triad { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
.triad-item { flex: 1; min-width: 160px; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem; text-align: center; }
.triad-item i { font-size: 1.5rem; margin-bottom: 0.5rem; display: block; }
.triad-item h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.4rem; }
.triad-item p { font-size: 0.8rem; color: var(--text2); line-height: 1.4; }
.triad-plus { font-size: 2rem; font-weight: 700; color: var(--red); flex-shrink: 0; }

/* ===== LECTURE 6 STYLES ===== */
.state-agg-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; margin-top: 1rem; }
.agg-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem; }
.agg-card h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.agg-card p { font-size: 0.83rem; color: var(--text2); line-height: 1.5; margin-bottom: 0.5rem; }
.agg-detail { font-size: 0.78rem; color: var(--text3); border-top: 1px solid var(--border); padding-top: 0.5rem; line-height: 1.6; }
.three-approaches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem; }
.approach-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem; }
.approach-card h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.5rem; }
.approach-card p { font-size: 0.83rem; color: var(--text2); line-height: 1.5; margin-bottom: 0.5rem; }
.approach-limit { font-size: 0.8rem; color: var(--text3); margin-top: 0.5rem; border-top: 1px solid var(--border); padding-top: 0.4rem; }
.dynaq-flow { display: flex; flex-direction: column; gap: 0.5rem; }
.dq-step { display: flex; gap: 1rem; align-items: flex-start; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; font-size: 0.9rem; }
.dq-num { background: var(--green); color: white; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.dq-arrow { color: var(--text3); font-size: 1.2rem; padding-left: 1.5rem; }
.dq-loop { border-color: var(--green); }
.mcts-steps { display: grid; grid-template-columns: repeat(4,1fr); gap: 0.75rem; }
.mcts-step { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem; }
.mcts-step h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 0.5rem; }
.mcts-step p { font-size: 0.8rem; color: var(--text2); line-height: 1.5; }
.mcts-why { display: flex; flex-direction: column; gap: 0.75rem; }
.mwhy-item { display: flex; gap: 1rem; align-items: flex-start; background: var(--bg2); border-radius: 10px; padding: 1rem; }
.mwhy-item i { font-size: 1.5rem; flex-shrink: 0; margin-top: 0.2rem; }
.mwhy-item h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.3rem; }
.mwhy-item p { font-size: 0.83rem; color: var(--text2); line-height: 1.5; }
.replay-steps { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; }
.rs-step { display: flex; gap: 0.75rem; align-items: flex-start; font-size: 0.88rem; color: var(--text2); line-height: 1.5; }
.rs-num { background: var(--blue); color: white; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.75rem; flex-shrink: 0; margin-top: 0.1rem; }
.highlight-box.green { background: rgba(67,233,123,0.1); border-left: 3px solid var(--green); }

/* ===== HERO ANIMATION ===== */
.hero-svg-wrap { width: 100%; height: 180px; }

/* ═══════════════════════ LECTURE 6 EXPANDED ═══════════════════════ */

/* VFA Motivation: Why Tabular Fails */
.l6-fail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}
.l6-fail-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 1.2rem;
  text-align: center;
}
.l6-fail-icon { font-size: 2rem; margin-bottom: .6rem; }
.l6-fail-card h4 { margin-bottom: .5rem; font-size: .95rem; }
.l6-fail-card p  { font-size: .85rem; line-height: 1.55; opacity: .85; }

/* VFA Motivation: 3-Step Process */
.l6-three-steps { background: var(--card); border-radius: 16px; padding: 1.4rem; border: 1px solid rgba(255,255,255,.08); }
.l6-three-steps h3 { margin-bottom: 1rem; }
.l6-steps-row { display: flex; gap: .8rem; align-items: stretch; }
.l6-step-box {
  flex: 1;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 1rem;
}
.l6-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
  color: #fff;
  margin-bottom: .5rem;
}
.l6-step-box h4 { margin-bottom: .4rem; font-size: .95rem; }
.l6-step-box p  { font-size: .85rem; line-height: 1.55; opacity: .85; }
.l6-step-arrow { display: flex; align-items: center; font-size: 1.4rem; color: var(--text-dim); padding: 0 .2rem; }

/* Gradient Methods: Challenges Grid */
.l6-challenges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .9rem;
  margin-top: .8rem;
}
.l6-challenge-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.l6-challenge-card h4 { font-size: .9rem; margin-bottom: .4rem; }
.l6-challenge-card p  { font-size: .83rem; line-height: 1.55; opacity: .85; }

/* Deep RL: NN Grid */
.l6-nn-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .9rem;
  margin-top: .8rem;
}
.l6-nn-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}
.l6-nn-icon { font-size: 1.8rem; margin-bottom: .5rem; }
.l6-nn-card h4 { font-size: .9rem; margin-bottom: .4rem; }
.l6-nn-card p  { font-size: .82rem; line-height: 1.5; opacity: .85; }

/* CNN Grid */
.l6-cnn-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .9rem;
  margin-top: .8rem;
}
.l6-cnn-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 1rem;
}
.l6-cnn-card h4 { font-size: .88rem; margin-bottom: .4rem; color: var(--teal); }
.l6-cnn-card p  { font-size: .83rem; line-height: 1.5; opacity: .85; }

/* Model-Based: Advantages List */
.l6-advantages-list {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-top: .8rem;
}

/* Dyna-Q: Planning for Action Selection */
.l6-action-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .9rem;
  margin-top: .8rem;
}
.l6-asel-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 1.1rem;
}
.l6-asel-card h4 { font-size: .9rem; margin-bottom: .4rem; }
.l6-asel-card p  { font-size: .85rem; line-height: 1.55; opacity: .85; }

/* Forward Search */
.l6-forward-search {
  display: flex;
  gap: .6rem;
  align-items: stretch;
  margin-top: .8rem;
}
.l6-fs-step {
  flex: 1;
  background: var(--card);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: .9rem;
}
.l6-fs-step h4 { font-size: .88rem; margin-bottom: .4rem; }
.l6-fs-step p  { font-size: .82rem; line-height: 1.5; opacity: .85; }
.l6-fs-arrow { display: flex; align-items: center; font-size: 1.2rem; color: var(--text-dim); }

/* Simulation-Based Search: MC Tree Evaluation */
.l6-mctse-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .9rem;
  margin-top: .8rem;
}
.l6-mctse-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 1rem;
}
.l6-mctse-card h4 { font-size: .88rem; margin-bottom: .4rem; color: var(--teal); }
.l6-mctse-card p  { font-size: .83rem; line-height: 1.5; opacity: .85; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  :root { --sidebar-w: 220px; }
  .section { padding: 1.5rem 1.5rem 3rem; }
  .ae-steps { grid-template-columns: 1fr 1fr; }
  .innovations-grid, .backup-grid, .async-types { grid-template-columns: 1fr; }
  .components-grid { grid-template-columns: 1fr; }
  .four-problems { grid-template-columns: 1fr 1fr; }
  .three-approaches, .state-agg-grid { grid-template-columns: 1fr; }
  .mcts-steps { grid-template-columns: 1fr 1fr; }
  .deadly-triad { flex-direction: column; }
  .l6-fail-grid { grid-template-columns: 1fr 1fr; }
  .l6-nn-grid, .l6-cnn-grid { grid-template-columns: 1fr 1fr; }
  .l6-mctse-grid { grid-template-columns: 1fr 1fr; }
  .l6-steps-row { flex-direction: column; }
  .l6-step-arrow { transform: rotate(90deg); align-self: center; }
  .l6-challenges-grid { grid-template-columns: 1fr 1fr; }
  .l6-action-select-grid { grid-template-columns: 1fr; }
  .l6-forward-search { flex-direction: column; }
  .l6-fs-arrow { transform: rotate(90deg); align-self: center; }
}
@media (max-width: 680px) {
  :root { --sidebar-w: 0px; }
  .sidebar { width: 240px; transform: translateX(-240px); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); width: 240px; }
  .main-content { margin-left: 0; }
  .hero { flex-direction: column; }
  .hero-visual { display: none; }
  .ae-steps { grid-template-columns: 1fr; }
  .pillars-grid { grid-template-columns: 1fr; }
  .approx-types { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════ DEEP DIVES ═══ */

/* Convergence Table */
.conv-table-wrap { overflow-x: auto; margin: 1.5rem 0; border-radius: 12px; }
.conv-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.conv-table th {
  background: rgba(108,99,255,.18);
  padding: .6rem 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid rgba(108,99,255,.3);
}
.conv-table td {
  padding: .55rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.conv-table tr:hover td { background: rgba(255,255,255,.03); }
.conv-cell { font-weight: 600; text-align: center; border-radius: 6px; padding: .3rem .6rem !important; }
.conv-cell.yes  { background: rgba(67,233,123,.15); color: #43E97B; }
.conv-cell.warn { background: rgba(247,151,30,.15);  color: #F7971E; }
.conv-cell.no   { background: rgba(249,83,198,.15);  color: #F953C6; }
.conv-cell.na   { color: var(--text-dim); }

/* Deep-dive insight cards */
.dd-insight-row {
  display: flex;
  gap: 1.2rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.dd-insight {
  flex: 1;
  min-width: 240px;
  background: var(--card);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
}
.dd-insight h3 { margin-bottom: .6rem; font-size: 1rem; }
.dd-insight ul { margin: .5rem 0 0 1rem; }
.dd-insight ul li { margin-bottom: .35rem; font-size: .9rem; line-height: 1.5; }
.dd-insight-icon { font-size: 1.8rem; margin-bottom: .5rem; }

/* Semi-Gradient derivation blocks */
.sg-derivation {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.08);
  border-left: 4px solid var(--purple);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.2rem;
}
.sg-derivation h3 { margin-bottom: .7rem; font-size: 1rem; color: var(--purple-light); }
.sg-key {
  background: rgba(108,99,255,.1);
  border: 2px solid var(--purple);
  border-radius: 14px;
  padding: 1.4rem;
  margin-bottom: 1.2rem;
}
.sg-key h3 { margin-bottom: .7rem; font-size: 1.1rem; }
.sg-highlight {
  background: rgba(108,99,255,.2);
  border: 1px solid var(--purple);
  font-size: 1.05rem;
}
.sg-compare { margin-top: 1.5rem; }
.sg-compare h3 { margin-bottom: .8rem; }

/* Backup diagrams */
.backup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 1.5rem;
}
.backup-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.backup-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--teal);
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding-bottom: .5rem;
}
.backup-formula {
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  background: var(--bg);
  border-radius: 8px;
  padding: .5rem .7rem;
  color: var(--teal);
  word-break: break-all;
}
.backup-props { margin-left: 1rem; font-size: .85rem; }
.backup-props li { margin-bottom: .25rem; line-height: 1.5; }
.backup-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: .7rem;
  background: var(--bg);
  border-radius: 10px;
  min-height: 90px;
}
.bd-root {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--purple);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
  color: #fff;
}
.bd-chain { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.bd-link {
  font-size: .7rem;
  background: var(--teal);
  color: #000;
  border-radius: 4px;
  padding: .1rem .4rem;
  font-weight: 600;
}
.bd-node { width: 28px; height: 28px; }
.bd-terminal {
  background: rgba(249,83,198,.2);
  border: 1px solid var(--pink);
  border-radius: 6px;
  font-size: .7rem;
  padding: .2rem .5rem;
  color: var(--pink);
}
.bd-dots { font-size: 1rem; color: var(--text-dim); }
.s-circle {
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem;
}
.bd-branches { display: flex; gap: 1rem; }
.bd-branch { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.bd-action {
  font-size: .65rem;
  background: rgba(247,151,30,.3);
  color: var(--gold);
  border-radius: 4px;
  padding: .1rem .35rem;
}
.bd-states { display: flex; flex-direction: column; gap: .2rem; align-items: center; }

/* Algorithm Landscape */
.landscape-grid { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 1.5rem; }
.landscape-axis {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
}
.landscape-axis h3 { margin-bottom: .8rem; color: var(--teal); }
.landscape-axis-bar {
  display: flex;
  gap: 1rem;
  align-items: stretch;
}
.la-end {
  flex: 1;
  background: var(--bg);
  border-radius: 10px;
  padding: .8rem 1rem;
  font-size: .88rem;
}
.la-end strong { display: block; margin-bottom: .4rem; color: var(--purple-light); font-size: .95rem; }
.la-end ul { margin-left: 1rem; }
.la-end ul li { margin-bottom: .2rem; }
.la-arrow {
  display: flex;
  align-items: center;
  font-size: 1.4rem;
  color: var(--text-dim);
  padding: 0 .5rem;
}
.la-middle {
  margin-top: .7rem;
  background: rgba(0,212,170,.1);
  border: 1px solid var(--teal);
  border-radius: 8px;
  padding: .5rem 1rem;
  font-size: .9rem;
  text-align: center;
}
.landscape-spectrum-bar {
  display: flex;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  margin-top: .5rem;
}
.lsb-item {
  flex: 1;
  padding: .7rem;
  text-align: center;
  font-weight: 600;
  font-size: .88rem;
}
.lsb-item small { display: block; font-weight: 400; opacity: .75; margin-top: .1rem; }
.lsb-td  { background: rgba(108,99,255,.25); }
.lsb-tdn { background: rgba(0,212,170,.15); }
.lsb-mc  { background: rgba(247,151,30,.2); }

/* Algorithm Map */
.algo-map { margin-top: 1.5rem; }
.algo-map h3 { margin-bottom: 1rem; }
.am-grid {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 2px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
}
.am-header {
  background: rgba(108,99,255,.2);
  padding: .6rem 1rem;
  font-weight: 700;
  font-size: .88rem;
}
.am-row-header {
  background: rgba(0,212,170,.1);
  padding: .6rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}
.am-cell {
  background: var(--card);
  padding: .6rem 1rem;
  font-size: .85rem;
  border-top: 1px solid rgba(255,255,255,.04);
}
.am-na { opacity: .5; font-style: italic; }

/* GPI Diagram */
.gpi-diagram {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--card);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}
.gpi-box {
  flex: 1;
  min-width: 200px;
  background: var(--bg);
  border-radius: 12px;
  padding: 1.2rem;
  text-align: center;
  border: 2px solid transparent;
}
.gpi-box.eval   { border-color: var(--purple); }
.gpi-box.improve{ border-color: var(--teal); }
.gpi-icon { font-size: 2rem; margin-bottom: .5rem; }
.gpi-box h3 { margin-bottom: .4rem; font-size: 1rem; }
.gpi-box p  { font-size: .85rem; opacity: .8; margin-bottom: .7rem; }
.gpi-methods { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; }
.gpi-tag {
  background: rgba(108,99,255,.2);
  border: 1px solid rgba(108,99,255,.3);
  border-radius: 20px;
  padding: .2rem .6rem;
  font-size: .75rem;
  font-weight: 600;
}
.gpi-arrows {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  color: var(--text-dim);
}
.gpi-arrow { font-size: 1.5rem; color: var(--gold); }
.gpi-vfa-section { margin-top: 1.5rem; }
.gpi-vfa-section h3 { margin-bottom: .8rem; font-size: 1.1rem; }

@media (max-width: 900px) {
  .dd-insight-row { flex-direction: column; }
  .backup-grid { grid-template-columns: 1fr 1fr; }
  .landscape-axis-bar { flex-direction: column; }
  .gpi-diagram { flex-direction: column; }
  .am-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .backup-grid { grid-template-columns: 1fr; }
  .l6-fail-grid, .l6-nn-grid, .l6-cnn-grid, .l6-mctse-grid, .l6-challenges-grid { grid-template-columns: 1fr; }
}
