/* ============================================
   Mandarine × IA — Design tokens
   Brand: orange #FC7F3C, dark #030712
   Fonts: Space Grotesk / Inter / Instrument Serif / JetBrains Mono
   ============================================ */

:root {
  --orange: #FC7F3C;
  --orange-light: #ff9d4e;
  --orange-soft: #fff7ed;
  --orange-tint: #ffedd5;

  --dark: #030712;
  --dark-2: #111827;
  --dark-3: #1f2937;
  --gray: #6b7280;
  --gray-light: #e5e7eb;
  --gray-lighter: #f3f4f6;

  --bg: #ffffff;
  --bg-alt: #faf7f3;

  --green: #1eb958;
  --green-soft: #dcfce7;
  --red: #dc2626;
  --red-soft: #fee2e2;

  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;

  --space-xs: clamp(.5rem, .45rem + .25vw, .75rem);
  --space-sm: clamp(1rem, .9rem + .5vw, 1.5rem);
  --space-md: clamp(1.5rem, 1.3rem + 1vw, 2.5rem);
  --space-lg: clamp(2rem, 1.6rem + 2vw, 4rem);
  --space-xl: clamp(3rem, 2.3rem + 3.5vw, 6rem);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-sm: 0 1px 2px rgba(3, 7, 18, .06), 0 1px 3px rgba(3, 7, 18, .04);
  --shadow-md: 0 4px 12px rgba(3, 7, 18, .08), 0 2px 6px rgba(3, 7, 18, .04);
  --shadow-lg: 0 24px 48px -12px rgba(3, 7, 18, .12);
  --shadow-orange: 0 20px 40px -12px rgba(252, 127, 60, .35);

  --transition: 220ms cubic-bezier(.4, 0, .2, 1);
}

/* ============================================
   Base
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, .95rem + .25vw, 1.125rem);
  line-height: 1.6;
  color: var(--dark);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-left: 300px; /* sidebar width on desktop */
}
@media (max-width: 1024px) {
  body { padding-left: 0; padding-top: 60px; }
  html { scroll-padding-top: 80px; }
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 var(--space-sm); }
h1 { font-size: clamp(2.5rem, 1.5rem + 5vw, 5.5rem); }
h2 { font-size: clamp(1.75rem, 1.2rem + 2.5vw, 3rem); }
h3 { font-size: clamp(1.125rem, 1rem + .5vw, 1.375rem); }
p { margin: 0 0 var(--space-sm); }
a { color: inherit; text-decoration: none; transition: color var(--transition); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
em { font-style: italic; }
.serif { font-family: var(--font-serif); font-weight: 400; }
.italic { font-style: italic; }
.orange { color: var(--orange); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-md); }

/* ============================================
   Progress bar (fixed top)
   ============================================ */
.progress-bar {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--orange), var(--orange-light));
  z-index: 100;
  transition: width 120ms linear;
}

/* ============================================
   Top bar (mobile)
   ============================================ */
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--orange); display: inline-block; }
.brand-logo {
  height: 22px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.brand-logo--lg { height: 40px; }
.brand-logo--footer { height: 32px; filter: brightness(0) invert(1); opacity: .92; }
.auth-logo { align-items: center; gap: .625rem; }
.topbar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  height: 60px;
  padding: 0 var(--space-md);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gray-light);
  z-index: 40;
  align-items: center;
  gap: var(--space-sm);
}
@media (max-width: 1024px) { .topbar { display: flex; } }
.topbar-logo {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: .95rem;
}
.topbar-logo em { color: var(--orange); font-style: normal; margin: 0 .2rem; }
.topbar-progress {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--gray);
  padding: .25rem .625rem;
  background: var(--orange-soft);
  border-radius: 999px;
}
.cs-toggle {
  display: none;
  width: 36px; height: 36px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 0;
}
.cs-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.cs-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cs-toggle.open span:nth-child(2) { opacity: 0; }
.cs-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 1024px) { .cs-toggle { display: flex; } }

/* ============================================
   E-learning sidebar
   ============================================ */
.course-sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 300px;
  background: white;
  border-right: 1px solid var(--gray-light);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform var(--transition);
}
@media (max-width: 1024px) {
  .course-sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    width: min(320px, 88vw);
  }
  .course-sidebar.open { transform: translateX(0); }
}
.cs-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(3, 7, 18, .5);
  z-index: 45;
  opacity: 0;
  transition: opacity var(--transition);
}
.cs-overlay.open { display: block; opacity: 1; }
@media (min-width: 1025px) { .cs-overlay { display: none !important; } }

.cs-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--gray-light);
}
.cs-logo {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}
.cs-logo em { color: var(--orange); font-style: normal; margin: 0 .2rem; }
.cs-progress-text {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--gray);
  margin-bottom: .375rem;
}
.cs-progress-text strong { color: var(--orange); font-weight: 600; }
.cs-progress-bar {
  height: 6px;
  background: var(--gray-light);
  border-radius: 999px;
  overflow: hidden;
}
.cs-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--orange), var(--orange-light));
  border-radius: 999px;
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}

.cs-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm) 0;
}
.cs-section-label {
  padding: .875rem var(--space-md) .375rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.cs-item {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .625rem var(--space-md);
  color: var(--dark);
  font-size: .9rem;
  transition: background var(--transition), color var(--transition);
  border-left: 3px solid transparent;
}
.cs-item:hover { background: var(--orange-soft); }
.cs-item-status {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--gray-light);
  flex-shrink: 0;
  position: relative;
  transition: all var(--transition);
}
.cs-item-num {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--gray);
  min-width: 20px;
}
.cs-item-title { line-height: 1.3; }
.cs-item-icon {
  color: var(--orange);
  font-size: 1rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* States */
.cs-item--current {
  background: var(--orange-soft);
  border-left-color: var(--orange);
}
.cs-item--current .cs-item-status {
  border-color: var(--orange);
  background: white;
  box-shadow: 0 0 0 3px rgba(252, 127, 60, .2);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(252, 127, 60, .2); }
  50% { box-shadow: 0 0 0 6px rgba(252, 127, 60, .1); }
}
.cs-item--current .cs-item-num { color: var(--orange); font-weight: 600; }

