/* =====================================================================================
   interface.css — chrome fixe, rail, blocs des mondes, ancres, fiche, menu, curseur, mobile
   (SPEC_V3 §5, §6.6). Thème SOMBRE uniquement (charte du 02/12/2026) : texte blanc, police Outfit,
   voiles de lisibilité à la couleur sombre du monde (--voile-texte, base.css). Propriétaire : lot B (interface).

   Écrite contre js/interface.js, qui pose les états :
     <html data-monde="hub|code|depthblitz|video|design|contact">   accents (base.css)
     <html data-cote="gauche|droite">          côté du texte (dégradé de lisibilité)
     html.ui-sans-texte                        aucun bloc de texte visible : dégradé effacé
     section.chapitre.actif / .sortie          bloc visible / sortie en cours
     .sous-etape.actif, .sous-etape[data-vide] sous-étape de la station la plus proche (Code)
     #rail li.actif, button[aria-current]      ligne active du rail
     #fiche.ouverte/.fermee, #menu-mobile.ouvert/.fermee, #curseur.lien/.objet/.presse/.glisse/.cache
     .ancre .cachee .gauche .dessus .actif ; .ancre--legende (texte seul, sans filet ni point)
     html.ui-pret / .ui-fiche-ouverte / .ui-menu-ouvert / .ui-curseur-actif
   Phases posées sur <html> par l'amorce et js/entree.js : [data-phase="entree"|"intro"|"site"].
   Sans interface.js, la page reste lisible : la section .actif du HTML (l'accueil) s'affiche telle quelle.
   Aucune règle ne dépend d'une classe posée sur <body>. Ombre de texte légère (--ombre-texte) sur le texte posé
   sur la 3D, aucun contour de lettres.
   ===================================================================================== */

/* =====================================================================================
   1. Calques de base
   ===================================================================================== */
canvas#scene {
  position: fixed;
  inset: 0;
  z-index: var(--z-scene);
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  outline: none;
  background: var(--encre);
}

/* Calque de lisibilité : un dégradé sombre sans bord, jamais un panneau (§5.2).
   OMEGA (sombre) : couleur sombre du monde (--voile-texte, base.css), PLEINE derrière toute la colonne de
   texte (largeur du .bloc + une marge : --voile-fin), puis fondu vers la scène sur 24vw. Les arrêts suivent
   la largeur réelle du bloc (même police, même taille : les « ch » concordent) au lieu de pourcentages,
   pour que la fin des lignes reste couverte sur les écrans étroits (tablette, 1024 px). */
#lisibilite {
  --voile-fin: calc(var(--gouttiere) + min(38ch, 42vw) + 4vw);
  position: fixed;
  inset: 0;
  z-index: var(--z-lisibilite);
  pointer-events: none;
  background: linear-gradient(90deg, var(--voile-texte) 0, var(--voile-texte) var(--voile-fin), transparent calc(var(--voile-fin) + 24vw));
  transition: opacity .6s var(--ease);
  /* OMEGA (ligne uniforme) : voile limité à la hauteur du bloc de texte affiché (--voile-haut / --voile-bas,
     posées par interface.js, majVoile), plein 48 px au-delà puis fondu sur 140 px. La ligne jaune qui passe
     plus haut ou plus bas n'est plus voilée (elle virait au kaki sous le voile rouge ou rose). Sans les
     variables : plein écran, comme avant. Portrait : pas de masque (feuille basse, règle plus bas). */
  -webkit-mask-image: linear-gradient(180deg, transparent calc(var(--voile-haut, 0px) - 188px), #000 calc(var(--voile-haut, 0px) - 48px), #000 calc(var(--voile-bas, 100vh) + 48px), transparent calc(var(--voile-bas, 100vh) + 188px));
  mask-image: linear-gradient(180deg, transparent calc(var(--voile-haut, 0px) - 188px), #000 calc(var(--voile-haut, 0px) - 48px), #000 calc(var(--voile-bas, 100vh) + 48px), transparent calc(var(--voile-bas, 100vh) + 188px));
}
/* Texte à droite (.bloc[data-cote="droite"] : à --g + 128 px du bord droit) */
html[data-cote="droite"] #lisibilite {
  --voile-fin: calc(var(--g) + 128px + min(38ch, 42vw) + 4vw);
  background: linear-gradient(270deg, var(--voile-texte) 0, var(--voile-texte) var(--voile-fin), transparent calc(var(--voile-fin) + 24vw));
}
html.ui-sans-texte #lisibilite { opacity: 0; }

/* OMEGA (sombre) : voiles du chrome et du rail, à la couleur sombre du monde. Ils restent visibles quand
   #lisibilite s'efface (ui-sans-texte), car le chrome et le rail, eux, restent affichés. Indispensables sur
   les mondes clairs (bleu de Depth Blitz), quasi invisibles à l'accueil et au Contact (voile nuit sur fond
   nuit). Calque 2 : au-dessus de la scène et de #lisibilite, SOUS les ancres, le texte et le chrome (ils
   n'assombrissent jamais un texte). Pseudo-éléments de <body> : aucune classe de <body> n'est lue. */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: calc(var(--z-lisibilite) + 1);
  pointer-events: none;
  transition: opacity .8s var(--ease);
}
/* Bandeau du haut : identité, statut, actions, compteur mobile ; plein sur la ligne du chrome, puis fondu */
body::before {
  left: 0;
  right: 0;
  top: 0;
  height: calc(150px + env(safe-area-inset-top, 0px));
  background: linear-gradient(180deg, var(--voile-texte) 0, var(--voile-texte) 40%, transparent 100%);
}
/* Halo du rail (bord droit, centré verticalement) : numéros, libellé actif, compteur « 00 / 05 » */
body::after {
  right: 0;
  top: calc(50% - 220px);
  width: calc(var(--g) + 300px);
  height: 440px;
  background: radial-gradient(ellipse 100% 50% at 100% 50%, var(--voile-texte) 0, var(--voile-texte) 45%, transparent 100%);
}
/* Entrée et début de l'intro : rien tant que le chrome n'est pas arrivé (pseudo-éléments : pas de :is()) */
html[data-phase="entree"] body::before,
html[data-phase="entree"] body::after,
html[data-phase="intro"]:not([data-intro~="chrome"]) body::before,
html[data-phase="intro"]:not([data-intro~="chrome"]) body::after { opacity: 0; }

/* Seul élément en flux : il fait défiler la page (hauteur réelle posée par defilement.js) */
#defilement {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 1450vh;
  visibility: hidden;
  pointer-events: none;
}
@supports (height: 1svh) {
  #defilement { height: 1450svh; }
}

/* Lien d'évitement : premier élément focusable, visible au focus seulement */
#evitement {
  position: fixed;
  left: var(--g);
  top: 12px;
  z-index: var(--z-evitement);
  padding: 10px 16px;
  border-radius: 2px;
  background: var(--ivoire);
  color: #08090D;
  font-family: var(--f-texte);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  transform: translateY(-160%);
  transition: transform var(--t-survol) var(--ease);
}
#evitement:focus,
#evitement:focus-visible { transform: none; }

