/* ==========================================================================
   π — L'infini apprivoisé
   Feuille de style unique du site. Aucune dépendance externe : le site
   fonctionne hors ligne, même ouvert directement depuis le disque.

   Sommaire
     01. Variables & thème
     02. Réinitialisation
     03. Typographie
     04. Mise en page
     05. En-tête & navigation
     06. Héros
     07. Boutons & pastilles
     08. Cartes
     09. Chiffres clés
     10. Frise chronologique
     11. Anecdotes
     12. Laboratoire (formulaires, curseurs, onglets, canvas)
     13. Quiz
     14. Tableaux
     15. Pied de page
     16. Pluie de chiffres & animations
     17. Accessibilité, mouvement réduit, impression
     18. Responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. Variables & thème
   -------------------------------------------------------------------------- */
:root {
  --nuit:        #05070f;
  --nuit-2:      #080c1a;
  --surface:     rgba(255, 255, 255, 0.035);
  --surface-2:   rgba(255, 255, 255, 0.06);
  --bordure:     rgba(255, 255, 255, 0.09);
  --bordure-vive:rgba(255, 255, 255, 0.18);

  --texte:       #e9edf9;
  --texte-doux:  #a7b0cc;
  --texte-faible: #6f7899;

  --or:          #f0c25c;
  --or-sombre:   #c8952f;
  --menthe:      #4fe3c1;
  --violet:      #8f7bf7;
  --corail:      #ff7a8a;

  --rayon:       18px;
  --rayon-sm:    12px;
  --rayon-pilule: 999px;

  --ombre:       0 18px 50px -20px rgba(0, 0, 0, 0.9);
  --ombre-douce: 0 8px 30px -18px rgba(0, 0, 0, 0.8);

  --police-titre: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --police-texte: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --police-chiffres: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --largeur:     1140px;
  --entete-h:    68px;
}

/* --------------------------------------------------------------------------
   02. Réinitialisation
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--entete-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--nuit);
  color: var(--texte);
  font-family: var(--police-texte);
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Halo d'ambiance : deux nappes de couleur très diffuses. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 620px at 12% -8%, rgba(143, 123, 247, 0.20), transparent 65%),
    radial-gradient(880px 640px at 92% 4%, rgba(79, 227, 193, 0.14), transparent 62%),
    radial-gradient(700px 700px at 50% 108%, rgba(240, 194, 92, 0.10), transparent 66%),
    linear-gradient(180deg, var(--nuit) 0%, var(--nuit-2) 55%, var(--nuit) 100%);
  pointer-events: none;
}

img, svg, canvas { max-width: 100%; display: block; }

a { color: var(--menthe); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--or);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: rgba(240, 194, 92, 0.3); color: #fff; }

/* --------------------------------------------------------------------------
   03. Typographie
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--police-titre);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

strong { color: #fff; font-weight: 650; }
em { color: var(--or); font-style: italic; }

code, kbd, samp {
  font-family: var(--police-chiffres);
  font-size: 0.92em;
}

code {
  background: var(--surface-2);
  border: 1px solid var(--bordure);
  border-radius: 6px;
  padding: 0.12em 0.42em;
  color: #d9e2ff;
}

kbd {
  background: var(--surface-2);
  border: 1px solid var(--bordure-vive);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.1em 0.45em;
  font-size: 0.82em;
  color: var(--texte);
}

blockquote {
  margin: 0;
  padding: 1.2rem 1.4rem 1.2rem 1.6rem;
  border-left: 3px solid var(--or);
  background: var(--surface);
  border-radius: 0 var(--rayon-sm) var(--rayon-sm) 0;
  font-family: var(--police-titre);
  font-size: 1.12rem;
  color: #f3f6ff;
}

blockquote footer {
  margin-top: 0.7rem;
  font-family: var(--police-texte);
  font-size: 0.85rem;
  color: var(--texte-faible);
}

.filigrane {
  font-family: var(--police-titre);
  font-size: clamp(7rem, 22vw, 16rem);
  line-height: 0.8;
  background: linear-gradient(160deg, var(--or) 0%, #fff 45%, var(--menthe) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
}

/* Petites étiquettes de section */
.surtitre {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--police-chiffres);
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--menthe);
  margin-bottom: 1rem;
}
.surtitre::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.chapeau {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--texte-doux);
  max-width: 62ch;
}