.cs-item--done .cs-item-status {
  border-color: var(--orange);
  background: var(--orange);
}
.cs-item--done .cs-item-status::after {
  content: '';
  position: absolute;
  left: 3px; top: 5px;
  width: 8px; height: 4px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg);
}
.cs-item--done { color: var(--gray); }
.cs-item--done .cs-item-title { text-decoration: line-through; opacity: .7; }

.cs-item--locked {
  color: #cbd0d7;
  cursor: not-allowed;
}
.cs-item--locked:hover { background: transparent; }
.cs-item--locked .cs-item-num { color: #cbd0d7; }
.cs-item--locked .cs-item-status {
  border-color: #d1d5db;
  background: #f3f4f6;
}
.cs-item--locked .cs-item-status::before {
  content: '';
  position: absolute;
  left: 4px; top: 5px;
  width: 6px; height: 5px;
  border: 1.5px solid #9ca3af;
  border-radius: 1px;
  border-bottom: 3px solid #9ca3af;
}
.cs-item--locked .cs-item-icon { color: #cbd0d7; }

.cs-item--bonus {
  padding-left: calc(var(--space-md) + 4px);
}

.cs-footer {
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--gray-light);
}
.cs-reset {
  width: 100%;
  padding: .5rem 1rem;
  background: transparent;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-sm);
  color: var(--gray);
  font-family: var(--font-body);
  font-size: .85rem;
  cursor: pointer;
  transition: all var(--transition);
}
.cs-reset:hover { border-color: var(--orange); color: var(--orange); background: var(--orange-soft); }

/* ============================================
   Chapter lock (hidden entirely until unlocked)
   ============================================ */
.chapter.locked { display: none; }

/* ============================================
   Continuer button (per chapter)
   ============================================ */
.chapter-continue {
  max-width: 780px;
  margin: var(--space-lg) auto 0;
  padding: var(--space-md);
  background: linear-gradient(135deg, var(--dark), var(--dark-2));
  border-radius: var(--radius-lg);
  text-align: center;
  color: white;
}
.chapter-continue-help {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: rgba(255, 255, 255, .6);
  margin-bottom: .625rem;
  min-height: 1em;
}
.chapter-continue-help:empty { display: none; }
.chapter-continue-btn {
  padding: .875rem 1.5rem;
  background: var(--orange);
  color: white;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1rem;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}
.chapter-continue-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-orange);
  background: var(--orange-light);
}
.chapter-continue-btn:disabled {
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .35);
  cursor: not-allowed;
}
.chapter-continue.done {
  background: var(--green-soft);
  color: var(--dark);
}
.chapter-continue.done .chapter-continue-help { color: var(--dark-2); }
.chapter-continue.done .chapter-continue-btn { background: white; color: var(--dark); border: 1px solid var(--green); }
.chapter-continue.done .chapter-continue-btn:hover { background: var(--green); color: white; }

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .875rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1rem;
  transition: all var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: var(--dark); color: white; }
.btn-primary:hover { background: var(--orange); transform: translateY(-2px); box-shadow: var(--shadow-orange); }
.btn-ghost { background: transparent; color: var(--dark); border-color: var(--gray-light); }
.btn-ghost:hover { border-color: var(--dark); background: var(--dark); color: white; }
.btn-sm { padding: .5rem 1rem; font-size: .875rem; }

/* ============================================
   Hero
   ============================================ */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex; align-items: center;
  padding: var(--space-xl) 0 var(--space-lg);
  overflow: hidden;
  background: radial-gradient(ellipse at top right, var(--orange-soft) 0%, transparent 60%),
              radial-gradient(ellipse at bottom left, #fef3ec 0%, transparent 50%),
              white;
}
.hero-glow {
  position: absolute;
  top: 20%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(252, 127, 60, .3), transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  animation: float 12s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 30px) scale(1.15); }
}
.hero-inner { position: relative; z-index: 2; text-align: center; }
.tag {
  display: inline-flex;
  padding: .5rem 1rem;
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .875rem;
  color: var(--gray);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
}
.hero-title { margin-bottom: var(--space-md); }
.hero-sub {
  font-size: clamp(1.125rem, 1rem + .5vw, 1.375rem);
  color: var(--gray);
  max-width: 620px; margin: 0 auto var(--space-lg);
  line-height: 1.55;
}
.hero-cta { display: flex; gap: .875rem; justify-content: center; flex-wrap: wrap; margin-bottom: var(--space-xl); }
.hero-stats { display: flex; gap: var(--space-md); justify-content: center; align-items: center; color: var(--gray); font-size: .95rem; }
.hero-stats > div:not(.sep) { display: flex; flex-direction: column; }
.hero-stats strong { font-family: var(--font-heading); font-size: 2rem; color: var(--dark); font-weight: 600; }
.hero-stats span { font-size: .875rem; }
.hero-stats .sep { color: var(--orange); font-size: 1.25rem; }
.scroll-hint {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: .75rem;
  color: var(--gray); animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(6px); } }

/* ============================================
   Chapters
   ============================================ */