/* Sprite des logos (créé par interface.js) : jamais display:none */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Numéro de monde (« 03 », Outfit en chiffres tabulaires) : remplace les anciennes lettres */
.numero {
  font-family: var(--f-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

/* =====================================================================================
   2. Chrome fixe
   ===================================================================================== */
#chrome {
  position: fixed;
  inset: 0;
  z-index: var(--z-chrome);
  pointer-events: none;
  text-shadow: var(--ombre-texte);
}
#chrome :is(a, button, [role="button"], [role="link"]) { pointer-events: auto; }

/* ---------- Repères de coin : croix de 9 px, blanc 22 %, à 16 px des coins ---------- */
.coin {
  position: absolute;
  width: 9px;
  height: 9px;
  pointer-events: none;
}
.coin::before,
.coin::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, .22);
}
.coin::before { left: 4px; top: 0; width: 1px; height: 9px; }
.coin::after { left: 0; top: 4px; width: 9px; height: 1px; }
.coin--hg { left: 16px; top: 16px; }
.coin--hd { right: 16px; top: 16px; }
.coin--bg { left: 16px; bottom: 16px; }
.coin--bd { right: 16px; bottom: 16px; }

/* ---------- Haut gauche : identité « Paul Pouyadoux » / « Étudiant en BUT MMI » (retour à l'accueil) ---------- */
#identite {
  position: absolute;
  left: var(--g);
  top: var(--haut);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 40px;
  padding-right: 6px;
  color: var(--ivoire);
}
.identite-nom {
  font-family: var(--f-texte);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--ivoire);
  white-space: nowrap;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size var(--t-survol) var(--ease);
}
#identite:is(:hover, :focus-visible) .identite-nom { background-size: 100% 1px; }
.identite-sous {
  font-family: var(--f-mono);
  font-size: .6875rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--argent);
  white-space: nowrap;
}

/* ---------- Haut centre : pastille de statut (panneau sombre, point jaune) ---------- */
#statut {
  position: absolute;
  top: calc(var(--haut) + 4px);
  left: 0;
  right: 0;
  margin: 0 auto;
  width: max-content;
  max-width: calc(100% - 2 * var(--g));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--ligne);
  border-radius: 999px;
  background: var(--panneau);
  box-shadow: var(--ombre);
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: .6875rem;
  line-height: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ivoire);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  transition: opacity .4s var(--ease), visibility 0s;
}
/* À l'accueil, la pastille du bloc dit déjà la même chose */
html[data-monde="hub"] #statut { opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility 0s linear .3s; }
#statut .statut-point,
.pastille-point {
  position: relative;
  display: block;
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--or-vif);
  box-shadow: 0 0 6px rgba(255, 199, 0, .7);
}
#statut .statut-point::after,
.pastille-point::after {                 /* une onde toutes les 2 s */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--or-vif);
  opacity: 0;
  animation: statut-onde 2s var(--ease) infinite;
}
@keyframes statut-onde {
  0% { transform: scale(1); opacity: .5; }
  100% { transform: scale(2.4); opacity: 0; }
}
#statut .statut-court { display: none; }

/* ---------- Haut droite : CV, Écrire, SON, Version simple, menu ⋯ ---------- */
#actions-haut {
  position: absolute;
  right: var(--g);
  top: var(--haut);
  height: 40px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.action-haut {
  padding: 6px 0;
  font-family: var(--f-mono);
  font-size: .75rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ivoire);
  white-space: nowrap;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size var(--t-survol) var(--ease), color var(--t-survol) var(--ease);
}
.action-haut:is(:hover, :focus-visible) { background-size: 100% 1px; color: var(--accent-texte); }
#lien-cv:not([href]),
#lien-cv[href=""] { display: none; }

/* Bouton SON : « SON » mono + 5 barres de 1 px (hauteur 3 → 12 px posée en ligne par interface.js) */
#bouton-son {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: .75rem;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--argent);
  transition: color var(--t-survol) var(--ease);
}
#bouton-son:is(:hover, :focus-visible),
#bouton-son[aria-pressed="true"] { color: var(--ivoire); }
.son-barres {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 12px;
}
.son-barres > i,
.son-barres > span {
  display: block;
  width: 1px;
  height: 1px;
  background: currentColor;
}
/* Son coupé : une ligne plate de 1 px */
.son-barres::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  margin-top: -.5px;
  background: currentColor;
  opacity: .7;
}
#bouton-son[aria-pressed="true"] .son-barres::before { opacity: 0; }
#bouton-son[aria-pressed="true"] .son-barres > :is(i, span) { background: var(--or-vif); }

/* Menu ⋯ : réglage « Effets de passage : pleins / atténués » (panneau construit par interface.js) */
#menu-plus {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: -10px;
  border-radius: 50%;
  color: var(--argent);
  transition: color var(--t-survol) var(--ease), background-color var(--t-survol) var(--ease);
}
#menu-plus svg { display: block; width: 14px; height: 4px; fill: currentColor; }
#menu-plus:is(:hover, :focus-visible),
#menu-plus[aria-expanded="true"] { color: var(--ivoire); background-color: rgba(255, 255, 255, .1); }
.menu-plus-panneau {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 232px;
  padding: 12px 16px 8px;
  border: 1px solid var(--ligne);
  border-radius: 2px;
  background: var(--panneau);
  box-shadow: var(--ombre);
  pointer-events: auto;
}
.menu-plus-panneau .menu-plus-titre {
  margin: 0 0 4px;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: .6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--argent);
}
.menu-plus-panneau [data-eclairs] {
  min-height: 40px;
  font-family: var(--f-texte);
  font-size: .9375rem;
  font-weight: 500;
  text-align: left;
  color: var(--ivoire);
}
.menu-plus-panneau [data-eclairs]:is(:hover, :focus-visible) { color: var(--accent-texte); }
.menu-plus-panneau [data-eclairs][aria-pressed="true"]::before { content: "● "; font-size: 8px; vertical-align: 2px; color: var(--or-vif); }

/* Bouton Menu et compteur « 00 / 05 » : mobile seulement */
#bouton-menu { display: none; }
#compteur-mobile { display: none; }

