/* ============================================================
   IA PARA PROFESIONALES — DESIGN SYSTEM
   Aesthetic: Master Tangle Lab + Seeing Theory
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;0,8..60,700;1,8..60,300;1,8..60,400&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* === TOKENS === */
:root {
  --color-bg: #FAF8F4;
  --color-bg-alt: #F0EDE6;
  --color-bg-dark: #1B2332;
  --color-bg-darker: #0f172a;
  --color-bg-card: #FFFFFF;
  --color-text: #2C2C2C;
  --color-text-light: #6B6B6B;
  --color-text-inverse: #FAF8F4;
  --color-heading: #1B2332;

  /* Bloque accent colors */
  --b1-color: #C4553A;
  --b2-color: #2A5B9F;
  --b3-color: #2A7B6F;
  --b4-color: #6B4C9A;
  --b5-color: #B8922A;
  --b6-color: #C75C2A;
  --mes1-color: #C4553A;
  --mes2-color: #2A5B9F;
  --mes3-color: #2A7B6F;

  --color-accent: #C4553A;
  --color-accent-glow: rgba(196, 85, 58, 0.4);
  --color-border: #E0DCD4;
  --color-border-strong: #C8C2B6;
  --color-success: #2D6B2D;
  --color-success-bg: #E8F4E8;
  --color-error: #B83232;
  --color-error-bg: #FAEAEA;

  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-sans: 'DM Sans', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --max-width: 820px;
  --nav-height: 64px;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-serif);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.72;
  min-height: 100vh;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--color-heading);
  line-height: 1.2;
  letter-spacing: -0.015em;
}
p { margin-bottom: var(--space-md); }
a { color: var(--color-accent); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
a:hover { border-bottom-color: var(--color-accent); }
strong { font-weight: 600; }
code { font-family: var(--font-mono); font-size: 0.88em; background: var(--color-bg-alt); padding: 0.15em 0.4em; border-radius: 3px; }

/* === DARK BODY (index.html) === */
body.home-dark {
  background: #0f172a;
  color: #fff;
}

/* ============================================================
   HOMEPAGE — DARK SCROLLYTELLING
   ============================================================ */

/* Canvas + glow */
#bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100vh;
  z-index: 0;
  pointer-events: auto;
}
.ambient-glow {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100vh;
  background: radial-gradient(circle at center, transparent 0%, rgba(15, 23, 42, 0.85) 100%);
  z-index: 1;
  pointer-events: none;
}

/* --- Nav --- */
.nav {
  position: sticky;
  top: 0; z-index: 100;
  background: rgba(27, 35, 50, 0.95);
  backdrop-filter: blur(12px);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-xl);
  box-shadow: 0 1px 8px rgba(0,0,0,0.15);
}
body.home-dark .nav {
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  position: fixed;
  width: 100%;
  transition: background 0.4s, box-shadow 0.4s;
}
body.home-dark .nav.scrolled {
  background: rgba(27, 35, 50, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 8px rgba(0,0,0,0.15);
}
.nav__logo {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text-inverse);
  text-decoration: none;
  border: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.nav__logo:hover { border: none; opacity: 0.85; }
.nav__links {
  display: flex;
  gap: var(--space-lg);
  margin-left: auto;
  list-style: none;
  align-items: center;
}
.nav__links a, .nav__links button {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(250,248,244,0.55);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: color 0.3s;
}
.nav__links a:hover, .nav__links button:hover { color: var(--color-text-inverse); }
.nav__radar {
  color: #C49A2A !important;
  border: 1px solid rgba(196,154,42,0.3) !important;
  border-radius: 20px;
  padding: 4px 14px;
  transition: all 0.3s;
}
.nav__radar:hover { background: rgba(196,154,42,0.15); border-color: rgba(196,154,42,0.6) !important; }
.nav__toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text-inverse);
  font-size: 1.5rem;
  cursor: pointer;
  margin-left: auto;
}

