/* ============================================================================
   ROBUR · ENCOCHE — jetons de conception (charte du 2026-10-04, Rams)
   Source : ~/design-system/identites/robur/charte/_sources/tokens.py (ne pas éditer à la main)

   Le compte : quatre traits, le cinquième les barre. Ce qui est fait est encré,
   ce qui reste est en contour. Style typographique international : grille,
   chiffres en vedette, une seule couleur d'action, l'outremer.

   TROIS RÈGLES
   1. Filets, pas d'ombres. L'ornement unique est le filet de section (--regle).
   2. Plein = fait, contour = à faire. La forme porte l'état ; la couleur suit.
   3. Les capitales condensées sont réservées au titre d'écran et aux chiffres.
      Tout le reste, boutons compris, est en Robur Encoche Texte, en phrase.
      Un coach qui parle en capitales crie ; Robur ne crie pas.

   Noms de jetons = ceux de la production : l'intégration échange des valeurs.
   Contrastes : chaque couple utilisé est mesuré dans tokens/contrastes.json
   (aucun sous AA). --c-text-subtle passe à 5,36:1 (la prod : 4,12:1).
   ============================================================================ */

/* Polices fabriquées pour Robur : Barlow / Barlow Condensed (OFL 1.1), retouchées
   (accents à 24°, glyphes de décompte U+1D377 / U+1D378, chiffres tabulaires par
   défaut) et renommées. Sous-ensembles latin + latin-ext, aucun CDN. */