/* --------------------------------------------------------------------------
   04. Mise en page
   -------------------------------------------------------------------------- */
.conteneur {
  width: min(100% - 2.4rem, var(--largeur));
  margin-inline: auto;
}

.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section--serree { padding: clamp(2.2rem, 5vw, 3.5rem) 0; }
.section--bordee { border-top: 1px solid var(--bordure); }

.entete-section { max-width: 70ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.entete-section--centre { margin-inline: auto; text-align: center; }
.entete-section--centre .chapeau { margin-inline: auto; }

.grille { display: grid; gap: 1.2rem; }
.grille--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grille--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grille--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.traits { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; align-items: center; }
.pile > * + * { margin-top: var(--espace, 1rem); }

.centre { text-align: center; }
.doux { color: var(--texte-doux); }
.faible { color: var(--texte-faible); }
.mono { font-family: var(--police-chiffres); }
.or { color: var(--or); }
.menthe { color: var(--menthe); }
.violet { color: var(--violet); }
.petit { font-size: 0.86rem; }
.mini { font-size: 0.78rem; }

/* --------------------------------------------------------------------------
   05. En-tête & navigation
   -------------------------------------------------------------------------- */
.entete {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--entete-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(5, 7, 15, 0.62);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.entete.est-collee {
  background: rgba(5, 7, 15, 0.88);
  border-bottom-color: var(--bordure);
}

.entete .conteneur {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.marque {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--texte);
  font-family: var(--police-titre);
  font-size: 1.12rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.marque:hover { text-decoration: none; }
.marque__pi {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(150deg, rgba(240, 194, 92, 0.22), rgba(79, 227, 193, 0.16));
  border: 1px solid var(--bordure-vive);
  font-size: 1.25rem;
  color: var(--or);
}
.marque small { display: block; font-family: var(--police-chiffres); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--texte-faible); }

.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav a {
  color: var(--texte-doux);
  font-size: 0.92rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--rayon-pilule);
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav a:hover { color: var(--texte); background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--nuit); background: var(--or); font-weight: 600; }

.burger {
  display: none;
  width: 42px; height: 42px;
  border-radius: 11px;
  border: 1px solid var(--bordure);
  background: var(--surface);
  color: var(--texte);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
}
.burger span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform 0.25s ease, opacity 0.25s ease; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   06. Héros
   -------------------------------------------------------------------------- */
.heros {
  position: relative;
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(3rem, 7vw, 5.5rem);
  overflow: hidden;
}
.heros__grille {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.heros h1 { margin-bottom: 0.6rem; }
.heros h1 .degrade {
  display: block;
  background: linear-gradient(120deg, var(--or) 0%, #fff 40%, var(--menthe) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.heros__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.9rem; }

.heros__pi {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
}
.heros__pi .filigrane {
  filter: drop-shadow(0 26px 60px rgba(240, 194, 92, 0.22));
  animation: flotter 7s ease-in-out infinite;
}
.heros__debut {
  margin-top: 0.4rem;
  font-family: var(--police-chiffres);
  font-size: clamp(0.72rem, 1.6vw, 0.95rem);
  color: var(--texte-doux);
  word-break: break-all;
  max-width: 30ch;
  text-align: center;
  line-height: 1.9;
}
.heros__debut b { color: var(--or); font-weight: 500; }

/* Bandeau défilant de décimales */
.ruban {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--bordure);
  border-bottom: 1px solid var(--bordure);
  padding: 0.7rem 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ruban__piste {
  display: flex;
  width: max-content;
  gap: 3rem;
  font-family: var(--police-chiffres);
  font-size: 0.9rem;
  letter-spacing: 0.24em;
  color: var(--texte-faible);
  white-space: nowrap;
  animation: defiler 60s linear infinite;
}
.ruban__piste span b { color: var(--or); font-weight: 500; }

/* --------------------------------------------------------------------------
   07. Boutons & pastilles
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.35rem;
  border-radius: var(--rayon-pilule);
  border: 1px solid var(--bordure-vive);
  background: var(--surface-2);
  color: var(--texte);
  font-size: 0.94rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-2px); background: rgba(255,255,255,0.1); text-decoration: none; border-color: var(--bordure-vive); }
.btn:active { transform: translateY(0); }
.btn--or {
  background: linear-gradient(135deg, var(--or) 0%, #ffdf9a 100%);
  color: #241a04;
  border-color: transparent;
  font-weight: 650;
  box-shadow: 0 14px 34px -16px rgba(240, 194, 92, 0.8);
}
.btn--or:hover { background: linear-gradient(135deg, #ffd478 0%, #fff0c8 100%); }
.btn--menthe {
  background: linear-gradient(135deg, var(--menthe) 0%, #a9f5e2 100%);
  color: #04241d;
  border-color: transparent;
  font-weight: 650;
}
.btn--discret { background: transparent; }
.btn--petit { padding: 0.5rem 0.95rem; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

.pastille {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.7rem;
  border-radius: var(--rayon-pilule);
  border: 1px solid var(--bordure);
  background: var(--surface);
  font-size: 0.76rem;
  font-family: var(--police-chiffres);
  letter-spacing: 0.06em;
  color: var(--texte-doux);
  text-transform: uppercase;
}
.pastille--or { color: var(--or); border-color: rgba(240, 194, 92, 0.35); background: rgba(240, 194, 92, 0.08); }
.pastille--menthe { color: var(--menthe); border-color: rgba(79, 227, 193, 0.32); background: rgba(79, 227, 193, 0.08); }
.pastille--violet { color: var(--violet); border-color: rgba(143, 123, 247, 0.35); background: rgba(143, 123, 247, 0.1); }

/* --------------------------------------------------------------------------
   08. Cartes
   -------------------------------------------------------------------------- */
.carte {
  position: relative;
  padding: clamp(1.2rem, 2.4vw, 1.7rem);
  border-radius: var(--rayon);
  border: 1px solid var(--bordure);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--ombre-douce);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}
.carte--survol:hover {
  transform: translateY(-4px);
  border-color: var(--bordure-vive);
  box-shadow: var(--ombre);
}
.carte--lien { display: block; color: inherit; }
.carte--lien:hover { text-decoration: none; }
.carte--lien::after {
  content: "→";
  position: absolute;
  right: 1.3rem;
  bottom: 1.1rem;
  color: var(--or);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.carte--lien:hover::after { opacity: 1; transform: translateX(0); }

.carte__icone {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 13px;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  background: rgba(240, 194, 92, 0.12);
  border: 1px solid rgba(240, 194, 92, 0.25);
  color: var(--or);
}
.carte__icone--menthe { background: rgba(79, 227, 193, 0.12); border-color: rgba(79, 227, 193, 0.25); color: var(--menthe); }
.carte__icone--violet { background: rgba(143, 123, 247, 0.14); border-color: rgba(143, 123, 247, 0.3); color: var(--violet); }
.carte h3 { margin-bottom: 0.4rem; }
.carte p { color: var(--texte-doux); font-size: 0.94rem; }

.carte--formule { text-align: center; }
.carte--formule .formule {
  font-family: var(--police-titre);
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  color: #fff;
  margin: 0.4rem 0 0.7rem;
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   09. Chiffres clés
   -------------------------------------------------------------------------- */
.cles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--bordure);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  overflow: hidden;
}
.cle {
  background: var(--nuit-2);
  padding: 1.4rem 1.2rem;
  text-align: center;
}
.cle__valeur {
  display: block;
  font-family: var(--police-titre);
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  color: var(--or);
  line-height: 1.1;
}
.cle__valeur small { font-size: 0.5em; color: var(--texte-doux); }
.cle__label {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--texte-faible);
}

/* Compte à rebours */
.compte {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: stretch;
}
.compte__bloc {
  flex: 1 1 90px;
  padding: 1rem 0.6rem;
  text-align: center;
  border-radius: var(--rayon-sm);
  border: 1px solid var(--bordure);
  background: var(--surface);
}
.compte__val {
  display: block;
  font-family: var(--police-chiffres);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  color: #fff;
}
.compte__lab { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--texte-faible); }

/* Bandeau de mise en avant */
.bandeau {
  border: 1px solid rgba(240, 194, 92, 0.3);
  background: linear-gradient(120deg, rgba(240, 194, 92, 0.12), rgba(143, 123, 247, 0.10));
  border-radius: var(--rayon);
  padding: clamp(1.4rem, 3vw, 2.2rem);
}

/* --------------------------------------------------------------------------
   10. Frise chronologique
   -------------------------------------------------------------------------- */
.frise {
  position: relative;
  margin-top: 1rem;
  padding-left: 2.2rem;
}
.frise::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--or), var(--violet), var(--menthe), transparent);
  opacity: 0.55;
}
.frise__item {
  position: relative;
  padding: 0 0 2.2rem 0;
}
.frise__item::before {
  content: "";
  position: absolute;
  left: -2.2rem;
  top: 0.55rem;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--nuit);
  border: 2px solid var(--or);
  box-shadow: 0 0 0 4px rgba(240, 194, 92, 0.12);
}
.frise__item--menthe::before { border-color: var(--menthe); box-shadow: 0 0 0 4px rgba(79, 227, 193, 0.12); }
.frise__item--violet::before { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(143, 123, 247, 0.12); }
.frise__item--moderne::before { border-color: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.14); }