.chapter {
  padding: var(--space-xl) 0;
  position: relative;
}
.chapter-alt { background: var(--bg-alt); }
.chapter-head {
  max-width: 780px;
  margin: 0 auto var(--space-lg);
  text-align: center;
}
.chapter-num {
  display: inline-block;
  font-family: var(--font-mono);
  color: var(--orange);
  font-size: .875rem;
  letter-spacing: .05em;
  margin-bottom: var(--space-sm);
}
.chapter-lead {
  font-size: clamp(1.05rem, 1rem + .35vw, 1.25rem);
  color: var(--gray);
  max-width: 640px; margin: var(--space-sm) auto 0;
  line-height: 1.55;
}

/* ============================================
   Concentric circles (chapter 1)
   ============================================ */
.concentric {
  position: relative;
  width: min(520px, 88vw);
  aspect-ratio: 1;
  margin: var(--space-lg) auto var(--space-md);
}
.ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  justify-content: center;
  padding: 0;
  border: 0;
  overflow: visible;
}
.ring-label {
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
  font-family: var(--font-heading);
  font-weight: 600;
}
/* Outer ring — IA */
.ring-1 {
  background: white;
  border: 1.5px solid var(--orange-tint);
  z-index: 1;
  align-items: flex-start;
}
.ring-1 .ring-label {
  transform: translateY(-50%);
  padding: .4rem 1rem;
  background: white;
  border: 1.5px solid var(--dark);
  border-radius: 999px;
  color: var(--dark);
  font-size: .875rem;
  letter-spacing: .04em;
  box-shadow: 0 4px 10px -2px rgba(3, 7, 18, .12);
}
/* Middle ring — Machine Learning */
.ring-2 {
  inset: 13%;
  background: var(--orange-soft);
  border: 1.5px solid var(--orange-light);
  z-index: 2;
  align-items: flex-start;
}
.ring-2 .ring-label {
  transform: translateY(-50%);
  padding: .4rem 1rem;
  background: white;
  border: 1.5px solid var(--orange);
  border-radius: 999px;
  color: var(--orange);
  font-size: .875rem;
  letter-spacing: .04em;
  box-shadow: 0 4px 10px -2px rgba(252, 127, 60, .25);
}
/* Inner disc — LLM */
.ring-3 {
  inset: 32%;
  background: radial-gradient(circle at 30% 25%, var(--orange-light), var(--orange) 65%, #e0651f 100%);
  border: 0;
  z-index: 3;
  align-items: center;
  box-shadow: 0 24px 48px -12px rgba(252, 127, 60, .5), inset 0 -8px 16px rgba(3, 7, 18, .12);
}
.ring-3 .ring-label {
  color: white;
  font-weight: 700;
  font-size: clamp(1.5rem, 1rem + 2vw, 2.25rem);
  text-shadow: 0 2px 8px rgba(3, 7, 18, .25);
  letter-spacing: .01em;
}
.ring:hover { transform: scale(1.008); }
.ring-3:hover { transform: scale(1.03); }
.ring.active {
  box-shadow: 0 0 0 4px rgba(252, 127, 60, .35), var(--shadow-orange);
}
.ring-3.active {
  box-shadow: 0 0 0 5px rgba(252, 127, 60, .35), 0 24px 48px -12px rgba(252, 127, 60, .6), inset 0 -8px 16px rgba(3, 7, 18, .12);
}
.concentric-info {
  max-width: 620px; margin: 0 auto;
  padding: var(--space-md);
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
  text-align: center;
  min-height: 100px;
  transition: all var(--transition);
}
.concentric-info strong { color: var(--orange); font-family: var(--font-heading); }

/* ============================================
   Predict demo (chapter 2)
   ============================================ */
.predict-demo {
  max-width: 780px; margin: var(--space-lg) auto;
  padding: var(--space-md);
  background: var(--dark);
  border-radius: var(--radius-lg);
  color: white;
  box-shadow: var(--shadow-lg);
}
.predict-sentence {
  font-family: var(--font-mono);
  font-size: clamp(1rem, .9rem + .5vw, 1.375rem);
  padding: var(--space-md);
  background: rgba(255, 255, 255, .05);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  min-height: 80px;
  line-height: 1.8;
}
.predict-sentence span { display: inline-block; margin-right: .5rem; }
.predict-sentence .new-word {
  color: var(--orange);
  animation: pop .4s ease-out;
}
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.predict-options { display: flex; flex-direction: column; gap: .5rem; margin-bottom: var(--space-md); }
.predict-opt {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius-sm);
  color: white;
  text-align: left;
  transition: all var(--transition);
  font-size: 1rem;
}
.predict-opt:hover:not(:disabled) {
  background: var(--orange);
  border-color: var(--orange);
  transform: translateX(4px);
}
.predict-opt:disabled { opacity: .4; cursor: default; }
.predict-opt-bar {
  flex: 1; height: 8px; background: rgba(255, 255, 255, .1); border-radius: 999px; overflow: hidden;
}
.predict-opt-bar-fill { height: 100%; background: var(--orange-light); border-radius: 999px; transition: width .6s ease; }
.predict-opt-pct { font-family: var(--font-mono); font-size: .875rem; opacity: .8; min-width: 45px; text-align: right; }
.predict-opt-word { min-width: 100px; font-weight: 500; }

/* ============================================
   Two-column
   ============================================ */
.two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md);
  max-width: 900px; margin: var(--space-lg) auto 0;
}
.two-col .col {
  padding: var(--space-md);
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
}
.two-col h3 { color: var(--orange); }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }

/* ============================================
   Tools grid (chapter 3)
   ============================================ */
.filter-bar {
  display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}
