/* ============================================================
   FORMATION IA — Design System « Nuit électrique »
   5 pages · dark premium · mesh gradients · micro-interactions
   ============================================================ */

:root {
  /* Palette */
  --bg: #070b14;
  --bg-2: #0a1120;
  --surface: rgba(20, 30, 55, .55);
  --surface-solid: #101a30;
  --border: rgba(120, 150, 220, .14);
  --border-strong: rgba(120, 150, 220, .3);
  --ink: #eef3fd;
  --muted: #a5b3d6;
  --accent: #5b8cff;
  --accent-2: #a78bfa;
  --success: #34d399;
  --warm: #fbbf24;
  --danger: #f87171;
  --grad: linear-gradient(100deg, #5b8cff 0%, #a78bfa 50%, #34d399 100%);

  /* Typo */
  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Rythme */
  --radius: 18px;
  --radius-lg: 26px;
  --ease: cubic-bezier(.25, .1, .25, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Utilitaires ---------- */
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.muted { color: var(--muted); }

/* ---------- MESH GRADIENT ANIMÉ (fond) ---------- */
.mesh {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: var(--bg);
}
.mesh::before, .mesh::after, .mesh .blob {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .22;
  will-change: transform;
}
.mesh::before {
  width: 55vw; height: 55vw;
  background: radial-gradient(circle, #5b8cff, transparent 70%);
  top: -18vw; left: -12vw;
  animation: drift1 26s var(--ease) infinite alternate;
}
.mesh::after {
  width: 48vw; height: 48vw;
  background: radial-gradient(circle, #a78bfa, transparent 70%);
  top: 24vh; right: -16vw;
  animation: drift2 32s var(--ease) infinite alternate;
}
.mesh .blob {
  width: 42vw; height: 42vw;
  background: radial-gradient(circle, #34d399, transparent 70%);
  bottom: -16vw; left: 26vw;
  animation: drift3 38s var(--ease) infinite alternate;
}
@keyframes drift1 { to { transform: translate(9vw, 7vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-8vw, 10vh) scale(.9); } }
@keyframes drift3 { to { transform: translate(6vw, -9vh) scale(1.2); } }

/* Grain subtil par-dessus */
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

/* ---------- NAVIGATION ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 11, 20, .62);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo .dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(91, 140, 255, .8);
  animation: pulse 3s var(--ease) infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 26px rgba(52, 211, 153, .9); } }
.nav-links { display: flex; gap: 26px; list-style: none; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color .2s;
  position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: -6px;
  height: 2px;
  background: var(--grad);
  border-radius: 2px;
  transition: right .25s var(--ease);
}
.nav-links a:hover::after, .nav-links a.active::after { right: 0; }
.nav-cta {
  padding: 10px 20px;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
  box-shadow: 0 4px 18px rgba(91, 140, 255, .3);
  white-space: nowrap;
}
.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(91, 140, 255, .5);
}

/* Barre de progression de scroll */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--grad);
  z-index: 60;
  border-radius: 0 3px 3px 0;
}

/* ---------- HERO ---------- */
.hero {
  min-height: 92vh;
  display: flex;
  align-items: center;
  position: relative;
  padding: 130px 0 80px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--success);
  background: rgba(52, 211, 153, .09);
  border: 1px solid rgba(52, 211, 153, .25);
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 26px;
}
.eyebrow .live {
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: blink 2s infinite;
}
@keyframes blink { 50% { opacity: .3; } }
h1 {
  font-family: var(--font-head);
  font-size: clamp(38px, 6.5vw, 68px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.03em;
}
.hero .lead {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--muted);
  max-width: 520px;
  margin-top: 24px;
}
.hero-ctas { display: flex; gap: 14px; margin-top: 38px; flex-wrap: wrap; }

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 30px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 16px;
  font-family: var(--font-body);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.btn-primary {
  background: var(--grad);
  background-size: 150% 100%;
  color: #fff;
  box-shadow: 0 6px 24px rgba(91, 140, 255, .35);
}
.btn-primary:hover {
  transform: translateY(-3px);
  background-position: 100% 0;
  box-shadow: 0 12px 36px rgba(167, 139, 250, .45);
}
.btn-ghost {
  background: rgba(20, 30, 55, .4);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--accent); }

/* ---------- CARTE HERO (terminal animé) ---------- */
.terminal {
  background: rgba(10, 16, 32, .8);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 0 1px rgba(91, 140, 255, .06), 0 0 60px rgba(91, 140, 255, .08);
  transform: rotate(1.5deg);
  transition: transform .4s var(--ease);
}
.terminal:hover { transform: rotate(0deg) scale(1.02); }
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(16, 26, 48, .6);
}
.terminal-bar i {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: block;
}
.terminal-bar i:nth-child(1) { background: #ff5f57; }
.terminal-bar i:nth-child(2) { background: #febc2e; }
.terminal-bar i:nth-child(3) { background: #28c840; }
.terminal-bar span {
  margin-left: 8px;
  font-size: 12px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}
.terminal-body {
  padding: 22px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  line-height: 2;
  min-height: 240px;
}
.terminal-body .l { opacity: 0; animation: typing .4s var(--ease) forwards; }
.terminal-body .l:nth-child(1) { animation-delay: .3s; }
.terminal-body .l:nth-child(2) { animation-delay: .9s; }
.terminal-body .l:nth-child(3) { animation-delay: 1.5s; }
.terminal-body .l:nth-child(4) { animation-delay: 2.1s; }
.terminal-body .l:nth-child(5) { animation-delay: 2.7s; }
.terminal-body .l:nth-child(6) { animation-delay: 3.3s; }
@keyframes typing { to { opacity: 1; } }
.t-ok { color: var(--success); }
.t-info { color: var(--accent); }
.t-warn { color: var(--warm); }
.t-dim { color: var(--muted); }
.cursor {
  display: inline-block;
  width: 9px; height: 16px;
  background: var(--accent);
  vertical-align: middle;
  animation: blink 1s infinite;
}

/* ---------- STATS COMPTEURS ---------- */
.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 34px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 30px;
}
.stat { text-align: center; }
.stat b {
  display: block;
  font-family: var(--font-head);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -.02em;
}
.stat span { color: var(--muted); font-size: 14px; }

/* ---------- SECTIONS ---------- */
section { padding: 96px 0; position: relative; }
.sec-head { max-width: 640px; margin-bottom: 54px; }
.sec-head.center { margin-left: auto; margin-right: auto; text-align: center; }
h2 {
  font-family: var(--font-head);
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.15;
}
.sec-head p { color: var(--muted); margin-top: 14px; font-size: 17px; }

/* ---------- TIMELINE PARCOURS ---------- */
.timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 26px; left: 10%; right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), var(--success), transparent);
  opacity: .5;
}
.tl-step { text-align: center; padding: 0 10px; position: relative; }
.tl-step .n {
  width: 52px; height: 52px;
  margin: 0 auto 18px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 20px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  position: relative;
  z-index: 1;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.tl-step:hover .n {
  transform: translateY(-6px) scale(1.08);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(91, 140, 255, .3);
}
.tl-step b { display: block; font-size: 16px; font-family: var(--font-head); }
.tl-step small { color: var(--muted); }

/* ---------- BENTO GRID MODULES ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}
.bento a { text-decoration: none; color: inherit; }
.b-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
  display: flex;
  flex-direction: column;
  min-height: 220px;
}
.b-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 0%), rgba(91, 140, 255, .12), transparent 40%);
  opacity: 0;
  transition: opacity .4s;
}
.b-card:hover::before { opacity: 1; }
.b-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
}
.b-card .tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  font-family: 'JetBrains Mono', monospace;
}
.b-card h3 {
  font-family: var(--font-head);
  font-size: 21px;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}
.b-card p { color: var(--muted); font-size: 14.5px; flex: 1; }
.b-card .meta {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.b-card .go {
  color: var(--accent);
  font-weight: 700;
  transition: transform .2s var(--ease);
  display: inline-block;
}
.b-card:hover .go { transform: translateX(5px); }
/* Placement bento (grille 6 col) */
.b-1 { grid-column: span 3; grid-row: span 2; justify-content: center; }
.b-2 { grid-column: span 3; }
.b-3 { grid-column: span 3; }
.b-4 { grid-column: span 2; }
.b-5 { grid-column: span 2; }
.b-6 { grid-column: span 2; }
.b-wide { grid-column: span 6; flex-direction: row; align-items: center; gap: 28px; }

/* ---------- COMPARATIF ---------- */
.vs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.vs-card {
  border-radius: var(--radius-lg);
  padding: 34px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(10px);
}
.vs-card.win {
  border-color: rgba(52, 211, 153, .35);
  background: linear-gradient(160deg, rgba(52, 211, 153, .07), rgba(20, 30, 55, .5) 60%);
}
.vs-card h3 {
  font-family: var(--font-head);
  font-size: 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.vs-card ul { list-style: none; }
.vs-card li {
  padding: 10px 0;
  color: var(--muted);
  font-size: 15.5px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px dashed var(--border);
}
.vs-card li:last-child { border-bottom: none; }
.vs-card li i {
  flex-shrink: 0;
  font-style: normal;
  font-weight: 800;
  width: 22px; height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 13px;
  margin-top: 2px;
}
.vs-card .no i { background: rgba(248, 113, 113, .12); color: var(--danger); }
.vs-card .yes i { background: rgba(52, 211, 153, .12); color: var(--success); }
.vs-card .yes { color: var(--ink); }

/* ---------- CARTES SYSTÈMES (page systemes) ---------- */
.sys-list { display: grid; gap: 22px; }
.sys-card {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 22px;
  align-items: start;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  transition: transform .3s var(--ease), border-color .3s;
}
.sys-card:hover { transform: translateX(6px); border-color: var(--border-strong); }
.sys-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: linear-gradient(140deg, rgba(91, 140, 255, .18), rgba(52, 211, 153, .12));
  border: 1px solid var(--border-strong);
}
.sys-card h3 { font-family: var(--font-head); font-size: 20px; margin-bottom: 6px; }
.sys-card p { color: var(--muted); font-size: 15px; }
.sys-stats { display: flex; gap: 22px; margin-top: 14px; flex-wrap: wrap; }
.sys-stats div b { font-family: var(--font-head); font-size: 22px; color: var(--accent); display: block; }
.sys-stats div span { font-size: 12.5px; color: var(--muted); }
.badge-on {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--success);
  background: rgba(52, 211, 153, .1);
  border: 1px solid rgba(52, 211, 153, .3);
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-on::before {
  content: '';
  width: 7px; height: 7px;
  background: var(--success);
  border-radius: 50%;
  animation: blink 2s infinite;
}

/* ---------- PAGE MODULE : détails ---------- */
.mod-hero { padding-top: 150px; }
.mod-hero .crumb {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}
.mod-hero .crumb:hover { color: var(--accent); }
.mod-meta { display: flex; gap: 12px; margin: 18px 0 22px; flex-wrap: wrap; }
.chip {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  background: rgba(20, 30, 55, .4);
}
.chip.hl { color: var(--accent); border-color: rgba(91, 140, 255, .4); }
.mod-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 44px 0 0;
}
.mod-nav a {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  transition: transform .25s var(--ease), border-color .25s;
}
.mod-nav a:hover { transform: translateY(-4px); border-color: var(--accent); }
.mod-nav b { display: block; font-family: var(--font-head); font-size: 15.5px; color: var(--ink); }
.mod-nav span { font-size: 13px; color: var(--muted); }