/* --- Hero (fullscreen) --- */
.home-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 10;
}
.home-hero .hero-title {
  font-family: var(--font-sans);
  font-size: clamp(3rem, 7vw, 5rem);
  color: #ffffff;
  margin: 0 0 10px 0;
  line-height: 1.1;
  letter-spacing: -1px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.5);
  font-weight: 700;
}
.home-hero .hero-subtitle {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: rgba(255,255,255,0.7);
  font-weight: 300;
  margin: 0 0 15px 0;
  letter-spacing: 0.5px;
  max-width: 620px;
  padding: 0 1rem;
  line-height: 1.65;
}
.home-hero .hero-meta {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 40px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
  flex-wrap: wrap;
}
.home-hero .hero-meta strong { color: #fff; }

.hero-cta {
  background: #ffffff;
  color: #0f172a;
  border: none;
  padding: 16px 40px;
  border-radius: 30px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  display: inline-flex;
  align-items: center;
}
.hero-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(255,255,255,0.2);
  color: #0f172a;
  border-bottom-color: transparent;
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  animation: bounce-hint 2s ease infinite;
}
@keyframes bounce-hint {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.3; }
  50% { transform: translateX(-50%) translateY(8px); opacity: 0.6; }
}

/* --- Content container (over canvas) --- */
.content-container {
  position: relative;
  z-index: 10;
  padding-bottom: 0;
  background: var(--color-bg-darker);
}

/* --- Rhythm legend --- */
.rhythm-legend {
  position: relative;
  z-index: 10;
  max-width: 700px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-xl) 0;
}
.rhythm-legend__inner {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  flex-wrap: wrap;
}
.rhythm-tag {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
}
.rhythm-tag span { opacity: 0.5; margin-left: 6px; }
.concept-tag { border-color: rgba(196,85,58,0.3); }
.lab-tag { border-color: rgba(42,91,159,0.3); }
.radar-tag { border-color: rgba(196,154,42,0.3); color: #C49A2A; }

/* --- Phase dividers --- */
.phase-divider {
  --phase-color: rgba(255,255,255,0.3);
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px 5%;
  text-align: center;
}
.phase-divider__label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--phase-color);
  opacity: 0.7;
  margin-bottom: 8px;
}
.phase-divider__title {
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}
.phase-divider__line {
  width: 60px;
  height: 2px;
  background: var(--phase-color);
  opacity: 0.4;
  margin: 20px auto 0;
}

/* --- Chapter rows (scrollytelling) --- */
.chapter-row {
  display: flex;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}
.chapter-left {
  width: 45%;
  padding: 100px 5%;
}
.chapter-sticky-content {
  position: sticky;
  top: 25vh;
}
.chapter-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
  display: block;
}
.chapter-row--m1 .chapter-num { color: var(--mes1-color); }
.chapter-row--m2 .chapter-num { color: var(--mes2-color); }
.chapter-row--m3 .chapter-num { color: var(--mes3-color); }

.chapter-title {
  font-family: var(--font-sans);
  font-size: clamp(2rem, 4vw, 3.2rem);
  color: #ffffff;
  margin: 0 0 18px 0;
  line-height: 1.1;
  font-weight: 700;
}
.chapter-desc {
  font-size: 1rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.7;
  max-width: 420px;
  margin-bottom: 25px;
  font-family: var(--font-serif);
}
.chapter-right {
  width: 55%;
  padding: 100px 5%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
}

/* --- Module cards (glassmorphism) --- */
.unit-card {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: white;
  transition: all 0.4s var(--ease-out-expo);
}
.unit-card:hover {
  transform: translateX(10px);
  border-color: rgba(255,255,255,0.15);
}
/* Dynamic card colors via --card-color */
.unit-card:hover { background: rgba(255,255,255,0.06); }
.unit-card--lab { border-left: 2px solid rgba(42,91,159,0.3); }
.unit-card--radar { border-left: 2px solid rgba(196,154,42,0.4); background: rgba(196,154,42,0.03); }
.unit-card--radar:hover { background: rgba(196,154,42,0.08); }

.unit-symbol {
  --card-color: #C4553A;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.75rem;
  background: color-mix(in srgb, var(--card-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--card-color) 35%, transparent);
  color: var(--card-color);
}

.unit-symbol.completed {
  background: var(--color-success) !important;
  border-color: var(--color-success) !important;
  color: #fff !important;
}