.filter {
  padding: .5rem 1rem;
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: .875rem;
  color: var(--gray);
  transition: all var(--transition);
}
.filter:hover { border-color: var(--orange); color: var(--orange); }
.filter.active { background: var(--dark); color: white; border-color: var(--dark); }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  max-width: 1080px;
  margin: 0 auto;
}
@media (max-width: 860px) { .tools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .tools-grid { grid-template-columns: 1fr; } }
.tool {
  padding: var(--space-md);
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}
.tool.dim { opacity: .3; filter: grayscale(1); }
.tool.hi { border-color: var(--orange); box-shadow: var(--shadow-orange); transform: translateY(-4px); }
.tool-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .25rem; }
.tool-head h3 { margin: 0; }
.tool-emoji { font-size: 1.75rem; }
.tool-by { font-family: var(--font-mono); font-size: .75rem; color: var(--gray); margin-bottom: var(--space-sm); }
.tool ul { padding-left: 1.125rem; margin: var(--space-sm) 0 0; color: var(--gray); font-size: .95rem; }
.tool li { margin-bottom: .375rem; }

/* ============================================
   Key takeaway box
   ============================================ */
.key-takeaway {
  max-width: 780px; margin: var(--space-lg) auto 0;
  padding: var(--space-md);
  background: linear-gradient(135deg, var(--orange-soft), white);
  border: 1px solid var(--orange-tint);
  border-radius: var(--radius-md);
  display: flex; gap: var(--space-sm); align-items: flex-start;
}
.key-takeaway p { margin: 0; }
.kt-badge {
  flex-shrink: 0;
  padding: .375rem .75rem;
  background: white;
  border: 1px solid var(--orange);
  color: var(--orange);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .75rem;
  white-space: nowrap;
}

/* ============================================
   Tabs (chapter 4)
   ============================================ */
.tabs { max-width: 820px; margin: 0 auto; }
.tab-buttons {
  display: flex; gap: .25rem;
  background: white;
  padding: .375rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-light);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}
.tab-btn {
  flex: 1; min-width: 140px;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--gray);
  font-family: var(--font-heading);
  font-size: .95rem;
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--dark); }
.tab-btn.active { background: var(--dark); color: white; }
.tab-panel {
  display: none;
  padding: var(--space-md);
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
  animation: fadeIn .3s ease-out;
}
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.fake-quote {
  padding: var(--space-md);
  background: var(--bg-alt);
  border-left: 3px solid var(--orange);
  border-radius: var(--radius-sm);
  margin: var(--space-sm) 0;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--dark-2);
}
.fake-quote p { margin: 0; }

.verif-result {
  margin-top: var(--space-sm);
  padding: var(--space-md);
  background: var(--red-soft);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  animation: fadeIn .4s ease-out;
}
.verif-item {
  position: relative;
  padding: .375rem 0 .375rem 1.5rem;
  font-size: .95rem;
}
.verif-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: .8em;
  width: 8px; height: 8px;
  border-radius: 50%;
}
.verif-no::before { background: var(--red); }
.verif-warn::before { background: #f59e0b; }
.verif-note { margin-top: var(--space-sm); font-style: italic; color: var(--dark-2); }

.feature-list { list-style: none; padding: 0; margin: 0 0 var(--space-sm); }
.feature-list li {
  position: relative;
  padding: .5rem 0 .5rem 1.5rem;
  line-height: 1.55;
}
.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .95em;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gray);
}
.feature-list.is-danger li::before { background: var(--red); }
.feature-list.is-ok li::before { background: var(--green); }
.feature-list.is-neutral li::before { background: var(--orange); }

.memory-demo {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-alt);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column; gap: .625rem;
}
.msg {
  padding: .625rem 1rem;
  border-radius: var(--radius-md);
  max-width: 80%;
  font-size: .95rem;
}
.msg.you { align-self: flex-end; background: var(--orange); color: white; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: white; border: 1px solid var(--gray-light); border-bottom-left-radius: 4px; }
.conv-break {
  align-self: center;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--gray);
  margin: .5rem 0;
}

.quiz-inline {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-alt);
  border-radius: var(--radius-md);
}
.quiz-choices { display: flex; flex-direction: column; gap: .5rem; margin: .75rem 0 .5rem; }
.quiz-choices button {
  text-align: left;
  padding: .75rem 1rem;
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  font-size: .95rem;
}
.quiz-choices button:hover:not(:disabled) { border-color: var(--orange); }
.quiz-choices button.right { background: var(--green-soft); border-color: var(--green); }
.quiz-choices button.wrong { background: var(--red-soft); border-color: var(--red); }
.quiz-feedback { margin-top: .5rem; font-size: .95rem; font-weight: 500; min-height: 1.5em; }
.quiz-feedback.right { color: var(--green); }
.quiz-feedback.wrong { color: var(--red); }

/* ============================================
   Prompt builder (chapter 5)
   ============================================ */
.prompt-builder {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--space-md);
  max-width: 1000px; margin: 0 auto;
}
@media (max-width: 820px) { .prompt-builder { grid-template-columns: 1fr; } }

.pb-left { display: flex; flex-direction: column; gap: .625rem; }
.pb-toggle {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: 1rem;
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}
.pb-toggle:hover { border-color: var(--orange); }
.pb-toggle input { margin-top: 4px; accent-color: var(--orange); width: 18px; height: 18px; cursor: pointer; }
.pb-toggle strong { display: block; font-family: var(--font-heading); font-size: 1rem; margin-bottom: 2px; }
.pb-toggle span { display: block; font-size: .85rem; color: var(--gray); }
.pb-toggle:has(input:checked) { background: var(--orange-soft); border-color: var(--orange); }