/* ---------- FAQ / accordéon ---------- */
.acc { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.acc details { border-bottom: 1px solid var(--border); }
.acc details:last-child { border-bottom: none; }
.acc summary {
  cursor: pointer;
  list-style: none;
  padding: 22px 26px;
  font-weight: 600;
  font-size: 16.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background .2s;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary:hover { background: rgba(91, 140, 255, .05); }
.acc summary::after {
  content: '+';
  font-family: var(--font-head);
  font-size: 22px;
  color: var(--accent);
  transition: transform .3s var(--ease);
}
.acc details[open] summary::after { transform: rotate(45deg); }
.acc .acc-body { padding: 0 26px 22px; color: var(--muted); font-size: 15.5px; }

/* ---------- CTA FINAL ---------- */
.cta-final {
  text-align: center;
  padding: 110px 0;
  position: relative;
}
.cta-final::before {
  content: '';
  position: absolute;
  inset: 40% 20% 0;
  background: radial-gradient(ellipse at center, rgba(91, 140, 255, .14), transparent 70%);
  filter: blur(40px);
  z-index: -1;
}
.cta-final p { color: var(--muted); max-width: 520px; margin: 16px auto 34px; font-size: 17px; }

/* ---------- FOOTER ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 44px 0;
  background: rgba(7, 11, 20, .7);
  backdrop-filter: blur(10px);
}
.foot-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
footer p { color: var(--muted); font-size: 14px; }
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ---------- REVEAL AU SCROLL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .1s; }
.reveal.d2 { transition-delay: .2s; }
.reveal.d3 { transition-delay: .3s; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .terminal { transform: none; max-width: 560px; }
  .stats-band { grid-template-columns: repeat(2, 1fr); gap: 26px; }
  .timeline { grid-template-columns: 1fr; gap: 8px; }
  .timeline::before { display: none; }
  .tl-step { display: flex; align-items: center; gap: 16px; text-align: left; }
  .tl-step .n { margin: 0; flex-shrink: 0; }
  .bento { grid-template-columns: 1fr; }
  .b-1, .b-2, .b-3, .b-4, .b-5, .b-6, .b-wide { grid-column: span 1; grid-row: auto; }
  .b-wide { flex-direction: column; align-items: flex-start; }
  .vs-grid { grid-template-columns: 1fr; }
  .sys-card { grid-template-columns: 1fr; }
  .sys-icon { width: 52px; height: 52px; font-size: 24px; }
  .mod-nav { grid-template-columns: 1fr; }
  section { padding: 64px 0; }
  .hero { padding-top: 110px; min-height: auto; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-cta { padding: 9px 16px; font-size: 13px; }
  .hero-ctas .btn { width: 100%; }
}

/* ---------- ACCESSIBILITÉ ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
/* ---------- PAGES DE CONTENU (générées par build.py) ---------- */
.doc-title { margin-top: 14px; font-size: clamp(32px, 5vw, 54px); }
.doc-title .kicker {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.doc-section { padding-top: 24px; }
.doc-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.doc-toc {
  position: sticky;
  top: 96px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13.5px;
}
.doc-toc b {
  font-family: var(--font-head);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.doc-toc ol { list-style: none; margin-top: 10px; display: grid; gap: 8px; }
.doc-toc a { color: var(--muted); text-decoration: none; line-height: 1.4; display: block; }
.doc-toc a:hover { color: var(--accent); }

.prose { max-width: 780px; font-size: 16.5px; }
.prose > * + * { margin-top: 18px; }
.prose h2 {
  font-size: clamp(24px, 3vw, 30px);
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 90px;
}
.prose h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }
.prose h3 {
  font-family: var(--font-head);
  font-size: 20px;
  margin-top: 38px;
  scroll-margin-top: 90px;
}
.prose h4 { font-size: 16.5px; margin-top: 28px; }
.prose p, .prose li { color: #c9d4ee; }
.prose strong { color: var(--ink); }
.prose a { color: var(--accent); text-underline-offset: 3px; word-break: break-word; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--accent); }
.prose code {
  font-family: 'JetBrains Mono', monospace;
  font-size: .88em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(91, 140, 255, .12);
  color: #cfdcff;
}
.prose pre {
  overflow-x: auto;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(5, 9, 18, .75);
  line-height: 1.5;
}
.prose pre code { padding: 0; background: none; font-size: 13.5px; color: #cfdcff; }
.prose pre.diagram code { color: #9fe8c9; }
.prose blockquote {
  padding: 16px 22px;
  border-left: 3px solid var(--accent-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: rgba(167, 139, 250, .08);
}
.prose blockquote p + p { margin-top: 8px; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.prose th, .prose td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.prose th {
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--ink);
  background: rgba(91, 140, 255, .08);
  white-space: nowrap;
}
.prose td { color: #c9d4ee; }
.prose tr:last-child td { border-bottom: none; }
.prose .mod-nav { margin-top: 64px; }

@media (max-width: 900px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .doc-toc { position: static; }
  .prose { font-size: 16px; }
}