.frise__quand {
  font-family: var(--police-chiffres);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--or);
}
.frise__item--menthe .frise__quand { color: var(--menthe); }
.frise__item--violet .frise__quand { color: var(--violet); }
.frise__titre { margin: 0.15rem 0 0.35rem; font-size: 1.2rem; }
.frise__texte { color: var(--texte-doux); font-size: 0.95rem; margin: 0; max-width: 74ch; }
.frise__note {
  display: inline-block;
  margin-top: 0.55rem;
  font-family: var(--police-chiffres);
  font-size: 0.85rem;
  color: var(--or);
  background: rgba(240, 194, 92, 0.1);
  border: 1px solid rgba(240, 194, 92, 0.22);
  border-radius: var(--rayon-pilule);
  padding: 0.15rem 0.7rem;
}

.jalon {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--bordure);
}
.jalon__an {
  flex: 0 0 82px;
  font-family: var(--police-chiffres);
  color: var(--or);
  font-size: 0.9rem;
}
.jalon__txt { color: var(--texte-doux); font-size: 0.92rem; }

/* --------------------------------------------------------------------------
   11. Anecdotes
   -------------------------------------------------------------------------- */
.colonnes-2 { columns: 2; column-gap: 1.2rem; }
@media (max-width: 760px) { .colonnes-2 { columns: 1; } }

