/* ── RESET & TOKENS ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
a { text-decoration: none; color: inherit; }

:root {
  /* Light mode (default) */
  --bg:       #f8f9fc;
  --surface:  #ffffff;
  --surface2: #f0f2f5;
  --border:   #e2e5eb;
  --border2:  #d0d4dc;
  --text:     #1a1d26;
  --muted:    #64748b;
  --dim:      #94a3b8;

  /* Stage accent palette */
  --s1: #16a34a;  --s1bg: rgba(22,163,74,.06);   --s1bd: rgba(22,163,74,.18);
  --s2: #d97706;  --s2bg: rgba(217,119,6,.06);   --s2bd: rgba(217,119,6,.18);
  --s3: #ea580c;  --s3bg: rgba(234,88,12,.06);   --s3bd: rgba(234,88,12,.18);
  --s4: #dc2626;  --s4bg: rgba(220,38,38,.06);   --s4bd: rgba(220,38,38,.18);
  --s5: #2563eb;  --s5bg: rgba(37,99,235,.06);   --s5bd: rgba(37,99,235,.18);
  --s6: #9333ea;  --s6bg: rgba(147,51,234,.06);  --s6bd: rgba(147,51,234,.18);
  --s7: #0d9488;  --s7bg: rgba(13,148,136,.06);  --s7bd: rgba(13,148,136,.18);
  --s8: #64748b;  --s8bg: rgba(100,116,139,.06); --s8bd: rgba(100,116,139,.18);
  --s9: #b45309;  --s9bg: rgba(180,83,9,.06);   --s9bd: rgba(180,83,9,.18);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

/* Dark mode */
[data-theme="dark"] {
  --bg:       #0b0d10;
  --surface:  #12151a;
  --surface2: #181c24;
  --border:   #222632;
  --border2:  #2e3545;
  --text:     #e2e6f0;
  --muted:    #64748b;
  --dim:      #334155;

  --s1: #22c55e;  --s1bg: rgba(34,197,94,.07);   --s1bd: rgba(34,197,94,.22);
  --s2: #f59e0b;  --s2bg: rgba(245,158,11,.07);  --s2bd: rgba(245,158,11,.22);
  --s3: #f97316;  --s3bg: rgba(249,115,22,.07);  --s3bd: rgba(249,115,22,.22);
  --s4: #ef4444;  --s4bg: rgba(239,68,68,.07);   --s4bd: rgba(239,68,68,.22);
  --s5: #3b82f6;  --s5bg: rgba(59,130,246,.07);  --s5bd: rgba(59,130,246,.22);
  --s6: #a855f7;  --s6bg: rgba(168,85,247,.07);  --s6bd: rgba(168,85,247,.22);
  --s7: #14b8a6;  --s7bg: rgba(20,184,166,.07);  --s7bd: rgba(20,184,166,.22);
  --s8: #94a3b8;  --s8bg: rgba(148,163,184,.07); --s8bd: rgba(148,163,184,.22);
  --s9: #d97706;  --s9bg: rgba(217,119,6,.07);  --s9bd: rgba(217,119,6,.22);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.65;
  overflow-x: hidden;
}