.unit-details h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.1rem;
  color: white;
  margin: 0 0 4px 0;
}
.unit-details p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.45);
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
}
.unit-details .status {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  margin-top: 4px;
  color: rgba(255,255,255,0.25);
}
.unit-details .status.done { color: var(--color-success); }

/* --- Radar IA banner (landing) --- */
.radar-banner {
  position: relative;
  z-index: 10;
  padding: var(--space-3xl) var(--space-xl);
}
.radar-banner__inner {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  background: rgba(196,154,42,0.06);
  border: 1px solid rgba(196,154,42,0.2);
  border-radius: 20px;
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  overflow: hidden;
}
.radar-banner__pulse {
  position: absolute;
  top: 50%; left: 50%;
  width: 200px; height: 200px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196,154,42,0.15) 0%, transparent 70%);
  animation: radarPulse 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes radarPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
  50% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
}
.radar-banner__content { position: relative; z-index: 1; }
.radar-banner__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #C49A2A;
  margin-bottom: var(--space-sm);
  display: block;
}
.radar-banner__title {
  font-family: var(--font-sans);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: #fff;
  margin-bottom: var(--space-md);
}
.radar-banner__desc {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: rgba(255,255,255,0.6);
  max-width: 520px;
  margin: 0 auto var(--space-lg);
  line-height: 1.7;
}
.radar-banner__cta {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  color: #1B2332;
  background: #C49A2A;
  padding: 10px 28px;
  border-radius: 8px;
  border: none;
  transition: all 0.3s;
}
.radar-banner__cta:hover { background: #d4aa3a; border: none; transform: translateY(-1px); }

/* --- Sidebar radar link --- */
.nav-link--radar {
  color: #C49A2A !important;
  border-left: 2px solid rgba(196,154,42,0.4) !important;
}
.nav-link--radar:hover { background: rgba(196,154,42,0.08); }

/* --- Landing footer (dark) --- */
.landing-footer {
  position: relative;
  z-index: 10;
  background: var(--color-bg-darker);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  font-size: 0.78rem;
  font-family: var(--font-sans);
  color: rgba(255,255,255,0.25);
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* --- About section (dark) --- */
.about-section {
  position: relative;
  z-index: 10;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  padding: var(--space-3xl) 5%;
}
.about-inner {
  max-width: 1000px;
  margin: 0 auto;
}
.about-heading {
  text-align: center;
  margin-bottom: var(--space-2xl);
}
.about-heading h2 {
  font-family: var(--font-sans);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: var(--space-sm);
  border: none;
  padding: 0;
}
.about-heading p {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: rgba(255,255,255,0.5);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-lg);
}
.about-item {
  text-align: center;
  padding: var(--space-lg);
}
.about-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto var(--space-md);
}
.about-item h3 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: var(--space-sm);
}
.about-item p {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.6;
}

/* ============================================================
   MODULE PAGES — LIGHT READING LAYOUT
   ============================================================ */

/* --- Topbar --- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(27, 35, 50, 0.95);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  z-index: 200;
  box-shadow: 0 1px 8px rgba(0,0,0,0.15);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.topbar-brand {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9rem;
}
.topbar-brand a { color: var(--color-text-inverse); text-decoration: none; border: none; }
.topbar-brand a:hover { opacity: 0.85; border: none; }
.topbar-right { display: flex; align-items: center; gap: var(--space-sm); }

.btn-topbar {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--color-text-inverse);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-topbar:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.25); }

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text-inverse);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  width: 280px;
  height: calc(100vh - var(--nav-height));
  background: var(--color-bg-card);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s var(--ease-out-expo);
}
.sidebar-progress {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}
.sidebar-progress-label {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-light);
  margin-bottom: var(--space-sm);
  font-weight: 600;
}
.progress-track {
  height: 4px;
  background: var(--color-bg-alt);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.progress-text {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--color-text-light);
  margin-top: var(--space-xs);
}

/* Nav groups */
.nav-group { padding: var(--space-sm) 0; }
.nav-group-label {
  padding: var(--space-sm) var(--space-lg) var(--space-xs);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-light);
  font-weight: 500;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 9px var(--space-lg);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--color-text-light);
  text-decoration: none;
  border: none;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  line-height: 1.35;
}
.nav-link:hover {
  background: var(--color-bg-alt);
  color: var(--color-heading);
  border-bottom: none;
}
.nav-link.active {
  background: var(--mes1-bg);
  color: var(--mes1-color);
  border-left-color: var(--mes1-color);
  font-weight: 600;
}
.nav-link.completed .nav-num {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
}
.nav-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--color-text-light);
  transition: all 0.15s;
}
.nav-link.active .nav-num {
  background: var(--mes1-color);
  color: #fff;
}