/* ---------- Bas centre : flèche « défiler », un filet de 1 px (accueil ; visibilité par interface.js) ---------- */
#defiler {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  margin: 0 auto;
  width: 12px;
  height: 44px;
  pointer-events: none;
  transition: opacity .6s var(--ease);
}
#defiler.cache { opacity: 0; }
.defiler-ligne {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  margin-left: -.5px;
  background: var(--ivoire);
  animation: defiler-flotte 2.4s var(--ease) infinite;
}
.defiler-ligne::before,
.defiler-ligne::after {                  /* pointe de flèche : deux filets de 1 px à 45° */
  content: "";
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 8px;
  background: var(--ivoire);
  transform-origin: 50% 100%;
}
.defiler-ligne::before { left: 0; transform: rotate(40deg); }
.defiler-ligne::after { left: 0; transform: rotate(-40deg); }
@keyframes defiler-flotte {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* =====================================================================================
   3. Rail des mondes : 6 lignes de 34 px (6 × 34 = 204 px, placé à calc(50% − 102px)),
   chacune un numéro mono et un libellé. interface.js pose #rail-remplissage { transform: scaleY(G / 5) }
   et place #rail-pointe d'après les boîtes mesurées : leurs positions de repos sont libres.
   ===================================================================================== */
#rail {
  position: fixed;
  z-index: var(--z-chrome);
  right: var(--g);
  top: calc(50% - 102px);
  width: 28px;
  height: 204px;
  text-shadow: var(--ombre-texte);
}
.rail-ligne {                           /* du centre de la ligne 00 à celui de la ligne 05 */
  position: absolute;
  right: 0;
  top: 17px;
  width: 1px;
  height: 170px;
  background: var(--plomb);
  pointer-events: none;
}
#rail-remplissage {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 1px;
  height: 100%;
  background: var(--or-vif);
  box-shadow: 0 0 6px rgba(255, 199, 0, .6);
  transform: scaleY(0);
  transform-origin: 50% 0;
}
/* Pointe : le halo jaune est aussi posé en ligne par interface.js (couleurTrait) */
#rail-pointe {
  position: absolute;
  right: -2px;
  top: 15px;
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--trait);
  box-shadow: 0 0 8px 1px rgba(255, 199, 0, .75);
  pointer-events: none;
}
#rail ol {
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-rows: 34px;
  list-style: none;
}
#rail li {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
#rail li > :is(button, a) {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 34px;
  padding: 0 11px 0 6px;
  color: var(--argent);
  transition: color var(--t-survol) var(--ease);
}
#rail li > :is(button, a):is(:hover, :focus-visible) { color: var(--ivoire); }
#rail li > :is(button, a):focus-visible { outline-offset: -2px; }
#rail .numero {
  font-size: .75rem;
  line-height: 1;
}
/* Ligne active : blanc, barre de 2 px à l'accent du monde, posée sur le fil */
#rail li.actif > :is(button, a),
#rail li > :is(button, a)[aria-current]:not([aria-current="false"]) { color: var(--ivoire); }
#rail li > :is(button, a)::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 8px;
  width: 2px;
  height: 18px;
  background: var(--accent);
  opacity: 0;
  transform: scaleY(.3);
  transition: opacity var(--t-survol) var(--ease), transform var(--t-survol) var(--ease);
}
#rail li.actif > :is(button, a)::after { opacity: 1; transform: none; }
/* Libellé à gauche du numéro : celui de la ligne active, tous au survol du rail */
#rail .rail-nom {
  position: absolute;
  right: 100%;
  top: 50%;
  margin-top: -7px;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: .75rem;
  line-height: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--argent);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity var(--t-survol) var(--ease), transform var(--t-survol) var(--ease), color var(--t-survol) var(--ease);
}
#rail li.actif .rail-nom,
#rail:is(:hover, :focus-within) .rail-nom { opacity: 1; transform: none; }
#rail li.actif .rail-nom,
#rail li > :is(button, a):is(:hover, :focus-visible) .rail-nom { color: var(--ivoire); }

/* Compteur « 00 / 05 », 14 px sous le rail ; les chiffres roulent (interface.js) */
#rail-compteur {
  position: absolute;
  right: -1px;
  top: calc(100% + 14px);
  margin: 0;
  display: flex;
  align-items: center;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: .75rem;
  line-height: 14px;
  letter-spacing: .04em;
  color: var(--argent);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
#rail-compteur .rouleau {
  display: inline-block;
  position: relative;
  height: 14px;
  overflow: hidden;
  vertical-align: top;
  color: var(--ivoire);
}
#rail-compteur .rouleau > span { display: block; }
#rail-compteur .compteur-total { white-space: pre; }

/* =====================================================================================
   4. Mondes et blocs de texte (colonne gauche ou droite, centrée verticalement)
   ===================================================================================== */
#contenu {
  position: fixed;
  inset: 0;
  z-index: var(--z-contenu);
  pointer-events: none;
}
.chapitre {
  position: absolute;
  inset: 0;
  pointer-events: none;
  visibility: hidden;
}
.chapitre.actif { visibility: visible; }
/* Seuls les contrôles captent le pointeur : un clic dans le vide du bloc atteint la scène */
.chapitre :is(a, button, [role="button"], summary) { pointer-events: auto; }

.bloc {
  position: absolute;
  left: var(--gouttiere);
  top: 50%;
  width: min(38ch, 42vw);
  font-size: var(--taille-texte);
  transform: translateY(-50%);
  pointer-events: none;
}
/* Texte à droite (Code k1, k3) : il laisse le rail et son libellé actif libres */
.bloc[data-cote="droite"] {
  left: auto;
  right: calc(var(--g) + 128px);
}
/* Le surtitre a remplacé l’ancien libellé numéroté : celui-ci reste masqué s’il est recréé */
.chapitre .bloc > .libelle { display: none !important; }

/* OMEGA (sombre) : ombre de texte légère sur tout le texte des blocs (héritée), retirée là où le texte est
   déjà posé sur un aplat (boutons, étiquettes, pastille) */
.chapitre .bloc { text-shadow: var(--ombre-texte); }
.chapitre :is(.tags li, .pastille, .bouton, .bouton-jeu) { text-shadow: none; }

/* ---------- Surtitre (libellé en capitales, accent du monde) ---------- */
.chapitre .surtitre,
.chapitre .type {
  margin: 0 0 16px;
  font-family: var(--f-mono);
  font-size: var(--taille-libelle);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-texte);
  font-variant-numeric: tabular-nums;
}
.chapitre .type { margin-bottom: 12px; }

/* ---------- Titre : Outfit 500, casse de phrase, jamais en capitales ---------- */
.chapitre .titre {
  margin: 0 0 18px -.04em;
  font-family: var(--f-titre);
  font-size: var(--taille-titre);
  font-weight: 500;
  font-style: normal;
  line-height: 1;
  letter-spacing: -.02em;
  text-transform: none;
  color: var(--ivoire);
  text-wrap: balance;
  font-feature-settings: "kern";
}
/* Mots : chaque mot dans un span en overflow hidden, son contenu monte de 110 % à 0.
   Les marges négatives laissent la place aux accents et aux jambages sans changer la mise en page. */
.chapitre .titre .mot {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: .1em .06em .18em .02em;
  margin: -.1em -.06em -.18em -.02em;
}
.chapitre .titre .mot > span {
  display: inline-block;
  padding: .1em .06em .18em .02em;
  margin: -.1em -.06em -.18em -.02em;
}

