/* ==========================================================================
   K2T — Système final « Maison »
   Jetons de conception partagés : site vitrine (clair uniquement),
   application web (clair + sombre), application mobile Flutter (mêmes valeurs).
   Ratios de contraste WCAG 2.x mesurés sur --blanc #FFFEFC sauf mention.
   ========================================================================== */

/* ---------- Polices (SIL OFL 1.1, auto-hébergées, sous-ensemble latin) ---------- */
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-var-latin.woff2") format("woff2"); font-weight: 300 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-italic-var-latin.woff2") format("woff2"); font-weight: 300 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/instrument-sans-var-latin.woff2") format("woff2"); font-weight: 400 700; font-stretch: 75% 100%; font-style: normal; font-display: swap; }

:root {
  /* ---------- Typographie ---------- */
  --font-titre: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-texte: "Instrument Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --titre-axes: "SOFT" 50, "WONK" 0;

  /* Site : échelle 1,25 */
  --t-hero: clamp(2.5rem, 5vw, 4.5rem);        /* 40 → 72 px | lh 1,02 */
  --t-h2: clamp(2rem, 3.4vw, 3.125rem);        /* 32 → 50 px | lh 1,08 */
  --t-h3: clamp(1.375rem, 1.9vw, 1.625rem);    /* 22 → 26 px | lh 1,2  */
  --t-chapo: clamp(1.125rem, 1.4vw, 1.3125rem);/* 18 → 21 px | lh 1,5  */
  --t-corps: 1.0625rem;                        /* 17 px | lh 1,65 */
  --t-note: 0.8125rem;                         /* 13 px */
  --t-mini: 0.75rem;                           /* 12 px : PLANCHER ABSOLU, aucun texte en dessous */

  /* Application : interface dense */
  --a-titre: 1.625rem;   /* 26 px, Fraunces */
  --a-chiffre: 2.25rem;  /* 36 px, Fraunces */
  --a-h2: 1.125rem;      /* 18 px, Fraunces */
  --a-corps: 0.875rem;   /* 14 px */
  --a-petit: 0.8125rem;  /* 13 px */
  --a-mini: 0.75rem;     /* 12 px, plancher */

  /* ---------- Neutres teintés ---------- */
  --blanc: #FFFEFC;       /* fond de page                         encre-900 dessus 17,69 */
  --papier-50: #FAF7F1;   /* bande, barre latérale                16,67 */
  --papier-100: #F4F0E7;  /* survol, pistes                       15,68 */
  --filet-200: #E8E2D6;   /* filets (décoratif)                   1,29 */
  --filet-300: #D8D0C2;   /* bordures de cartes, champs           1,53 */
  --encre-400: #978C7D;   /* NON TEXTUEL UNIQUEMENT : icônes inactives, points de conduite, bordures fortes — 3,27 */
  --encre-500: #72685B;   /* plus petit texte autorisé : légendes, « Repos », compteurs — 5,42 AA */
  --encre-600: #5A5146;   /* texte secondaire                     7,72 AAA */
  --encre-700: #3B342B;   /* texte courant de l'application       12,17 AAA */
  --encre-900: #1B1712;   /* titres, texte, bouton principal      17,69 AAA */
  --noir-marque: #020202; /* noir du logo, pied de page           20,7 */

  /* ---------- Or du logo : une encre, pas une peinture ---------- */
  --or-800: #6E4405;      /* texte or sur fond or clair           8,43 */
  --or-700: #8A5606;      /* TOUT TEXTE OR                        6,10 */
  --or-600: #AA6B09;      /* filets, icônes, titres ≥ 24 px       4,33 */
  --or-500: #DB9E2C;      /* point de notification, petits aplats portant du noir (7,59) */
  --or-300: #FFD35C;      /* pastilles de compteur, bloc jour DLC (noir dessus 12,50) */
  --or-100: #FFF1CC;      /* surlignage d'une ligne, mise en avant */
  --or-50: #FFF9E8;       /* fond « aujourd'hui », ligne active   encre-500 dessus 5,16 */

  /* ---------- Tricolore (ruban du logo, usage ponctuel) ---------- */
  --bleu-france: #1F3F8F;
  --rouge-france: #C8102E;

  /* ---------- États ---------- */
  --succes-700: #17693F; --succes-fond: #E6F4EC;   /* 6,66 | 5,92 sur son fond */
  --alerte-700: #9A4A06; --alerte-fond: #FFF0DC;   /* 6,21 | 5,59 */
  --erreur-700: #B3261E; --erreur-fond: #FDECEA;   /* 6,48 | 5,72 */
  --info-700: #1B5A9E;   --info-fond: #E8F1FB;     /* 6,94 | 6,13 */

  /* ---------- Postes du planning ----------
     Couleur TOUJOURS doublée d'un code texte de 4 lettres (CHEF, COMM…) :
     lisible par les daltoniens et à l'impression noir et blanc. Texte sur fond ≥ 5:1. */
  --poste-1: #0B5A8C; --poste-1-fond: #E3F0F8;  /* CHEF · SECO — 6,33 */
  --poste-2: #0F6E84; --poste-2-fond: #DDF3F4;  /* COMM — 5,08 */
  --poste-3: #9B3B6E; --poste-3-fond: #F9E6F0;  /* PATI — 5,43 */
  --poste-4: #4F5560; --poste-4-fond: #ECEEF1;  /* PLON — 6,45 */
  --poste-5: #136B52; --poste-5-fond: #E0F3EA;  /* RESP · RANG — 5,59 */
  --poste-6: #5B6412; --poste-6-fond: #F0F2D2;  /* SERV · RUNN — 5,60 */
  --poste-7: #A14A00; --poste-7-fond: #FDEBD9;  /* BAR — 5,17 */
  --poste-8: #5E4BA6; --poste-8-fond: #ECE8F8;  /* ACCU — 5,76 */
  --poste-9: #8C2F2F; --poste-9-fond: #F8E4E1;  /* EXTR — 6,70 */

  /* ---------- Espacements (base 4 / 8) ---------- */
  --e-1: 4px; --e-2: 8px; --e-3: 12px; --e-4: 16px; --e-5: 20px; --e-6: 24px;
  --e-8: 32px; --e-10: 40px; --e-12: 48px; --e-16: 64px; --e-24: 96px;
  --section-dense: clamp(56px, 7vw, 96px);
  --section-air: clamp(72px, 10vw, 144px);
  --conteneur: 1240px;
  --gouttiere: clamp(16px, 2.2vw, 24px);
  --cible: 44px;          /* cible tactile minimale */

  /* ---------- Rayons ---------- */
  --r-1: 2px; --r-2: 4px; --r-3: 8px; --r-plein: 999px;

  /* ---------- Ombres teintées (ce qui flotte réellement) ---------- */
  --ombre-1: 0 1px 2px rgba(59, 45, 20, .06), 0 1px 1px rgba(59, 45, 20, .04);
  --ombre-2: 0 8px 20px rgba(59, 45, 20, .08), 0 2px 6px rgba(59, 45, 20, .05);
  --ombre-3: 0 24px 56px rgba(59, 45, 20, .16), 0 8px 16px rgba(59, 45, 20, .07);

  /* ---------- Mouvement ---------- */
  --courbe: cubic-bezier(0.16, 1, 0.3, 1);
  --duree-1: 160ms;   /* survol, appui */
  --duree-2: 240ms;   /* transition de page, ouverture de panneau */
  --duree-3: 560ms;   /* révélation */
  --montee: 20px;     /* révélation : 16 à 24 px */
  --decalage: 70ms;   /* décalage entre éléments révélés */

  /* ---------- Rôles sémantiques (seuls consommés par les composants) ---------- */
  --fond: var(--blanc);
  --fond-2: var(--papier-50);
  --fond-3: var(--papier-100);
  --surface: var(--blanc);
  --bordure: var(--filet-200);
  --bordure-forte: var(--filet-300);
  --bordure-champ: #8F8474;   /* bord de champ : 3,6:1, perceptible (WCAG 1.4.11) */
  --texte: var(--encre-900);
  --texte-2: var(--encre-600);
  --texte-3: var(--encre-500);
  --non-textuel: var(--encre-400);
  --accent-texte: var(--or-700);
  --accent-trait: var(--or-600);
  --accent-aplat: var(--or-300);
  --accent-fond: var(--or-50);
  --accent-surligne: var(--or-100);
  --bouton-fond: var(--encre-900);
  --bouton-texte: var(--blanc);
  --anneau: var(--or-600);
  --voile: rgba(27, 23, 18, .48);
  --squelette: #EFEAE0;
  --squelette-reflet: #F8F5EF;
  color-scheme: light;
}

