:root {
  color-scheme: dark;
  --bg: #020710;
  --panel: rgba(16, 26, 40, 0.82);
  --panel-strong: rgba(21, 34, 53, 0.96);
  --line: rgba(56, 255, 178, 0.22);
  --text: #e0f0ff;
  --muted: #8892a4;
  --accent: #38ffb2;
  --accent-2: #6ea8ff;
  --warn: #ff9f00;
  --danger: #ff4757;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.38);
  font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(56, 255, 178, 0.14), transparent 30rem),
    radial-gradient(circle at 92% 12%, rgba(110, 168, 255, 0.12), transparent 28rem),
    linear-gradient(180deg, #0a1018 0%, var(--bg) 54%, #020710 100%);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

/* Precision secondaire dans une cellule ou un paragraphe. */
.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Les liens de prose doivent se voir. La regle ci-dessus est volontairement
   neutre pour la navigation, le logo et les liens de bas de page, qui portent
   leur propre style -- mais elle rendait aussi indistinguables les 86 liens
   du corps de la documentation. On ne cible donc que le texte courant. */
.content p a,
.content li a,
.content td a,
.content figcaption a,
.content .callout a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(56, 255, 178, 0.45);
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

.content p a:hover,
.content li a:hover,
.content td a:hover,
.content figcaption a:hover,
.content .callout a:hover {
  text-decoration-color: var(--accent);
}

.content p a:focus-visible,
.content li a:focus-visible,
.content td a:focus-visible,
.content .callout a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.docs-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: rgba(5, 12, 22, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(56, 255, 178, 0.22), rgba(110, 168, 255, 0.15));
  border: 1px solid var(--line);
  box-shadow: 0 0 26px rgba(56, 255, 178, 0.18);
}

.brand-title {
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-size: 0.9rem;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 2px;
}

.search {
  width: 100%;
  border: 1px solid rgba(110, 168, 255, 0.22);
  border-radius: 12px;
  padding: 11px 12px;
  margin-bottom: 20px;
  background: rgba(7, 16, 27, 0.9);
  color: var(--text);
  outline: none;
}

.search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 255, 178, 0.12);
}

.nav-group {
  margin: 18px 0;
}

.nav-title {
  color: var(--accent);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 8px;
}