.anecdote {
  break-inside: avoid;
  margin-bottom: 1.2rem;
  padding: 1.3rem 1.4rem;
  border-radius: var(--rayon);
  border: 1px solid var(--bordure);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.anecdote__num {
  font-family: var(--police-chiffres);
  font-size: 0.78rem;
  color: var(--menthe);
  letter-spacing: 0.14em;
}
.anecdote h3 { margin: 0.2rem 0 0.5rem; font-size: 1.1rem; }
.anecdote p { font-size: 0.94rem; color: var(--texte-doux); }
.anecdote--or { border-left: 3px solid var(--or); }
.anecdote--menthe { border-left: 3px solid var(--menthe); }
.anecdote--violet { border-left: 3px solid var(--violet); }

.poesie {
  font-family: var(--police-titre);
  font-size: 1.02rem;
  line-height: 2;
  color: #f2f5ff;
  white-space: pre-line;
  margin: 0.6rem 0;
}
.poesie mark {
  background: rgba(240, 194, 92, 0.16);
  color: var(--or);
  border-radius: 4px;
  padding: 0 0.2em;
}

.citation-carte {
  position: relative;
  padding: 1.6rem 1.6rem 1.4rem;
  border-radius: var(--rayon);
  border: 1px solid var(--bordure);
  background: linear-gradient(135deg, rgba(143, 123, 247, 0.14), rgba(79, 227, 193, 0.08));
}
.citation-carte::before {
  content: "“";
  position: absolute;
  top: -0.2rem;
  left: 1rem;
  font-family: var(--police-titre);
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.14);
}
.citation-carte p { font-family: var(--police-titre); font-size: 1.08rem; color: #f4f7ff; }

/* --------------------------------------------------------------------------
   12. Laboratoire
   -------------------------------------------------------------------------- */
.onglets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.4rem;
  border-radius: var(--rayon-pilule);
  border: 1px solid var(--bordure);
  background: var(--surface);
  margin-bottom: 1.6rem;
}
.onglet {
  flex: 1 1 auto;
  padding: 0.55rem 0.95rem;
  border: 0;
  border-radius: var(--rayon-pilule);
  background: transparent;
  color: var(--texte-doux);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}