.pb-preview {
  background: var(--dark);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.pb-preview-head {
  display: flex; align-items: center; gap: .375rem;
  padding: .625rem .875rem;
  background: rgba(255, 255, 255, .04);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.pb-preview-head .dot { width: 12px; height: 12px; }
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }
.pb-file { margin-left: auto; font-family: var(--font-mono); font-size: .75rem; color: rgba(255, 255, 255, .5); }
#promptPreview {
  margin: 0;
  padding: var(--space-md);
  min-height: 240px;
  color: rgba(255, 255, 255, .9);
  font-family: var(--font-mono);
  font-size: .85rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
#promptPreview .k { color: var(--orange); font-weight: 500; }
#promptPreview .c { color: rgba(255, 255, 255, .4); font-style: italic; }
#promptPreview .placeholder { color: rgba(255, 255, 255, .3); font-style: italic; }

.pb-score { margin-top: var(--space-sm); }
.pb-score-label { font-family: var(--font-mono); font-size: .75rem; color: var(--gray); margin-bottom: .375rem; }
.pb-score-bar { height: 8px; background: var(--gray-light); border-radius: 999px; overflow: hidden; }
.pb-score-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--orange), var(--orange-light));
  border-radius: 999px;
  transition: width .4s cubic-bezier(.4, 0, .2, 1);
}
.pb-score-text { margin-top: .5rem; font-size: .875rem; color: var(--dark-2); }

/* ============================================
   Staircase (chapter 6)
   ============================================ */
.staircase {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  max-width: 1100px;
  margin: 0 auto;
}
@media (max-width: 640px) { .staircase { grid-template-columns: 1fr; } }
.stair {
  padding: var(--space-md);
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  position: relative;
}
.stair:hover { transform: translateY(-6px); border-color: var(--orange); box-shadow: var(--shadow-orange); }
.stair-num {
  width: 42px; height: 42px;
  background: var(--orange);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}
.stair h3 { margin-bottom: .5rem; }
.stair-example {
  margin-top: var(--space-sm);
  padding: .75rem;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--dark-2);
  line-height: 1.5;
}

/* ============================================
   Quiz final
   ============================================ */
.chapter-quiz { background: var(--dark); color: white; }
.chapter-quiz .chapter-lead { color: rgba(255, 255, 255, .7); }
.chapter-quiz .chapter-num { color: var(--orange); }
.quiz { max-width: 780px; margin: 0 auto; }
.q-block {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}
.q-num { font-family: var(--font-mono); color: var(--orange); font-size: .875rem; margin-bottom: .25rem; }
.q-text { font-family: var(--font-heading); font-size: 1.125rem; margin-bottom: var(--space-sm); }
.q-choices { display: flex; flex-direction: column; gap: .5rem; }
.q-choice {
  text-align: left;
  padding: .75rem 1rem;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius-sm);
  color: white;
  font-size: .95rem;
  transition: all var(--transition);
}
.q-choice:hover:not(:disabled) { background: rgba(255, 255, 255, .12); border-color: var(--orange); }
.q-choice.right { background: rgba(30, 185, 88, .2); border-color: var(--green); }
.q-choice.wrong { background: rgba(220, 38, 38, .2); border-color: var(--red); }
.q-explain {
  margin-top: .625rem;
  padding: .625rem .875rem;
  background: rgba(252, 127, 60, .1);
  border-left: 2px solid var(--orange);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, .9);
}
.quiz-result {
  max-width: 780px; margin: var(--space-md) auto 0;
  text-align: center;
  padding: var(--space-lg);
  background: rgba(252, 127, 60, .1);
  border: 1px solid var(--orange);
  border-radius: var(--radius-md);
}
.quiz-score {
  font-family: var(--font-heading);
  font-size: 3rem;
  color: var(--orange);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}
#quizMessage { color: white; margin-bottom: var(--space-sm); }
#quizReset { background: white; color: var(--dark); }
#quizReset:hover { background: var(--orange); color: white; }

/* ============================================
   Roadmap
   ============================================ */
.roadmap {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-md);
  max-width: 1100px; margin: 0 auto;
}
.road-card {
  padding: var(--space-md);
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}
.road-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.road-card.featured { border-color: var(--orange); background: var(--orange-soft); }
.road-head { display: flex; flex-direction: column; gap: .5rem; margin-bottom: var(--space-sm); }
.road-time {
  align-self: flex-start;
  padding: .25rem .75rem;
  background: var(--dark);
  color: white;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .75rem;
}
.road-card.featured .road-time { background: var(--orange); }
.road-head h3 { margin: 0; }
.road-check { list-style: none; padding: 0; margin: 0; }
.road-check li {
  border-top: 1px dashed var(--gray-light);
  font-size: .95rem;
}
.road-check li:first-child { border-top: none; }
.road-item {
  display: flex;
  gap: .625rem;
  align-items: flex-start;
  padding: .625rem .5rem;
  margin: 0 -.5rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  user-select: none;
}
.road-item:hover { background: var(--orange-soft); }
.road-check input { margin-top: 3px; accent-color: var(--orange); width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; }
.road-check input:checked + span { text-decoration: line-through; opacity: .55; }

/* ============================================
   Footer
   ============================================ */
.footer {
  padding: var(--space-lg) 0;
  background: var(--dark);
  color: rgba(255, 255, 255, .8);
}
.footer-inner {
  display: flex; flex-direction: column; gap: var(--space-md);
  align-items: center;
  text-align: center;
}
.footer-logo { display: flex; gap: .625rem; align-items: center; }
.footer-logo div { display: flex; flex-direction: column; align-items: flex-start; }
.footer-logo strong { font-family: var(--font-heading); color: white; }
.footer-logo span { font-size: .875rem; color: rgba(255, 255, 255, .6); }
.footer-links { display: flex; gap: var(--space-md); }
.footer-links a { color: rgba(255, 255, 255, .8); font-size: .95rem; }
.footer-links a:hover { color: var(--orange); }
.footer-note { font-family: var(--font-mono); font-size: .75rem; color: rgba(255, 255, 255, .5); }

