/* ============================================================
   JAVASCRIPT DÉCRYPTÉ — Identité visuelle JavaScript
   Jaune JS #F7DF1E · noir / gris très foncé · Space Grotesk +
   Inter + JetBrains Mono · Navigation identique au Guide Java
   ============================================================ */

:root {
  --bg: #0d0d0d;
  --bg-card: #161616;
  --bg-darker: #090909;
  --bg-elev: #1d1d1d;
  --fg: #f2f2f0;
  --fg-muted: #a6a6a3;
  --border: #2a2a28;
  --border-strong: #3a3a37;
  --js: #F7DF1E;
  --js-soft: rgba(247, 223, 30, 0.1);
  --js-softer: rgba(247, 223, 30, 0.05);
  --js-glow: rgba(247, 223, 30, 0.16);
  --js-text: #F7DF1E;            /* texte accent sur fond sombre */
  --danger: #ff6b6b;
  --ok: #4ade80;
  --code-bg: #0a0a0a;
  --code-fg: rgba(255, 255, 255, 0.94);
  --console-bg: #0a0a0a;
  --token-comment: #7c7c74;
  --token-string: #b8d977;
  --token-number: #f0b45c;
  --token-keyword: #F7DF1E;
  --token-class: #7dd3fc;
  --token-punct: #b8b8b2;
  --topbar-bg: rgba(13, 13, 13, 0.82);
  --header-bg: rgba(13, 13, 13, 0.58);
  --footer-bg: rgba(10, 10, 10, 0.85);
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.45);
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
  --radius: 10px;
  --topbar-h: 57px;
}

:root[data-theme="light"] {
  --bg: #fafaf7;
  --bg-card: #ffffff;
  --bg-darker: #f0f0ea;
  --bg-elev: #ffffff;
  --fg: #191917;
  --fg-muted: #5f5f5a;
  --border: #e2e2da;
  --border-strong: #cfcfc5;
  --js: #F7DF1E;
  --js-soft: rgba(247, 223, 30, 0.22);
  --js-softer: rgba(247, 223, 30, 0.1);
  --js-glow: rgba(247, 223, 30, 0.3);
  --js-text: #8f7c00;            /* jaune assombri pour rester lisible sur clair */
  --danger: #dc2626;
  --ok: #16a34a;
  --code-bg: #14140f;
  --code-fg: rgba(255, 255, 255, 0.95);
  --console-bg: #14140f;
  --topbar-bg: rgba(250, 250, 247, 0.88);
  --header-bg: rgba(250, 250, 247, 0.64);
  --footer-bg: rgba(245, 245, 240, 0.92);
  --shadow-card: 0 8px 30px rgba(40, 35, 0, 0.1);
}

body.theme-ready {
  transition: background-color 0.3s ease, color 0.3s ease;
}
body.theme-ready * {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--js); color: #111; }

/* Scrollbars globales */
::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-darker); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--js); }

