/* ═══════════════════════════════════════════════════════════
   StackSimplified — Claude Certified Architect: Foundations (CCAR-F)
   Global Stylesheet — Brand: Primary Blue #233D90, Accent Red #E31B23
   ═══════════════════════════════════════════════════════════ */

/* ─── Design Tokens: Light Theme ─── */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fd;
  --bg-muted: #eef1f9;
  --border: #e2e6f0;
  --border-light: #f1f4fb;
  --text: #14203f;
  --text-dim: #45506e;
  --text-muted: #8b93a9;

  /* Brand */
  --brand-blue: #233D90;
  --brand-blue-2: #3556c0;
  --brand-red: #E31B23;
  --brand-red-2: #ff3b43;

  --primary: #233D90;
  --primary-soft: #eef1fb;
  --primary-border: #c2ccec;
  --secondary: #E31B23;
  --secondary-soft: #fdecec;
  --secondary-border: #f6c3c5;
  --dark: #14203f;

  --accent: #233D90;
  --accent-soft: #eef1fb;
  --success: #10b981;
  --success-soft: #d1fae5;
  --danger: #E31B23;
  --danger-soft: #fdecec;
  --warn: #f59e0b;
  --warn-soft: #fef3c7;

  --radius: 14px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 3px rgba(20,32,63,0.05), 0 1px 2px rgba(20,32,63,0.04);
  --shadow-md: 0 4px 14px rgba(20,32,63,0.08);
  --shadow-lg: 0 12px 34px rgba(20,32,63,0.12);
  --transition: 0.2s ease;
}

/* ─── Design Tokens: Dark Theme ─── */
[data-theme="dark"] {
  --bg: #0c1226;
  --bg-soft: #141d38;
  --bg-muted: #1f2b4d;
  --border: #263356;
  --border-light: #141d38;
  --text: #eef2fb;
  --text-dim: #c2cae0;
  --text-muted: #6b7594;

  --primary: #6d8bff;
  --primary-soft: rgba(35,61,144,0.28);
  --primary-border: rgba(109,139,255,0.4);
  --secondary: #ff5a61;
  --secondary-soft: rgba(227,27,35,0.18);
  --secondary-border: rgba(255,90,97,0.4);

  --accent-soft: rgba(35,61,144,0.22);
  --success-soft: rgba(16,185,129,0.12);
  --danger-soft: rgba(227,27,35,0.16);
  --warn-soft: rgba(245,158,11,0.12);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 34px rgba(0,0,0,0.55);
}

/* ─── Base Reset & Typography ─── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}
#root { min-height: 100vh; }
code, .mono { font-family: 'JetBrains Mono', monospace; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
::selection { background: rgba(35,61,144,0.16); }

::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ─── Container ─── */
.container { max-width: 820px; margin: 0 auto; padding: 0 24px; width: 100%; }
.container-wide { max-width: 1120px; margin: 0 auto; padding: 0 24px; width: 100%; }