.onglet:hover { color: var(--texte); background: var(--surface-2); }
.onglet[aria-selected="true"] { background: var(--or); color: #241a04; font-weight: 650; }

.panneau[hidden] { display: none; }
.panneau { animation: apparaitre 0.35s ease both; }

.labo {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
}
.labo--inverse { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); }
@media (max-width: 900px) { .labo, .labo--inverse { grid-template-columns: 1fr; } }

.pupitre {
  padding: 1.3rem;
  border-radius: var(--rayon);
  border: 1px solid var(--bordure);
  background: var(--surface);
}
.pupitre h3 { font-size: 1.05rem; }

.champ { display: block; margin-bottom: 1rem; }
.champ__label {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--texte-faible);
  margin-bottom: 0.35rem;
}
input[type="text"],
input[type="number"],
input[type="search"],
select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: var(--rayon-sm);
  border: 1px solid var(--bordure-vive);
  background: rgba(4, 6, 14, 0.7);
  color: var(--texte);
  font-family: var(--police-chiffres);
  font-size: 0.98rem;
}
input::placeholder { color: var(--texte-faible); }
select { cursor: pointer; }

input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--or), var(--menthe));
  outline-offset: 6px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--or);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--or);
  cursor: pointer;
}

.range-ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.range-ligne output { font-family: var(--police-chiffres); color: var(--or); font-size: 0.95rem; }

.resultat {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}
.resultat__case {
  flex: 1 1 120px;
  padding: 0.8rem;
  border-radius: var(--rayon-sm);
  border: 1px solid var(--bordure);
  background: rgba(4, 6, 14, 0.5);
}
.resultat__lab { display: block; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--texte-faible); }
.resultat__val { display: block; font-family: var(--police-chiffres); font-size: 1.15rem; color: #fff; word-break: break-all; }
.resultat__val--or { color: var(--or); }

.toile {
  position: relative;
  border-radius: var(--rayon);
  border: 1px solid var(--bordure);
  background: radial-gradient(circle at 50% 40%, rgba(143, 123, 247, 0.10), rgba(4, 6, 14, 0.85) 70%);
  overflow: hidden;
}
.toile canvas { width: 100%; height: auto; display: block; }
.toile__coin {
  position: absolute;
  top: 0.6rem; right: 0.8rem;
  font-family: var(--police-chiffres);
  font-size: 0.78rem;
  color: var(--texte-doux);
  background: rgba(4, 6, 14, 0.6);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-pilule);
  padding: 0.15rem 0.6rem;
}

.defilement-chiffres {
  font-family: var(--police-chiffres);
  font-size: 0.95rem;
  line-height: 1.95;
  letter-spacing: 0.06em;
  color: #dfe6ff;
  word-break: break-all;
  background: rgba(4, 6, 14, 0.65);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-sm);
  padding: 1rem;
  max-height: 320px;
  overflow: auto;
}
.defilement-chiffres b { color: var(--or); background: rgba(240, 194, 92, 0.16); border-radius: 3px; padding: 0 2px; }
.defilement-chiffres i { color: var(--menthe); font-style: normal; }
.defilement-chiffres u { color: var(--corail); text-decoration: none; font-weight: 700; }

