/* ==========================================================================
   sitefaitbienfait.fr — le panneau d'affichage, et l'habillage des tons
   --------------------------------------------------------------------------
   Un mode se pose par data-mode sur <html> (normal : pas d'attribut). Il
   redéfinit les JETONS (couleurs, polices, rayon) et quelques règles de
   caractère. Tout le reste suit, puisque le site n'écrit aucune couleur en dur.
   ========================================================================== */

/* --- Le bandeau du ton : sous l'en-tête collé, donc toujours visible -------
   Hors du ton normal, il dit que c'est pour rire et propose le retour en un
   clic. Une seule ligne (spec 08, 2026-10-16 : sur trois lignes, il prenait
   81 px de haut sur téléphone) ; l'explication est dans le panneau. */
.tete__mode { display: none; }
:root[data-mode] .tete__mode {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0.3125rem var(--marge);
  font-size: 0.8125rem;
  line-height: 1.35;
  white-space: nowrap;
  color: var(--plan);
  background: var(--bleu);
}
.tete__mode > span { overflow: hidden; text-overflow: ellipsis; }
.tete__mode-retour {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.75rem;
  font: inherit;
  font-weight: 600;
  color: inherit;
  background: none;
  border: 1px solid currentColor;
  border-radius: 999px;
  cursor: pointer;
}
.tete__mode-retour:hover { background: color-mix(in srgb, var(--plan) 18%, transparent); }
:root[data-mode='geek'] .tete__mode-retour { border-radius: 0; }

/* --- L'en-tête tient dans un téléphone, dans tous les tons -----------------
   La marque, le bouton du ton et « réglages » ne se resserrent pas : sans
   ces règles, la page débordait de l'écran en agence, geek et IA (mesuré le
   2026-10-16). */
@media (max-width: 30rem) {
  .tete--refonte { gap: 0.75rem; }
  .tete--refonte .tete__actions { gap: 0.5rem; }
  :root[data-mode='corporate'] .tete__actions .bouton { padding-inline: 0.875rem; letter-spacing: 0.08em; }
}
/* Hors du ton normal seulement (son « Écrire » tient) : la marque perd son
   « .fr » et un cran de taille. */
@media (max-width: 26rem) {
  :root[data-mode] .tete--refonte .marque { font-size: 1rem; }
  :root[data-mode] .marque__domaine { display: none; }
  /* Le picto du retour est décoratif : sans lui, « On peut en rire, parfois »
     et « Redevenir sérieux » tiennent sur une ligne à 360 px. */
  .tete__mode-retour .picto { display: none; }
  :root[data-mode] .tete__mode { gap: 0.5rem; }
}

/* --- Ce qui ouvre le panneau -----------------------------------------------
   Sur ordinateur, une languette au bord droit ; sur téléphone (sous 52 rem,
   là où la navigation disparaît), le bouton « réglages » de l'en-tête. Sans
   script, ni l'un ni l'autre : ils n'ouvriraient rien (règle de la charte). */
.languette,
.tete__reglages { display: none; }
@media (min-width: 52.01rem) {
  .js .languette {
    position: fixed;
    z-index: 30;
    right: 0;
    top: 50%;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 3rem;
    padding: 0 0 0 0.125rem;
    color: var(--encre-doux);
    background: color-mix(in srgb, var(--plan) 90%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--trait);
    border-right: 0;
    border-radius: var(--rayon) 0 0 var(--rayon);
    transform: translateY(-50%);
    cursor: pointer;
    transition: color var(--transition), width var(--transition);
  }
  .languette:hover,
  .languette[aria-expanded='true'] { color: var(--bleu); width: 3.25rem; }
}
@media (max-width: 52rem) {
  .js .tete__reglages {
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    color: var(--encre-doux);
    background: none;
    border: 1px solid var(--trait);
    border-radius: 50%;
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
  }
  .js .tete__reglages:hover,
  .js .tete__reglages[aria-expanded='true'] { color: var(--bleu); border-color: var(--bleu); }
}

/* --- Le panneau ------------------------------------------------------------
   Il glisse depuis la droite, sur toute la hauteur ; la page s'assombrit
   derrière et ne défile plus. */
html.panneau-ouvert { overflow: hidden; }

.reglages {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(24rem, calc(100vw - 2.5rem));
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0 1.5rem 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--encre);
  background: var(--plan);
  border: 0;
  border-left: 1px solid var(--trait);
}
/* ::backdrop n'hérite des jetons que dans les navigateurs récents : ailleurs,
   pas de voile, le panneau reste utilisable. */
.reglages::backdrop { background: var(--voile); }
.reglages[open] { animation: reglages-entree 280ms cubic-bezier(0.2, 0.6, 0.3, 1); }
.reglages[open]::backdrop { animation: reglages-voile 280ms ease; }
.reglages.est-sortant { animation: reglages-sortie 200ms ease-in forwards; }
.reglages.est-sortant::backdrop { animation: reglages-voile 200ms ease reverse forwards; }
@keyframes reglages-entree { from { transform: translateX(100%); } }
@keyframes reglages-sortie { to { transform: translateX(100%); } }
@keyframes reglages-voile { from { opacity: 0; } }