/* Titre de projet (Code k1 à k4) */
.chapitre .titre-projet {
  margin: 0 0 14px -.03em;
  font-family: var(--f-titre);
  font-size: clamp(1.9rem, 3.2vw, 3rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.02em;
  color: var(--ivoire);
  text-wrap: balance;
}

/* ---------- Rôle (accueil), texte courant ---------- */
.chapitre .role {
  margin: 0 0 14px;
  font-family: var(--f-texte);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ivoire);
}
.chapitre .texte {
  max-width: 38ch;
  margin: 0;
  font-family: var(--f-texte);
  font-size: var(--taille-texte);
  font-weight: 400;
  line-height: 1.55;
  color: var(--texte-courant);
  text-wrap: pretty;
}

/* ---------- Pastille de statut (accueil) : panneau sombre ---------- */
.chapitre .pastille {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 0;
  padding: 8px 14px;
  border: 1px solid var(--ligne);
  border-radius: 999px;
  background: var(--panneau);
  box-shadow: var(--ombre);
  font-family: var(--f-mono);
  font-size: .6875rem;
  font-weight: 500;
  line-height: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ivoire);
}

/* ---------- Sommaire (accueil) : « 01 Code » · « 02 Depth Blitz »… ---------- */
.chapitre .sommaire { margin: 22px 0 0; }
.chapitre .sommaire ol {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chapitre .sommaire button {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-height: 34px;
  padding: 6px 0;
  font-family: var(--f-texte);
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ivoire);
  background-image: linear-gradient(var(--ivoire), var(--ivoire));
  background-repeat: no-repeat;
  background-position: 0 calc(100% - 4px);
  background-size: 0% 1px;
  transition: background-size var(--t-survol) var(--ease);
}
.chapitre .sommaire button:is(:hover, :focus-visible) { background-size: 100% 1px; }
.chapitre .sommaire .numero {
  font-size: .75rem;
  color: var(--argent);
}

/* ---------- Aide (accueil) ---------- */
.chapitre .aide {
  margin: 18px 0 0;
  max-width: 38ch;
  font-family: var(--f-texte);
  font-size: .8125rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--argent);
}

/* ---------- Outils (Code) : étiquettes en capitales sur panneau sombre ---------- */
.chapitre .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.chapitre .tags li {
  padding: 5px 9px;
  border: 1px solid var(--ligne);
  border-radius: 2px;
  background: var(--feuille);
  font-family: var(--f-mono);
  font-size: .6875rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ivoire);
}
.chapitre .tags--outils { max-width: 40ch; }
.chapitre .suite { margin: 22px 0 0; }
.chapitre .lien-suite {
  display: inline-flex;
  align-items: baseline;
  gap: .4em;
  min-height: 34px;
  padding: 6px 0;
  font-family: var(--f-texte);
  font-size: .9375rem;
  font-weight: 500;
  color: var(--ivoire);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 calc(100% - 4px);
  background-size: 100% 1px;
  transition: color var(--t-survol) var(--ease);
}
.chapitre .lien-suite:is(:hover, :focus-visible) { color: var(--accent-texte); }

/* ---------- Mondes provisoires : lignes de données, étiquette « en construction » ---------- */
.chapitre .donnees {
  margin: 16px 0 0;
  max-width: 46ch;
  font-family: var(--f-mono);
  font-size: var(--taille-libelle);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--argent);
  font-variant-numeric: tabular-nums;
}
.chapitre .donnees + .donnees { margin-top: 6px; }
.chapitre .donnees--chiffres { text-transform: none; letter-spacing: .02em; color: var(--ivoire); }
.chapitre :is(.donnees--role, .donnees--projet) {
  font-family: var(--f-texte);
  font-size: .9375rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
  color: var(--texte-courant);
}
.chapitre .donnees--role { font-weight: 500; color: var(--ivoire); }
.chapitre .donnees:empty { display: none; }
.chapitre .etiquette-proto {
  display: inline-block;
  margin: 22px 0 0;
  padding: 5px 9px;
  border: 1px dashed var(--filet-fort);
  border-radius: 2px;
  font-family: var(--f-mono);
  font-size: .6875rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--argent);
}

/* ---------- Contact : boutons, réseaux, micro-pied ---------- */
.chapitre .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 26px 0 0;
}
.chapitre .actions:empty { display: none; }
.chapitre .actions a:not([href]):not(.bouton--bientot) { display: none; }
.chapitre .liens-sociaux {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.chapitre .liens-sociaux li { display: flex; align-items: center; }
.chapitre .liens-sociaux li + li::before {
  content: "";
  width: 1px;
  height: 12px;
  margin: 0 14px;
  background: var(--filet-fort);
}
.chapitre .micro-pied {
  margin: 30px 0 0;
  font-family: var(--f-mono);
  font-size: .6875rem;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--argent);
}

/* « Lire la suite » : mobile seulement */
.lire-suite { display: none; }

/* Depth Blitz : les chiffres du jeu, en grand (F5) */
.chapitre .chiffres-jeu { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 18px 0 0; padding: 0; list-style: none; }
.chapitre .chiffres-jeu li { display: flex; align-items: baseline; gap: 8px; font-family: var(--f-mono); font-size: var(--taille-libelle);
  font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--argent); }
.chapitre .chiffres-jeu .chiffre { font-family: var(--f-titre); font-size: 2.25rem; font-weight: 500; line-height: 1;
  letter-spacing: -.02em; text-transform: none; color: var(--ivoire); font-variant-numeric: tabular-nums; }
.chapitre .boutons-jeu { margin-top: 16px; }
.chapitre .lien-video { margin: 16px 0 0; }
@media (orientation: portrait) { .chapitre .chiffres-jeu { margin-top: 12px; gap: 4px 20px; } .chapitre .chiffres-jeu .chiffre { font-size: 1.75rem; } }

/* Vidéo & chaîne : vidéos à la une */
.chapitre .videos-liste { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.chapitre .videos-liste .numero { font-family: var(--f-mono); color: var(--accent-texte); margin-right: 10px; }
.chapitre .videos-liste a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
.chapitre .videos-liste a:is(:hover, :focus-visible) { border-bottom-color: var(--accent-texte); }

/* Contact : réseau à venir (même corps que .lien, inactif) */
.chapitre .liens-sociaux .lien-bientot { display: inline-flex; align-items: baseline; gap: .4em; padding: 4px 0; font-family: var(--f-texte);
  font-size: .9375rem; font-weight: 500; line-height: 1.3; color: var(--argent); cursor: default; }

/* =====================================================================================
   5. Apparitions : fondus décalés, titre mot par mot, sous-étapes, sortie rapide
   ===================================================================================== */
.chapitre .bloc > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .3s var(--ease), transform .4s var(--ease);
}
.chapitre .bloc > .titre { opacity: 1; transform: none; }
.chapitre .titre .mot > span {
  transform: translateY(110%);
  transition: transform .35s var(--ease);
}
/* Visible : durées longues ; les propriétés et la courbe viennent de la règle de repos, les délais des
   règles ci-dessous (pas de raccourci « transition » ici, il remettrait les délais à zéro) */