/* ==========================================================================
   Thème sombre — APPLICATION UNIQUEMENT (le site reste blanc).
   Actif seulement avec [data-theme="dark"], sur choix explicite de l'utilisateur
   (bouton lune, mémorisé ; ?theme=dark pour la capture). Le clair reste le défaut. Ratios mesurés sur #15120E.
   ========================================================================== */
[data-theme="dark"] {
  --fond: #15120E;
  --fond-2: #1B1712;
  --fond-3: #25201A;
  --surface: #1E1A15;
  --bordure: #2E2921;
  --bordure-forte: #3F382E;
  --bordure-champ: #6B6255;
  --texte: #F3EEE6;          /* 16,17 */
  --texte-2: #C9C0B2;        /* 10,37 */
  --texte-3: #A39989;        /* 6,65 */
  --non-textuel: #6B6255;
  --accent-texte: #E9B448;   /* 9,86 */
  --accent-trait: #DB9E2C;
  --accent-aplat: #FFD35C;
  --accent-fond: #2A2213;
  --accent-surligne: #3A2E14;
  --bouton-fond: #F3EEE6;
  --bouton-texte: #15120E;
  --anneau: #FFD35C;
  --voile: rgba(0, 0, 0, .6);
  --squelette: #26211B;
  --squelette-reflet: #302A22;

  --succes-700: #6FD3A0; --succes-fond: #14291F;
  --alerte-700: #F5B061; --alerte-fond: #33230F;
  --erreur-700: #F28B82; --erreur-fond: #361815;
  --info-700: #8DBEF2;   --info-fond: #13243A;

  --poste-1: #8CC8EE; --poste-1-fond: #12293A;
  --poste-2: #7FD3DF; --poste-2-fond: #0F2B30;
  --poste-3: #EFA3CB; --poste-3-fond: #35182A;
  --poste-4: #C3C8D0; --poste-4-fond: #262A30;
  --poste-5: #7FD5B4; --poste-5-fond: #102C22;
  --poste-6: #CDD67A; --poste-6-fond: #2A2D0E;
  --poste-7: #F5AE74; --poste-7-fond: #38200C;
  --poste-8: #BFB1F2; --poste-8-fond: #241D40;
  --poste-9: #F0A29A; --poste-9-fond: #381717;

  --ombre-1: 0 1px 2px rgba(0, 0, 0, .4);
  --ombre-2: 0 8px 20px rgba(0, 0, 0, .45);
  --ombre-3: 0 24px 56px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