/* ============ TOPBAR ============ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 18px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  margin-right: clamp(24px, 3vw, 52px);
  flex-shrink: 0;
}
.topbar-brand-link {
  display: flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
}
.js-logo { width: 26px; height: 26px; display: block; border-radius: 6px; }
.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand-accent { color: var(--js-text); }
.brand-author { font-size: 12px; color: var(--fg-muted); white-space: nowrap; }
.topbar-center {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
}
.topbar-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--js);
  flex-shrink: 0;
}
.topbar-slogan {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  white-space: nowrap;
  flex-shrink: 0;
  overflow: visible;
}
.topbar-slogan .diamond { color: var(--js-text); margin: 0 4px; }
.topbar-tools {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: clamp(96px, 8vw, 160px);
}
.topbar-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--fg-muted);
  font-size: 9px;
  transition: color 0.2s;
}
.topbar-icon-item:hover { color: var(--fg); }
.topbar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px; height: 25px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
}
.topbar-badge-uml {
  color: #8b5cf6;
  border-color: #8b5cf655;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: -0.08em;
}
.topbar-badge-mail { color: #ea4335; border-color: #ea433555; }
.topbar-badge-linkedin {
  color: #0a66c2;
  border-color: #0a66c255;
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
}
.topbar-badge-github { color: var(--fg); border-color: var(--border-strong); }
.topbar-separator {
  width: 1px;
  height: 25px;
  margin: 0 2px;
  background: var(--border-strong);
}
.topbar-icon-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.topbar-icon-svg.icon-mono { color: var(--fg); }
.topbar-uml-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.18em;
}
.uml-u { color: #ef4444; }
.uml-m { color: #22c55e; }
.uml-l { color: #3b82f6; }
.topbar-linkedin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  background: #0a66c2;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: clamp(28px, 4vw, 56px);
  flex-shrink: 0;
}
.sidebar-toggle-btn, .theme-toggle {
  width: 34px; height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.sidebar-toggle-btn:hover, .theme-toggle:hover {
  color: var(--js-text);
  border-color: var(--js);
  background: var(--js-softer);
}
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }

/* ============ PROGRESS BAR ============ */
.progress-bar {
  position: fixed;
  top: var(--topbar-h);
  left: 0; right: 0;
  height: 3px;
  background: var(--bg-darker);
  z-index: 99;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--js), #fff35c);
  box-shadow: 0 0 10px var(--js-glow);
  transition: width 0.15s ease-out;
}

/* ============ MOBILE NAV (chips) ============ */
.mobile-nav {
  display: none;
  position: fixed;
  top: calc(var(--topbar-h) + 3px);
  left: 0; right: 0;
  z-index: 90;
  backdrop-filter: blur(12px);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  padding: 9px 14px;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.mobile-nav::-webkit-scrollbar { display: none; }
.mobile-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--fg-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
}
.chip-num { font-family: var(--font-mono); font-weight: 600; font-size: 11px; color: var(--js-text); }
.chip-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong); }
.mobile-chip.active {
  border-color: var(--js);
  background: var(--js-soft);
  color: var(--fg);
  transform: scale(1.04);
}
.mobile-chip.active .chip-dot { background: var(--js); }
@media (max-width: 1023px) {
  .mobile-nav { display: flex; }
  body { overflow: hidden; }
}

/* ============ SLIDES (navigation horizontale) ============ */
.main-content { position: relative; z-index: 1; }
.slides-container {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  height: calc(100vh - var(--topbar-h) - 3px);
  margin-top: calc(var(--topbar-h) + 3px);
  scrollbar-width: thin;
  scrollbar-color: var(--js) var(--bg);
}
.slides-container::-webkit-scrollbar { height: 7px; }
.slides-container::-webkit-scrollbar-track { background: var(--bg); }
.slides-container::-webkit-scrollbar-thumb { background: var(--js); border-radius: 4px; }

.slide {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  height: 100%;
  overflow-y: auto;
  padding: 28px 22px 90px;
}
.slide-hero { display: flex; align-items: center; justify-content: center; }
.slide-chapter {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  max-width: 1400px;
  margin: 0 auto;
}
@media (min-width: 1024px) {
  .slide { padding: 30px 26px 90px; }
  .slide-chapter { grid-template-columns: 205px 1fr; }
}
/* En mode sidebar masquée */
body.sidebar-collapsed .slide-chapter { grid-template-columns: 1fr; }
body.sidebar-collapsed .sidebar { display: none !important; }

