/* =====================================================================================
   base.css — jetons, remise à zéro, typographie, boutons (SPEC_V3 §5.1, §5.3)
   Thème SOMBRE uniquement (charte « mode sombre » du 02/12/2026) : aucun mode clair, aucune variante
   prefers-color-scheme. Les noms de jetons gardent leur rôle, seules les valeurs changent :
   --encre = les fonds (nuit #08090D), --ivoire = le texte (blanc). Police : Outfit partout.
   Aucune dépendance aux classes posées sur <body>. Ombre de texte légère autorisée (lisibilité sur la 3D),
   aucun contour de lettres.
   ===================================================================================== */

/* ---------- Jetons ---------- */
:root {
  color-scheme: dark;

  /* Palette (charte sombre) */
  --encre: #08090D;          /* fonds (nuit) */
  --ivoire: #FFFFFF;         /* texte principal, 19:1 sur --encre */
  --argent: #C4C9D4;         /* texte secondaire, 12:1 */
  --plomb: #3A404C;          /* filets, piste du rail */
  --or: #FFD60A;             /* jaune du Trait en texte, 13:1 */
  --or-vif: #FFD60A;         /* jaune du Trait hors texte : ligne de chargement, remplissage du rail */
  --feuille: #12151C;        /* panneaux (surface) */
  --ligne: rgba(255, 255, 255, .14);  /* bord des panneaux */
  --texte-courant: #E6E9F0;  /* texte courant, 16:1 */
  --piste: #1B1F29;          /* piste de la ligne de chargement (surface haute) */

  /* Dérivés */
  --filet: rgba(255, 255, 255, .12);
  --filet-fort: rgba(255, 255, 255, .22);
  --ombre: 0 12px 40px rgba(0, 0, 0, .45);
  --contour: transparent;
  --panneau: rgba(14, 17, 24, .82);
  --voile: rgba(8, 9, 13, .88);
  /* Ombre de texte légère (charte) : lisibilité du texte blanc posé sur la 3D */
  --ombre-texte: 0 1px 14px rgba(0, 0, 0, .35);

  /* Accent et fond du monde courant (html[data-monde], posé par interface.js) */
  --accent: #FFD60A;
  --accent-texte: #FFFFFF;
  --fond: #08090D;
  /* Voile de lisibilité du monde (dégradé derrière la colonne de texte, bandeaux du chrome et du rail) */
  --voile-texte: rgba(8, 9, 13, .72);

  /* Couleur courante du Trait (point du curseur, pointe du rail) : écrite par interface.js, toujours jaune */
  --trait: #FFD60A;

  /* Mise en page */
  --g: clamp(16px, 2.2vw, 32px);
  --gouttiere: 6vw;          /* marge gauche du bloc de texte */
  --haut: 24px;              /* ligne haute du chrome */

  /* Typographie : Outfit partout (les cinq noms de jetons restent, pour les feuilles qui les emploient) */
  --f-texte: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-titre: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-impact: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;   /* ancien nom, gardé pour les replis */
  --f-mono: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;     /* libellés en capitales espacées */
  --f-serif: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --taille-titre: clamp(2.6rem, 5.2vw, 5.4rem);
  --taille-texte: 1.0625rem;
  --taille-libelle: .75rem;

  /* Mouvement : une seule courbe */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --t-survol: .3s;
  --t-apparition: .6s;
  --t-titre: .9s;

  /* Calques */
  --z-scene: 0;
  --z-lisibilite: 1;
  --z-ancres: 8;
  --z-contenu: 10;
  --z-chrome: 20;
  --z-fiche: 40;
  --z-menu: 50;
  --z-toast: 60;
  --z-curseur: 90;
  --z-entree: 100;
  --z-evitement: 110;
}

/* Accent par monde (charte sombre) : --accent pour les aplats et filets, --accent-texte pour le texte,
   tous deux lisibles sur le voile du monde (≥ 4,5:1) */