.reglages__tete {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 -1.5rem;
  padding: 0.875rem 1.5rem;
  background: var(--plan);
  border-bottom: 1px solid var(--trait);
}
.reglages__titre {
  margin: 0;
  font-family: var(--titre);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.022em;
}
.reglages__fermer {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--encre-doux);
  background: none;
  border: 1px solid var(--trait);
  border-radius: 50%;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.reglages__fermer:hover { color: var(--bleu); border-color: var(--bleu); }

.reglages__groupe { margin-top: 1.75rem; }
/* Le traitement des titres de section du site, en plus petit. */
.reglages__intitule {
  margin: 0 0 0.875rem;
  padding-bottom: 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--encre-doux);
  border-bottom: 1px solid var(--trait);
}

/* Le thème : deux boutons sur une ligne, l'actif plein. */
.reglages__themes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--plan-creux);
  border: 1px solid var(--trait);
  border-radius: 999px;
}
.reglages__theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.25rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--encre-doux);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}
.reglages__theme:hover { color: var(--encre); }
.reglages__theme[aria-pressed='true'] { color: var(--sur-bleu); background: var(--bleu); }
.reglages__theme[disabled] { cursor: not-allowed; opacity: 0.45; }
/* Pourquoi le thème ne change rien : remplie par modes.js pour un ton qui
   impose son habillage (theme_fige dans modes.php), vide sinon. */
.reglages__note { margin: 0.5rem 0 0; font-size: 0.8125rem; color: var(--encre-doux); }
.reglages__note:empty { display: none; }

/* La mention d'un ton, en bas de page (« pied.mention ») : vide au ton normal. */
.pied__mention { flex-basis: 100%; margin: 0.25rem 0 0; font-size: 0.8125rem; }
.pied__mention:empty { display: none; }

.reglages__intro {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--encre-doux);
  text-wrap: pretty;
}

/* Les tons : des lignes de registre, pas des cartes. */
.reglages__tons { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--trait); }
.reglages__ton {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 0.875rem;
  row-gap: 0.125rem;
  align-items: center;
  width: 100%;
  padding: 0.75rem 0.75rem 0.75rem 0.625rem;
  font: inherit;
  text-align: left;
  color: var(--encre);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--trait);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.reglages__ton > .picto:first-child { grid-row: span 2; color: var(--encre-doux); }
.reglages__nom { font-weight: 700; font-size: 0.9375rem; }
.reglages__desc { grid-column: 2; font-size: 0.8125rem; line-height: 1.35; color: var(--encre-doux); }
.reglages__coche { grid-column: 3; grid-row: 1 / span 2; color: var(--bleu); opacity: 0; }
.reglages__ton:hover { background: var(--plan-creux); }
.reglages__ton:hover > .picto:first-child { color: var(--bleu); }
/* Le trait bleu à gauche de l'actif : celui des onglets, couché. */
.reglages__ton[aria-pressed='true'] { background: var(--plan-creux); box-shadow: inset 3px 0 0 var(--bleu); }
.reglages__ton[aria-pressed='true'] > .picto:first-child,
.reglages__ton[aria-pressed='true'] .reglages__nom { color: var(--bleu); }
.reglages__ton[aria-pressed='true'] .reglages__coche { opacity: 1; }

.reglages__pied {
  margin: 1.5rem 0 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--encre-doux);
}

/* ::backdrop échappe à la règle générale du mouvement réduit (style.css). */
@media (prefers-reduced-motion: reduce) {
  .reglages::backdrop, .reglages.est-sortant::backdrop { animation: none; }
}

/* Les tons à angles vifs les gardent ici aussi. */
:root:is([data-mode='corporate'], [data-mode='geek']) :is(.reglages__themes, .reglages__theme, .tete__reglages, .reglages__fermer, .tiroir__fermer, .languette) { border-radius: 0; }

/* --- L'annonce d'un changement de ton : un clin d'œil, en bas à droite ---- */
.annonce-ton {
  position: fixed;
  z-index: 30;
  right: 1rem;
  bottom: 1rem;
  width: max-content;
  max-width: min(20rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--plan);
  background: var(--encre);
  border-radius: var(--rayon);
  opacity: 0;
  pointer-events: none;
}
.annonce-ton.est-visible { animation: annonce-ton 3800ms ease both; }
@keyframes annonce-ton {
  0% { opacity: 0; transform: translateY(8px); }
  8%, 85% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}

/* ==========================================================================
   CORPORATE : on se prend pour un grand cabinet
   Revu le 2026-10-15 : la première version (violet, dégradés, grands
   arrondis, ombres) ressemblait trop au mode IA. Celle-ci joue le cabinet de
   conseil : bleu marine et or, titres à empattements, angles vifs, filets
   fins, capitales espacées, aucun dégradé, aucune ombre. Sobre, cher, un peu
   solennel : l'inverse du mode IA.
   ========================================================================== */