.occurrence {
  display: flex;
  gap: 0.8rem;
  align-items: baseline;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--bordure);
  font-size: 0.9rem;
}
.occurrence__pos { flex: 0 0 auto; font-family: var(--police-chiffres); color: var(--or); }
.occurrence__ctx { font-family: var(--police-chiffres); color: var(--texte-doux); word-break: break-all; }

.jauge {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
  border: 1px solid var(--bordure);
}
.jauge__barre {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--menthe), var(--or));
  transition: width 0.5s ease;
}

.barres { display: grid; gap: 0.35rem; }
.barre { display: grid; grid-template-columns: 1.6rem 1fr 4.5rem; align-items: center; gap: 0.6rem; font-size: 0.82rem; }
.barre__piste { height: 14px; border-radius: 6px; background: rgba(255,255,255,0.06); overflow: hidden; }
.barre__remplissage { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--violet), var(--menthe)); transition: width 0.6s ease; }
.barre__val { font-family: var(--police-chiffres); color: var(--texte-doux); text-align: right; }
.barre__chiffre { font-family: var(--police-chiffres); color: var(--or); }

.jeu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-family: var(--police-chiffres);
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  margin: 0.5rem 0 1rem;
}
.jeu span { padding: 0.1rem 0.25rem; border-radius: 6px; }
.jeu span.fait { color: var(--menthe); background: rgba(79, 227, 193, 0.12); }
.jeu span.erreur { color: var(--corail); background: rgba(255, 122, 138, 0.16); }
.jeu span.courant { border-bottom: 2px solid var(--or); color: #fff; animation: clignote 1.1s ease-in-out infinite; }

/* --------------------------------------------------------------------------
   13. Quiz
   -------------------------------------------------------------------------- */
.quiz { max-width: 800px; margin-inline: auto; }
.quiz__entete { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.6rem; font-family: var(--police-chiffres); font-size: 0.85rem; color: var(--texte-doux); }
.question {
  padding: clamp(1.3rem, 3vw, 2rem);
  border-radius: var(--rayon);
  border: 1px solid var(--bordure);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--ombre-douce);
}
.question__texte { font-family: var(--police-titre); font-size: clamp(1.15rem, 2.4vw, 1.5rem); margin-bottom: 1.2rem; }
.reponses { display: grid; gap: 0.6rem; }
.reponse {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: var(--rayon-sm);
  border: 1px solid var(--bordure-vive);
  background: rgba(4, 6, 14, 0.5);
  color: var(--texte);
  font-family: inherit;
  font-size: 0.96rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.reponse:hover:not(:disabled) { border-color: var(--or); background: rgba(240, 194, 92, 0.08); transform: translateX(3px); }
.reponse__lettre {
  flex: 0 0 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-2);
  font-family: var(--police-chiffres);
  font-size: 0.85rem;
  color: var(--texte-doux);
}
.reponse.est-bonne { border-color: var(--menthe); background: rgba(79, 227, 193, 0.12); }
.reponse.est-bonne .reponse__lettre { background: var(--menthe); color: #04241d; }
.reponse.est-fausse { border-color: var(--corail); background: rgba(255, 122, 138, 0.1); }
.reponse.est-fausse .reponse__lettre { background: var(--corail); color: #2b0409; }
.reponse:disabled { cursor: default; }

.explication {
  margin-top: 1rem;
  padding: 0.95rem 1.05rem;
  border-radius: var(--rayon-sm);
  border-left: 3px solid var(--menthe);
  background: rgba(79, 227, 193, 0.07);
  font-size: 0.92rem;
  color: var(--texte-doux);
}
.explication strong { color: var(--menthe); }

.quiz__pied { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.4rem; flex-wrap: wrap; }

.score-final { text-align: center; padding: clamp(1.6rem, 4vw, 3rem); }
.score-final__nombre { font-family: var(--police-titre); font-size: clamp(3rem, 10vw, 5.5rem); color: var(--or); line-height: 1; }
.score-final__mention { font-size: 1.1rem; color: var(--texte-doux); margin-top: 0.6rem; }

/* --------------------------------------------------------------------------
   14. Tableaux
   -------------------------------------------------------------------------- */
.tableau-enveloppe { overflow-x: auto; border: 1px solid var(--bordure); border-radius: var(--rayon); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 520px; }
caption { caption-side: top; text-align: left; padding: 0.9rem 1rem; color: var(--texte-faible); font-size: 0.82rem; }
th, td { padding: 0.7rem 1rem; text-align: left; border-bottom: 1px solid var(--bordure); }
th { font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--texte-faible); font-weight: 600; background: rgba(255,255,255,0.03); }
tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody tr:last-child td { border-bottom: 0; }
td.mono, th.mono { font-family: var(--police-chiffres); }

/* --------------------------------------------------------------------------
   15. Pied de page
   -------------------------------------------------------------------------- */
.pied {
  border-top: 1px solid var(--bordure);
  padding: 3rem 0 2rem;
  margin-top: 2rem;
  background: rgba(4, 6, 14, 0.5);
}
.pied__grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}
.pied h4 { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--texte-faible); }
.pied ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.pied a { color: var(--texte-doux); font-size: 0.9rem; }
.pied a:hover { color: var(--or); }
.pied__bas {
  margin-top: 2.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--bordure);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--texte-faible);
}
.pied__chiffres {
  font-family: var(--police-chiffres);
  font-size: 0.72rem;
  color: var(--texte-faible);
  letter-spacing: 0.1em;
  word-break: break-all;
  opacity: 0.75;
}