/* Subtle grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.02'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 999;
}
[data-theme="dark"] body::after {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
}

/* ── HERO ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: center;
  padding: 120px 80px 100px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.08) 0%, rgba(147,51,234,.05) 40%, transparent 70%);
  top: 50%; left: 38%;
  transform: translate(-50%,-50%);
  pointer-events: none;
}
[data-theme="dark"] .hero-glow {
  background: radial-gradient(circle, rgba(59,130,246,.1) 0%, rgba(168,85,247,.06) 40%, transparent 70%);
}

.hero-content { position: relative; z-index: 2; }

.hero-label {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeUp .5s ease .1s forwards;
}

.hero-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(40px, 5.5vw, 80px);
  font-weight: 700;
  line-height: 1.07;
  letter-spacing: -.03em;
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp .6s ease .25s forwards;
}

.hero-title em {
  font-style: italic;
  background: linear-gradient(135deg, #2563eb 0%, #9333ea 50%, #db2777 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="dark"] .hero-title em {
  background: linear-gradient(135deg, #3b82f6 0%, #a855f7 50%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-sub {
  font-size: 17px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.7;
  max-width: 440px;
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeUp .6s ease .4s forwards;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeUp .6s ease .55s forwards;
}

.meta-pill {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--muted);
  padding: 6px 14px;
  border: 1px solid var(--border2);
  border-radius: 100px;
}

.hero-req {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 10px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: fit-content;
  opacity: 0;
  animation: fadeUp .6s ease .62s forwards;
}

.req-icon { font-size: 18px; flex-shrink: 0; }

.req-text {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}
.req-text strong {
  font-weight: 600;
  color: var(--text);
}

.hero-social-proof {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(37,99,235,.06), rgba(147,51,234,.06));
  border: 1px solid rgba(37,99,235,.15);
  border-radius: 100px;
  width: fit-content;
  opacity: 0;
  animation: fadeUp .6s ease .65s forwards;
}
.hero-social-proof strong { color: var(--text); font-weight: 600; }

.hero-subscribe {
  margin-bottom: 20px;
  border-radius: var(--radius-md);
  overflow: hidden;
  width: fit-content;
  opacity: 0;
  animation: fadeUp .6s ease .68s forwards;
}
.hero-subscribe iframe {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  max-width: 100%;
}
[data-theme="dark"] .hero-subscribe iframe {
  filter: invert(1) hue-rotate(180deg);
}

.hero-actions {
  display: flex;
  gap: 12px;
  opacity: 0;
  animation: fadeUp .6s ease .7s forwards;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 13px 28px;
  background: var(--text);
  color: var(--bg);
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .15s;
}
.btn-primary:hover { opacity: .88; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 13px 28px;
  border: 1px solid var(--border2);
  color: var(--muted);
  border-radius: 100px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--dim); }

/* Hero flow cards (right column) */
.hero-flow {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fadeIn .8s ease .8s forwards;
}

.flow-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 380px;
}

.flow-card {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid;
  cursor: pointer;
  transition: transform .2s, opacity .2s;
}
.flow-card:hover { transform: translateY(-2px); opacity: .85; }

.flow-card-num {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .15em;
  opacity: .5;
  margin-bottom: 6px;
}

.flow-card-ico { font-size: 20px; margin-bottom: 6px; display: block; }

.flow-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

/* Hero scroll hint */
.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: fadeIn .6s ease 1.2s forwards;
}

.scroll-text {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--dim);
}

.scroll-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, var(--dim), transparent);
  animation: scrollBob 2s ease-in-out infinite;
}

/* ── STICKY BAR SEARCH (light mode) ─────────────────────── */
.search-box { background: var(--surface); }
#searchInput { color: var(--text); }

/* ── STICKY BAR ───────────────────────────────────────────── */
.sticky-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248,249,252,.88);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  transition: transform .3s ease, opacity .3s ease;
}
.sticky-bar.sticky-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}
[data-theme="dark"] .sticky-bar { background: rgba(11,13,16,.88); }

/* Progress bar */
.progress-bar-wrap {
  height: 3px;
  background: var(--border);
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--s1), var(--s5), var(--s6));
  width: 0%;
  transition: width .4s ease;
}

.sticky-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 10px 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Search */
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .2s;
  margin-bottom: 8px;
}
.search-box:focus-within { border-color: var(--border2); }
.search-box svg { color: var(--muted); flex-shrink: 0; }

#searchInput {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
}
#searchInput::placeholder { color: var(--muted); }

.search-count {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  flex-shrink: 0;
  min-width: 28px;
  text-align: right;
}

/* Stage nav pills */
.stage-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.stage-nav::-webkit-scrollbar { display: none; }