/* --- Main content (module pages) --- */
.main-content {
  margin-left: 280px;
  padding-top: var(--nav-height);
  min-height: 100vh;
}

/* Module hero */
.module-hero {
  background: linear-gradient(135deg, #1B2332 0%, #16213E 50%, #0F3460 100%);
  padding: var(--space-3xl) var(--space-xl) var(--space-2xl);
  color: var(--color-text-inverse);
}
.module-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.module-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  margin-bottom: var(--space-md);
}
.module-hero h1 {
  font-family: var(--font-sans);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
  color: #fff;
}
.module-hero .subtitle {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
  max-width: 600px;
}
.module-meta {
  display: flex;
  gap: var(--space-xl);
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255,255,255,0.1);
  flex-wrap: wrap;
}
.module-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
}

/* Module body */
.module-body {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl) var(--space-3xl);
}

/* Section blocks */
.section-block { margin-bottom: var(--space-2xl); }
.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.section-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.section-icon.concept { background: var(--mes1-bg); color: var(--mes1-color); }
.section-icon.analogy { background: #FDF6E3; color: #B8922A; }
.section-icon.case { background: var(--color-bg-alt); color: var(--color-text-light); }
.section-icon.exercise { background: var(--mes2-bg); color: var(--mes2-color); }
.section-icon.quiz { background: var(--color-success-bg); color: var(--color-success); }

.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  color: var(--color-text-light);
}

/* Concept text */
.concept-text p {
  margin-bottom: var(--space-md);
  font-size: 1.02rem;
  line-height: 1.85;
}
.concept-text strong { color: var(--color-heading); }

/* Analogy box */
.analogy-box {
  background: #FDF6E3;
  border-left: 4px solid #C49A2A;
  border-radius: 0 8px 8px 0;
  padding: var(--space-lg);
}
.analogy-box p {
  font-size: 0.98rem;
  line-height: 1.8;
  margin: 0;
}

/* Case box */
.case-box {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: var(--space-lg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.case-box h4 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  margin-top: var(--space-md);
  color: var(--color-heading);
}
.case-box h4:first-child { margin-top: 0; }
.case-box p, .case-box li { font-size: 0.92rem; margin-bottom: var(--space-sm); line-height: 1.7; }
.case-box ol, .case-box ul { padding-left: var(--space-lg); margin-bottom: var(--space-sm); }

.prompt-example {
  background: var(--color-bg-dark);
  color: #D4D4E8;
  padding: var(--space-md) var(--space-lg);
  border-radius: 6px;
  font-size: 0.82rem;
  line-height: 1.7;
  margin: var(--space-md) 0;
  white-space: pre-wrap;
  font-family: var(--font-mono);
  overflow-x: auto;
}

/* Exercise box */
.exercise-box {
  background: var(--mes2-bg);
  border: 1px solid rgba(42, 91, 159, 0.25);
  border-radius: 8px;
  padding: var(--space-lg);
}
.exercise-box h4 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}
.exercise-objective {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-bottom: var(--space-md);
  font-style: italic;
  padding-bottom: var(--space-md);
  border-bottom: 1px solid rgba(42, 91, 159, 0.15);
}
.exercise-box ol { padding-left: var(--space-lg); }
.exercise-box li { font-size: 0.92rem; margin-bottom: var(--space-sm); line-height: 1.65; }
.exercise-criteria {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(42, 91, 159, 0.15);
  font-size: 0.85rem;
  color: var(--color-text-light);
}
.exercise-criteria strong { color: var(--color-heading); }