/* ============ SIDEBAR ============ */
.sidebar { display: none; }
@media (min-width: 1024px) {
  .sidebar { display: block; }
  .sidebar nav {
    position: sticky;
    top: 8px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    scrollbar-width: thin;
  }
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand .js-logo { width: 18px; height: 18px; }
.sidebar-brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
}
.sidebar-brand-text span { color: var(--js-text); }
.sidebar-brand-sub {
  font-size: 9px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sidebar-list { list-style: none; }
.sidebar-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 13px;
  text-decoration: none;
  color: var(--fg-muted);
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: all 0.18s;
}
.sidebar-item:hover { background: var(--js-softer); color: var(--fg); }
.sidebar-num {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  color: var(--js-text);
  border: 1px solid rgba(247, 223, 30, 0.35);
  background: var(--js-softer);
  border-radius: 5px;
  padding: 2px 5px;
  margin-top: 1px;
}
.sidebar-text { flex: 1; min-width: 0; }
.sidebar-title {
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1.35;
  color: inherit;
}
.sidebar-count {
  font-size: 10px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}
.sidebar-chevron { margin-top: 4px; opacity: 0; transition: all 0.2s; color: var(--js-text); }
.sidebar-item:hover .sidebar-chevron { opacity: 0.7; }
.sidebar-item.active {
  background: var(--js-soft);
  border-left-color: var(--js);
  color: var(--fg);
}
.sidebar-item.active .sidebar-title { color: var(--js-text); }
.sidebar-item.active .sidebar-chevron { opacity: 1; }

/* ============ HERO ============ */
.hero {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  position: relative;
  padding: 26px 18px 18px;
}
.hero-bg {
  position: absolute;
  inset: -10% -8% 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 25% 20%, rgba(247, 223, 30, 0.13), transparent 30%),
    radial-gradient(circle at 75% 60%, rgba(247, 223, 30, 0.08), transparent 25%);
}
.hero-particles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.particle {
  position: absolute;
  bottom: -20px;
  border-radius: 2px;
  background: var(--js);
  opacity: 0.25;
  animation: particle-rise linear infinite;
}
@keyframes particle-rise {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  15% { opacity: 0.3; }
  85% { opacity: 0.15; }
  100% { transform: translateY(-90vh) rotate(220deg); opacity: 0; }
}
.hero-content { position: relative; z-index: 2; }
.hero-main-panel {
  display: grid;
  grid-template-columns: minmax(260px, 460px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
}
.hero-photo-card {
  position: relative;
  background: linear-gradient(135deg, rgba(247, 223, 30, 0.18), rgba(247, 223, 30, 0.02));
  border: 1px solid rgba(247, 223, 30, 0.28);
  border-radius: 28px;
  padding: 14px;
  box-shadow: 0 18px 42px rgba(17, 17, 17, 0.08);
}
.hero-photo-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 20px;
  border: 1px solid rgba(247, 223, 30, 0.16);
  pointer-events: none;
}
.hero-photo-card img {
  display: block;
  width: 100%;
  height: clamp(340px, 40vw, 520px);
  object-fit: cover;
  object-position: center top;
  border-radius: 20px;
  background: var(--bg-darker);
}
.hero-copy {
  text-align: left;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--js-text);
  background: var(--js-soft);
  border: 1px solid rgba(247, 223, 30, 0.3);
  padding: 9px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
  text-transform: uppercase;
}
.hero-title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 0.92;
}
.title-line-1 {
  display: block;
  font-size: clamp(46px, 7vw, 98px);
  color: var(--fg);
  letter-spacing: -0.05em;
}
.title-accent { color: var(--js-text); }
.author-accent { color: var(--js-text); font-weight: 600; }
.title-line-2 {
  display: block;
  margin-top: 10px;
  font-size: clamp(18px, 2.1vw, 30px);
  font-weight: 600;
  line-height: 1.25;
  color: var(--fg-muted);
  letter-spacing: -0.02em;
}
.hero-persona {
  margin-bottom: 28px;
}
.hero-persona h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 42px);
  color: var(--fg);
}
.hero-persona p {
  margin: 0;
  color: var(--fg-muted);
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.6;
}
.hero-stats {
  display: flex;
  justify-content: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}
.stat-card {
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 18px 14px;
  min-width: 120px;
  text-align: center;
  transition: all 0.25s;
}
.stat-card:hover {
  border-color: var(--js);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(247, 223, 30, 0.12);
}
.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3vw, 38px);
  color: var(--js-text);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 10.5px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.hero-keyboard { display: none; }