html[data-monde="hub"],html[data-monde="contact"]{--accent:#FFD60A;--accent-texte:#FFFFFF}
html[data-monde="code"]{--accent:#8F98FF;--accent-texte:#DDE1FF}
html[data-monde="depthblitz"]{--accent:#9BE1FF;--accent-texte:#FFFFFF}
html[data-monde="video"]{--accent:#FF4D40;--accent-texte:#FF9C94}
html[data-monde="design"]{--accent:#FF5FB0;--accent-texte:#FFA8D3}
/* Fond du monde (= champ « fond » de MONDES, util/studio.js) : ciel, brouillard, arrière-plan */
html[data-monde="hub"] { --fond: #08090D; }
html[data-monde="code"] { --fond: #5865F2; }
html[data-monde="depthblitz"] { --fond: #62C9F5; }
html[data-monde="video"] { --fond: #7A0B12; }
html[data-monde="design"] { --fond: #8A1552; }
html[data-monde="contact"] { --fond: #08090D; }
/* Voile de lisibilité du monde : couleur sombre de la famille du monde, assez dense pour du texte BLANC
   partout, y compris sur le bleu clair de Depth Blitz (blanc ≈ 7:1 sur #62C9F5 voilé, ≈ 5:1 sur un reflet blanc) */
html[data-monde="hub"],
html[data-monde="contact"] { --voile-texte: rgba(8, 9, 13, .72); }
html[data-monde="code"] { --voile-texte: rgba(30, 36, 110, .62); }
html[data-monde="depthblitz"] { --voile-texte: rgba(6, 34, 64, .66); }
html[data-monde="video"] { --voile-texte: rgba(40, 3, 6, .62); }
html[data-monde="design"] { --voile-texte: rgba(48, 6, 30, .62); }
/* OMEGA (sombre) : sur le bleu clair de Depth Blitz, le voile reste plus clair qu'ailleurs : le texte secondaire
   s'éclaircit un peu pour garder ≥ 4,5:1 (#C4C9D4 n'y ferait que 4,4:1) */
html[data-monde="depthblitz"] { --argent: #DDE6EE; }

@media (max-width: 767px) {
  :root {
    --g: 16px;
    --gouttiere: 16px;
    --taille-texte: 1rem;
  }
}

/* ---------- Remise à zéro ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--encre);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
  /* La barre de défilement native est masquée : le rail fait office d'indicateur */
  scrollbar-width: none;
}
html::-webkit-scrollbar { width: 0; height: 0; display: none; }

body {
  margin: 0;
  min-height: 100%;
  background: #08090D;
  color: var(--ivoire);
  font-family: var(--f-texte);
  font-size: var(--taille-texte);
  font-weight: 400;
  line-height: 1.55;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-synthesis: none;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
h1, h2, h3, h4, h5, h6 { font-weight: 500; font-size: inherit; }
ol, ul { margin: 0; padding: 0; list-style: none; }
img, canvas, video { display: block; max-width: 100%; }
img { height: auto; border: 0; }
svg { overflow: visible; }
a { color: inherit; text-decoration: none; }
b, strong { font-weight: 500; }
sup { font-size: .62em; line-height: 0; vertical-align: .62em; letter-spacing: 0; }

button {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
button:disabled { cursor: default; }

/* L'attribut hidden l'emporte toujours */
[hidden] { display: none !important; }

::selection { background: #FFD60A; color: #08090D; }

/* ---------- Focus visible (§5.2) : anneau jaune du Trait, visible sur tous les fonds sombres ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid #FFD60A;
  outline-offset: 3px;
}

/* ---------- Accessibilité ---------- */
.visuellement-cache,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---------- Primitives typographiques (§5.3) ---------- */

/* Libellés et numéros : Outfit 500, .75rem, capitales, interlettrage .08em */
.mono {
  font-family: var(--f-mono);
  font-size: var(--taille-libelle);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--argent);
  font-variant-numeric: tabular-nums;
}

/* Texte courant */
.texte {
  font-family: var(--f-texte);
  font-size: var(--taille-texte);
  font-weight: 400;
  line-height: 1.55;
  color: var(--texte-courant);
  max-width: 46ch;
  text-wrap: pretty;
}

.or { color: var(--or); }

/* ---------- Boutons (§5.3) ---------- */
/* Principal (charte sombre) : angles vifs (2 px), 44 px, fond blanc plein, texte nuit #08090D ;
   survol : aplat à l'accent du monde (clair et vif), texte nuit toujours ≥ 6:1 */
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--ivoire);
  border-radius: 2px;
  background: var(--ivoire);
  color: #08090D;
  text-shadow: none;
  font-family: var(--f-texte);
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--t-survol) var(--ease), border-color var(--t-survol) var(--ease), color var(--t-survol) var(--ease);
}
.bouton:hover,
.bouton:focus-visible { background: var(--accent); border-color: var(--accent); color: #08090D; }
/* OMEGA (sombre) : à l'accueil et au Contact, --accent est le jaune du Trait : le survol du bouton principal s'allume en jaune */
/* Secondaire : transparent, contour blanc à 40 %, texte blanc */
.bouton--secondaire {
  border-color: rgba(255, 255, 255, .4);
  background: transparent;
  color: var(--ivoire);
}
.bouton--secondaire:hover,
.bouton--secondaire:focus-visible { background: transparent; border-color: var(--accent-texte); color: var(--accent-texte); }
/* Désactivé « Bientôt » : texte argent, bord pointillé */
.bouton--bientot,
.bouton--bientot:hover,
.bouton--bientot:focus-visible {
  border-style: dashed;
  border-color: var(--argent);
  background: transparent;
  color: var(--argent);
  cursor: default;
}
.bouton-etat {
  font-family: var(--f-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Lien texte : souligné de 1 px qui se dessine de gauche à droite */
.lien {
  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(--ivoire);
  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);
}
.lien:hover,
.lien:focus-visible { background-size: 100% 1px; color: var(--accent-texte); }
.lien .fleche { display: inline-block; transition: transform var(--t-survol) var(--ease); }
.lien:hover .fleche { transform: translateX(3px); }
.lien:hover .fleche-haut { transform: translate(2px, -2px); }
/* Variante fléchée (fiche) : même lien */
.lien-fleche { display: inline-flex; align-items: baseline; gap: .4em; }

/* Pilule bordée (Version simple) */
.pilule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid var(--filet-fort);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: .6875rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ivoire);
  white-space: nowrap;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.pilule:hover,
.pilule:focus-visible { background-color: var(--ivoire); border-color: var(--ivoire); color: #08090D; text-shadow: none; }

/* Logos (plateformes en couleur officielle, logiciels à l'encre) : 1em de haut, alignés sur le texte */
.logo {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: none;
  vertical-align: -.14em;
  overflow: visible;
  color: var(--ivoire);
}
.logo--youtube { width: 1.4em; }

/* Filet court */
.filet-or {
  display: block;
  width: 32px;
  height: 1px;
  background: var(--or-vif);
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}