.nav-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: 100px;
  background: none;
  cursor: pointer;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .04em;
  white-space: nowrap;
  transition: all .15s;
}
.nav-btn:hover { color: var(--text); background: var(--surface); border-color: var(--border); }
.nav-btn.active { color: var(--text); background: var(--surface); border-color: var(--border2); }

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

/* ── MAIN ─────────────────────────────────────────────────── */
.main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 32px 160px;
}

/* ── STAGE ────────────────────────────────────────────────── */
.stage {
  padding-top: 80px;
  scroll-margin-top: 120px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .55s ease, transform .55s ease;
}
.stage.visible { opacity: 1; transform: translateY(0); }

/* Stage header */
.stage-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
  padding: 36px 44px;
  border-radius: var(--radius-xl);
  border: 1px solid;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.stage-header::after {
  content: attr(data-n);
  position: absolute;
  right: -16px;
  bottom: -52px;
  font-family: 'Fraunces', serif;
  font-size: 200px;
  font-weight: 700;
  line-height: 1;
  opacity: .04;
  pointer-events: none;
  user-select: none;
}

.stage-tag {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-bottom: 10px;
  opacity: .75;
}

.stage-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(28px, 3.5vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
}

/* Problem / Solve boxes */
.stage-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 260px;
  max-width: 300px;
}

.meta-box {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.meta-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .65;
  margin-bottom: 5px;
}

/* ── STAGE LINK ──────────────────────────────────────────── */
.stage-link {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 100px;
  background: var(--text);
  color: var(--bg);
  transition: opacity .15s;
}
.stage-link:hover { opacity: .85; }

/* ── GROWTH SECTION ──────────────────────────────────────── */
.growth-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

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

.growth-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  margin-bottom: 8px;
}

.growth-text {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: #4a5568;
}
[data-theme="dark"] .growth-text { color: #8b95a8; }

.status-card { border-left: 3px solid var(--s1); }
.status-card .growth-label { color: var(--s1); }

.gap-card { border-left: 3px solid var(--s2); }
.gap-card .growth-label { color: var(--s2); }

.next-card { border-left: 3px solid var(--s5); }
.next-card .growth-label { color: var(--s5); }

/* ── STAGE PROGRESS INDICATOR ──────────────────────────────── */
.stage-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  border-radius: 6px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  opacity: .35;
  transition: all .2s;
  flex: 1;
  min-width: 0;
}

.progress-step.done {
  opacity: 1;
  background: var(--s1bg);
  border-color: var(--s1bd);
}

.progress-step.current {
  opacity: 1;
  border-color: var(--text);
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--text);
}

.progress-ico {
  font-size: 14px;
  line-height: 1;
}

.progress-n {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .05em;
}

.progress-step.done .progress-n { color: var(--s1); }
.progress-step.current .progress-n { color: var(--text); font-weight: 700; }

/* ── STAGE QUIZ SECTION ─────────────────────────────────────── */
.stage-quiz-section {
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

.stage-quiz-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.stage-quiz-ico {
  font-size: 24px;
  flex-shrink: 0;
}

.stage-quiz-title {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .05em;
}

.stage-quiz-desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.stage-quiz-item {
  padding: 24px;
  border-bottom: 1px solid var(--border);
}
.stage-quiz-item:last-child { border-bottom: none; }

.quiz-chapter-ref {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 12px;
  padding: 4px 10px;
  background: var(--surface2);
  border-radius: 100px;
  display: inline-block;
}

.quiz-chapter-link {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #ef4444;
  background: rgba(239, 68, 68, .08);
  border: 1px solid rgba(239, 68, 68, .2);
  border-radius: 100px;
  transition: all .15s;
}
.quiz-chapter-link:hover {
  background: rgba(239, 68, 68, .15);
  border-color: rgba(239, 68, 68, .35);
}
[data-theme="dark"] .quiz-chapter-link {
  color: #f87171;
  background: rgba(239, 68, 68, .12);
  border-color: rgba(239, 68, 68, .25);
}

/* ── STAGE BOTTOM LINK ─────────────────────────────────────── */
.stage-bottom-link {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  padding: 24px 0;
}

.stage-bottom-link .stage-link {
  font-size: 15px;
  padding: 12px 28px;
}

/* ── CHAPTERS ─────────────────────────────────────────────── */
.chapters { display: flex; flex-direction: column; gap: 8px; }

.chapter {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color .18s;
}
.chapter:hover { border-color: var(--border2); }

/* Chapter header */
.chapter-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  cursor: pointer;
  background: var(--surface);
  user-select: none;
  transition: background .15s;
}
.chapter-header:hover { background: var(--surface2); }