kbd {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 3px 8px;
  color: var(--fg);
}
@media (max-width: 860px) {
  .hero-main-panel {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-copy {
    text-align: center;
  }
  .hero-stats {
    justify-content: center;
  }
  .hero-photo-card img {
    height: 420px;
  }
}

/* ============ CHAPITRE ============ */
.chapter-wrap { min-width: 0; }
.chapter-section {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
}
.chapter-header { margin-bottom: 28px; }
.chapter-line { height: 1px; background: linear-gradient(to right, transparent, rgba(247, 223, 30, 0.4), transparent); margin-bottom: 26px; }
.chapter-header-inner { display: flex; align-items: center; gap: 22px; }
.chapter-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(56px, 7vw, 88px);
  line-height: 1;
  color: var(--js-text);
  opacity: 0.9;
  text-shadow: 0 0 34px var(--js-glow);
}
.chapter-meta { flex: 1; min-width: 0; }
.chapter-badge-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.chapter-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--js-text);
  border: 1px solid rgba(247, 223, 30, 0.35);
  background: var(--js-soft);
  padding: 4px 12px;
  border-radius: 999px;
}
.chapter-count { font-size: 12px; color: var(--fg-muted); font-family: var(--font-mono); }
.chapter-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  color: var(--fg);
  margin-bottom: 8px;
}
.chapter-subtitle { font-size: clamp(14px, 1.8vw, 17px); color: var(--fg-muted); }
.chapter-gradient-bar {
  height: 3px;
  margin-top: 18px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--js), rgba(247, 223, 30, 0.25) 40%, transparent);
}

/* ============ FICHE CARD ============ */
.fiches-list { display: flex; flex-direction: column; gap: 20px; }
.fiche-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fiche-card:hover { border-color: var(--border-strong); }
.fiche-card.open { border-color: rgba(247, 223, 30, 0.28); box-shadow: var(--shadow-card); }
.fiche-accent-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--js), rgba(247, 223, 30, 0.25));
}
.fiche-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px 16px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font-family: inherit;
  transition: background 0.2s;
}
.fiche-header:hover { background: var(--js-softer); }
.fiche-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--js);
  color: #111;
  border-radius: 9px;
  padding: 7px 12px;
  min-width: 62px;
  flex-shrink: 0;
  line-height: 1.1;
}
.badge-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.badge-num { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.fiche-badge-variant { background: var(--bg-elev); color: var(--js-text); border: 1px solid rgba(247, 223, 30, 0.4); }
.fiche-info { flex: 1; min-width: 0; }
.fiche-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(17px, 2.4vw, 21px);
  color: var(--fg);
  line-height: 1.25;
}
.fiche-subtitle { font-size: 13.5px; color: var(--fg-muted); margin-top: 3px; }
.fiche-chevron { color: var(--js-text); flex-shrink: 0; transition: transform 0.25s; }
.fiche-card.open .fiche-chevron { transform: rotate(180deg); }

.fiche-content { display: none; padding: 0 20px 22px; }
.fiche-card.open .fiche-content { display: block; }
.fiche-content-inner { display: flex; flex-direction: column; gap: 18px; }

