/* ============================================================
   CareerAlign — Shared Design System
   ============================================================
   Single source of truth for every page on the site.
   Each HTML file links here with:
     <link rel="stylesheet" href="styles.css">        (root pages)
     <link rel="stylesheet" href="../styles.css">     (subdirectory pages)
   Page-specific overrides (e.g. phase colours on hero tags)
   go in a tiny inline <style> block.
   ============================================================ */


/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-base:       #0b0d14;
  --bg-surface:    #10131e;
  --bg-elevated:   #171c2e;
  --bg-overlay:    #1e2438;

  /* Borders */
  --border-subtle:  #1a1f34;
  --border-default: #232840;
  --border-strong:  #2e3554;

  /* Text */
  --text-primary:   #e6e8f4;
  --text-secondary: #8e94b5;
  --text-muted:     #545a78;

  /* Accents */
  --accent-indigo:  #6366f1;
  --accent-cyan:    #22d3ee;
  --accent-violet:  #a855f7;
  --glow-indigo:    rgba(99,102,241,0.25);

  /* Phase / module colours */
  --phase-prereq:   #64748b;
  --phase-found:    #3b82f6;
  --phase-api:      #06b6d4;
  --phase-rag:      #f97316;
  --phase-agent:    #a855f7;
  --phase-quality:  #ef4444;
  --phase-cloud:    #22c55e;
  --phase-project:  #f59e0b;

  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Nunito', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Radii */
  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 18px;

  /* Page-level accent (override per page via inline <style>) */
  --page-color:    var(--phase-found);
  --page-color-04: rgba(59,130,246,0.04);
  --page-color-07: rgba(59,130,246,0.07);
  --page-color-12: rgba(59,130,246,0.12);
  --page-color-15: rgba(59,130,246,0.15);
  --page-color-25: rgba(59,130,246,0.25);
  --page-color-30: rgba(59,130,246,0.3);
}

/* ── Light Theme ──────────────────────────────────────────── */
[data-theme="light"] {
  --bg-base:       #f5f6fa;
  --bg-surface:    #ffffff;
  --bg-elevated:   #eef0f6;
  --bg-overlay:    #e4e7ef;

  --border-subtle:  #dfe2ec;
  --border-default: #cdd1de;
  --border-strong:  #b4b9cc;

  --text-primary:   #1a1c2e;
  --text-secondary: #4a5068;
  --text-muted:     #7e849e;

  --accent-indigo:  #4f46e5;
  --accent-cyan:    #0891b2;
  --accent-violet:  #7c3aed;
  --glow-indigo:    rgba(79,70,229,0.18);

  --phase-prereq:   #475569;
  --phase-found:    #2563eb;
  --phase-api:      #0891b2;
  --phase-rag:      #ea580c;
  --phase-agent:    #7c3aed;
  --phase-quality:  #dc2626;
  --phase-cloud:    #16a34a;
  --phase-project:  #d97706;
}

[data-theme="light"] .nav {
  background: rgba(245,246,250,0.94);
}

[data-theme="light"] .hero--landing::before {
  background: radial-gradient(ellipse at center, rgba(79,70,229,0.08) 0%, transparent 70%);
}

[data-theme="light"] .hero--hub h1 {
  background: linear-gradient(135deg, #1a1c2e 30%, #4f46e5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .module-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

[data-theme="light"] ::-webkit-scrollbar-track { background: var(--bg-base); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: var(--border-default); }


/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; }


/* ── Typography ────────────────────────────────────────────── */
/* (type scale is handled per-component below; this section
   exists for any future global type rules) */


/* ── Navigation ────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11,13,20,0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 32px;
  display: flex;
  align-items: center;
  height: 58px;
  gap: 24px;
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
.nav-logo span,
.nav-logo .accent { color: var(--accent-indigo); }

/* Module-page variant (compact pills) */
.nav-links {
  display: flex;
  gap: 6px;
  flex: 1;
  flex-wrap: wrap;
  overflow: hidden;
}
.nav-links a {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
  transition: all .2s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text-primary); background: var(--bg-elevated); }
.nav-links a.active { color: var(--page-color); background: var(--page-color-15); }

/* Hub / landing-page variant (wider spacing) */
.nav-links--wide {
  gap: 24px;
}
.nav-links--wide a {
  font-size: 13.5px;
  padding: 0;
  border-radius: 0;
  color: var(--text-secondary);
}
.nav-links--wide a:hover { color: var(--text-primary); background: none; }