:root[data-mode='corporate'] {
  --plan: #fbfaf6;
  --plan-creux: #f2efe6;
  --encre: #0a1f44;
  --encre-doux: #4a5873;
  --trait: #d9d3c2;
  --bleu: #0b3d91;
  --bleu-vif: #7a5d18;
  --sur-bleu: #ffffff;
  --fond-champ: #ffffff;
  --rayon: 2px;
  --titre: Georgia, 'Times New Roman', 'Liberation Serif', serif;
  --agence-or: #7a5d18;
}
:root[data-mode='corporate'][data-theme='sombre'] {
  --plan: #0a1428;
  --plan-creux: #101d36;
  --encre: #f3efe4;
  --encre-doux: #a9b4c7;
  --trait: #24324d;
  --bleu: #9db8f0;
  --bleu-vif: #d4b26a;
  --sur-bleu: #0a1428;
  --fond-champ: #101d36;
  --agence-or: #d4b26a;
}
@media (prefers-color-scheme: dark) {
  :root[data-mode='corporate']:not([data-theme='clair']) {
    --plan: #0a1428;
    --plan-creux: #101d36;
    --encre: #f3efe4;
    --encre-doux: #a9b4c7;
    --trait: #24324d;
    --bleu: #9db8f0;
    --bleu-vif: #d4b26a;
    --sur-bleu: #0a1428;
    --fond-champ: #101d36;
    --agence-or: #d4b26a;
  }
}

:root[data-mode='corporate'] :is(h1, h2, h3) { font-weight: 600; letter-spacing: -0.01em; }

/* Les titres de section : capitales très espacées, en or, précédées d'un
   filet. La signature des rapports annuels. */
:root[data-mode='corporate'] .section__titre {
  font-family: var(--texte);
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--agence-or);
}
:root[data-mode='corporate'] .section__titre::before {
  content: '';
  display: inline-block;
  width: 2.5rem;
  height: 1px;
  margin-right: 1rem;
  vertical-align: middle;
  background: var(--agence-or);
}

/* Les boutons : rectangles, capitales espacées. */
:root[data-mode='corporate'] .bouton {
  border-radius: 0;
  padding: 1rem 1.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
:root[data-mode='corporate'] :is(.bloc__etiquette, .exemple-tete__etiquette, .technos__famille) {
  font-family: var(--texte);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--agence-or);
}
:root[data-mode='corporate'] .statut {
  border-radius: 0;
  font-family: var(--texte);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Pas de surligneur : un filet d'or sous le mot, et l'italique des titres
   de couverture. */
:root[data-mode='corporate'] :is(.surligne, .diapo__titre) {
  background-image: linear-gradient(transparent 90%, var(--agence-or) 90% 96%, transparent 96%);
  animation: none;
}
:root[data-mode='corporate'] .accroche__ligne:last-child { font-style: italic; }

/* Les cercles deviennent des anneaux fins. */
:root[data-mode='corporate'] :is(.accroche__cercle, .diapo__sceau) {
  background: none;
  border: 1px solid color-mix(in srgb, var(--agence-or) 45%, transparent);
}

/* Les scènes : papier, filet fin, angles vifs ; le fil et les repères en or. */
:root[data-mode='corporate'] .diapo__scene { background: var(--plan); }
:root[data-mode='corporate'] .ligne-blocs__fil { color: var(--agence-or); }
:root[data-mode='corporate'] .bloc__repere { border-color: var(--agence-or); border-radius: 0; }
:root[data-mode='corporate'] .bloc__numero { -webkit-text-stroke-color: var(--agence-or); font-family: var(--titre); }
:root[data-mode='corporate'] :is(.puce, .techno, .diapo__bouton, .telephone, .telephone__image) { border-radius: var(--rayon); }

/* ==========================================================================
   GEEK : le terminal
   Noir, vert phosphore, tout en mono, des lignes de balayage, pas un arrondi.
   Toujours de nuit : le thème clair n'y change rien.
   ========================================================================== */
:root[data-mode='geek'] {
  --plan: #030703;
  --plan-creux: #071107;
  --encre: #39ff6a;
  --encre-doux: #1fa847;
  --trait: #12401f;
  --bleu: #39ff6a;
  --bleu-vif: #a6ffbd;
  --sur-bleu: #030703;
  --sombre: #020502;
  --fond-champ: #071107;
  --erreur: #ff5f56;
  --rayon: 0;
  --titre: var(--mono);
  --texte: var(--mono);
  color-scheme: dark;
}
:root[data-mode='geek'] body {
  background: transparent;
  text-shadow: 0 0 6px color-mix(in srgb, var(--encre) 35%, transparent);
}
:root[data-mode='geek'] { background: var(--plan); }

/* Les lignes de balayage d'un vieil écran, par-dessus tout, sans gêner la souris. */
:root[data-mode='geek'] body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  background: repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, 0.18) 2px 3px);
}