/* ============================================
   Split layouts (main + aside)
   ============================================ */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: var(--space-md);
  max-width: 1180px;
  margin: 0 auto;
  align-items: start;
}
.split.reverse { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); }
.split.reverse .side { order: -1; }
@media (max-width: 900px) {
  .split, .split.reverse { grid-template-columns: 1fr; }
  .split.reverse .side { order: 0; }
}
.side { display: flex; flex-direction: column; gap: var(--space-sm); position: sticky; top: 96px; }
@media (max-width: 900px) { .side { position: static; } }

.side-card {
  padding: var(--space-md);
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}
.side-card:hover { box-shadow: var(--shadow-md); }
.side-card-head {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: .625rem;
}
.side-card-head::before { content: '✦'; font-size: 1rem; }
.side-card h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin: 0 0 .5rem;
  line-height: 1.3;
}
.side-card p { font-size: .95rem; line-height: 1.55; margin: 0 0 .625rem; color: var(--dark-2); }
.side-card p:last-child { margin-bottom: 0; }
.side-card--example { border-left: 3px solid var(--orange); }
.side-card--tip { background: var(--orange-soft); border-color: var(--orange-tint); }
.side-card--warn { background: #fef3ec; border-left: 3px solid #f59e0b; }
.side-card--quiz { background: var(--dark); color: white; border-color: var(--dark); }
.side-card--quiz .side-card-head { color: var(--orange-light); }
.side-card--quiz h4 { color: white; }
.side-card--quiz p { color: rgba(255, 255, 255, .8); }

.side-example-list { list-style: none; padding: 0; margin: 0; }
.side-example-list li {
  padding: .5rem 0;
  border-top: 1px dashed var(--gray-light);
  font-size: .9rem;
  line-height: 1.5;
}
.side-example-list li:first-child { border-top: none; }
.side-example-list strong { display: block; color: var(--orange); font-family: var(--font-heading); font-size: .85rem; margin-bottom: .125rem; }

/* Mini quiz inside side card */
.mini-quiz { display: flex; flex-direction: column; gap: .375rem; }
.mini-quiz button {
  text-align: left;
  padding: .625rem .75rem;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: var(--radius-sm);
  color: white;
  font-size: .875rem;
  transition: all var(--transition);
}
.mini-quiz button:hover:not(:disabled) { background: rgba(255, 255, 255, .15); border-color: var(--orange-light); }
.mini-quiz button.right { background: rgba(30, 185, 88, .2); border-color: var(--green); }
.mini-quiz button.wrong { background: rgba(220, 38, 38, .2); border-color: var(--red); }
.mini-quiz-feedback {
  margin-top: .5rem;
  font-size: .85rem;
  min-height: 1em;
  color: rgba(255, 255, 255, .85);
  line-height: 1.45;
}

/* ============================================
   Métier tabs (Chapter 6 new)
   ============================================ */
.metier-tabs {
  display: flex; gap: .375rem;
  flex-wrap: wrap;
  padding: .375rem;
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
  max-width: 1080px;
  margin: 0 auto var(--space-md);
}
.metier-tab {
  flex: 1; min-width: 130px;
  padding: .75rem .875rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: .95rem;
  color: var(--gray);
  transition: all var(--transition);
}
.metier-tab:hover { color: var(--dark); }
.metier-tab.active { background: var(--orange); color: white; }
.metier-panel {
  display: none;
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--space-lg);
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-lg);
  animation: fadeIn .3s ease-out;
}
.metier-panel.active { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }
@media (max-width: 640px) { .metier-panel.active { grid-template-columns: 1fr; } }
.metier-case {
  padding: var(--space-md);
  background: var(--bg-alt);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--orange);
}
.metier-case h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin: 0 0 .375rem;
  color: var(--dark);
}
.metier-case p {
  font-size: .9rem;
  line-height: 1.55;
  color: var(--dark-2);
  margin: 0;
}
.metier-case .prompt-ex {
  margin-top: .625rem;
  padding: .625rem;
  background: white;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: .78rem;
  line-height: 1.5;
  color: var(--dark-2);
  border: 1px dashed var(--gray-light);
}

/* ============================================
   Chooser / decision tree (Chapter Choisir)
   ============================================ */
.chooser {
  max-width: 780px; margin: 0 auto var(--space-md);
  padding: var(--space-md);
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-lg);
}
.chooser-step {
  margin-bottom: var(--space-md);
}
.chooser-step:last-child { margin-bottom: 0; }
.chooser-label {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--orange);
  letter-spacing: .05em;
  margin-bottom: .5rem;
}
.chooser-question {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: .75rem;
}
.chooser-choices { display: flex; gap: .5rem; flex-wrap: wrap; }
.chooser-choice {
  padding: .625rem 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  transition: all var(--transition);
}
.chooser-choice:hover { border-color: var(--orange); }
.chooser-choice.active { background: var(--dark); color: white; border-color: var(--dark); }
.chooser-result {
  padding: var(--space-md);
  background: linear-gradient(135deg, var(--orange-soft), white);
  border: 1px solid var(--orange);
  border-radius: var(--radius-md);
  margin-top: var(--space-md);
}
.chooser-result h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--orange);
  margin: 0 0 .5rem;
}
.chooser-result p { margin: 0 0 .5rem; font-size: .95rem; line-height: 1.55; }