/* ============================================================
   QUIZ
   ============================================================ */
.quiz-section {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 2px solid var(--color-border);
}
.quiz-intro {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--color-text-light);
  margin-bottom: var(--space-lg);
}
.quiz-question { margin-bottom: var(--space-xl); }
.quiz-question .q-text {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: var(--space-md);
  line-height: 1.5;
}
.quiz-options { display: flex; flex-direction: column; gap: var(--space-sm); }
.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: 12px var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.5;
  transition: all 0.15s;
  background: var(--color-bg-card);
  font-family: var(--font-sans);
}
.quiz-option:hover:not(.disabled) {
  border-color: var(--color-accent);
  background: var(--mes1-bg);
}
.quiz-option.disabled { cursor: default; }
.quiz-option .marker {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  transition: all 0.15s;
  margin-top: 1px;
}

.quiz-option.selected.correct { border-color: var(--color-success); background: var(--color-success-bg); }
.quiz-option.selected.correct .marker { background: var(--color-success); border-color: var(--color-success); color: #fff; }
.quiz-option.selected.incorrect { border-color: var(--color-error); background: var(--color-error-bg); }
.quiz-option.selected.incorrect .marker { background: var(--color-error); border-color: var(--color-error); color: #fff; }
.quiz-option.reveal-correct { border-color: var(--color-success); background: var(--color-success-bg); }

.quiz-feedback {
  margin-top: var(--space-sm);
  padding: var(--space-md);
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.65;
  font-family: var(--font-sans);
  display: none;
}
.quiz-feedback.show { display: block; }
.quiz-feedback.correct { background: var(--color-success-bg); border: 1px solid var(--color-success); color: #1a5c1a; }
.quiz-feedback.incorrect { background: var(--color-error-bg); border: 1px solid #FECACA; color: var(--color-error); }

.quiz-result {
  margin-top: var(--space-lg);
  padding: var(--space-lg);
  border-radius: 8px;
  text-align: center;
  display: none;
  font-family: var(--font-sans);
}
.quiz-result.show { display: block; }
.quiz-result.passed { background: var(--color-success-bg); border: 1px solid var(--color-success); }
.quiz-result.failed { background: var(--color-error-bg); border: 1px solid var(--color-error); }
.quiz-result p { font-size: 0.95rem; margin-bottom: var(--space-sm); }
.quiz-result .result-icon { font-size: 2rem; margin-bottom: var(--space-sm); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 24px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}
.btn:hover { border-bottom: none; }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: #A8432E; color: #fff; }
.btn-secondary { background: var(--color-bg-alt); color: var(--color-heading); border: 1px solid var(--color-border); }
.btn-secondary:hover { background: var(--color-border); }

/* Module navigation */
.module-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
  gap: var(--space-md);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 30px rgba(0,0,0,0.2); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: block; }
  .main-content { margin-left: 0; }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--nav-height);
    background: rgba(0,0,0,0.4);
    z-index: 99;
  }
  .sidebar-overlay.open { display: block; }

  /* Homepage */
  .chapter-row { flex-direction: column; }
  .chapter-left, .chapter-right { width: 100%; padding: 40px 5%; }
  .chapter-left { padding-top: 80px; }
  .chapter-sticky-content { position: relative; top: 0; }
  .nav__toggle { display: block; }
  .nav__links { display: none; }
  .nav__links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: rgba(27, 35, 50, 0.98);
    padding: var(--space-lg);
    gap: var(--space-md);
  }
}

@media (max-width: 768px) {
  .module-hero { padding: var(--space-2xl) var(--space-md) var(--space-xl); }
  .module-hero h1 { font-size: 1.5rem; }
  .module-body { padding: var(--space-xl) var(--space-md) var(--space-2xl); }
  .module-nav { flex-direction: column; }
  .module-meta { flex-direction: column; gap: var(--space-sm); }
}

/* Scrollbar */
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }

/* Print */
@media print {
  .sidebar, .topbar, .sidebar-toggle, .sidebar-overlay, .module-nav, .nav { display: none !important; }
  .main-content { margin-left: 0 !important; padding-top: 0 !important; }
}