/* --------------------------------------------------------------------------
   16. Pluie de chiffres & animations
   -------------------------------------------------------------------------- */
#pluie {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.5;
  pointer-events: none;
}

.revele { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.revele.est-visible { opacity: 1; transform: none; }

@keyframes flotter {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-14px) rotate(1deg); }
}
@keyframes defiler {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes apparaitre {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes clignote {
  0%, 100% { border-color: var(--or); }
  50%      { border-color: transparent; }
}

/* --------------------------------------------------------------------------
   17. Accessibilité, mouvement réduit, impression
   -------------------------------------------------------------------------- */
.lien-evitement {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  border-radius: var(--rayon-sm);
  background: var(--or);
  color: #241a04;
  font-weight: 600;
  transition: top 0.2s ease;
}
.lien-evitement:focus { top: 0.7rem; text-decoration: none; }

.lecteur-ecran,
.visuellement-cache {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .revele { opacity: 1; transform: none; }
  #pluie { display: none; }
}

@media print {
  body::before, #pluie, .entete, .ruban { display: none !important; }
  body { background: #fff; color: #111; }
  .carte, .anecdote, .question { border-color: #ccc; background: #fff; box-shadow: none; }
}

/* --------------------------------------------------------------------------
   18. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .heros__grille { grid-template-columns: 1fr; }
  .heros__pi { order: -1; min-height: 190px; }
  .heros__debut { max-width: 44ch; }
}

@media (max-width: 860px) {
  .burger { display: inline-flex; }
  .nav {
    position: absolute;
    top: var(--entete-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    padding: 0.9rem;
    background: rgba(5, 7, 15, 0.97);
    border-bottom: 1px solid var(--bordure);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transform: translateY(-12px);
    opacity: 0;
    /* visibility:hidden retire aussi les liens de l'ordre de tabulation
       tant que le menu est fermé (accessibilité clavier). */
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
    max-height: calc(100vh - var(--entete-h));
    overflow-y: auto;
  }
  .nav.est-ouvert { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }
  .nav a { padding: 0.75rem 0.9rem; border-radius: var(--rayon-sm); font-size: 0.98rem; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .conteneur { width: min(100% - 1.6rem, var(--largeur)); }
  .frise { padding-left: 1.9rem; }
  .frise__item::before { left: -1.9rem; width: 14px; height: 14px; }
  .onglet { font-size: 0.82rem; padding: 0.5rem 0.7rem; }
  .jeu { font-size: 1.2rem; }
}