.fiche-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}
.toolbar-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--js-text);
}
.img-toggle-btn {
  font-size: 12px;
  font-family: var(--font-sans);
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 5px 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.img-toggle-btn:hover { color: var(--js-text); border-color: var(--js); background: var(--js-softer); }

.fiche-image-wrap { display: block; }
.fiche-image-wrap img {
  display: block;
  width: 100%;
  max-width: 1080px;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: #fff;
}

/* ============ EXPLICATIONS (sous la fiche) ============ */
.fiche-explain {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.exp { max-width: 900px; }
.exp-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--js-text);
}
.exp p { font-size: 16.5px; line-height: 1.75; color: var(--fg); }
.exp p + p { margin-top: 8px; }
.exp strong { color: var(--js-text); font-weight: 600; }
.exp em { color: var(--fg); }
.exp code, .term-name code, .term-def code, .line-exp code, .exp li code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--js-soft);
  border: 1px solid rgba(247, 223, 30, 0.22);
  color: var(--js-text);
  border-radius: 5px;
  padding: 1px 6px;
  white-space: nowrap;
}
.exp-def { border-left: 3px solid var(--js); padding-left: 14px; }
.exp-def p { font-size: 18px; }
.exp-terms { display: flex; flex-direction: column; gap: 0; }
.term-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  align-items: baseline;
}
.term-row:last-child { border-bottom: none; }
.term-name {
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--js-text);
  word-break: break-word;
}
.term-def { font-size: 16px; line-height: 1.7; color: var(--fg); }
.exp-how { border-left: 3px solid var(--border-strong); padding-left: 14px; }
.exp-warn {
  background: rgba(255, 107, 107, 0.06);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 8px;
  padding: 14px 16px;
}
.exp-warn .exp-label { color: var(--danger); }
.exp-warn ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.exp-warn li {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--fg);
  padding-left: 20px;
  position: relative;
}
.exp-warn li::before { content: "▸"; position: absolute; left: 0; color: var(--danger); }
.exp-tip {
  background: var(--js-softer);
  border: 1px solid rgba(247, 223, 30, 0.25);
  border-radius: 8px;
  padding: 14px 16px;
}
.exp-tip p { font-size: 15.5px; }
.exp-note { border-left: 3px dashed var(--border-strong); padding-left: 14px; }
.exp-note p { color: var(--fg-muted); font-size: 15px; }

/* Ligne par ligne */
.exp-lines { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.line-row {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 20px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  align-items: start;
}
.line-row:last-child { border-bottom: none; }
.line-row:nth-child(odd) { background: var(--bg-elev); }
.exp-lines .line-code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--fg);
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-width: 0;
}
.line-exp {
  min-width: 0;
  font-size: 14.5px;
  color: var(--fg-muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* ============ CODE BLOCKS ============ */
.code-block-wrapper {
  background: var(--code-bg);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  max-width: 900px;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.code-block-lang {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--js-text);
}
.code-block-copy {
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.code-block-copy:hover { color: var(--js-text); border-color: var(--js); }
.code-block-wrapper pre {
  padding: 16px 18px;
  overflow-x: auto;
}
.code-block-wrapper code, .line-code .token-comment, .code-block-wrapper code span {
  font-family: var(--font-mono);
}
.code-block-wrapper code {
  font-size: 14px;
  line-height: 1.75;
  color: var(--code-fg);
  white-space: pre;
  display: block;
}
.token-comment { color: var(--token-comment); font-style: italic; }
.token-string { color: var(--token-string); }
.token-number { color: var(--token-number); }
.token-keyword { color: var(--token-keyword); font-weight: 600; }
.token-class { color: var(--token-class); }
.token-punct { color: var(--token-punct); }

/* Console */
.console-box {
  background: var(--console-bg);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  max-width: 640px;
}
.console-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 8px 14px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.console-dots { display: inline-flex; gap: 5px; }
.console-dots i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--border-strong);
}
.console-dots i:first-child { background: #ff5f57; }
.console-dots i:nth-child(2) { background: #febc2e; }
.console-dots i:nth-child(3) { background: #28c840; }
.console-body { padding: 12px 16px; }
.console-line {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  color: #d6e2c6;
  white-space: pre-wrap;
}
:root[data-theme="light"] .console-line { color: #cfe3b8; }

/* ============ NAV ARROWS / COUNTER / HINT ============ */
.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 80;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  color: var(--fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.nav-arrow:hover { border-color: var(--js); color: var(--js-text); background: var(--js-softer); }
.nav-arrow:disabled { opacity: 0.25; pointer-events: none; }
.nav-arrow.prev { left: 14px; }
.nav-arrow.next { right: 14px; }
@media (max-width: 1023px) {
  .nav-arrow { display: none; }
}

.slide-counter {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 7px 16px;
}
.slide-counter .current { color: var(--js-text); font-weight: 600; }
.slide-counter .sep { color: var(--fg-muted); }
#slideTotal { color: var(--fg-muted); }

.scroll-hint {
  position: fixed;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  white-space: nowrap;
  color: var(--fg-muted);
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 15px;
  animation: hint-float 2.2s ease-in-out infinite;
  transition: opacity 0.4s;
}
.scroll-hint.hidden { opacity: 0; pointer-events: none; }
.scroll-hint svg { color: var(--js-text); }
@keyframes hint-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-5px); }
}

/* ============ FOOTER ============ */
.footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--border);
  margin-top: 56px;
  backdrop-filter: blur(10px);
}
.footer-inner { max-width: 1160px; margin: 0 auto; padding: 44px 22px 24px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-bottom: 30px;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; }
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 10px;
}
.footer-brand .js-logo { width: 22px; height: 22px; }
.footer-desc { font-size: 13.5px; color: var(--fg-muted); line-height: 1.7; max-width: 340px; }
.footer-heading {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 12px;
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.footer-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--js-text); }
.footer-num { font-family: var(--font-mono); font-size: 11px; color: var(--js-text); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  font-size: 12.5px;
  color: var(--fg-muted);
}
.footer-fonts { font-family: var(--font-mono); font-size: 11px; }