/* Une commande s'écrit en minuscules : pas de capitales sur les titres. */
:root[data-mode='geek'] .section__titre { text-transform: none; letter-spacing: 0.02em; }
:root[data-mode='geek'] .section__titre::before { content: '$ '; color: var(--encre-doux); }
:root[data-mode='geek'] .bouton { border-radius: 0; }
:root[data-mode='geek'] .bouton--plein { color: var(--plan); }
:root[data-mode='geek'] .diapo__numero { -webkit-text-stroke: 1px var(--bleu); }
:root[data-mode='geek'] .surligne,
:root[data-mode='geek'] .diapo__titre { background-image: linear-gradient(transparent 58%, color-mix(in srgb, var(--bleu) 22%, transparent) 58% 92%, transparent 92%); }
/* Les captures passent au phosphore… */
.fenetre__image,
.telephone__image { transition: filter 700ms ease; }
:root[data-mode='geek'] .fenetre__image,
:root[data-mode='geek'] .telephone__image { filter: grayscale(1) sepia(1) hue-rotate(70deg) saturate(2.6) brightness(0.85); }
/* …sauf celles qu'on a déchiffrées. */
:root[data-mode='geek'] .est-dechiffre .fenetre__image,
:root[data-mode='geek'] .est-dechiffre .telephone__image { filter: none; }

/* Le bouton de déchiffrement, en geek seulement, en bas à droite de la capture. */
/* `:where` : priorité nulle, pour ne jamais écraser un cadre déjà placé
   (les écrans de l'établi sont en position absolue). */
:where(.chiffrable) { position: relative; }
.dechiffrer { display: none; }
:root[data-mode='geek'] .dechiffrer {
  position: absolute;
  z-index: 2;
  right: 0.625rem;
  bottom: 0.625rem;
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--encre);
  background: var(--plan);
  border: 1px solid var(--bleu);
  cursor: pointer;
}
:root[data-mode='geek'] .dechiffrer:hover { color: var(--plan); background: var(--bleu); }

/* Le petit terminal qui s'ouvre sur l'image pendant le déchiffrement. */
.dechiffrage {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  align-content: end;
  gap: 0.25rem;
  padding: 0.875rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--encre);
  background: rgba(3, 7, 3, 0.86);
  transition: opacity 400ms ease;
}
.dechiffrage.est-fini { opacity: 0; }
:root[data-mode='geek'] .accroche__cercle { background: radial-gradient(circle, color-mix(in srgb, var(--bleu) 10%, transparent), transparent 70%); }

/* Le curseur qui clignote pendant qu'un texte se tape. */
.en-frappe::after {
  content: '█';
  margin-left: 0.1em;
  animation: diapo-curseur 900ms steps(1) infinite;
}

/* La pluie de caractères : derrière tout, très pâle. */
.pluie {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.16;
  pointer-events: none;
}

/* L'écran de démarrage, le temps d'un battement. Couleurs écrites ici et non
   en jetons : il s'affiche AVANT que le mode geek ait fini de se poser. */
.demarrage {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-content: center;
  gap: 0.375rem;
  padding: 0 max(1.5rem, 20vw);
  font-family: var(--mono);
  font-size: clamp(0.875rem, 0.8rem + 0.4vw, 1.125rem);
  color: #39ff6a;
  background: #030703;
  text-shadow: 0 0 8px rgba(57, 255, 106, 0.5);
  transition: opacity 500ms ease;
}
.demarrage.est-fini { opacity: 0; }

/* ==========================================================================
   FUN : on rigole
   Crème et corail, une police de titre qu'on ne présente plus, des scènes un
   peu de travers, des boutons qui se dandinent.
   ========================================================================== */
:root[data-mode='fun'] {
  --plan: #fff8ec;
  --plan-creux: #ffeed5;
  --encre: #2b1a3d;
  --encre-doux: #6e5684;
  --trait: #f2cf9f;
  /* Corail foncé : le #ff4f6d d'origine faisait 3,0 sur la crème. */
  --bleu: #c42d4b;
  --bleu-vif: #a8233f;
  --sur-bleu: #ffffff;
  --fun-jaune: #ffd23f;
  --fun-violet: #8f5cff;
  --fond-champ: #fffdf8;
  --rayon: 22px;
  --titre: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', ui-rounded, cursive;
}
:root[data-mode='fun'][data-theme='sombre'] {
  --plan: #1f1430;
  --plan-creux: #2b1d42;
  --encre: #fff2e0;
  --encre-doux: #d6bfe9;
  --trait: #4a3566;
  --bleu: #ff6f88;
  --bleu-vif: #ffa25c;
  --sur-bleu: #1f1430;
  --fond-champ: #2b1d42;
}
@media (prefers-color-scheme: dark) {
  :root[data-mode='fun']:not([data-theme='clair']) {
    --plan: #1f1430;
    --plan-creux: #2b1d42;
    --encre: #fff2e0;
    --encre-doux: #d6bfe9;
    --trait: #4a3566;
    --bleu: #ff6f88;
    --bleu-vif: #ffa25c;
    --fond-champ: #2b1d42;
  }
}

:root[data-mode='fun'] .section__titre { font-family: var(--titre); font-size: 1.125rem; letter-spacing: 0.04em; }
:root[data-mode='fun'] .ligne-blocs { transform: rotate(-0.6deg); }
:root[data-mode='fun'] .technos,
:root[data-mode='fun'] .ecrire { transform: rotate(0.6deg); }
:root[data-mode='fun'] .surligne,
:root[data-mode='fun'] .diapo__titre {
  background-image: linear-gradient(transparent 50%, var(--fun-jaune) 50% 92%, transparent 92%);
}
:root[data-mode='fun'] .diapo__bandeau { transform: rotate(-4deg); }
/* L'adresse du sceau en corail ne passait pas 3,9 de contraste : en violet doux. */
:root[data-mode='fun'] .diapo__sceau-nom { color: var(--encre-doux); }
:root[data-mode='fun'] .accroche__cercle,
:root[data-mode='fun'] .diapo__sceau { background: color-mix(in srgb, var(--fun-jaune) 30%, transparent); }