@font-face {
  font-family: 'Robur Encoche Display';
  src: url('./fonts/Robur-Encoche-Display-SemiBold-latin.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-0302, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+1D377-1D378;
}
@font-face {
  font-family: 'Robur Encoche Display';
  src: url('./fonts/Robur-Encoche-Display-SemiBold-latin-ext.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Robur Encoche Display';
  src: url('./fonts/Robur-Encoche-Display-Bold-latin.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-0302, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+1D377-1D378;
}
@font-face {
  font-family: 'Robur Encoche Display';
  src: url('./fonts/Robur-Encoche-Display-Bold-latin-ext.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Robur Encoche Texte';
  src: url('./fonts/Robur-Encoche-Texte-Regular-latin.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-0302, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+1D377-1D378;
}
@font-face {
  font-family: 'Robur Encoche Texte';
  src: url('./fonts/Robur-Encoche-Texte-Regular-latin-ext.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Robur Encoche Texte';
  src: url('./fonts/Robur-Encoche-Texte-Medium-latin.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-0302, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+1D377-1D378;
}
@font-face {
  font-family: 'Robur Encoche Texte';
  src: url('./fonts/Robur-Encoche-Texte-Medium-latin-ext.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Robur Encoche Texte';
  src: url('./fonts/Robur-Encoche-Texte-SemiBold-latin.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-0302, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+1D377-1D378;
}
@font-face {
  font-family: 'Robur Encoche Texte';
  src: url('./fonts/Robur-Encoche-Texte-SemiBold-latin-ext.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Robur Encoche Texte';
  src: url('./fonts/Robur-Encoche-Texte-Bold-latin.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-0302, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+1D377-1D378;
}
@font-face {
  font-family: 'Robur Encoche Texte';
  src: url('./fonts/Robur-Encoche-Texte-Bold-latin-ext.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* ── Typographie ──────────────────────────────────────────────────────── */
  --font-titre: 'Robur Encoche Display', 'Arial Narrow', sans-serif;
  --font-texte: 'Robur Encoche Texte', ui-sans-serif, system-ui, sans-serif;
  --font-chiffre: var(--font-titre);   /* chiffres tabulaires intégrés à la fonte */
  --fv-titre: normal;

  /* Échelle mobile (rôles iOS, en rem : suit la taille de police du système) */
  --t-large-title: 2.5rem; --lh-large-title: 1.05; --fw-large-title: 700; --tr-large-title: 0;  /* titre · capitales · titre d’écran, un par écran — 40/40 */
  --t-title1: 1.75rem; --lh-title1: 1.14; --fw-title1: 600; --tr-title1: 0;  /* titre · phrase · titre de feuille — 28/32 */
  --t-title2: 1.375rem; --lh-title2: 1.18; --fw-title2: 600; --tr-title2: 0.005em;  /* titre · phrase · titre de groupe — 22/26 */
  --t-title3: 1.25rem; --lh-title3: 1.2; --fw-title3: 600; --tr-title3: 0;  /* texte · phrase · nom d’exercice en fiche — 20/24 */
  --t-headline: 1.0625rem; --lh-headline: 1.3; --fw-headline: 600; --tr-headline: 0;  /* texte · phrase · nom d’exercice en liste, bouton — 17/22 */
  --t-body: 1.0625rem; --lh-body: 1.4; --fw-body: 400; --tr-body: 0;  /* texte · phrase · texte courant, mot du coach — 17/24 */
  --t-callout: 1.0rem; --lh-callout: 1.375; --fw-callout: 400; --tr-callout: 0;  /* texte · phrase · 16/22 */
  --t-subhead: 0.9375rem; --lh-subhead: 1.33; --fw-subhead: 400; --tr-subhead: 0;  /* texte · phrase · prescription « 4 × 8 — 42,5 kg » — 15/20 */
  --t-footnote: 0.8125rem; --lh-footnote: 1.38; --fw-footnote: 400; --tr-footnote: 0.01em;  /* texte · phrase · 13/18 */
  --t-etiquette: 0.8125rem; --lh-etiquette: 1.23; --fw-etiquette: 600; --tr-etiquette: 0.08em;  /* texte · capitales · étiquette de section, onglets — 13/16 */
  --t-caption1: 0.75rem; --lh-caption1: 1.33; --fw-caption1: 500; --tr-caption1: 0.01em;  /* texte · phrase · 12/16 */
  --t-caption2: 0.6875rem; --lh-caption2: 1.18; --fw-caption2: 500; --tr-caption2: 0.02em;  /* texte · phrase · 11/13, jamais porteur d’une info seule */
  --t-chiffre: 2.75rem; --lh-chiffre: 1.0; --fw-chiffre: 700; --tr-chiffre: 0;  /* titre · chiffres · la charge, le poids — 44/44, tabulaire */
  --t-chiffre-xl: 4.5rem; --lh-chiffre-xl: 0.92; --fw-chiffre-xl: 700; --tr-chiffre-xl: -0.01em;  /* titre · chiffres · le chiffre unique d’un écran (repos) — 72/66 */
  /* Échelle web (site vitrine) */
  --t-w-display: clamp(3.5rem, 2rem + 4.4vw, 6rem); --lh-w-display: 1.02; --fw-w-display: 700; --tr-w-display: -0.005em;  /* titre · capitales · hero du site — 56→96 ; interligne ≥ 1,02 : les accents des capitales ne touchent jamais la ligne du dessus */
  --t-w-h1: clamp(2.5rem, 1.6rem + 3vw, 4rem); --lh-w-h1: 1.04; --fw-w-h1: 700; --tr-w-h1: 0;  /* titre · capitales · 40→64 */
  --t-w-h2: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); --lh-w-h2: 1.05; --fw-w-h2: 600; --tr-w-h2: 0;  /* titre · phrase · 28→40 */
  --t-w-h3: 1.5rem; --lh-w-h3: 1.2; --fw-w-h3: 600; --tr-w-h3: 0;  /* texte · phrase · 24/29 */
  --t-w-lead: clamp(1.125rem, 1rem + .4vw, 1.375rem); --lh-w-lead: 1.45; --fw-w-lead: 400; --tr-w-lead: 0;  /* texte · phrase · chapeau — 18→22 */
  --t-w-body: 1.125rem; --lh-w-body: 1.55; --fw-w-body: 400; --tr-w-body: 0;  /* texte · phrase · 18/28 */
  --t-w-small: 0.9375rem; --lh-w-small: 1.47; --fw-w-small: 400; --tr-w-small: 0;  /* texte · phrase · 15/22 */
  --t-w-etiquette: 0.8125rem; --lh-w-etiquette: 1.23; --fw-w-etiquette: 600; --tr-w-etiquette: 0.1em;  /* texte · capitales · 13/16 */

  /* Alias hérités de la production (mêmes noms, valeurs Encoche) */
  --text-xs: 0.75rem; --text-sm: 0.875rem; --text-base: 1rem; --text-lg: 1.125rem;
  --text-xl: 1.375rem; --text-2xl: 1.75rem; --text-3xl: 2.25rem;
  --text-chiffre: var(--t-chiffre); --text-chiffre-xl: var(--t-chiffre-xl);
  --leading-serre: 1.0; --leading-titre: 1.1; --leading-normal: 1.45; --leading-aere: 1.65;
  --poids-normal: 400; --poids-moyen: 500; --poids-demi: 600; --poids-gras: 700;
  --tracking-titre: 0;
  --tracking-marque: 0.058em;     /* logotype : 58 unités de fonte */
  --tracking-etiquette: 0.08em;

  /* ── Espacement : base 4 px, grille de 8 ──────────────────────────────── */
  --space-1: 0.25rem; --space-2: 0.5rem;  --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.5rem;  --space-6: 2rem;    --space-8: 3rem;    --space-10: 4rem;
  --space-12: 5rem;   --space-16: 7rem;
  --gouttiere: var(--space-5);          /* 24 : marge d'écran mobile */
  --colonne-numero: 4rem;               /* colonne des numéros 01, 02… et de l étiquette Coach */
  --largeur-lecture: 34rem;
  --largeur-app: 78rem;

  /* ── Formes : angles vifs ─────────────────────────────────────────────────
     La grille ne s'arrondit pas. Une exception : le haut d'une feuille,
     objet qui glisse sous le pouce (12 px). Pastilles et pouces : disque.  */
  --rayon-0: 0; --rayon-feuille: 12px; --rayon-disque: 999px;
  /* noms hérités, valeurs Encoche */
  --radius-xs: 0; --radius-sm: 0; --radius-md: 0; --radius-lg: 0;
  --radius-8: 0; --radius-10: 0; --radius-12: 0;
  --radius-16: var(--rayon-feuille); --radius-20: var(--rayon-feuille);
  --radius-full: var(--rayon-disque);

  --hairline: 0.5px;
  --trait: 1px solid var(--c-border);
  --trait-fort: 1px solid var(--c-border-strong);
  --regle: 3px;               /* filet de section, à l'encre : l'ornement unique */
  --filet-statut: 3px;
  --filet-nature: 3px;
  --contour-a-faire: 1.5px;   /* trait vide = à faire */

  /* ── Décompte (le signe dans l'interface) ───────────────────────────────
     Une série = un trait. Cinq séries = le cinq barré. Mêmes proportions que
     le symbole : trait 7, blanc 5, barre à 24°.                            */
  --encoche-angle: -24deg;
  --encoche-trait: 7px; --encoche-blanc: 5px; --encoche-hauteur: 28px;

  /* ── Cibles tactiles ──────────────────────────────────────────────────── */
  --cible-min: 44px;
  --cible-gant: 56px;

  /* ── Mouvement : sec, net, jamais rebondi ─────────────────────────────── */
  --ease: cubic-bezier(.3, 0, .1, 1);
  --ease-sortie: cubic-bezier(.4, 0, 1, 1);
  --dur-court: 120ms; --dur-base: 180ms; --dur-long: 320ms;
  --dur-encre: 240ms;    /* la barre qui s'encre quand une série est validée */
  --dur-squelette: 1.6s;

  --z-barre: 200; --z-flottant: 300; --z-feuille: 400;

  /* ── Grammaire iOS (validée par Adam, inchangée) ──────────────────────── */
  --inset-haut: env(safe-area-inset-top, 0px);
  --inset-bas:  env(safe-area-inset-bottom, 0px);
  --inset-gauche: env(safe-area-inset-left, 0px);
  --inset-droite: env(safe-area-inset-right, 0px);
  --h-barre-onglets: 56px; --h-barre-nav: 44px; --h-barre-action: 72px;
  --inset-groupe: var(--space-4); --retrait-separateur: var(--space-4);
  --h-ligne: 44px;
  --h-ligne-exercice: 64px;  /* numéro + nom + prescription + décompte */
  --roue-ligne: 44px; --roue-visibles: 5;
  --icone-onglet: 24px;
  --largeur-fiche: 41rem;
  --clavier: 0px; --feuille-decouvert: var(--space-8); --feuille-seuil-fermeture: 96px;
  --feuille-detent-mi: 60dvh; --feuille-detent-seuil: 72px;
  --echelle-senior: 112%;
}

html { font-size: 100%; }
html.lecture-large { font-size: var(--echelle-senior); }

/* ══ THÈME CLAIR — « Craie » ═════════════════════════════════════════════════
   La magnésie sur les mains : un blanc cassé froid, l'encre carbone,
   l'outremer pour l'action. Thème par défaut : on s'entraîne aussi dehors.  */
:root,
:root[data-theme="clair"] {
  color-scheme: light;
  --c-bg: #EFEFEA;
  --c-surface: #FBFBF8;
  --c-surface-2: #E3E3DD;
  --c-border: #CACAC3;
  --c-border-strong: #787B84;  /* 3.67:1 sur bg */
  --c-text: #101114;  /* 16.37:1 sur bg */
  --c-text-muted: #4A4D55;  /* 7.33:1 sur bg */
  --c-text-subtle: #5E616A;  /* 5.36:1 sur bg */
  --c-accent: #1F3BD1;  /* 6.99:1 sur bg */
  --c-accent-strong: #172DA3;
  --c-accent-soft: #E2E6FA;
  --c-on-accent: #FFFFFF;
  --c-alerte: #B4231A;  /* 5.70:1 sur bg */
  --c-alerte-soft: #F6E0DC;
  --c-attention: #7A5800;  /* 5.65:1 sur bg */
  --c-attention-soft: #F2E8CC;
  --c-macro-proteines: #1F3BD1;  /* 7.78:1 sur surface */
  --c-macro-glucides: #00707A;  /* 5.63:1 sur surface */
  --c-macro-lipides: #3A3D45;  /* 10.48:1 sur surface */
  --c-repos: #00707A;  /* 5.63:1 sur surface */
  --c-data-progression: #1F3BD1;  /* 7.78:1 sur surface */
  --c-data-volume: #101114;  /* 18.21:1 sur surface */
  --c-data-reference: #787B84;  /* 4.08:1 sur surface */
  --c-accent-bande: #7A8BE6;  /* 3.04:1 sur surface */
  --c-alerte-bande: #CB6D63;  /* 3.43:1 sur surface */
  --c-attention-bande: #AA8530;  /* 3.32:1 sur surface */
  --c-papier: #EFEFEA;
  --c-encre: var(--c-text);
  --c-voile: rgba(16, 17, 20, .44);
  --ombre-flottant: none;
  --ombre-feuille: 0 -1px 0 #CACAC3;
}

/* ══ THÈME SOMBRE — « Carbone » ══════════════════════════════════════════════
   Salle le soir. L'outremer remonte en clarté SANS pâlir : #6E89FF (6,14:1)
   remplace le #8FA3FF de l'exploration, trop lavande, qui tirait au violet. */
:root[data-theme="sombre"] {
  color-scheme: dark;
  --c-bg: #0D0E11;
  --c-surface: #16181D;
  --c-surface-2: #20232A;
  --c-border: #30343D;
  --c-border-strong: #6E737E;  /* 4.06:1 sur bg */
  --c-text: #F1F1EC;  /* 17.03:1 sur bg */
  --c-text-muted: #A4A8B2;  /* 8.11:1 sur bg */
  --c-text-subtle: #8D919B;  /* 6.12:1 sur bg */
  --c-accent: #6E89FF;  /* 6.14:1 sur bg */
  --c-accent-strong: #94A8FF;
  --c-accent-soft: #1A2140;
  --c-on-accent: #0D0E11;
  --c-alerte: #FF8B7B;  /* 8.48:1 sur bg */
  --c-alerte-soft: #2E1714;
  --c-attention: #E8B740;  /* 10.37:1 sur bg */
  --c-attention-soft: #2B2312;
  --c-macro-proteines: #6E89FF;  /* 5.65:1 sur surface */
  --c-macro-glucides: #3CBDC6;  /* 7.85:1 sur surface */
  --c-macro-lipides: #C9CCD3;  /* 11.05:1 sur surface */
  --c-repos: #3CBDC6;  /* 7.85:1 sur surface */
  --c-data-progression: #6E89FF;  /* 5.65:1 sur surface */
  --c-data-volume: #F1F1EC;  /* 15.67:1 sur surface */
  --c-data-reference: #6E737E;  /* 3.73:1 sur surface */
  --c-accent-bande: #4D64CC;  /* 3.39:1 sur surface */
  --c-alerte-bande: #A0574D;  /* 3.35:1 sur surface */
  --c-attention-bande: #8C6E28;  /* 3.70:1 sur surface */
  --c-papier: #EFEFEA;
  --c-encre: var(--c-text);
  --c-voile: rgba(0, 0, 0, .62);
  --ombre-flottant: none;
  --ombre-feuille: 0 -1px 0 #30343D;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --c-bg: #0D0E11;
    --c-surface: #16181D;
    --c-surface-2: #20232A;
    --c-border: #30343D;
    --c-border-strong: #6E737E;  /* 4.06:1 sur bg */
    --c-text: #F1F1EC;  /* 17.03:1 sur bg */
    --c-text-muted: #A4A8B2;  /* 8.11:1 sur bg */
    --c-text-subtle: #8D919B;  /* 6.12:1 sur bg */
    --c-accent: #6E89FF;  /* 6.14:1 sur bg */
    --c-accent-strong: #94A8FF;
    --c-accent-soft: #1A2140;
    --c-on-accent: #0D0E11;
    --c-alerte: #FF8B7B;  /* 8.48:1 sur bg */
    --c-alerte-soft: #2E1714;
    --c-attention: #E8B740;  /* 10.37:1 sur bg */
    --c-attention-soft: #2B2312;
    --c-macro-proteines: #6E89FF;  /* 5.65:1 sur surface */
    --c-macro-glucides: #3CBDC6;  /* 7.85:1 sur surface */
    --c-macro-lipides: #C9CCD3;  /* 11.05:1 sur surface */
    --c-repos: #3CBDC6;  /* 7.85:1 sur surface */
    --c-data-progression: #6E89FF;  /* 5.65:1 sur surface */
    --c-data-volume: #F1F1EC;  /* 15.67:1 sur surface */
    --c-data-reference: #6E737E;  /* 3.73:1 sur surface */
    --c-accent-bande: #4D64CC;  /* 3.39:1 sur surface */
    --c-alerte-bande: #A0574D;  /* 3.35:1 sur surface */
    --c-attention-bande: #8C6E28;  /* 3.70:1 sur surface */
    --c-voile: rgba(0, 0, 0, .62);
    --ombre-feuille: 0 -1px 0 #30343D;
  }
}

@media (prefers-contrast: more) {
  :root { --c-text-muted: #2F3238; --c-text-subtle: #4A4D55; --c-border: var(--c-border-strong); }
  :root[data-theme="sombre"] { --c-text-muted: #C9CCD3; --c-text-subtle: #A4A8B2; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-court: 0ms; --dur-base: 0ms; --dur-long: 0ms; --dur-encre: 0ms; }
  *, *::before, *::after {
    animation-duration: 1ms !important; animation-iteration-count: 1 !important;
    transition-duration: 1ms !important; scroll-behavior: auto !important;
  }
}