/* ─── Navbar ─── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm); transition: background 0.3s;
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; text-decoration: none; }
.brand .logo-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-2));
  display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 16px;
  box-shadow: 0 4px 14px rgba(35,61,144,0.35);
}
.brand .logo-text { font-size: 16px; font-weight: 800; color: var(--text); }
.brand .logo-text span { color: var(--brand-red); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-home-link, .theme-toggle {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg-soft); display: grid; place-items: center; font-size: 16px;
  cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.nav-home-link:hover, .theme-toggle:hover { background: var(--bg-muted); border-color: var(--primary); transform: scale(1.05); text-decoration: none; }

/* ─── Breadcrumbs ─── */
.breadcrumbs {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted); margin-left: 16px;
  min-width: 0; overflow: hidden;
}
.breadcrumbs a { color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.breadcrumbs a:hover { color: var(--primary); text-decoration: none; }
.breadcrumbs .sep { opacity: 0.5; flex-shrink: 0; }
.breadcrumbs .current { color: var(--text-dim); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumbs .section-crumb { color: var(--text-muted); font-weight: 500; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Progress Bar ─── */
.reading-progress { position: fixed; top: 64px; left: 0; right: 0; height: 3px; z-index: 99; background: transparent; }
.reading-progress-bar { height: 100%; background: linear-gradient(90deg, var(--brand-blue), var(--brand-red)); transition: width 0.1s linear; border-radius: 0 2px 2px 0; }

/* ─── Landing / Hero ─── */
.landing { padding-bottom: 100px; }
.hero-wrap { position: relative; overflow: hidden; padding: 72px 0 40px; }
.hero-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(circle at 18% 20%, rgba(35,61,144,0.14), transparent 42%),
    radial-gradient(circle at 82% 15%, rgba(227,27,35,0.12), transparent 40%),
    radial-gradient(circle at 50% 95%, rgba(35,61,144,0.08), transparent 55%);
}
.hero-wrap .container { position: relative; z-index: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 999px; font-size: 12px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  background: var(--primary-soft); border: 1px solid var(--primary-border); color: var(--primary);
  margin-bottom: 22px;
}
.hero-title {
  font-size: clamp(34px, 5.5vw, 62px); font-weight: 900; line-height: 1.07;
  letter-spacing: -1.6px; color: var(--text); margin-bottom: 20px;
}
.hero-title span {
  background: linear-gradient(120deg, var(--brand-blue), var(--brand-red));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { font-size: 18px; line-height: 1.75; color: var(--text-dim); max-width: 680px; margin: 0 auto 30px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.cta-btn {
  padding: 15px 30px; border-radius: 12px; border: none;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-2)); color: #fff;
  font-weight: 700; font-size: 15px; cursor: pointer;
  box-shadow: 0 8px 24px rgba(35,61,144,0.35); transition: all 0.2s;
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(35,61,144,0.45); }
.cta-ghost {
  padding: 15px 26px; border-radius: 12px; font-weight: 700; font-size: 15px;
  border: 1.5px solid var(--primary-border); color: var(--primary); background: var(--bg);
  transition: all 0.2s; text-decoration: none; display: inline-flex; align-items: center;
}
.cta-ghost:hover { border-color: var(--primary); background: var(--primary-soft); text-decoration: none; transform: translateY(-2px); }

/* ─── Stats Bar ─── */
.stats-bar { display: flex; justify-content: center; gap: 14px; margin: 40px auto 0; flex-wrap: wrap; max-width: 900px; }
.stat-item {
  text-align: center; min-width: 120px; flex: 1;
  padding: 16px 12px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.stat-value { font-size: 22px; font-weight: 900; color: var(--brand-blue); }
[data-theme="dark"] .stat-value { color: var(--primary); }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-top: 3px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ─── Section titles ─── */
.section-title { font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: 10px; text-align: center; }
.section-desc { font-size: 14px; color: var(--text-dim); margin-bottom: 26px; text-align: center; max-width: 640px; margin-left: auto; margin-right: auto; }

/* ─── Domains Section ─── */
.domains-section { margin: 60px 0; }
.domain-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.domain-card {
  padding: 22px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg); box-shadow: var(--shadow-sm); transition: all 0.25s;
}
.domain-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--primary-border); }
.domain-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.domain-icon { font-size: 26px; }
.domain-weight {
  font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 800;
  color: var(--brand-red); background: var(--secondary-soft);
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--secondary-border);
}
[data-theme="dark"] .domain-weight { color: var(--secondary); }
.domain-card h4 { font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.domain-card p { font-size: 13px; line-height: 1.7; color: var(--text-dim); margin-bottom: 14px; }
.domain-bar { height: 7px; border-radius: 999px; background: var(--bg-muted); overflow: hidden; }
.domain-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-blue), var(--brand-red)); }

/* ─── Who Is This For ─── */
.who-section { margin: 60px 0; }
.who-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.who-card { padding: 22px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg); box-shadow: var(--shadow-sm); transition: all 0.25s; }
.who-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--primary-border); }
.who-icon { font-size: 28px; display: block; margin-bottom: 10px; }
.who-card h4 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.who-card p { font-size: 13px; line-height: 1.7; color: var(--text-dim); }