html:not([data-phase="intro"]) .chapitre.actif:not(.sortie) :is(.bloc:not(.sous-etape), .sous-etape.actif) > :not(.titre),
html[data-intro~="titre"] .chapitre.actif:not(.sortie) :is(.bloc:not(.sous-etape), .sous-etape.actif) > :not(.titre) {
  opacity: 1;
  transform: none;
  transition-duration: .7s, .9s;
}
html:not([data-phase="intro"]) .chapitre.actif:not(.sortie) :is(.bloc:not(.sous-etape), .sous-etape.actif) .titre .mot > span,
html[data-intro~="titre"] .chapitre.actif:not(.sortie) :is(.bloc:not(.sous-etape), .sous-etape.actif) .titre .mot > span {
  transform: none;
  transition: transform .9s var(--ease) calc(.06s + var(--i, 0) * .07s);
}
.chapitre.actif:not(.sortie) :is(.bloc:not(.sous-etape), .sous-etape.actif) > :is(.surtitre, .type) { transition-delay: 0s; }
.chapitre.actif:not(.sortie) :is(.bloc:not(.sous-etape), .sous-etape.actif) > :is(.titre-projet, .role) { transition-delay: .08s; }
.chapitre.actif:not(.sortie) :is(.bloc:not(.sous-etape), .sous-etape.actif) > .texte { transition-delay: .16s; }
.chapitre.actif:not(.sortie) :is(.bloc:not(.sous-etape), .sous-etape.actif) > :not(.surtitre, .type, .titre, .titre-projet, .role, .texte) { transition-delay: .26s; }
/* Sous-étapes inactives : effacées, puis hors de l'ordre de tabulation à la fin du fondu */
.chapitre .sous-etape:not(.actif) { visibility: hidden; transition: visibility 0s linear .3s; }
.chapitre .sous-etape:not(.actif) :is(a, button) { pointer-events: none; }
.chapitre .sous-etape[data-vide] { display: none; }
/* Sortie : les contrôles effacés ne captent plus le pointeur tout de suite, et quittent l'ordre de
   tabulation à la fin du fondu (visibility héritée à nouveau dès que .sortie est retirée) */
.chapitre.sortie :is(a, button, [role="button"], summary) { pointer-events: none; }
.chapitre.sortie .bloc > * {
  visibility: hidden;
  transition: opacity .3s var(--ease), transform .4s var(--ease), visibility 0s linear .3s;
}
html[data-intro-rapide] .chapitre :is(.bloc > *, .titre .mot > span) {
  transition-duration: .4s !important;
  transition-delay: 0s !important;
}

/* Intro : le chrome et le rail arrivent après le titre */
#chrome,
#rail { transition: opacity .8s var(--ease); }
html[data-phase="intro"]:not([data-intro~="chrome"]) :is(#chrome, #rail, #ancres) { opacity: 0; }
html[data-intro-rapide] :is(#chrome, #rail) { transition-duration: .4s; }

/* =====================================================================================
   6. Ancres. interface.js pose .ancre { transform: translate3d(x, y, 0) }.
   Légendes (.ancre--legende) : texte seul, coin haut gauche juste sous le point 3D, toujours visibles.
   Autres ancres (repli) : étiquette reliée au point par un filet de 1 px à angle droit.
   ===================================================================================== */
#ancres {
  position: fixed;
  inset: 0;
  z-index: var(--z-ancres);
  overflow: hidden;
  pointer-events: none;
}
.ancre {
  --ancre-y: 7px;                          /* hauteur du filet horizontal dans la boîte */
  --ancre-h: 26px;                         /* longueur du filet vertical jusqu'au point */
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: max-content;
  height: auto;
  margin-top: calc(-1 * (var(--ancre-y) + var(--ancre-h)));
  padding-left: 40px;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: .75rem;
  line-height: 1.3;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ivoire);
  text-shadow: var(--ombre-texte);
  white-space: nowrap;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), visibility 0s linear .25s;
}
.ancre:not(.cachee) {
  visibility: visible;
  opacity: 1;
  transition: opacity .4s var(--ease), visibility 0s;
}
.ancre::before {                           /* le point 3D */
  content: "";
  position: absolute;
  left: -2.5px;
  top: calc(var(--ancre-y) + var(--ancre-h) - 2.5px);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .6);
}
.ancre::after {                            /* filet de 1 px à angle droit */
  content: "";
  position: absolute;
  left: 0;
  top: var(--ancre-y);
  width: 32px;
  height: var(--ancre-h);
  border-left: 1px solid rgba(255, 255, 255, .6);
  border-top: 1px solid rgba(255, 255, 255, .6);
  pointer-events: none;
}
.ancre.actif::before { background: var(--ivoire); }
.ancre.actif::after { border-color: var(--ivoire); }
.ancre.gauche {
  align-items: flex-end;
  padding-left: 0;
  padding-right: 40px;
  text-align: right;
  translate: -100% 0;
}
.ancre.gauche::before { left: auto; right: -2.5px; }
.ancre.gauche::after { left: auto; right: 0; border-left: 0; border-right: 1px solid rgba(255, 255, 255, .6); }
/* Placement de repli « dessus » : étiquette centrée au-dessus du point, reliée par un filet vertical */
#ancres .ancre.dessus {
  align-items: center;
  margin-top: 0;
  padding: 0;
  text-align: center;
  translate: none;
}
#ancres .ancre.dessus::before {
  left: calc(var(--px, 0px) - 2.5px);
  right: auto;
  top: calc(100% + var(--gap, 16px) - 2.5px);
}
#ancres .ancre.dessus::after {
  left: var(--px, 0px);
  right: auto;
  top: calc(100% + 3px);
  width: 0;
  height: calc(var(--gap, 16px) - 5px);
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, .6);
}

/* ---------- Légendes : numéro et nom en blanc, description en argent ; ni filet ni point ---------- */
#ancres .ancre.ancre--legende {
  gap: 3px;
  margin: 0;
  padding: 0;
  align-items: flex-start;
  text-align: left;
  translate: none;
}
#ancres .ancre.ancre--legende::before,
#ancres .ancre.ancre--legende::after { content: none; display: none; }
/* OMEGA (sombre) : la légende de sortie (« Suivant · 03 … ») flotte sur la scène du monde, parfois claire
   (eau bleu clair de Depth Blitz) : petite pastille sombre, comme le libellé du curseur, pour rester lisible */
#ancres .ancre.ancre--legende[data-ancre$="-sortie"] {
  padding: 6px 10px;
  border: 1px solid var(--ligne);
  border-radius: 2px;
  background: var(--panneau);
  text-shadow: none;
}
.ancre--legende .ancre-titre {
  display: inline-flex;
  align-items: baseline;
  gap: .6em;
  color: var(--ivoire);
}
.ancre--legende .ancre-num { color: var(--ivoire); }
.ancre--legende .ancre-desc {
  max-width: 15em;
  font-family: var(--f-texte);
  font-size: .8125rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  color: var(--argent);
  white-space: normal;
}
.ancre .ancre-libelle { color: var(--ivoire); }