.nav-home {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-indigo);
  padding: 6px 14px;
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 7px;
  transition: all .2s;
  white-space: nowrap;
  margin-left: auto;
}
.nav-home:hover { background: rgba(99,102,241,0.1); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.progress-badge {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12.5px;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  white-space: nowrap;
}


/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  padding: 70px 60px 50px;
  max-width: 1400px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}
.hero > * { position: relative; z-index: 1; }

/* Landing-page glow */
.hero--landing {
  padding: 100px 40px 80px;
  max-width: 900px;
  text-align: center;
  border-bottom: none;
}
.hero--landing::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(99,102,241,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero--landing h1 {
  font-size: clamp(2.6rem, 5.5vw, 3.8rem);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
.hero--landing h1 .highlight {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero .tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.75;
}
.hero .tagline strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Course-hub hero variant */
.hero--hub {
  padding: 80px 60px 60px;
  max-width: 1300px;
  border-bottom: none;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #a5b4fc;
  margin-bottom: 24px;
}
.hero--hub h1 {
  font-size: clamp(36px, 5vw, 64px);
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #e6e8f4 30%, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.75;
  margin-bottom: 40px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Module-page hero */
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--page-color-12);
  border: 1px solid var(--page-color-25);
  border-radius: 20px;
  padding: 5px 14px;
  margin-bottom: 22px;
  font-size: 12.5px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--page-color);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  max-width: 820px;
  margin-bottom: 20px;
}
.hero h1 em { font-style: normal; color: var(--page-color); }
.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 760px;
  line-height: 1.75;
  margin-bottom: 36px;
}
.hero-checklist {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.hero-pill svg { color: var(--page-color); flex-shrink: 0; }
.hero-badges { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(239,68,68,0.10); border: 1px solid rgba(239,68,68,0.25);
  border-radius: 14px; padding: 3px 12px;
  font-size: 11px; font-family: var(--font-display); font-weight: 600;
  color: #ef4444; letter-spacing: 0.03em; text-transform: uppercase;
}

/* Stats strips */
.stats-strip {
  display: flex;
  gap: 0;
  margin: 56px 0 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-surface);
}
.stat-item {
  flex: 1;
  padding: 22px 24px;
  border-right: 1px solid var(--border-default);
  text-align: center;
}
.stat-item:last-child { border-right: none; }
.stat-val {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Landing-page stats (centred, flexbox) */
.stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 56px;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}
/* .stat-label already defined above */


/* ── Content Grid & Sidebar TOC ────────────────────────────── */
.content-grid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 60px 80px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  align-items: start;
}
.toc {
  position: sticky;
  top: 78px;
  padding: 32px 0;
  border-right: 1px solid var(--border-subtle);
  margin-right: 48px;
}
.toc-title {
  font-size: 11px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.toc a {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
  transition: color .2s;
  border-left: 2px solid transparent;
  padding-left: 12px;
  margin-left: -2px;
}
.toc a:hover { color: var(--text-primary); border-left-color: var(--page-color); }
.toc a.section {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 12.5px;
  margin-top: 8px;
}
.toc a.sub { padding-left: 24px; font-size: 12px; }

.main { padding: 40px 0; }


/* ── Sections & Headings ───────────────────────────────────── */

/* Module-page sections */
.section { margin-bottom: 60px; }
.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.section-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--page-color-15);
  border: 1px solid var(--page-color-30);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--page-color);
  flex-shrink: 0;
}
.section h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-primary);
}
.section h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 28px 0 12px;
}
.section p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1rem;
  line-height: 1.8;
}
.section p strong { color: var(--text-primary); font-weight: 600; }
.section ul, .section ol {
  color: var(--text-secondary);
  margin: 0 0 16px 24px;
  font-size: 1rem;
  line-height: 1.8;
}
.section li { margin-bottom: 6px; }
.section li strong { color: var(--text-primary); font-weight: 600; }

/* Hub / landing section wrappers */
.section--hub .section-header {
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 36px;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 0;
  border-bottom: none;
}
.section--hub {
  max-width: 1300px;
  margin: 0 auto;
  padding: 56px 60px;
  margin-bottom: 0;
}
.section--landing {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 40px;
  margin-bottom: 0;
}
.section-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.section-title span { color: var(--accent-indigo); }
.section-sub {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 6px;
  max-width: 600px;
  line-height: 1.65;
}
.section-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
  margin-bottom: 40px;
  line-height: 1.7;
}
.divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 0 60px;
}