/* ─── Journey ─── */
.journey-section { margin: 60px 0; }
.journey-steps { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-soft); }
.journey-step { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: var(--radius-sm); width: 100%; max-width: 520px; transition: all 0.2s; }
.journey-step:hover { background: var(--primary-soft); }
.journey-step-num { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--brand-blue); color: #fff; }
.journey-step-icon { font-size: 18px; flex-shrink: 0; }
.journey-step-label { font-size: 14px; font-weight: 600; color: var(--text); flex: 1; }
.journey-connector { color: var(--primary); font-size: 14px; opacity: 0.5; margin-left: auto; }

/* ─── Roadmap ─── */
.roadmap-section { margin: 60px 0; scroll-margin-top: 80px; }
.roadmap-title { font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: 8px; text-align: center; }
.roadmap-desc { font-size: 14px; color: var(--text-dim); margin-bottom: 28px; text-align: center; max-width: 640px; margin-left: auto; margin-right: auto; }
.roadmap-module { margin-bottom: 28px; }
.roadmap-module-title {
  font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--brand-blue); margin: 0 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--primary-border);
}
[data-theme="dark"] .roadmap-module-title { color: var(--primary); }
.roadmap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.roadmap-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); cursor: pointer; transition: all 0.2s; position: relative; }
.roadmap-item:hover { border-color: var(--primary-border); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.roadmap-item.active:hover { border-color: var(--primary); }
.roadmap-item.locked { opacity: 0.62; cursor: default; }
.roadmap-item.locked:hover { transform: none; box-shadow: none; border-color: var(--border); }
.roadmap-num { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--bg-muted); color: var(--text-dim); border: 1px solid var(--border); }
.roadmap-item.active .roadmap-num { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); }
.roadmap-item-text { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; }
.roadmap-badge-live { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--success); background: var(--success-soft); border: 1px solid #a7f3d0; padding: 3px 8px; border-radius: 999px; flex-shrink: 0; }
[data-theme="dark"] .roadmap-badge-live { border-color: rgba(16,185,129,0.35); }
.roadmap-item .lock-icon { font-size: 11px; opacity: 0.6; flex-shrink: 0; }

/* ─── Chapter Cards ─── */
.chapters-heading { font-size: 24px; font-weight: 800; color: var(--text); margin: 60px 0 16px; text-align: center; }
.chapter-list { display: flex; flex-direction: column; gap: 10px; }
.chapter-item { display: flex; align-items: center; gap: 16px; padding: 20px 22px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg); cursor: pointer; transition: all 0.25s; box-shadow: var(--shadow-sm); }
.chapter-item:hover { border-color: var(--primary-border); box-shadow: var(--shadow-md); transform: translateX(4px); }
.chapter-item-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--primary-soft); border: 1px solid var(--primary-border); flex-shrink: 0; }
.chapter-item-body { flex: 1; }
.chapter-item-body h3 { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.chapter-item-body p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.chapter-item-meta { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.chapter-item-arrow { font-size: 18px; color: var(--primary); font-weight: 700; }
.footer { text-align: center; margin-top: 60px; color: var(--text-muted); font-size: 13px; }
.footer strong { color: var(--brand-blue); }
[data-theme="dark"] .footer strong { color: var(--primary); }

/* ─── Philosophy ─── */
.philosophy-section { margin: 60px 0; }
.philosophy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.phil-card { padding: 22px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg); box-shadow: var(--shadow-sm); transition: all 0.25s; }
.phil-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--secondary-border); }
.phil-icon { font-size: 24px; margin-bottom: 10px; }
.phil-card h4 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.phil-card p { font-size: 13px; line-height: 1.7; color: var(--text-dim); }