/* Pricing table */
.pricing {
  max-width: 1080px; margin: var(--space-lg) auto 0;
  overflow-x: auto;
}
.pricing table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: .9rem;
}
.pricing th, .pricing td {
  padding: .875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-light);
}
.pricing th {
  background: var(--dark);
  color: white;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.pricing tr:last-child td { border-bottom: none; }
.pricing tr:hover td { background: var(--orange-soft); }
.pricing .plan-name { font-weight: 600; color: var(--dark); }
.pricing .plan-price { font-family: var(--font-mono); color: var(--orange); font-weight: 500; }
.pricing-note {
  max-width: 1080px; margin: .625rem auto 0;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--gray);
  font-style: italic;
}

/* Advanced techniques cards (chapter 5) */
.techniques {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-sm);
  max-width: 1080px;
  margin: var(--space-lg) auto 0;
}
.technique {
  padding: var(--space-md);
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}
.technique:hover { border-color: var(--orange); box-shadow: var(--shadow-sm); }
.technique-tag {
  display: inline-block;
  padding: .2rem .5rem;
  background: var(--dark);
  color: white;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: .7rem;
  margin-bottom: .625rem;
}
.technique h4 { font-family: var(--font-heading); font-size: 1rem; margin: 0 0 .375rem; }
.technique p { font-size: .9rem; color: var(--dark-2); margin: 0 0 .5rem; }
.technique .ex {
  padding: .5rem .625rem;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: .75rem;
  line-height: 1.5;
  color: var(--dark-2);
}

/* Before / after prompt comparison */
.beforeafter {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm);
  margin: var(--space-md) 0;
}
@media (max-width: 640px) { .beforeafter { grid-template-columns: 1fr; } }
.ba-card {
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  font-size: .85rem;
  line-height: 1.55;
}
.ba-before {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
}
.ba-after {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #14532d;
}
.ba-label {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: .375rem;
  opacity: .7;
}

/* Ressources cards */
.resources {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  max-width: 1080px;
  margin: 0 auto;
}
@media (max-width: 860px) { .resources { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .resources { grid-template-columns: 1fr; } }
.resource {
  padding: var(--space-md);
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}
.resource:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--orange); }
.resource-cat {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .5rem;
}
.resource h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin: 0 0 .375rem;
}
.resource p { font-size: .9rem; color: var(--dark-2); margin: 0 0 .5rem; line-height: 1.5; }
.resource-tag {
  display: inline-block;
  padding: .15rem .5rem;
  background: var(--orange-soft);
  color: var(--orange);
  border-radius: 4px;
  font-size: .75rem;
  font-family: var(--font-mono);
}

/* ============================================
   Glossaire
   ============================================ */