/* ── Callout Boxes ─────────────────────────────────────────── */
.callout {
  border-left: 3px solid var(--page-color);
  background: var(--page-color-07);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin: 20px 0;
}
.callout.info { border-color: var(--accent-indigo); background: rgba(99,102,241,0.07); }
.callout.tip  { border-color: var(--phase-cloud);  background: rgba(34,197,94,0.07);  }
.callout.warn { border-color: var(--phase-project); background: rgba(245,158,11,0.07); }
.callout-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--page-color);
}
.callout.info .callout-label { color: var(--accent-indigo); }
.callout.tip  .callout-label { color: var(--phase-cloud);  }
.callout.warn .callout-label { color: var(--phase-project); }
.callout.exam { border-color: #ef4444; background: rgba(239,68,68,0.07); }
.callout.exam .callout-label { color: #ef4444; }
.callout p { margin: 0; color: var(--text-secondary); font-size: 0.95rem; }


/* ── Code Blocks ───────────────────────────────────────────── */
pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 20px 0;
}
code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--accent-cyan);
  line-height: 1.65;
}
:not(pre) > code {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 13px;
}
.code-comment { color: var(--text-muted); }
.code-keyword { color: #c084fc; }
.code-string  { color: #86efac; }
.code-fn      { color: #67e8f9; }
.code-num     { color: #fca5a5; }


/* ── Tables ────────────────────────────────────────────────── */
.comp-table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14px; }
.comp-table th,
.comp-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-subtle); }
.comp-table th {
  background: var(--bg-elevated);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.comp-table td { color: var(--text-secondary); }
.comp-table tr:hover td { background: var(--page-color-04); }

.price-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px; }
.price-table th {
  text-align: left; padding: 12px 16px;
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  font-family: var(--font-display); font-weight: 600;
  font-size: 12px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.price-table td { padding: 10px 16px; border: 1px solid var(--border-default); color: var(--text-secondary); }
.price-table tbody tr:hover { background: var(--bg-surface); }
.price-table code { font-size: 12px; }

.data-table {
  width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px;
}
.data-table th {
  background: var(--bg-elevated); color: var(--text-primary);
  font-family: var(--font-display); font-weight: 600; font-size: 12px;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
.data-table td {
  padding: 10px 16px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}
.data-table tr:hover td { background: var(--bg-surface); }
.data-table td strong { color: var(--text-primary); }
.comp-table td strong { color: var(--text-primary); }

/* Generic table fallback */
table:not(.comp-table):not(.price-table) {
  width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px;
}
table:not(.comp-table):not(.price-table) th,
table:not(.comp-table):not(.price-table) td {
  padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-subtle);
}
table:not(.comp-table):not(.price-table) th {
  background: var(--bg-surface);
  font-family: var(--font-display); font-weight: 600;
  color: var(--text-primary); font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
table:not(.comp-table):not(.price-table) td { color: var(--text-secondary); }
table:not(.comp-table):not(.price-table) tr:hover td { background: var(--bg-surface); }


/* ── Cards & Grids ─────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 40px;
}

/* Skill / concept card grid (module pages) */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.skill-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: border-color .2s;
}
.skill-card:hover { border-color: var(--page-color); }
.skill-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.skill-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--page-color-15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.skill-card h4 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.skill-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

/* Checklist (module pages) */
.checklist { list-style: none; margin: 16px 0; }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  color: var(--text-secondary);
}
.checklist li:last-child { border-bottom: none; }
.check-box {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 2px solid var(--page-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.check-box.done { background: var(--page-color); border-color: var(--page-color); }

/* SVG diagram wrapper */
.diagram-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin: 32px 0;
}
.diagram-caption {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
  font-style: italic;
}

/* Formula block */
.formula {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 16px 22px;
  margin: 20px 0;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent-cyan);
  text-align: center;
  letter-spacing: 0.02em;
}

/* Tab labels (plain / deep toggle on module pages) */
.tab-row {
  display: flex;
  gap: 8px;
  margin-bottom: -1px;
  padding: 0;
}
.tab-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 6px 6px 0 0;
  background: var(--bg-overlay);
  color: var(--text-muted);
  border: 1px solid var(--border-default);
  border-bottom: none;
}
.tab-label.plain { color: var(--phase-cloud); }
.tab-label.deep  { color: var(--accent-violet); }