/* ============ BACK TO TOP ============ */
.back-to-top {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 80;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  color: var(--fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.back-to-top:hover { border-color: var(--js); color: var(--js-text); background: var(--js-softer); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1023px) {
  .topbar-brand { margin-right: 24px; }
  .topbar-tools { margin-left: 24px; }
  .topbar-actions { margin-left: 24px; }
  .slide { padding: 58px 14px 110px; }
  .slides-container { height: calc(100vh - var(--topbar-h) - 46px); margin-top: calc(var(--topbar-h) + 3px); }
  .topbar-slogan { display: none; }
  .topbar-icon-item .topbar-icon-label { display: none; }
  .topbar-badge { width: 30px; height: 30px; }
  .chapter-header-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .chapter-num { font-size: 44px; }
  .fiche-header { padding: 14px; flex-wrap: wrap; gap: 12px; }
  .fiche-badge { min-width: 54px; padding: 6px 10px; }
  .fiche-content { padding: 0 14px 18px; }
  .fiche-explain { padding: 15px; }
  .exp-label { font-size: 12px; }
  .exp p { font-size: 17px; }
  .exp-def p { font-size: 19px; }
  .exp code, .term-name code, .term-def code, .line-exp code, .exp li code {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .term-row { grid-template-columns: 1fr; gap: 4px; }
  .term-name { font-size: 15.5px; }
  .term-def { font-size: 17px; }
  .exp-warn li { font-size: 16.5px; }
  .exp-tip p { font-size: 16.5px; }
  .exp-note p { font-size: 16px; }
  .line-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .exp-lines .line-code { font-size: 14.5px; }
  .line-exp { font-size: 15.5px; }
  .code-block-lang { font-size: 11.5px; }
  .code-block-copy { font-size: 12.5px; }
  .code-block-wrapper code { font-size: 15px; }
  .console-title { font-size: 11.5px; }
  .console-line { font-size: 15px; }
  .slide-counter { bottom: 12px; }
  .scroll-hint { display: none; }
  .back-to-top { bottom: 12px; right: 12px; }
}
@media (max-width: 480px) {
  .topbar-brand { margin-right: 0; }
  .topbar-actions { margin-left: auto; }
  .brand-author { display: none; }
  .topbar-tools { display: none; }
  .hero-stats { gap: 10px; }
  .stat-card { padding: 13px 18px; min-width: 100px; }
  .stat-value { font-size: 26px; }
}