/* =====================================================================================
   7. Fiche (code conservé ; rien ne l'ouvre dans ce tour) : colonne de droite sur dégradé sombre
   ===================================================================================== */
#fiche {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  z-index: var(--z-fiche);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: max(52vw, 640px);
  max-width: 100%;
  padding: clamp(84px, 12vh, 128px) calc(var(--g) + 60px) clamp(40px, 7vh, 72px) 0;
  border: 0;
  background: linear-gradient(to left, rgba(8, 9, 13, .94) 0%, rgba(8, 9, 13, .94) 58%, rgba(8, 9, 13, 0) 100%);
  color: var(--ivoire);
  pointer-events: auto;
  transition: opacity .45s var(--ease);
}
#fiche.fermee { opacity: 0; }
.fiche-corps {
  position: relative;
  width: min(36vw, 540px);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .25) transparent;
  padding-right: 10px;
}
.fiche-corps > * { transition: opacity .5s var(--ease), transform .6s var(--ease); }
#fiche.fermee .fiche-corps > * { opacity: 0; transform: translateX(16px); }
#fiche .fiche-num {
  margin: 0;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--argent);
}
#fiche .fiche-titre {
  margin: 16px 0 10px;
  font-family: var(--f-titre);
  font-weight: 500;
  font-size: clamp(28px, 2.6vw, 42px);
  line-height: 1.05;
  letter-spacing: -.02em;
  color: var(--ivoire);
  outline: none;
}
#fiche .fiche-type {
  margin: 0;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: .75rem;
  line-height: 1.6;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--argent);
}
#fiche .fiche-image { margin: 24px 0 20px; }
#fiche .fiche-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(54vh, 620px);
  object-fit: contain;
  object-position: left center;
}
#fiche .fiche-texte {
  max-width: 44ch;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--texte-courant);
}
#fiche .fiche-liens { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 20px 0 0; }
#fiche .fiche-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  margin: 30px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--filet);
}
#fiche .fiche-fermer { margin-left: auto; color: var(--argent); }
#fiche .fiche-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px 18px; }
#fiche .fiche-tete .fiche-fermer { flex: none; }
#fiche .fiche-emplacements { display: grid; grid-template-columns: repeat(3, minmax(0, 104px)); gap: 12px; margin: -6px 0 20px; }
#fiche .fiche-boutons { margin-top: 20px; }
.emplacement {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  overflow: hidden;
  border: 1px dashed rgba(255, 255, 255, .3);
  border-radius: 2px;
  background: #141822;
}
.emplacement--16x9 { aspect-ratio: 16 / 9; }
.emplacement--16x10 { aspect-ratio: 16 / 10; }
.emplacement--telephone { aspect-ratio: 9 / 19.5; }
.emplacement-contenu { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; text-align: center; }
.emplacement-icone { font-size: 20px; color: var(--argent); }
.emplacement-titre,
.emplacement-sous {
  font-family: var(--f-mono);
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--argent);
}
.boutons-jeu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 560px; margin: 18px 0 0; }
.bouton-jeu {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 14px 8px 12px;
  border: 1px solid var(--ivoire);
  border-radius: 2px;
  background: var(--feuille);
  color: var(--ivoire);
}
.bouton-jeu-logo { font-size: 24px; }
.bouton-jeu-texte { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bouton-jeu-haut { font-family: var(--f-mono); font-size: .625rem; letter-spacing: .08em; text-transform: uppercase; color: var(--argent); }
.bouton-jeu-nom { font-size: .9375rem; font-weight: 500; }
.bouton-jeu .fleche { margin-left: auto; }
.bouton-jeu.est-bientot { border-style: dashed; border-color: var(--argent); color: var(--argent); }
/* Visionneuse : projet ouvert par-dessus le portfolio quand la page est dans un cadre (aperçu claude.ai) */
html.ui-visionneuse-ouverte { overflow: hidden; }
html.ui-visionneuse-ouverte #curseur { opacity: 0; }
html.ui-visionneuse-ouverte,
html.ui-visionneuse-ouverte * { cursor: auto !important; }
.visionneuse {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-menu) + 5);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: var(--voile);
  backdrop-filter: blur(6px);
}
.visionneuse[hidden] { display: none; }
.visionneuse-barre { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.visionneuse-titre {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 1rem/1.2 var(--f-texte);
  color: var(--ivoire);
}
.visionneuse-fermer { flex: none; min-height: 44px; }
.visionneuse-cadre {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--ligne);
  border-radius: 10px;
  background: var(--feuille);
  box-shadow: var(--ombre);
}
.visionneuse-cadre--image { object-fit: contain; }
html.ui-fiche-ouverte { overflow: hidden; }
html.ui-fiche-ouverte #ancres { opacity: 0; transition: opacity .25s var(--ease); }
html.ui-fiche-ouverte .chapitre .bloc {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity .25s var(--ease), visibility 0s linear .25s !important;
}
@media (min-width: 768px) {
  html.ui-fiche-ouverte #chrome { z-index: calc(var(--z-fiche) + 1); }
}

/* =====================================================================================
   8. Menu mobile : feuille plein écran sombre (construite par interface.js)
   ===================================================================================== */
#menu-mobile {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  display: flex;
  flex-direction: column;
  padding: calc(84px + env(safe-area-inset-top, 0px)) 16px calc(28px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--encre);
  color: var(--ivoire);
  transition: opacity .4s var(--ease);
}
#menu-mobile.fermee { opacity: 0; }
#menu-mobile .menu-tete > span {
  position: absolute;
  left: 16px;
  top: calc(var(--haut) + 12px + env(safe-area-inset-top, 0px));
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--argent);
}
.menu-fermer {
  position: absolute;
  top: calc(var(--haut) - 2px + env(safe-area-inset-top, 0px));
  right: 16px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 2px;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ivoire);
}
.menu-chapitres { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--filet); }
.menu-chapitres li { border-bottom: 1px solid var(--filet); }
.menu-chapitres button {
  display: flex;
  align-items: baseline;
  gap: 16px;
  width: 100%;
  min-height: 60px;
  padding: 8px 0;
  font-family: var(--f-titre);
  font-size: clamp(24px, 7.4vw, 32px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.02em;
  text-align: left;
  color: var(--ivoire);
}
.menu-chapitres .numero { font-size: .75rem; letter-spacing: .04em; color: var(--argent); transform: translateY(-6px); }
.menu-chapitres button[aria-current="true"] .menu-nom {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 2px;
}
.menu-liens {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 26px;
  margin-top: auto;
  padding-top: 28px;
}
.menu-liens .lien { min-height: 44px; align-items: center; }
#menu-mobile .menu-eclairs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 22px;
  margin: auto 0 0;
  padding-top: 28px;
}
#menu-mobile .menu-eclairs > span {
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: .75rem;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--argent);
}
#menu-mobile .menu-eclairs .lien { min-height: 44px; align-items: center; }
#menu-mobile .menu-eclairs [data-eclairs][aria-pressed="true"]::before { content: "● "; font-size: 8px; vertical-align: 2px; color: var(--or-vif); }
#menu-mobile .menu-eclairs + .menu-liens { margin-top: 0; padding-top: 4px; }
html.ui-menu-ouvert { overflow: hidden; }