/* Fun sombre : le jaune sous un texte clair ne se lisait pas (1,3). Le
   surligneur devient un trait de stabilo pleine hauteur, le texte passe en
   foncé (12,1). Le cercle jaune, lui, pâlit : il brunissait le fond. */
:root[data-mode='fun'][data-theme='sombre'] :is(.surligne, .diapo__titre) {
  color: #1f1430;
  background-image: linear-gradient(transparent 6%, var(--fun-jaune) 6% 96%, transparent 96%);
}
:root[data-mode='fun'][data-theme='sombre'] :is(.accroche__cercle, .diapo__sceau) {
  background: color-mix(in srgb, var(--fun-jaune) 12%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root[data-mode='fun']:not([data-theme='clair']) :is(.surligne, .diapo__titre) {
    color: #1f1430;
    background-image: linear-gradient(transparent 6%, var(--fun-jaune) 6% 96%, transparent 96%);
  }
  :root[data-mode='fun']:not([data-theme='clair']) :is(.accroche__cercle, .diapo__sceau) {
    background: color-mix(in srgb, var(--fun-jaune) 12%, transparent);
  }
}
:root[data-mode='fun'] .bouton:hover { animation: fun-dandiner 500ms ease; }
@keyframes fun-dandiner {
  25% { transform: rotate(-3deg) scale(1.04); }
  50% { transform: rotate(3deg) scale(1.04); }
  75% { transform: rotate(-1.5deg); }
}

.confetti {
  position: fixed;
  z-index: 50;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  background: var(--couleur);
  pointer-events: none;
}

/* ==========================================================================
   IA : le site que sort une IA quand on lui demande « un site pro »
   Indigo, violet, rose en dégradé ; des taches de couleur floues en fond ;
   des cartes arrondies à l'ombre douce, aux teintes alternées comme un
   tableau de bord de démonstration ; des titres centrés sous une pastille ;
   des émojis partout (ils sont dans les textes). Toutes les couleurs de
   texte ont été mesurées (spec 07).
   ========================================================================== */
:root[data-mode='ia'] {
  --plan: #ffffff;
  --plan-creux: #f8fafc;
  --encre: #0f172a;
  --encre-doux: #475569;
  --trait: #e2e8f0;
  --bleu: #4f46e5;
  --bleu-vif: #9333ea;
  --sur-bleu: #ffffff;
  --fond-champ: #f8fafc;
  --rayon: 16px;
  --ia-rose: #db2777;
  --ia-teinte-1: #eef2ff;
  --ia-teinte-2: #faf5ff;
  --ia-teinte-3: #ecfdf5;
  --ia-teinte-4: #fff7ed;
  --ia-ombre: 0 12px 32px -14px rgba(79, 70, 229, 0.35);
}
:root[data-mode='ia'][data-theme='sombre'] {
  --plan: #0b1120;
  --plan-creux: #111827;
  --encre: #f1f5f9;
  --encre-doux: #94a3b8;
  --trait: #1e293b;
  --bleu: #818cf8;
  --bleu-vif: #c084fc;
  --sur-bleu: #0b1120;
  --fond-champ: #111827;
  --ia-rose: #f472b6;
  --ia-teinte-1: #1e1b4b;
  --ia-teinte-2: #2e1065;
  --ia-teinte-3: #052e2b;
  --ia-teinte-4: #3b1d0b;
  --ia-ombre: 0 12px 32px -14px rgba(0, 0, 0, 0.6);
}
@media (prefers-color-scheme: dark) {
  :root[data-mode='ia']:not([data-theme='clair']) {
    --plan: #0b1120;
    --plan-creux: #111827;
    --encre: #f1f5f9;
    --encre-doux: #94a3b8;
    --trait: #1e293b;
    --bleu: #818cf8;
    --bleu-vif: #c084fc;
    --sur-bleu: #0b1120;
    --fond-champ: #111827;
    --ia-rose: #f472b6;
    --ia-teinte-1: #1e1b4b;
    --ia-teinte-2: #2e1065;
    --ia-teinte-3: #052e2b;
    --ia-teinte-4: #3b1d0b;
    --ia-ombre: 0 12px 32px -14px rgba(0, 0, 0, 0.6);
  }
}

/* Les taches de couleur floues, en haut à droite et à gauche. */
:root[data-mode='ia'] body {
  background:
    radial-gradient(48rem 28rem at 90% -5%, color-mix(in srgb, var(--bleu-vif) 18%, transparent), transparent 70%),
    radial-gradient(40rem 26rem at -8% 30%, color-mix(in srgb, var(--bleu) 14%, transparent), transparent 70%),
    var(--plan);
  background-attachment: fixed;
}
:root[data-mode='ia'] :is(.accroche__cercle, .diapo__sceau) {
  background: radial-gradient(circle, color-mix(in srgb, var(--ia-rose) 18%, transparent), transparent 68%);
}
:root[data-mode='ia'] .diapo__sceau-nom { display: none; }

/* Le dégradé dans la lettre, sur tout ce qui se veut important. */
:root[data-mode='ia'] :is(.surligne, .diapo__titre, .accroche__ligne:last-child) {
  background-image: linear-gradient(90deg, var(--bleu), var(--bleu-vif), var(--ia-rose));
  background-size: 100% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: none;
}

/* Les titres de section : centrés, dans une pastille. */
:root[data-mode='ia'] .section__titre {
  display: table;
  margin-inline: auto;
  margin-bottom: 2rem;
  padding: 0.375rem 1rem;
  font-family: var(--texte);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--bleu);
  background: color-mix(in srgb, var(--bleu) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--bleu) 25%, transparent);
  border-radius: 999px;
}
:root[data-mode='ia'] .statut {
  border-radius: 999px;
  color: var(--bleu);
  background: color-mix(in srgb, var(--bleu) 8%, var(--plan));
  border-color: color-mix(in srgb, var(--bleu) 25%, transparent);
}
:root[data-mode='ia'] .statut__point { display: none; }