/* ─── Badges ─── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; font-family: 'JetBrains Mono', monospace; letter-spacing: 0.3px; }
.badge-beginner { background: var(--success-soft); color: var(--success); border: 1px solid #a7f3d0; }
.badge-intermediate { background: var(--warn-soft); color: var(--warn); border: 1px solid #fde68a; }
.badge-advanced { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--secondary-border); }
.badge-time { background: var(--bg-muted); color: var(--text-dim); border: 1px solid var(--border); }
.badge-module { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-border); }

/* ─── Chapter Layout ─── */
.layout-with-nav { display: flex; min-height: calc(100vh - 64px); }
.chapter-sidebar { position: sticky; top: 64px; height: calc(100vh - 64px); width: 290px; min-width: 290px; padding: 16px 12px; overflow-y: auto; border-right: 1px solid var(--border); background: var(--bg-soft); transition: background 0.3s; display: flex; flex-direction: column; }
.sidebar-home-btn { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--text-dim); text-decoration: none; border: 1px solid var(--border); background: var(--bg); transition: all 0.2s; }
.sidebar-home-btn:hover { color: var(--primary); border-color: var(--primary-border); background: var(--primary-soft); text-decoration: none; }
.sidebar-chapters { flex: 1; overflow-y: auto; }
.sidebar-chapter-group { margin-bottom: 2px; }
.sidebar-chapter-header { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s; user-select: none; }
.sidebar-chapter-header:hover { background: var(--bg-muted); }
.sidebar-chapter-header.active { background: var(--primary-soft); color: var(--primary); }
.sidebar-chapter-num { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 10px; font-weight: 800; background: var(--bg-muted); color: var(--text-muted); border: 1px solid var(--border); }
.sidebar-chapter-header.active .sidebar-chapter-num { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); }
.sidebar-chapter-title { font-size: 12.5px; font-weight: 600; color: var(--text-dim); flex: 1; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-chapter-header.active .sidebar-chapter-title { color: var(--primary); font-weight: 700; }
.sidebar-chapter-arrow { font-size: 9px; color: var(--text-muted); transition: transform 0.2s; flex-shrink: 0; }
.sidebar-chapter-arrow.open { transform: rotate(90deg); }
.sidebar-chapter-header.active .sidebar-chapter-arrow { color: var(--primary); }
.sidebar-sections-list { padding: 4px 0 8px 20px; margin-left: 10px; border-left: 2px solid var(--border); }
.sidebar-sec-link { display: block; padding: 5px 12px; margin-bottom: 1px; font-size: 11.5px; color: var(--text-muted); line-height: 1.4; text-decoration: none; border-radius: 4px; transition: all 0.15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-sec-link:hover { color: var(--text); background: var(--bg-muted); text-decoration: none; }
.sidebar-sec-link.active { color: var(--primary); font-weight: 600; background: var(--primary-soft); }
.sidebar-next-chapter { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.sidebar-next-btn { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius-sm); text-decoration: none; background: var(--bg); border: 1px solid var(--border); transition: all 0.2s; }
.sidebar-next-btn:hover { border-color: var(--primary-border); background: var(--primary-soft); text-decoration: none; }
.sidebar-next-btn span:first-child { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.sidebar-next-title { font-size: 12.5px; font-weight: 700; color: var(--primary); }

/* ─── Chapter Content ─── */
.chapter-content { flex: 1; min-width: 0; padding: 48px 56px 120px; max-width: 880px; }
.chapter-badge { display: inline-flex; align-items: center; font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 1.5px; color: var(--primary); background: var(--primary-soft); border: 1px solid var(--primary-border); padding: 4px 12px; border-radius: 999px; margin-bottom: 12px; font-weight: 600; }
.chapter-title { font-size: clamp(26px, 3.5vw, 38px); font-weight: 900; color: var(--text); margin-bottom: 10px; line-height: 1.15; }
.chapter-overview { font-size: 16px; line-height: 1.8; color: var(--text-dim); margin-bottom: 24px; max-width: 720px; }
.chapter-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }

/* Learning Objectives */
.learning-objectives { padding: 8px 24px; border-radius: var(--radius); margin-bottom: 40px; background: var(--primary-soft); border: 1px solid var(--primary-border); overflow: hidden; }
.learning-objectives.open { padding-bottom: 20px; }
.lo-toggle { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: none; cursor: pointer; padding: 14px 0; text-align: left; color: var(--primary); }
.lo-toggle h3 { font-size: 14px; font-weight: 800; color: var(--primary); margin: 0; flex: 1; }
.lo-chevron { font-size: 10px; color: var(--primary); flex-shrink: 0; transition: transform 0.2s ease; }
.lo-chevron.open { transform: rotate(90deg); }
.lo-hint { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--primary); opacity: 0.7; flex-shrink: 0; }
.learning-objectives .lo-list { list-style: none; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.learning-objectives .lo-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-dim); line-height: 1.6; }
.learning-objectives .lo-list li::before { content: '\1F3AF'; flex-shrink: 0; }