/* =====================================================================================
   9. Curseur (pointeur fin uniquement) : positions posées par interface.js
   ===================================================================================== */
#curseur {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: var(--z-curseur);
  pointer-events: none;
}
html.ui-curseur-actif,
html.ui-curseur-actif * { cursor: none !important; }
#curseur .point,
#curseur .anneau,
#curseur .libelle {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease);
}
/* Point jaune du Trait, avec un petit halo (étincelant) */
#curseur .point { width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background-color: var(--trait); box-shadow: 0 0 6px 1px rgba(255, 199, 0, .7); }
#curseur .anneau {
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 50%;
  transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease),
    border-color .35s var(--ease), background-color .35s var(--ease), opacity .25s var(--ease),
    scale .25s var(--ease);
}
/* Lien → 46 px teinté ; objet 3D → 64 px, bordure à l'accent du monde ; glisser → ellipse orientée ;
   clic → 0,8 puis rebond en 0,3 s */
#curseur.lien .anneau {
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  background-color: rgba(255, 255, 255, .08);
}
#curseur.objet .anneau {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-color: var(--accent-texte);
}
#curseur.glisse .anneau {
  scale: 1.3 .8;
  rotate: var(--angle-geste, 0deg);
}
#curseur.presse .anneau { animation: curseur-presse .3s var(--ease); }
@keyframes curseur-presse {
  0% { scale: 1; }
  35% { scale: .8; }
  100% { scale: 1; }
}
/* Libellé (« Entrer · Code ») : pastille sombre sous l'anneau, lisible sur les aplats de couleur */
#curseur .libelle {
  padding: 5px 8px;
  border: 1px solid var(--ligne);
  border-radius: 2px;
  background: var(--panneau);
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: .6875rem;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ivoire);
  white-space: nowrap;
  transform: translate(-50%, 42px);
  opacity: 0;
}
#curseur.objet .libelle:not(:empty) { opacity: 1; }
#curseur.cache :is(.point, .anneau, .libelle) { opacity: 0; }
@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  #curseur { display: none !important; }
}

/* =====================================================================================
   10. Toast, chargement (masques du moteur)
   ===================================================================================== */
#toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: var(--z-toast);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border: 1px solid var(--ligne);
  border-radius: 2px;
  background: var(--panneau);
  box-shadow: var(--ombre);
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: .75rem;
  line-height: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ivoire);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
#toast::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--or-vif);
}
#toast:not(:empty) {
  visibility: visible;
  opacity: 1;
  transition: opacity .3s var(--ease);
}
#toast.sortie { opacity: 0; }

/* « Chargement » (ancien élément, gardé masqué) */
#chargement {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-chrome) + 1);
  display: grid;
  place-items: center;
  margin: 0;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ivoire);
  pointer-events: none;
}

/* Boîte « CHARGEMENT » du moteur (saut vers un monde pas encore prêt) : panneau sombre, texte blanc (§5.2).
   Le moteur injecte ses styles après cette feuille : la spécificité « html body » l'emporte. */
html body .moteur-chargement {
  padding: 14px 20px;
  border: 1px solid var(--ligne);
  border-radius: 2px;
  background: var(--panneau);
  box-shadow: var(--ombre);
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: .75rem;
  letter-spacing: .08em;
  color: var(--ivoire);
}
html body .moteur-chargement i { background: var(--piste); }
html body .moteur-chargement i::after { background: var(--or-vif); box-shadow: 0 0 6px rgba(255, 199, 0, .6); }
/* Interface minimale du moteur (repli si interface.js échoue) : texte blanc sur fond sombre */
html body .moteur-ui-min,
html body .moteur-ui-compteurs { color: var(--ivoire); }
html body .moteur-ui-toast { border-color: var(--ligne); background: var(--panneau); color: var(--ivoire); }

/* =====================================================================================
   11. Phases
   ===================================================================================== */
/* Écran d'entrée : pas de défilement ; tout le reste est masqué et non focusable
   (!important : l'emporte sur les styles en ligne qu'interface.js poserait déjà) */
html[data-phase="entree"] { overflow: hidden; }
html[data-phase="entree"] :is(#chrome, #rail, #contenu, #ancres, #curseur, #fiche, #menu-mobile, #toast, #lisibilite, .menu-plus-panneau),
html[data-phase="entree"] :is(#chrome, #rail, #contenu, #ancres, #curseur, #fiche, #menu-mobile, #toast, .menu-plus-panneau) * {
  visibility: hidden !important;
}

/* =====================================================================================
   12. Largeurs et hauteurs intermédiaires (bureau et tablette)
   ===================================================================================== */
/* La pastille longue ne tient plus entre l'identité et les actions : version courte */
@media (min-width: 768px) and (max-width: 1259px) {
  #statut .statut-long {
    display: block;                       /* reste lu par les lecteurs d'écran (la courte est aria-hidden) */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  #statut .statut-court { display: inline; }
}
/* Tablette : la pastille passe en bas au centre */
@media (min-width: 768px) and (max-width: 1039px) {
  #statut { top: auto; bottom: 18px; }
  #defiler { bottom: 62px; }
  html.ui-fiche-ouverte #statut { visibility: hidden; }
  .bloc { width: min(36ch, 46vw); }
}
/* Écrans bas : titres et marges resserrés pour que le bloc de l'accueil tienne entre le chrome et le bas */
@media (min-width: 768px) and (max-height: 820px) {
  :root { --taille-titre: clamp(2.4rem, min(5.2vw, 9.5vh), 5.4rem); }
  #rail { top: calc(50% - 120px); }
  .chapitre .titre { margin-bottom: 14px; }
  .chapitre .pastille { margin-top: 16px; }
  .chapitre .sommaire { margin-top: 14px; }
  .chapitre .aide { margin-top: 12px; }
  .chapitre .texte { line-height: 1.5; }
}
@media (min-width: 768px) and (max-height: 640px) {
  .chapitre .aide { display: none; }
  .bloc { top: calc(50% + 24px); }
}

/* =====================================================================================
   13. Portrait (innerWidth < innerHeight, comme les plans portrait du moteur) :
   à l'accueil le bloc est EN HAUT (0-38vh), dans les mondes il est dans une feuille basse de 40vh.
   ===================================================================================== */
@media (orientation: portrait) {
  .bloc,
  .bloc[data-cote="droite"] {
    left: var(--gouttiere);
    right: var(--gouttiere);
    top: auto;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: 620px;
    transform: none;
  }
  .chapitre[data-chapitre="hub"] .bloc {
    top: calc(var(--haut) + 56px + env(safe-area-inset-top, 0px));
    bottom: auto;
  }
  /* Feuille basse (mondes) et feuille haute (accueil) : voile sombre du monde, plein derrière le bloc puis fondu */
  #lisibilite,
  html[data-cote="droite"] #lisibilite {
    background: linear-gradient(0deg, var(--voile-texte) 0, var(--voile-texte) 40%, transparent 64%);
    -webkit-mask-image: none;
    mask-image: none;
  }
  html[data-monde="hub"] #lisibilite {
    background: linear-gradient(180deg, var(--voile-texte) 0, var(--voile-texte) 46%, transparent 70%);
  }
  .chapitre .titre { margin-bottom: 12px; }
  .chapitre .titre-projet { font-size: clamp(1.6rem, 6.4vw, 2.4rem); margin-bottom: 10px; }
  .chapitre .texte { max-width: none; }
  .chapitre .pastille { margin-top: 14px; }
  .chapitre .tags { margin-top: 12px; }
  .chapitre .etiquette-proto { margin-top: 14px; }
  .chapitre .actions { margin-top: 18px; }
  .chapitre .micro-pied { margin-top: 18px; }
  /* La pastille du chrome descendrait sur la feuille basse : retirée (l'accueil garde la sienne) */
  #statut { display: none; }
}