/* Les boutons : dégradé, coins arrondis, ombre colorée. */
:root[data-mode='ia'] .bouton { border-radius: 12px; }
:root[data-mode='ia'] .bouton--plein {
  border: 0;
  background: linear-gradient(90deg, var(--bleu), var(--bleu-vif));
  box-shadow: var(--ia-ombre);
}

/* Les scènes deviennent transparentes ; les blocs, des cartes aux teintes
   alternées, comme sur toutes les pages « features » générées. */
:root[data-mode='ia'] .ligne-blocs {
  background: none;
  border: 0;
  padding-inline: 0;
}
:root[data-mode='ia'] :is(.ligne-blocs__fil, .bloc__repere) { display: none; }
:root[data-mode='ia'] .ligne-blocs__liste { padding-top: 0; }
:root[data-mode='ia'] .bloc {
  padding: 1.5rem;
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ia-ombre);
}
:root[data-mode='ia'] .bloc:nth-child(4n + 1) { background: var(--ia-teinte-1); }
:root[data-mode='ia'] .bloc:nth-child(4n + 2) { background: var(--ia-teinte-2); }
:root[data-mode='ia'] .bloc:nth-child(4n + 3) { background: var(--ia-teinte-3); }
:root[data-mode='ia'] .bloc:nth-child(4n + 4) { background: var(--ia-teinte-4); }
:root[data-mode='ia'] .bloc__numero { display: none; }
:root[data-mode='ia'] .diapo__scene.ligne-blocs { box-shadow: none; padding-bottom: 1rem; }  /* plus précis que la règle des ombres, plus bas */
:root[data-mode='ia'] .ligne-blocs .diapo__sceau { display: none; }
/* Le picto dans sa tuile arrondie, l'étiquette en police ordinaire : la
   carte « fonctionnalité » de manuel. */