.ch-id {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  width: 30px;
  flex-shrink: 0;
}

.ch-ico { font-size: 18px; line-height: 1; flex-shrink: 0; }

.ch-info { flex: 1; min-width: 0; }

.ch-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-trigger {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-chevron {
  flex-shrink: 0;
  width: 18px; height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: transform .22s ease;
}
.chapter.open .ch-chevron { transform: rotate(180deg); }

/* Chapter body accordion */
.chapter-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .32s cubic-bezier(0,1,.3,1);
}
.chapter.open .chapter-body {
  max-height: 4000px;
  transition: max-height .55s ease;
}

.chapter-inner {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* ── WHY BOX ──────────────────────────────────────────────── */
.why-box {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.015);
}
[data-theme="dark"] .why-box { background: rgba(255,255,255,.02); }

.why-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: .65;
}

.why-text {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.65;
  color: #4a5568;
}
[data-theme="dark"] .why-text { color: #8b95a8; }

.s1-theme .why-box { border-left: 2px solid var(--s1bd); }
.s2-theme .why-box { border-left: 2px solid var(--s2bd); }
.s3-theme .why-box { border-left: 2px solid var(--s3bd); }
.s4-theme .why-box { border-left: 2px solid var(--s4bd); }
.s5-theme .why-box { border-left: 2px solid var(--s5bd); }
.s6-theme .why-box { border-left: 2px solid var(--s6bd); }
.s7-theme .why-box { border-left: 2px solid var(--s7bd); }
.s8-theme .why-box { border-left: 2px solid var(--s8bd); }
.s9-theme .why-box { border-left: 2px solid var(--s9bd); }

.s1-theme .why-label { color: var(--s1); }
.s2-theme .why-label { color: var(--s2); }
.s3-theme .why-label { color: var(--s3); }
.s4-theme .why-label { color: var(--s4); }
.s5-theme .why-label { color: var(--s5); }
.s6-theme .why-label { color: var(--s6); }
.s7-theme .why-label { color: var(--s7); }
.s8-theme .why-label { color: var(--s8); }
.s9-theme .why-label { color: var(--s9); }

/* ── TOPICS TABLE ─────────────────────────────────────────── */
.topics { display: flex; flex-direction: column; }

.topic {
  display: grid;
  grid-template-columns: 196px 1fr;
  border-bottom: 1px solid var(--border);
}
.topic:last-child { border-bottom: none; }
.topic.hidden { display: none; }

.topic-left {
  padding: 16px 16px 16px 22px;
  border-right: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* Topic completion checkbox */
.topic-check {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border2);
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.topic-check:checked {
  background: var(--s5);
  border-color: var(--s5);
}
.topic-check:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.topic.completed .topic-name,
.topic.completed .topic-sub {
  opacity: .5;
  text-decoration: line-through;
}
.topic-left-text { flex: 1; min-width: 0; }

.topic-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.topic-sub {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.45;
}

.topic-right { padding: 16px 20px 16px 18px; }

.detail-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.detail-list li {
  font-size: 14px;
  font-weight: 400;
  color: #4a5568;
  display: flex;
  gap: 8px;
  line-height: 1.55;
}
[data-theme="dark"] .detail-list li { color: #8b95a8; }

.detail-list li::before {
  content: '·';
  color: var(--dim);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── STAGE COLOR CLASSES ──────────────────────────────────── */
.s1-theme .stage-header { background: var(--s1bg); border-color: var(--s1bd); }
.s1-theme .stage-tag, .s1-theme .stage-title { color: var(--s1); }

.s2-theme .stage-header { background: var(--s2bg); border-color: var(--s2bd); }
.s2-theme .stage-tag, .s2-theme .stage-title { color: var(--s2); }

.s3-theme .stage-header { background: var(--s3bg); border-color: var(--s3bd); }
.s3-theme .stage-tag, .s3-theme .stage-title { color: var(--s3); }

.s4-theme .stage-header { background: var(--s4bg); border-color: var(--s4bd); }
.s4-theme .stage-tag, .s4-theme .stage-title { color: var(--s4); }

.s5-theme .stage-header { background: var(--s5bg); border-color: var(--s5bd); }
.s5-theme .stage-tag, .s5-theme .stage-title { color: var(--s5); }

.s6-theme .stage-header { background: var(--s6bg); border-color: var(--s6bd); }
.s6-theme .stage-tag, .s6-theme .stage-title { color: var(--s6); }

.s7-theme .stage-header { background: var(--s7bg); border-color: var(--s7bd); }
.s7-theme .stage-tag, .s7-theme .stage-title { color: var(--s7); }

.s8-theme .stage-header { background: var(--s8bg); border-color: var(--s8bd); }
.s8-theme .stage-tag, .s8-theme .stage-title { color: var(--s8); }

.s9-theme .stage-header { background: var(--s9bg); border-color: var(--s9bd); }
.s9-theme .stage-tag, .s9-theme .stage-title { color: var(--s9); }

/* Meta boxes per theme */
.s1-theme .meta-box.solve { background: var(--s1bg); border: 1px solid var(--s1bd); color: var(--s1); }
.s2-theme .meta-box.solve { background: var(--s2bg); border: 1px solid var(--s2bd); color: var(--s2); }
.s3-theme .meta-box.solve { background: var(--s3bg); border: 1px solid var(--s3bd); color: var(--s3); }
.s4-theme .meta-box.solve { background: var(--s4bg); border: 1px solid var(--s4bd); color: var(--s4); }
.s5-theme .meta-box.solve { background: var(--s5bg); border: 1px solid var(--s5bd); color: var(--s5); }
.s6-theme .meta-box.solve { background: var(--s6bg); border: 1px solid var(--s6bd); color: var(--s6); }
.s7-theme .meta-box.solve { background: var(--s7bg); border: 1px solid var(--s7bd); color: var(--s7); }
.s8-theme .meta-box.solve { background: var(--s8bg); border: 1px solid var(--s8bd); color: var(--s8); }
.s9-theme .meta-box.solve { background: var(--s9bg); border: 1px solid var(--s9bd); color: var(--s9); }

.meta-box.problem { background: rgba(0,0,0,.03); border: 1px solid var(--border2); color: #4b5563; }
[data-theme="dark"] .meta-box.problem { background: rgba(255,255,255,.04); color: #9ca3af; }

/* Nav active color per stage */
.s1-theme ~ * .nav-btn[data-id="s1"].active,
.nav-btn[data-id="s1"].active { border-color: var(--s1); color: var(--s1); }
.nav-btn[data-id="s2"].active { border-color: var(--s2); color: var(--s2); }
.nav-btn[data-id="s3"].active { border-color: var(--s3); color: var(--s3); }
.nav-btn[data-id="s4"].active { border-color: var(--s4); color: var(--s4); }
.nav-btn[data-id="s5"].active { border-color: var(--s5); color: var(--s5); }
.nav-btn[data-id="s6"].active { border-color: var(--s6); color: var(--s6); }
.nav-btn[data-id="s7"].active { border-color: var(--s7); color: var(--s7); }
.nav-btn[data-id="s8"].active { border-color: var(--s8); color: var(--s8); }

/* ── COMPARE SECTION ─────────────────────────────────────── */
.compare {
  padding: 80px 32px 100px;
  border-bottom: 1px solid var(--border);
}

.compare-inner {
  max-width: 820px;
  margin: 0 auto;
}

.compare-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.compare-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  color: var(--text);
}

.compare-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  border-radius: 100px;
  padding: 4px;
}

.compare-tab {
  padding: 8px 20px;
  border: none;
  border-radius: 100px;
  background: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: all .2s;
}
.compare-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
[data-theme="dark"] .compare-tab.active {
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

/* Graph panels */
.graph-panel {
  display: none;
  animation: fadeIn .35s ease;
}
.graph-panel.active { display: block; }

.graph-desc {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 28px;
  line-height: 1.6;
}

/* Graph container */
.graph-container {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.graph-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 0;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  min-width: 32px;
  text-align: right;
}

.graph-area {
  flex: 1;
  min-width: 0;
}

.graph-wrap {
  position: relative;
}

.graph-svg {
  width: 100%;
  height: auto;
  aspect-ratio: 500 / 250;
  border-left: 1.5px solid var(--border2);
  border-bottom: 1.5px solid var(--border2);
  border-radius: 0 0 0 4px;
  display: block;
}

.graph-line {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.deadline-label {
  position: absolute;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: #ef4444;
  white-space: nowrap;
  pointer-events: none;
  background: var(--bg);
  padding: 0 4px;
}

.deadline-h {
  transform: translateY(-100%);
}

.deadline-v {
  transform: translateX(-50%);
}

.graph-x-axis {
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
}

/* Legend */
.graph-legend {
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
}

.legend-line {
  width: 24px;
  height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}
.legend-line.dashed {
  background: none !important;
  border-top: 2.5px dashed var(--dim);
  height: 0;
}

/* Insight cards */
.graph-insights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.insight-card {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color .15s;
}
.insight-card:hover { border-color: var(--border2); }

.insight-ico {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1.2;
}

.insight-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.insight-body {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  color: #4a5568;
}
[data-theme="dark"] .insight-body { color: #8b95a8; }

/* ── GRAPH Y-AXIS LABEL ──────────────────────────────────── */
.graph-y-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .05em;
}

/* ── GRAPH SOURCES (details/summary) ─────────────────────── */
.graph-sources {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.sources-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  background: var(--surface);
  transition: background .15s, color .15s;
  list-style: none;
}
.sources-toggle::-webkit-details-marker { display: none; }
.sources-toggle::after {
  content: '▸';
  margin-left: auto;
  font-size: 11px;
  transition: transform .2s;
}
.graph-sources[open] .sources-toggle::after { transform: rotate(90deg); }
.sources-toggle:hover { background: var(--surface2); color: var(--text); }

.sources-body {
  padding: 14px 20px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}

.sources-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sources-body li {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  padding-left: 14px;
  position: relative;
}
.sources-body li::before {
  content: '·';
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--dim);
}
.sources-body li strong {
  color: var(--text);
  font-weight: 600;
}
.sources-body li em {
  font-style: normal;
  opacity: .7;
  font-size: 12px;
}

/* ── CS COURSE MAPPING ──────────────────────────────────── */
.cs-map {
  padding: 80px 32px 100px;
  border-bottom: 1px solid var(--border);
}

.cs-map-inner {
  max-width: 820px;
  margin: 0 auto;
}

.cs-map-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.cs-map-desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 32px;
}

.cs-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.cs-map-card {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color .15s;
  cursor: default;
}
.cs-map-card:hover { border-color: var(--border2); }

.cs-map-stage {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.cs-map-courses {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cs-course {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface2);
  border-radius: 100px;
  border: 1px solid var(--border);
}

/* ── DATA STRUCTURE QUIZ ─────────────────────────────────── */
.quiz {
  padding: 80px 32px 100px;
  border-bottom: 1px solid var(--border);
}

.quiz-inner {
  max-width: 820px;
  margin: 0 auto;
}

.quiz-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.quiz-desc {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 40px;
}
.quiz-desc strong { color: var(--text); font-weight: 600; }

/* Scenario */
.quiz-scenario {
  margin-bottom: 48px;
}

.scenario-header { margin-bottom: 16px; }

.scenario-num {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .15em;
  color: var(--s5);
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}

.scenario-q {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}

/* Option buttons */
.scenario-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 0;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all .18s;
  font-family: inherit;
}
.option-btn:hover { border-color: var(--border2); background: var(--surface2); }
.option-btn.selected { border-color: var(--s5); background: var(--s5bg); }

.option-label {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
  transition: all .18s;
}
.option-btn.selected .option-label {
  background: var(--s5);
  color: #fff;
}

.option-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.option-desc {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

/* Result panel */
.scenario-result {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  animation: fadeUp .4s ease;
}
.scenario-result.visible {
  display: flex;
}

.result-card {
  padding: 20px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}
.result-card.wrong { border-left: 3px solid var(--s4); }
.result-card.right { border-left: 3px solid var(--s1); }

.result-tag {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.result-card.wrong .result-tag { color: var(--s4); }
.result-card.right .result-tag { color: var(--s1); }

.result-code {
  padding: 14px 16px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  overflow-x: auto;
}
.result-code code {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
}

.result-effect { margin-top: 4px; }

.effect-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.effect-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  min-width: 72px;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 8px;
  background: var(--surface2);
  border-radius: 100px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 100px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.bar-fill.slow { background: var(--s4); }
.bar-fill.fast { background: var(--s1); }

.effect-value {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  min-width: 120px;
  flex-shrink: 0;
  text-align: right;
}

.result-body {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: #4a5568;
}
.result-body strong { font-weight: 600; color: var(--text); }
[data-theme="dark"] .result-body { color: #8b95a8; }

/* Conclusion */
.quiz-conclusion {
  padding: 24px 28px;
  background: var(--s5bg);
  border: 1px solid var(--s5bd);
  border-radius: var(--radius-md);
  text-align: center;
}

.quiz-conclusion p {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
}
.quiz-conclusion strong { font-weight: 600; color: var(--s5); }

/* ── SEARCH HIGHLIGHT ─────────────────────────────────────── */
mark {
  background: rgba(245,158,11,.15);
  color: #92400e;
  border-radius: 2px;
  padding: 0 2px;
}
[data-theme="dark"] mark { background: rgba(245,158,11,.22); color: #fbbf24; }

/* ── MID-CONTENT COMMUNITY BANNER ────────────────────────── */
.mid-banner {
  margin: 32px 0;
  padding: 0;
}

.mid-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 28px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--s5);
}

.mid-banner-text {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mid-banner-emoji { font-size: 22px; flex-shrink: 0; }

.mid-banner-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.mid-banner-sub {
  font-size: 13px;
  color: var(--muted);
}

.mid-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.mid-banner-btn {
  padding: 8px 18px;
  background: var(--text);
  color: var(--bg);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .15s;
}
.mid-banner-btn:hover { opacity: .85; }

.mid-banner-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s;
}
.mid-banner-link:hover { color: var(--text); }

/* ── COMMUNITY SECTION ────────────────────────────────────── */
.community-section {
  padding: 80px 32px 100px;
  border-top: 1px solid var(--border);
}

.community-inner {
  max-width: 820px;
  margin: 0 auto;
}

.community-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.community-heading {
  font-family: 'Fraunces', serif;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: 40px;
}

.community-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.comm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color .18s;
}
.comm-card:hover { border-color: var(--border2); }

.comm-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.comm-ico { font-size: 26px; line-height: 1; flex-shrink: 0; }

.comm-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.comm-card-sub {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--muted);
}

.comm-card-desc {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.65;
}

.kakao-qr-wrap {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}

.kakao-qr-img {
  width: 112px;
  height: 112px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.comm-subscribe {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: auto;
}
.comm-subscribe iframe {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  display: block;
}
[data-theme="dark"] .comm-subscribe iframe {
  filter: invert(1) hue-rotate(180deg);
}

.comm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
  margin-top: auto;
}

.comm-btn-primary { background: var(--text); color: var(--bg); }
.comm-btn-primary:hover { opacity: .88; }

.comm-btn-ghost { border: 1px solid var(--border2); color: var(--muted); }
.comm-btn-ghost:hover { color: var(--text); border-color: var(--dim); }

/* ── FOOTER ───────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 32px;
}

.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.footer-logo {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 18px;
}

.footer-dot { color: var(--dim); }

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.footer-links a:hover { color: var(--text); }

.footer-copy {
  font-size: 13px;
  font-weight: 400;
  color: var(--dim);
}

/* ── THEME TOGGLE ────────────────────────────────────────── */
.theme-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,.1);
  transition: background .2s, border-color .2s, transform .15s;
}
.theme-toggle:hover { transform: scale(1.08); }
[data-theme="dark"] .theme-toggle { box-shadow: 0 2px 12px rgba(0,0,0,.4); }

.theme-toggle .icon-sun,
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: block; }

/* ── LANGUAGE TOGGLE ──────────────────────────────────────── */
.lang-toggle {
  position: fixed;
  bottom: 76px;
  right: 24px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  transition: transform .2s;
}
.lang-toggle:hover { transform: scale(1.08); }
.lang-label { font-size: 13px; font-weight: 600; letter-spacing: -.02em; }
[data-theme="dark"] .lang-toggle { box-shadow: 0 2px 12px rgba(0,0,0,.4); }

/* ── UTILITY ──────────────────────────────────────────────── */
.hidden { display: none !important; }
.chapter.hidden { display: none !important; }
.stage.hidden { display: none !important; }

/* ── ANIMATIONS ───────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scrollBob {
  0%, 100% { transform: scaleY(1); opacity: .4; }
  50%       { transform: scaleY(1.3); opacity: 1; }
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero { padding: 100px 48px 80px; }
  .flow-cards { max-width: 340px; }
}

@media (max-width: 840px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 100px 32px 80px;
    text-align: center;
  }
  .hero-sub { max-width: 100%; }
  .hero-meta { justify-content: center; }
  .hero-social-proof { margin-left: auto; margin-right: auto; text-align: center; }
  .hero-subscribe { display: none; }
  .hero-actions { justify-content: center; }
  .hero-flow { display: none; }
  .sticky-inner { padding: 10px 20px; }
  .main { padding: 0 20px 100px; }
  .stage-header { grid-template-columns: 1fr; padding: 28px 28px; }
  .stage-meta { max-width: 100%; }
  .topic { grid-template-columns: 1fr; }
  .topic-left { border-right: none; border-bottom: 1px solid var(--border); }
  .footer { padding: 40px 20px; }
  .compare { padding: 60px 20px 80px; }
  .compare-header { flex-direction: column; align-items: flex-start; }
  .graph-insights { grid-template-columns: 1fr; }
  .graph-legend { flex-direction: column; gap: 8px; }
  .quiz { padding: 60px 20px 80px; }
  .scenario-options { grid-template-columns: 1fr; }
  .effect-bar { flex-wrap: wrap; }
  .hero-req { width: auto; }
  .community-section { padding: 60px 20px 80px; }
  .community-grid { grid-template-columns: 1fr; }
  .mid-banner-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .mid-banner-actions { flex-direction: row; }
}

@media (max-width: 540px) {
  .hero-title { font-size: 36px; }
  .chapter-header { padding: 14px 16px; gap: 10px; }
  .ch-trigger { display: none; }
}