.glossary-controls {
  max-width: 1080px;
  margin: 0 auto var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
#glossarySearch {
  width: 100%;
  padding: .875rem 1.25rem;
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--dark);
  transition: all var(--transition);
}
#glossarySearch:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(252, 127, 60, .15);
}
#glossarySearch::placeholder { color: var(--gray); }
.glossary-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
}
.glossary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-sm);
  max-width: 1180px;
  margin: 0 auto;
}
.gloss-card {
  padding: var(--space-md);
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.gloss-card:hover {
  border-color: var(--orange);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.gloss-card.hidden { display: none; }
.gloss-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
}
.gloss-term {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--dark);
  margin: 0;
  line-height: 1.2;
}
.gloss-term small {
  display: block;
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--gray);
  font-weight: 400;
  margin-top: .125rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.gloss-cat {
  flex-shrink: 0;
  padding: .15rem .5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.gloss-cat[data-cat="fondamentaux"] { background: var(--orange-soft); color: #9a3412; }
.gloss-cat[data-cat="outils"] { background: #dbeafe; color: #1e3a8a; }
.gloss-cat[data-cat="prompting"] { background: #ede9fe; color: #5b21b6; }
.gloss-cat[data-cat="risques"] { background: #fee2e2; color: #7f1d1d; }
.gloss-cat[data-cat="auto"] { background: #dcfce7; color: #14532d; }
.gloss-def {
  font-size: .9rem;
  line-height: 1.55;
  color: var(--dark-2);
  margin: 0;
}
.gloss-def strong { color: var(--dark); }
.gloss-related {
  margin-top: auto;
  padding-top: .5rem;
  border-top: 1px dashed var(--gray-light);
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--gray);
}
.gloss-related span { color: var(--orange); }
.glossary-empty {
  max-width: 620px;
  margin: var(--space-md) auto 0;
  padding: var(--space-md);
  background: white;
  border: 1px dashed var(--gray-light);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--gray);
  font-style: italic;
}
.gloss-highlight { background: var(--orange-soft); padding: 0 .15em; border-radius: 3px; }

/* ============================================
   Auth gate (login)
   ============================================ */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: radial-gradient(ellipse at top right, var(--orange-soft) 0%, transparent 60%),
              radial-gradient(ellipse at bottom left, #fef3ec 0%, transparent 50%),
              white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  overflow-y: auto;
}
.auth-gate[hidden] { display: none; }
body.locked-out { overflow: hidden; }
.auth-card {
  max-width: 440px;
  width: 100%;
  padding: var(--space-lg);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px -12px rgba(3, 7, 18, .15);
  border: 1px solid var(--gray-light);
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  margin-bottom: var(--space-md);
  font-size: 1rem;
}
.auth-logo em { color: var(--orange); font-style: normal; margin: 0 .2rem; }
.auth-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin: 0 0 .5rem;
  color: var(--dark);
}
.auth-lead {
  color: var(--gray);
  font-size: .95rem;
  margin: 0 0 var(--space-md);
  line-height: 1.55;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: .375rem;
}
.auth-field > span {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.auth-field input,
.auth-field select {
  padding: .75rem 1rem;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--dark);
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.auth-field input:focus,
.auth-field select:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(252, 127, 60, .15);
}
.auth-submit {
  justify-content: center;
  padding: .875rem 1.5rem;
  margin-top: .25rem;
}
.auth-error {
  padding: .625rem .875rem;
  background: var(--red-soft);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: .9rem;
}
.auth-error[hidden] { display: none; }
.auth-footer {
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px dashed var(--gray-light);
  font-size: .85rem;
  color: var(--gray);
  text-align: center;
}
.auth-footer a { color: var(--orange); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================
   Sidebar user chip & actions
   ============================================ */
.cs-user {
  padding: .5rem .625rem;
  background: var(--orange-soft);
  border: 1px solid var(--orange-tint);
  border-radius: var(--radius-md);
  margin-bottom: .625rem;
}
.cs-user-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: .9rem;
  color: var(--dark);
  line-height: 1.2;
}
.cs-user-role {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: 2px;
}
.cs-actions {
  display: flex;
  flex-direction: column;
  gap: .375rem;
}
.cs-action {
  width: 100%;
  padding: .5rem .75rem;
  background: transparent;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-sm);
  color: var(--gray);
  font-family: var(--font-body);
  font-size: .85rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.cs-action:hover { border-color: var(--orange); color: var(--orange); background: var(--orange-soft); }
.cs-action--logout:hover { border-color: var(--red); color: var(--red); background: #fef2f2; }
.cs-action[hidden] { display: none; }

/* ============================================
   Admin panel
   ============================================ */
.modal.modal-lg {
  max-width: 720px;
}
.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: .5rem;
}
.admin-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gray-lighter);
  border: 0;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--dark);
  transition: background var(--transition);
  padding: 0;
}
.admin-close:hover { background: var(--orange-soft); color: var(--orange); }
.admin-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.admin-section h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin: 0 0 .5rem;
  color: var(--dark);
}
.admin-users-wrap {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
}
.admin-users {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.admin-users th,
.admin-users td {
  padding: .5rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-light);
}
.admin-users th {
  background: var(--bg-alt);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: .75rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.admin-users tr:last-child td { border-bottom: none; }
.admin-users td.actions { text-align: right; }
.admin-role-badge {
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .7rem;
  text-transform: uppercase;
}
.admin-role-badge.admin { background: var(--dark); color: white; }
.admin-role-badge.user { background: var(--orange-soft); color: var(--orange); }
.admin-delete {
  padding: .25rem .625rem;
  background: transparent;
  border: 1px solid var(--gray-light);
  border-radius: 4px;
  color: var(--gray);
  font-size: .8rem;
  cursor: pointer;
  transition: all var(--transition);
}
.admin-delete:hover:not(:disabled) { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.admin-delete:disabled { opacity: .35; cursor: not-allowed; }
.admin-add-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .625rem;
  margin-bottom: .75rem;
}
@media (max-width: 560px) { .admin-add-grid { grid-template-columns: 1fr; } }

/* ============================================
   Récap post-formation
   ============================================ */
.recap-share {
  max-width: 780px;
  margin: 0 auto var(--space-md);
  padding: var(--space-md);
  background: white;
  border: 1px solid var(--orange);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-orange);
}
.recap-share-inner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.recap-share-inner > div:first-child { flex: 1; min-width: 0; }
.recap-share-label {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .375rem;
}
.recap-share-url {
  display: block;
  padding: .625rem .875rem;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--dark-2);
  word-break: break-all;
  border: 1px dashed var(--gray-light);
}

.recap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  max-width: 1080px;
  margin: 0 auto;
}
@media (max-width: 860px) { .recap-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .recap-grid { grid-template-columns: 1fr; } }
.recap-card {
  padding: var(--space-md);
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: .375rem;
}
.recap-card:hover { border-color: var(--orange); box-shadow: var(--shadow-sm); }
.recap-num {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--orange);
  letter-spacing: .05em;
}
.recap-card h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  color: var(--dark);
}
.recap-card p {
  font-size: .9rem;
  color: var(--dark-2);
  margin: 0;
  line-height: 1.5;
}

.homework {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  max-width: 1080px;
  margin: 0 auto;
}
@media (max-width: 640px) { .homework { grid-template-columns: 1fr; } }
.homework-block {
  padding: var(--space-md);
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
}
.homework-week {
  display: inline-block;
  padding: .3rem .75rem;
  background: var(--orange);
  color: white;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.recap-links {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-lg);
}

/* Toast (feedback léger) */
.toast {
  position: fixed;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: .75rem 1.25rem;
  background: var(--dark);
  color: white;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: .9rem;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  opacity: 0;
  transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s;
  pointer-events: none;
}
.toast[hidden] { display: none; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ============================================
   Modal de confirmation
   ============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  animation: modalBackdropIn .2s ease-out;
}
.modal-backdrop[hidden] { display: none; }
@keyframes modalBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s cubic-bezier(.4, 0, .2, 1);
}
@keyframes modalIn {
  from { transform: translateY(20px) scale(.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 .5rem;
  color: var(--dark);
  line-height: 1.25;
}
.modal-message {
  color: var(--dark-2);
  margin: 0 0 var(--space-md);
  line-height: 1.55;
  font-size: .95rem;
}
.modal-actions {
  display: flex;
  gap: .625rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.modal-actions .btn { min-width: 120px; justify-content: center; }
.modal .btn-primary.danger {
  background: var(--red);
  border-color: var(--red);
}
.modal .btn-primary.danger:hover {
  background: #b91c1c;
  box-shadow: 0 20px 40px -12px rgba(220, 38, 38, .4);
}

/* ============================================
   Reveal-on-scroll
   ============================================ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease-out, transform .6s ease-out; }
.reveal.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