:root[data-mode='ia'] .bloc__tete .picto {
  /* Le dessin garde 24 px (et son trait de 1,8 px) ; la tuile s'ajoute
     autour, d'où content-box. */
  --t: 24;
  box-sizing: content-box;
  padding: 0.5rem;
  color: var(--bleu);
  background: var(--plan);
  border-radius: 12px;
  box-shadow: 0 4px 12px -6px rgba(79, 70, 229, 0.4);
}
:root[data-mode='ia'] :is(.bloc__etiquette, .statut, .exemple-tete__etiquette, .technos__famille) {
  font-family: var(--texte);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
:root[data-mode='ia'] :is(.diapo__scene, .fenetre, .technos, .ecrire, .techno) { box-shadow: var(--ia-ombre); }
:root[data-mode='ia'] .techno:nth-child(4n + 1) { background: var(--ia-teinte-1); }
:root[data-mode='ia'] .techno:nth-child(4n + 2) { background: var(--ia-teinte-2); }
:root[data-mode='ia'] .techno:nth-child(4n + 3) { background: var(--ia-teinte-3); }
:root[data-mode='ia'] .techno:nth-child(4n + 4) { background: var(--ia-teinte-4); }

/* La mention, en pied de page aussi (« pied.mention » dans modes.php). */
:root[data-mode='ia'] .pied__mention { font-weight: 600; color: var(--bleu); }

/* Le faux chargement, le temps d'un soupir. Couleurs écrites ici : il
   s'affiche avant que le mode ait fini de se poser. */
.generation {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  padding: 1.5rem;
  text-align: center;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: #0f172a;
  background: radial-gradient(40rem 24rem at 50% 40%, #ede9fe, #ffffff 70%);
  transition: opacity 500ms ease;
}
.generation.est-fini { opacity: 0; }
.generation__titre {
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.75rem);
  font-weight: 700;
  background-image: linear-gradient(90deg, #4f46e5, #9333ea, #db2777);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.generation__barre {
  width: min(22rem, 80vw);
  height: 6px;
  border-radius: 999px;
  background: #e0e7ff;
  overflow: hidden;
}
.generation__barre span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f46e5, #9333ea, #db2777);
  animation: generation-scintille 900ms ease-in-out infinite;
}
@keyframes generation-scintille {
  from { transform: translateX(-100%); }
  to   { transform: translateX(250%); }
}
.generation__etape { font-size: 0.875rem; color: #475569; }

/* Les onglets suivent les angles de chaque ton. */
:root:is([data-mode='corporate'], [data-mode='geek'], [data-mode='an2000']) .onglets__onglet { border-radius: 0; }

/* ==========================================================================
   AN 2000 : le web d'avant (spec 10, 2026-10-16)
   Une page perso de l'an 2000, façon Windows 98 : fond gris, boutons et
   cadres en relief (clair en haut à gauche, sombre en bas à droite), barres
   de titre en dégradé bleu, Times New Roman, liens bleus soulignés. Un texte
   qui clignote (trois fois, pas plus), un bandeau qui défile (une fois), un
   ruban « en construction ». Polices du système, rien de téléchargé.
   Toujours gris, de jour comme de nuit : le thème n'y peut rien (theme_fige
   dans modes.php). Ces jetons, déclarés après ceux du thème sombre de
   style.css et avec le même poids, l'emportent dans tous les cas.
   ========================================================================== */
:root[data-mode='an2000'] {
  --plan: #c0c0c0;
  --plan-creux: #d4d0c8;
  --encre: #000000;
  --encre-doux: #303030;
  --trait: #808080;
  --bleu: #000080;
  --bleu-vif: #0000ee;
  --sur-bleu: #ffffff;
  --fond-champ: #ffffff;
  --rayon: 0px;
  --voile: rgb(0 0 0 / 0.35);
  --titre: 'Arial Black', 'Arial', Helvetica, sans-serif;
  --texte: 'Times New Roman', Times, serif;
  --mono: 'Courier New', Courier, monospace;
  --an-clair: #ffffff;
  --an-ombre: #808080;
  --an-noir: #000000;
  --an-titre-debut: #000080;
  --an-titre-fin: #1084d0;
  --an-sur-titre: #ffffff;
  --an-jaune: #ffff00;
  /* Pas le rouge pur : #ff0000 ne faisait que 4,0 sur blanc. #cc0000 : 5,9
     sur blanc, 3,3 sur le gris (en grands caractères, 3 suffisent). */
  --an-rouge: #cc0000;
  --an-lien: #0000ee;
  --an-scene: #ffffff;
  --an-sans: 'Arial', Helvetica, sans-serif;
  color-scheme: light;
}

/* Le cercle de l'accroche et le sceau des scènes n'existaient pas en 2000. */
:root[data-mode='an2000'] :is(.accroche__cercle, .diapo__sceau) { display: none; }

/* --- Le relief : la signature de l'époque ---------------------------------- */
:root[data-mode='an2000'] :is(.bouton, .tete__reglages, .reglages__fermer, .tiroir__fermer, .reglages__theme, .diapo__bouton, .languette, .tete__mode-retour, .onglets__onglet, .puce) {
  border: 2px solid;
  border-color: var(--an-clair) var(--an-noir) var(--an-noir) var(--an-clair);
  border-radius: 0;
  box-shadow: inset -1px -1px var(--an-ombre);
}
:root[data-mode='an2000'] :is(.bouton, .bouton--plein) {
  color: var(--encre);
  background: var(--plan);
  font-family: var(--an-sans);
  font-weight: 700;
}
:root[data-mode='an2000'] :is(.bouton, .diapo__bouton, .onglets__onglet):active {
  border-color: var(--an-noir) var(--an-clair) var(--an-clair) var(--an-noir);
  box-shadow: inset 1px 1px var(--an-ombre);
}
:root[data-mode='an2000'] .puce {
  color: var(--encre);
  background: var(--plan);
  font-family: var(--mono);
  font-weight: 700;
}
/* Les cadres creusés : scènes, champs. */
:root[data-mode='an2000'] :is(.diapo__scene, .ligne-blocs, .technos, .ecrire, .champ__saisie, .formulaire input, .formulaire textarea) {
  border: 2px solid;
  border-color: var(--an-ombre) var(--an-clair) var(--an-clair) var(--an-ombre);
  border-radius: 0;
  background: var(--an-scene);
  box-shadow: none;
}

/* --- Les fenêtres : barre de titre en dégradé bleu -------------------------- */
:root[data-mode='an2000'] .fenetre {
  border: 2px solid;
  border-color: var(--an-clair) var(--an-noir) var(--an-noir) var(--an-clair);
  border-radius: 0;
  background: var(--plan);
  box-shadow: none;
}
:root[data-mode='an2000'] .fenetre__barre {
  color: var(--an-sur-titre);
  font-family: var(--an-sans);
  font-weight: 700;
  background: linear-gradient(90deg, var(--an-titre-debut), var(--an-titre-fin));
  border-bottom: 0;
}
:root[data-mode='an2000'] .fenetre__barre :is(.fenetre__adresse, .picto) { color: var(--an-sur-titre); }
:root[data-mode='an2000'] .fenetre__points { order: 9; margin-left: auto; }
/* Les pseudo-éléments ne vont pas dans :is() : trois sélecteurs. */
:root[data-mode='an2000'] .fenetre__points::before,
:root[data-mode='an2000'] .fenetre__points::after,
:root[data-mode='an2000'] .fenetre__points span {
  border-radius: 0;
  background: var(--plan);
  border: 1px solid;
  border-color: var(--an-clair) var(--an-noir) var(--an-noir) var(--an-clair);
}

/* --- Les titres et les liens ------------------------------------------------- */
:root[data-mode='an2000'] .section__titre {
  font-family: var(--titre);
  font-size: 1.375rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--bleu);
  border-bottom: 2px groove var(--an-clair);
}
:root[data-mode='an2000'] .accroche__ligne {
  font-family: var(--texte);
  letter-spacing: 0;
  text-shadow: 3px 3px 0 var(--an-ombre);
}
/* Le surligneur devient un texte rouge qui clignote : trois fois, puis il
   s'arrête (ce qui bouge seul plus de cinq secondes doit pouvoir s'arrêter). */
/* `.js` en plus : la règle des apparitions (.js … .est-active .surligne,
   diaporama.css) pèse autant que celle-ci sans lui, et gardait son animation. */
:root.js[data-mode='an2000'] :is(.surligne, .diapo__titre) {
  background: none;
  color: var(--an-rouge);
  animation: an2000-clignote 1s steps(1) 3;
}
@keyframes an2000-clignote { 50% { visibility: hidden; } }
:root[data-mode='an2000'] :is(.lien, .tete__ancre) { color: var(--an-lien); text-decoration: underline; border-bottom: 0; }

/* --- La pastille : un ruban de chantier ---------------------------------------- */
:root[data-mode='an2000'] .accroche--refonte .statut {
  padding: 0.375rem 0.875rem;
  font-family: var(--an-sans);
  font-weight: 700;
  color: var(--an-noir);
  border: 2px solid var(--an-noir);
  border-radius: 0;
  background: repeating-linear-gradient(-45deg, var(--an-jaune) 0 14px, var(--an-noir) 14px 28px);
}
:root[data-mode='an2000'] .accroche--refonte .statut > span:last-child { padding: 0.0625rem 0.375rem; background: var(--an-jaune); }
:root[data-mode='an2000'] .statut__point { display: none; }

/* --- Le bandeau du ton : il arrive de la droite, une fois, puis s'arrête ----- */
:root[data-mode='an2000'] .tete__mode {
  color: var(--an-jaune);
  background: var(--an-noir);
  /* Arial et non Courier : plus étroite, elle tient sur une ligne à 360 px. */
  font-family: var(--an-sans);
  font-weight: 700;
}
:root[data-mode='an2000'] .tete__mode > span { animation: an2000-defile 4s linear 1; }
@keyframes an2000-defile { from { transform: translateX(100vw); } }
:root[data-mode='an2000'] .tete__mode-retour { padding-inline: 0.5rem; color: var(--encre); background: var(--plan); }

/* --- L'en-tête, le pied, les onglets, le panneau ----------------------------- */
:root[data-mode='an2000'] .tete--refonte {
  background: var(--plan);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom: 2px solid var(--an-ombre);
}
:root[data-mode='an2000'] .pied__mention { font-family: var(--an-sans); }
:root[data-mode='an2000'] .onglets__onglet { background: var(--plan); }
:root[data-mode='an2000'] .onglets__onglet[aria-selected='true'] { background: var(--an-scene); }
:root[data-mode='an2000'] .onglets__onglet::after { display: none; }
:root[data-mode='an2000'] .reglages { border-left: 2px solid var(--an-clair); }
:root[data-mode='an2000'] .reglages__themes { border-radius: 0; }
:root[data-mode='an2000'] .reglages__tete { background: linear-gradient(90deg, var(--an-titre-debut), var(--an-titre-fin)); }
:root[data-mode='an2000'] .reglages__titre { color: var(--an-sur-titre); font-family: var(--an-sans); }

/* --- À l'arrivée : la connexion par modem (modes.js) ------------------------- */
.connexion {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--voile);
  transition: opacity 400ms ease;
}
.connexion.est-fini { opacity: 0; }
.connexion__fenetre {
  width: min(24rem, calc(100vw - 2rem));
  font-family: var(--an-sans);
  font-size: 0.875rem;
  color: var(--encre);
  background: var(--plan);
  border: 2px solid;
  border-color: var(--an-clair) var(--an-noir) var(--an-noir) var(--an-clair);
}
.connexion__titre {
  margin: 0;
  padding: 0.25rem 0.5rem;
  font-weight: 700;
  color: var(--an-sur-titre);
  background: linear-gradient(90deg, var(--an-titre-debut), var(--an-titre-fin));
}
.connexion__lignes { display: grid; gap: 0.375rem; margin: 0; padding: 0.75rem 1rem 1rem; list-style: none; }

/* --- Les étoiles qui suivent la souris (modes.js) ----------------------------- */
.etincelle {
  position: fixed;
  z-index: 55;
  font-size: 0.875rem;
  line-height: 1;
  color: var(--couleur);
  pointer-events: none;
  animation: an2000-etincelle 700ms ease-out forwards;
}
@keyframes an2000-etincelle { to { transform: translateY(18px) scale(0.4); opacity: 0; } }