/* =====================================================================================
   14. Mobile (moins de 768 px)
   ===================================================================================== */
@media (max-width: 767px) {
  .coin--hg, .coin--bg { left: 8px; }
  .coin--hd, .coin--bd { right: 8px; }
  .coin--hg, .coin--hd { top: 8px; }
  .coin--bg, .coin--bd { bottom: 8px; }

  /* Barre du haut : identité, « 00 / 05 » au centre, SON (barres seules) et Menu */
  #identite,
  #actions-haut,
  #compteur-mobile { top: calc(var(--haut) + env(safe-area-inset-top, 0px)); }
  .identite-nom { font-size: 14px; }

  #compteur-mobile {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    width: max-content;
    height: 40px;
    margin: 0 auto;
    font-family: var(--f-mono);
    font-weight: 500;
    font-size: .75rem;
    letter-spacing: .04em;
    color: var(--argent);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
  }
  #compteur-mobile .compteur-num { color: var(--ivoire); }
  #compteur-mobile .compteur-total { white-space: pre; }

  #actions-haut { gap: 0; margin-right: -10px; }
  #lien-cv,
  #lien-ecrire,
  #lien-simple,
  #menu-plus,
  .menu-plus-panneau { display: none !important; }
  #bouton-son { justify-content: center; min-width: 44px; height: 44px; }
  #bouton-son .son-texte { display: none; }
  #bouton-menu {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 10px;
    font-family: var(--f-mono);
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ivoire);
  }

  #statut,
  #rail,
  #defiler { display: none !important; }
  /* Pas de rail sur mobile : pas de halo du rail */
  body::after { display: none; }

  /* Textes limités à 3 lignes ; « Lire la suite » déplie (interface.js pose .deplie) */
  .chapitre .texte:not(.deplie) {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
  }
  .chapitre .texte.deplie {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: none;
    overflow: visible;
  }
  .lire-suite {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    margin-top: 2px;
    font-family: var(--f-mono);
    font-size: .6875rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ivoire);
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  .lire-suite[hidden] { display: none !important; }

  /* Accueil : le menu remplace le sommaire ; aide plus discrète */
  .chapitre[data-chapitre="hub"] .sommaire { display: none; }
  .chapitre .aide { margin-top: 10px; font-size: .75rem; }
  .chapitre .role { font-size: 1rem; margin-bottom: 10px; }

  /* Cibles tactiles de 44 px */
  .chapitre .actions { gap: 8px; }
  .chapitre .actions .bouton { min-height: 44px; }
  .chapitre .liens-sociaux a,
  #fiche .fiche-nav :is(a, button) { min-height: 44px; display: inline-flex; align-items: center; }

  /* Ancres : légendes plus compactes (description masquée sur très petit écran) */
  .ancre--legende .ancre-desc { font-size: .75rem; max-width: 11em; }

  /* Fiche : feuille basse pleine largeur */
  #fiche {
    top: auto;
    left: 0;
    width: auto;
    max-height: 88svh;
    align-items: stretch;
    padding: 0;
    background: none;
  }
  .fiche-corps {
    width: 100%;
    max-height: 88svh;
    padding: 26px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--ligne);
    background: var(--feuille);
  }
  #fiche .fiche-image img { max-height: 34svh; }

  #toast { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 420px) {
  .identite-sous { display: none; }
  .ancre--legende .ancre-desc { display: none; }
}

/* =====================================================================================
   15. Mouvement réduit, impression
   ===================================================================================== */
/* Mouvement réduit : aucun glissement, un simple fondu de 0,3 s ; le titre apparaît en fondu */
@media (prefers-reduced-motion: reduce) {
  #statut .statut-point::after,
  .pastille-point::after,
  .defiler-ligne { animation: none !important; }
  #rail .rail-nom { transform: none; }
  .chapitre .titre .mot > span { transform: none !important; }
  .chapitre .bloc > .titre { opacity: 0; transition: opacity .3s linear; }
  html:not([data-phase="intro"]) .chapitre.actif:not(.sortie) :is(.bloc:not(.sous-etape), .sous-etape.actif) > .titre,
  html[data-intro~="titre"] .chapitre.actif:not(.sortie) :is(.bloc:not(.sous-etape), .sous-etape.actif) > .titre { opacity: 1; }
  .chapitre .bloc > * {
    transform: none !important;
    transition-property: opacity, visibility !important;
    transition-duration: .3s, 0s !important;
    transition-timing-function: linear, linear !important;
    transition-delay: 0s, 0s !important;
  }
  .chapitre.sortie .bloc > * { transition-delay: 0s, .3s !important; }
  #fiche .fiche-corps > * { transform: none !important; }
}

@media print {
  canvas#scene,
  #lisibilite,
  #chrome,
  #rail,
  #ancres,
  #curseur,
  #fiche,
  #menu-mobile,
  #toast,
  #entree,
  .menu-plus-panneau,
  #defilement,
  #chargement,
  .lire-suite,
  body::before,
  body::after { display: none !important; }
  #contenu, .chapitre, .chapitre .bloc { position: static !important; visibility: visible !important; opacity: 1 !important; transform: none !important; }
  .chapitre { margin-bottom: 32px; }
  /* États de repos des apparitions (blocs à opacité 0, mots du titre décalés de 110 %) neutralisés */
  .chapitre :is(.bloc > *, .titre .mot > span) {
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .chapitre .sous-etape { visibility: visible !important; }
  .chapitre .texte:not([hidden]) {
    display: block !important;
    -webkit-line-clamp: unset !important;
    line-clamp: none !important;
    overflow: visible !important;
  }
}