.nav-link {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Resultats de recherche : ils remplacent la navigation le temps de la
   recherche. Afficher les deux obligerait a choisir entre parcourir et
   chercher, dans une colonne deja etroite. */
.search-results { display: grid; gap: 4px; }

.search-count {
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.search-hit {
  display: grid;
  gap: 2px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.search-hit:hover {
  background: rgba(56, 255, 178, 0.06);
  border-color: rgba(56, 255, 178, 0.28);
}

.search-hit-page {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.search-hit-head {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.3;
}

.search-hit-text {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.search-empty {
  padding: 14px 11px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

/* Sous-navigation d'une page : derivee de ses <h2> par docs.js. Le trait
   vertical rattache visuellement les entrees a la page dont elles dependent. */
.nav-sub {
  display: grid;
  gap: 1px;
  margin: 2px 0 6px 14px;
  padding-left: 10px;
  border-left: 1px solid rgba(56, 255, 178, 0.2);
}

.nav-sublink {
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-sublink:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-sublink.current {
  color: var(--accent);
  background: rgba(56, 255, 178, 0.08);
}


.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: rgba(56, 255, 178, 0.1);
}

.content {
  max-width: 1120px;
  width: 100%;
  padding: 36px clamp(20px, 4vw, 64px) 80px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 34px;
}

.back-link {
  color: var(--muted);
  border: 1px solid rgba(110, 168, 255, 0.18);
  padding: 9px 12px;
  border-radius: 999px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(56, 255, 178, 0.08);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero {
  padding: clamp(26px, 4vw, 46px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(13, 27, 43, 0.94), rgba(5, 14, 26, 0.78));
  box-shadow: var(--shadow);
}

h1 {
  margin: 14px 0 14px;
  font-size: clamp(2.3rem, 5vw, 4.7rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

h2 {
  margin: 44px 0 14px;
  font-size: clamp(1.55rem, 2.6vw, 2.25rem);
  letter-spacing: -0.03em;
}

h3 {
  margin: 24px 0 10px;
  font-size: 1.08rem;
}

p {
  color: var(--muted);
  line-height: 1.72;
}

.lead {
  font-size: 1.12rem;
  max-width: 780px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.card {
  border: 1px solid rgba(110, 168, 255, 0.18);
  border-radius: 18px;
  background: var(--panel);
  padding: 18px;
}

.card strong {
  display: block;
  margin-bottom: 8px;
}

.callout {
  border-left: 3px solid var(--accent);
  background: rgba(56, 255, 178, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 20px 0;
}

.warning {
  border-left-color: var(--warn);
  background: rgba(255, 159, 0, 0.08);
}

.danger {
  border-left-color: var(--danger);
  background: rgba(255, 71, 87, 0.08);
}

.steps {
  counter-reset: step;
  display: grid;
  gap: 12px;
  margin: 18px 0;
  padding: 0;
}

.step {
  list-style: none;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid rgba(110, 168, 255, 0.16);
  border-radius: 16px;
  background: rgba(12, 24, 38, 0.58);
}

.step::before {
  counter-increment: step;
  content: counter(step);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #03100d;
  font-weight: 900;
}

.screenshot {
  margin: 22px 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(56, 255, 178, 0.25);
  box-shadow: var(--shadow);
  background: #02060b;
}

.screenshot img {
  display: block;
  width: 100%;
}

/* Une capture de fenetre complete s'affiche a environ la moitie de sa taille
   native dans la colonne : son texte devient illisible. Le lien vers le fichier
   d'origine rend le detail consultable sans sortir de la page. */
/* Enfant direct uniquement : c'est l'ancre qui enveloppe l'image. Ecrit
   `.screenshot a`, la regle attrapait aussi les liens de texte places dans la
   legende, qui passaient en bloc et prenaient le curseur loupe -- la
   ponctuation qui suit le lien se retrouvait alors seule sur sa ligne. */
.screenshot > a {
  display: block;
  cursor: zoom-in;
}

/* Capture d'une zone d'interface (menu, panneau isole) et non d'un ecran
   complet : on borne la largeur pour ne pas l'etirer au-dela de sa taille
   native, sinon le rendu devient flou et disproportionne. */
.screenshot.screenshot-inset {
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* Panneau de reglages detache (colonne de proprietes, popup de configuration).
   Plus large que .screenshot-inset pour que les libelles restent lisibles,
   mais nettement plus etroit qu'une capture d'ecran complete. */
.screenshot.screenshot-panel {
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Reperes numerotes sur une capture ────────────────────────────────────
   Meme principe que la demo interactive de la page d'accueil : un point
   numerote positionne en % sur l'image, qui ouvre une bulle d'explication au
   clic. Les positions sont portees par un style inline sur chaque repere. */
/* overflow visible : les bulles doivent pouvoir depasser du cadre. L'arrondi
   des coins, normalement obtenu par overflow:hidden, est donc reporte sur
   l'image elle-meme. */
.screenshot.hotspot-frame { position: relative; overflow: visible; }
.screenshot.hotspot-frame img { border-radius: inherit; }

.hotspot {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7dffd0, var(--accent));
  color: #020710;
  font-weight: 900;
  font-size: 0.78rem;
  font-family: 'Cascadia Mono', Consolas, monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid rgba(2, 7, 16, 0.55);
  box-shadow: 0 0 0 4px rgba(56, 255, 178, 0.18), 0 0 14px rgba(56, 255, 178, 0.35);
  transform: translate(-50%, -50%);
  z-index: 5;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hotspot::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1.5px solid rgba(56, 255, 178, 0.55);
  animation: hotspot-ping 2.4s cubic-bezier(0.2, 0.7, 0.4, 1) infinite;
}

@keyframes hotspot-ping {
  0% { transform: scale(0.7); opacity: 0.9; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* La pastille elle-meme respire, en plus de l'anneau qui se propage : sur une
   capture chargee, l'anneau seul passait inapercu. */
@keyframes hotspot-blink {
  0%, 100% { box-shadow: 0 0 0 4px rgba(56, 255, 178, 0.18), 0 0 14px rgba(56, 255, 178, 0.35); }
  50%      { box-shadow: 0 0 0 7px rgba(56, 255, 178, 0.34), 0 0 24px rgba(56, 255, 178, 0.65); }
}

.hotspot { animation: hotspot-blink 2.4s ease-in-out infinite; }

/* ── Reperes numerotes sur une capture ────────────────────────────────────
   Meme principe que la demo interactive de la page d'accueil : un point
   numerote positionne en % sur l'image, qui ouvre une bulle d'explication au
   clic. Les positions sont portees par un style inline sur chaque repere. */
.screenshot.hotspot-frame { position: relative; overflow: visible; }

.hotspot {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7dffd0, var(--accent));
  color: #020710;
  font-weight: 900;
  font-size: 0.78rem;
  font-family: 'Cascadia Mono', Consolas, monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid rgba(2, 7, 16, 0.55);
  box-shadow: 0 0 0 4px rgba(56, 255, 178, 0.18), 0 0 14px rgba(56, 255, 178, 0.35);
  transform: translate(-50%, -50%);
  z-index: 5;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hotspot::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1.5px solid rgba(56, 255, 178, 0.55);
  animation: hotspot-ping 2.4s cubic-bezier(0.2, 0.7, 0.4, 1) infinite;
}

@keyframes hotspot-ping {
  0% { transform: scale(0.7); opacity: 0.9; }
  100% { transform: scale(1.9); opacity: 0; }
}

.hotspot:hover,
.hotspot.active {
  box-shadow: 0 0 0 5px rgba(56, 255, 178, 0.3), 0 0 20px rgba(56, 255, 178, 0.5);
  transform: translate(-50%, -50%) scale(1.12);
}

.hotspot-bubble {
  position: absolute;
  z-index: 6;
  width: 250px;
  max-width: 78vw;
  padding: 13px 15px;
  border-radius: 12px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), 0 0 20px rgba(56, 255, 178, 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hotspot-bubble.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.hotspot-bubble strong { display: block; font-size: 0.85rem; color: var(--accent); margin-bottom: 5px; }
.hotspot-bubble p { margin: 0; font-size: 0.8rem; color: var(--muted); line-height: 1.55; }

.hotspot-hint {
  margin: 8px 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Sous 900px la capture devient trop petite pour viser un repere : on masque
   les points et la liste numerotee sous l'image prend le relais. */
@media (max-width: 900px) {
  .hotspot, .hotspot-bubble, .hotspot-hint { display: none; }
}

.screenshot-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 22px 0;
}

.screenshot-gallery .screenshot {
  margin: 0;
}

.screenshot figcaption {
  padding: 10px 14px;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid rgba(56, 255, 178, 0.18);
}

code {
  padding: 2px 6px;
  border-radius: 7px;
  background: rgba(110, 168, 255, 0.12);
  color: #d7e7ff;
}

h4 {
  margin: 22px 0 8px;
  font-size: 0.98rem;
  color: #e8f3ff;
}

kbd {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(215, 231, 255, 0.28);
  border-bottom-width: 2px;
  background: rgba(255, 255, 255, 0.06);
  color: #e8f3ff;
  font-family: 'Cascadia Mono', 'Consolas', monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: nowrap;
}

pre {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(110, 168, 255, 0.22);
  background: rgba(9, 16, 30, 0.72);
  overflow-x: auto;
}

pre code {
  padding: 0;
  background: none;
  font-family: 'Cascadia Mono', 'Consolas', monospace;
  font-size: 0.9rem;
  white-space: pre;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  overflow: hidden;
  border-radius: 16px;
}

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(110, 168, 255, 0.12);
  color: var(--muted);
}

th {
  color: var(--text);
  background: rgba(56, 255, 178, 0.09);
}

.footer-nav {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 54px;
}

.footer-nav a {
  flex: 1;
  border: 1px solid rgba(110, 168, 255, 0.18);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--muted);
  background: var(--panel);
}

.footer-nav a:last-child {
  text-align: right;
}

.mobile-menu {
  display: none;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
}

@media (max-width: 900px) {
  .docs-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    z-index: 20;
    inset: 0 auto 0 0;
    width: min(86vw, 320px);
    transform: translateX(-104%);
    transition: transform 0.2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-flex; }
  .grid { grid-template-columns: 1fr; }
  .screenshot-gallery { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
}
