/* ==========================================================================
   Speak Chantier — design tokens (source unique, copiée dans simulateur/public/tokens.css)
   Concept : le chantier en phase d'implantation. Dalle béton (fond), graphite
   du crayon de charpentier (texte), peinture de traçage orange (action),
   cordeau bleu (l'anglais à dire), stylo rouge des redlines (corrections).
   Deux voix typographiques : Big Shoulders = l'anglais parlé et les mesures ;
   Overpass = notre français, qui explique.
   ========================================================================== */

/* Identité v2 « Le casque qui parle » (guide-design §A) : Barlow auto-hébergée, licence SIL OFL (assets/fonts/OFL-*.txt).
   Anglais = Barlow Condensed (--f-voice) ; français = Barlow (--f-text). */
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/Barlow-Regular.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/Barlow-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700 900; font-display: swap; src: url("../fonts/Barlow-Bold.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 500 900; font-display: swap; src: url("../fonts/BarlowCondensed-Bold.woff2") format("woff2"); }

:root {
  /* --- Couleur : 6 teintes nommées + dérivées --- */
  --slab:      #F2F2EC;   /* craie (--sc-canvas) ; ancien béton béton : fond de page */
  --slab-2:    #EAEBE4;   /* bande alternée, béton plus sombre */
  --sheet:     #FFFFFF;   /* feuille / panneau posé sur la dalle */
  --graphite:  #19211D;   /* texte principal, crayon de charpentier */
  --graphite-2:#626B65;   /* texte secondaire */
  --rule:      #BFC6BF;   /* traits, bordures */
  --paint:     #FF5B21;   /* peinture de traçage : action principale, bouton radio */
  --paint-ink: #B83A0A;   /* orange lisible en petit texte sur fond clair */
  --chalk:     #2A57DC;   /* cordeau bleu : l'anglais à dire, liens */
  --redline:   #CF2338;   /* stylo rouge : corrections uniquement */
  --approved:  #1E7A4C;   /* tampon « approved » : objectif atteint */
  --on-paint:  #19211D;   /* texte posé sur l'orange */
  --scrim:     rgba(12, 16, 15, .78); /* voile sous les sous-titres vidéo */
  --night:     #101513;   /* fond des zones « en appel » et vidéo */
  --on-night:  #EEF1EC;

  /* --- Typographie --- */
  --f-voice: "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-text:  "Barlow", Arial, sans-serif;
  --link: #B83A0A;   /* --sc-link : liens soulignés, orange en texte */
  --control: 48px;   /* --sc-control-size */
  /* Échelle (Bringhurst) : 14 · 17 · 21 · 24 · 36 · 48 · 72 */
  /* Échelle d'affichage (retours du 29/10) : les rem suivent --sc-zoom via <html> ; petits textes plafonnés vers le bas. */
  --sc-zoom: .9;
  --t-xs: max(12px, .8125rem);  /* 13 → 12 (plancher) */
  --t-sm: .875rem;   /* 14 */
  --t-md: 1.125rem;  /* 18 = corps (§A.6) */
  --t-lg: 1.3125rem; /* 21 */
  --t-xl: 1.5rem;    /* 24 */
  --t-2xl: clamp(1.75rem, 1.2rem + 2.2vw, 2.25rem);  /* 28 → 36 */
  --t-3xl: clamp(2.125rem, 1.3rem + 3.4vw, 3rem);    /* 34 → 48 */
  --t-4xl: clamp(2.75rem, 1.4rem + 5.6vw, 4.5rem);   /* 44 → 72 */
  --lh-text: 1.5;
  --lh-tight: 1.08;

  /* --- Espace & forme --- */
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem; --s-8: 4.5rem; --s-9: 7rem;
  --r-ctl: 8px;     /* contrôles : boutons, champs */
  --r-sheet: 8px;   /* feuilles, panneaux */
  --measure: 66ch;
  --wrap: 1120px;   /* 1240 → 1120 (−10 %) */
  --shadow-sheet: 0 1px 0 rgba(28,35,32,.06), 0 12px 28px -18px rgba(28,35,32,.35);
  --focus: 0 0 0 3px var(--slab), 0 0 0 5px var(--chalk);
  color-scheme: light;
}

html { font-size: calc(var(--sc-zoom) * 100%); }

/* Nuit de chantier (thème sombre) : mêmes rôles, jamais une simple inversion */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --slab: #19211D; --slab-2: #1F2823; --sheet: #242E29; --graphite: #F2F2EC; --graphite-2: #A6B0AA; --rule: #34403B;
    --paint: #FF5B21; --paint-ink: #FF5B21; --link: #FF5B21; --chalk: #FF5B21; --redline: #FF6274; --approved: #5BCB8E; --on-paint: #141A17;
    --scrim: rgba(6, 9, 8, .8); --night: #0B0F0E; --on-night: #EEF1EC;
    --shadow-sheet: 0 1px 0 rgba(0,0,0,.4), 0 16px 32px -20px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --slab: #19211D; --slab-2: #1F2823; --sheet: #242E29; --graphite: #F2F2EC; --graphite-2: #A6B0AA; --rule: #34403B;
  --paint: #FF5B21; --paint-ink: #FF5B21; --link: #FF5B21; --chalk: #FF5B21; --redline: #FF6274; --approved: #5BCB8E; --on-paint: #141A17;
  --scrim: rgba(6, 9, 8, .8); --night: #0B0F0E; --on-night: #EEF1EC;
  --shadow-sheet: 0 1px 0 rgba(0,0,0,.4), 0 16px 32px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}