/* ─── Sections ─── */
.section { margin-bottom: 56px; scroll-margin-top: 80px; }
.section-heading { font-size: 23px; font-weight: 800; color: var(--text); margin-bottom: 10px; }
.section-intro { font-size: 15px; line-height: 1.8; color: var(--text-dim); margin-bottom: 20px; max-width: 720px; }

/* ─── Cards ─── */
.cards { display: grid; gap: 14px; margin: 20px 0; }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.card { padding: 22px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg); box-shadow: var(--shadow-sm); transition: all 0.25s; }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--primary-border); }
.card .card-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; margin-bottom: 12px; background: linear-gradient(135deg, var(--primary-soft), rgba(35,61,144,0.02)); border: 1px solid var(--primary-border); }
.card h4 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.card p { font-size: 13px; line-height: 1.7; color: var(--text-dim); }

/* ─── Diagram / Flow ─── */
.diagram { padding: 32px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-soft); margin: 20px 0; box-shadow: var(--shadow-sm); }
.flow { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 16px 0; }
.flow-node { padding: 16px 20px; border-radius: 12px; text-align: center; min-width: 130px; border: 1.5px solid var(--border); background: var(--bg); cursor: pointer; transition: all 0.25s; box-shadow: var(--shadow-sm); }
.flow-node:hover { transform: scale(1.05); border-color: var(--primary); box-shadow: var(--shadow-md); }
.flow-node.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 4px 16px rgba(35,61,144,0.18); }
.flow-node .fi { font-size: 24px; margin-bottom: 6px; }
.flow-node .ft { font-weight: 700; font-size: 13px; color: var(--text); }
.flow-node .fs { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.flow-arrow { color: var(--primary); font-size: 20px; font-weight: 800; animation: pulse 1.8s infinite ease-in-out; }
@keyframes pulse { 0%,100%{opacity:.4;transform:translateX(0)} 50%{opacity:1;transform:translateX(4px)} }
.node-detail { margin-top: 16px; padding: 16px 20px; border-radius: 12px; background: var(--bg); border: 1px solid var(--primary-border); font-size: 14px; line-height: 1.8; color: var(--text-dim); box-shadow: var(--shadow-sm); }
.node-detail strong { color: var(--text); }
.diagram-hint { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 12px; font-family: 'JetBrains Mono', monospace; }

/* ─── Callout ─── */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 16px 20px; border-radius: var(--radius); margin: 18px 0; font-size: 14px; line-height: 1.75; }
.callout-info { background: var(--accent-soft); border: 1px solid var(--primary-border); color: #1d3479; }
.callout-success { background: var(--success-soft); border: 1px solid #a7f3d0; color: #047857; }
.callout-warn { background: var(--warn-soft); border: 1px solid #fde68a; color: #92400e; }
.callout-danger { background: var(--danger-soft); border: 1px solid var(--secondary-border); color: #b91218; }
.callout-exam { background: var(--secondary-soft); border: 1px solid var(--secondary-border); color: #b91218; }
[data-theme="dark"] .callout-info { color: #a9bcff; }
[data-theme="dark"] .callout-success { color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
[data-theme="dark"] .callout-warn { color: #fcd34d; border-color: rgba(245,158,11,0.3); }
[data-theme="dark"] .callout-danger { color: #ff9ca0; }
[data-theme="dark"] .callout-exam { color: #ff9ca0; }

/* ─── Points List ─── */
.points { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.points li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.75; color: var(--text-dim); }
.points li .bullet { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--success-soft); border: 1px solid #a7f3d0; display: grid; place-items: center; font-size: 11px; color: var(--success); font-weight: 800; margin-top: 2px; }

/* ─── Quiz ─── */
.quiz-section { margin: 24px 0; padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-soft); }
.quiz-section h3 { font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.quiz-question { margin-bottom: 22px; }
.quiz-question p { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 10px; line-height: 1.6; }
.quiz-option { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 6px; border: 1px solid var(--border); background: var(--bg); cursor: pointer; transition: all 0.2s; font-size: 13px; color: var(--text-dim); }
.quiz-option:hover { border-color: var(--primary-border); background: var(--primary-soft); }
.quiz-option.selected { border-color: var(--primary); background: var(--primary-soft); color: var(--text); font-weight: 600; }
.quiz-option.correct { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.quiz-option.incorrect { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.quiz-option .option-letter { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--bg-muted); border: 1px solid var(--border); }
.quiz-explanation { margin-top: 8px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--success-soft); border: 1px solid #a7f3d0; font-size: 13px; color: #047857; line-height: 1.7; }
[data-theme="dark"] .quiz-explanation { color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
.quiz-check-btn { padding: 10px 20px; border-radius: 10px; border: none; background: var(--brand-blue); color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; transition: all 0.2s; margin-top: 8px; }
.quiz-check-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(35,61,144,0.3); }

/* ─── Scenario Box ─── */
.scenario-box { margin: 24px 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.scenario-header { padding: 18px 22px; background: linear-gradient(135deg, var(--brand-blue), var(--dark)); color: #f1f5f9; display: flex; align-items: center; gap: 12px; }
.scenario-header h4 { font-size: 15px; font-weight: 800; }
.scenario-header .scenario-icon { font-size: 22px; }
.scenario-body { padding: 22px; background: var(--bg); }
.scenario-body p { font-size: 14px; line-height: 1.8; color: var(--text-dim); margin-bottom: 12px; }
.scenario-requirements { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0; }
.scenario-req-item { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-soft); border: 1px solid var(--border); font-size: 13px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
.scenario-req-item .req-icon { font-size: 16px; }
.scenario-solution { margin-top: 16px; padding: 16px; border-radius: var(--radius-sm); background: var(--primary-soft); border: 1px solid var(--primary-border); }
.scenario-solution h5 { font-size: 13px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.scenario-solution p { font-size: 13px; line-height: 1.7; color: var(--text-dim); margin: 0; }

/* ─── Summary Section ─── */
.summary-section { margin: 24px 0; }
.summary-section h3 { font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 16px; }
.summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.summary-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-soft); border: 1px solid var(--border); font-size: 13px; line-height: 1.6; color: var(--text-dim); }
.sum-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* ─── Chapter Nav Footer ─── */
.chapter-nav-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); gap: 16px; }
.nav-prev { font-size: 14px; color: var(--text-muted); text-decoration: none; }
.nav-prev:hover { color: var(--text); text-decoration: none; }
.nav-next { font-size: 14px; font-weight: 700; color: var(--primary); text-decoration: none; text-align: right; }
.nav-next:hover { text-decoration: underline; }
.nav-done { font-size: 14px; color: var(--success); font-weight: 600; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .chapter-sidebar { display: none; }
  .chapter-content { padding: 32px 20px 80px; }
  .cards-2, .cards-3 { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .scenario-requirements { grid-template-columns: 1fr; }
  .who-grid, .philosophy-grid, .domain-grid { grid-template-columns: 1fr; }
  .flow { flex-direction: column; gap: 8px; }
  .flow-arrow { transform: rotate(90deg); }
  .breadcrumbs .section-crumb { display: none; }
}
@media (max-width: 600px) {
  .navbar { padding: 0 16px; }
  .hero-title { letter-spacing: -0.5px; }
  .hero-sub { font-size: 16px; }
  .stats-bar { gap: 10px; }
  .stat-item { min-width: 90px; }
  .stat-value { font-size: 18px; }
  .chapter-content { padding: 24px 16px 60px; }
  .section-heading { font-size: 19px; }
  .chapter-title { font-size: 25px; }
  .container { padding: 0 16px; }
  .roadmap-grid { grid-template-columns: 1fr; }
  .journey-step { padding: 8px 12px; }
}