/* ── Module Cards (course hub) ─────────────────────────────── */
.phase-heading {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 16px;
}
.module-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 22px 24px;
  border-top: 3px solid var(--card-color, #6366f1);
  transition: border-color .2s, box-shadow .2s, transform .2s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.module-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  transform: translateY(-2px);
  border-color: var(--card-color, #6366f1);
}
.module-card.completed { opacity: .6; }
.module-card.completed::after {
  content: '\2713  Read';
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 11px;
  font-weight: 700;
  color: #22c55e;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 20px;
  padding: 2px 9px;
}
.card-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--card-color, #6366f1);
  letter-spacing: .06em;
}
.card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.card-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.card-time {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.card-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}
.topic-pill {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  color: var(--text-muted);
}
.card-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: all .2s;
  flex-shrink: 0;
}
.card-check:checked {
  background: var(--card-color, #6366f1);
  border-color: var(--card-color, #6366f1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}


/* ── Subject Cards (landing page) ──────────────────────────── */
.path-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  transition: all .25s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.path-card.active:hover {
  border-color: var(--accent-indigo);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(99,102,241,0.12);
}
.path-card.coming-soon {
  opacity: 0.45;
  border-style: dashed;
  border-color: var(--border-subtle);
  cursor: default;
}
.path-card .icon { font-size: 2rem; line-height: 1; }
.path-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}
.path-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
  flex: 1;
}
.path-card .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  width: fit-content;
}
.path-card .badge.muted {
  color: var(--text-muted);
  border-color: var(--border-subtle);
}
.path-card .card-link {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-indigo);
  transition: color .2s;
}
.path-card .card-link:hover { color: var(--accent-cyan); }

/* Empty state */
.empty-state {
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
  padding: 60px 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}


/* ── Progress Tracking ─────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 20px 28px;
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.progress-label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-secondary);
}
.progress-track {
  flex: 1;
  height: 8px;
  background: var(--bg-base);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-cyan));
  border-radius: 4px;
  transition: width .5s ease;
}
.progress-pct {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent-cyan);
  white-space: nowrap;
}
.btn-reset {
  font-size: 12px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--font-body);
}
.btn-reset:hover { color: var(--text-secondary); background: var(--bg-overlay); }


/* ── Learning Path SVG (course hub) ────────────────────────── */
.path-section {
  padding: 56px 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.path-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 60px;
}
.learning-path-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.phase-tag {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.svg-module-box {
  cursor: pointer;
  transition: opacity .15s;
}
.svg-module-box:hover { opacity: .85; }
.svg-module-label {
  font-family: var(--font-display);
  font-weight: 600;
  pointer-events: none;
}


/* ── Glossary ──────────────────────────────────────────────── */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}
.glossary-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
}
.gloss-term {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}
.gloss-def {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}


/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
}
.btn-primary {
  background: var(--accent-indigo);
  color: white;
}
.btn-primary:hover {
  background: #5254d4;
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--accent-indigo);
  color: var(--text-primary);
}

/* Landing-page button variant (slightly larger) */
.btn--lg {
  padding: 12px 28px;
  font-size: 15px;
}
.btn--lg.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--glow-indigo);
}


/* ── Prev / Next Navigation ────────────────────────────────── */
.next-section {
  margin-top: 70px;
  padding-top: 40px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.next-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  font-family: var(--font-display);
}
.next-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 14px 22px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  transition: all .2s;
}
.next-btn:hover {
  border-color: var(--page-color);
  color: var(--page-color);
  transform: translateX(4px);
}
.prev-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 14px 22px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  transition: all .2s;
}
.prev-btn:hover {
  border-color: var(--page-color);
  color: var(--page-color);
  transform: translateX(-4px);
}
.next-phase {
  font-size: 12px;
  color: var(--page-color);
  font-weight: 500;
}


/* ── Footer ────────────────────────────────────────────────── */
footer,
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 36px 60px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
}
footer a { color: var(--accent-indigo); }
footer a:hover { text-decoration: underline; }


/* ── Colab Badges ──────────────────────────────────────────── */
.colab-btn {
  display: inline-flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.colab-btn:hover { opacity: 1; }


/* ── Theme Toggle ─────────────────────────────────────────── */
.theme-toggle {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: all .2s;
  margin-left: auto;
  display: flex;
  align-items: center;
}
.theme-toggle:hover {
  border-color: var(--accent-indigo);
  background: var(--bg-overlay);
}


/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }


/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav { padding: 0 16px; gap: 16px; }
  .hero { padding: 64px 20px 56px; }
  .hero--landing { padding: 64px 20px 56px; }
  .hero--landing h1,
  .hero h1 { font-size: 2rem; }
  .stats { gap: 24px; }
  .section--landing { padding: 56px 20px; }
  .section--hub { padding: 56px 20px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid {
    grid-template-columns: 1fr;
    padding: 0 20px 40px;
  }
  .toc { display: none; }
}

@media (max-width: 560px) {
  .card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats { flex-direction: column; gap: 16px; }
  .nav-links { gap: 16px; }
}
