/* =========================================================================
   TOKENS — polices et variables de design.
   POUR CHANGER UNE COULEUR OU UNE TAILLE : c'est ici, et nulle part ailleurs.
   Aucun autre fichier ne contient de couleur écrite en dur.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. POLICES — fichiers locaux, aucune requête réseau.

   Une seule superfamille, IBM Plex, en trois déclinaisons. C'est un choix
   assumé : elle donne à la page l'aspect d'un document officiel.
   IBM Plex Serif et Mono n'existent pas en version variable : on charge
   donc les graisses utiles, une par une, en deux sous-ensembles.

   Le sous-ensemble « latin-ext » est indispensable au catalan (ŀ, ŀl).
   ------------------------------------------------------------------- */

/* --- Titres : IBM Plex Serif 600 --------------------------------------- */
@font-face {
  font-family: 'Plex Serif';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/plexserif-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, 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;
}
@font-face {
  font-family: 'Plex Serif';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/plexserif-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, 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;
}

/* --- Texte : IBM Plex Sans 400 / 500 / 600 ----------------------------- */
@font-face {
  font-family: 'Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/plexsans-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, 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;
}
@font-face {
  font-family: 'Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/plexsans-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, 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: 'Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/plexsans-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, 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;
}
@font-face {
  font-family: 'Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/plexsans-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, 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: 'Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/plexsans-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, 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;
}
@font-face {
  font-family: 'Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/plexsans-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, 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;
}

/* --- Données : IBM Plex Mono 400 / 500 --------------------------------- */
@font-face {
  font-family: 'Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/plexmono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, 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;
}
@font-face {
  font-family: 'Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/plexmono-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, 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: 'Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/plexmono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, 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;
}
@font-face {
  font-family: 'Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/plexmono-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, 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;
}

/* =========================================================================
   2. VARIABLES
   ========================================================================= */

:root {
  /* -----------------------------------------------------------------------
     COULEURS

     Sept couleurs, pas une de plus. Univers du rapport d'expertise :
     surfaces plates, pas de dégradé, séparation par filets de 1px.
     --------------------------------------------------------------------- */
  --papier: #f6f7f9;      /* fond de page                                  */
  --surface: #ffffff;     /* cartes, encadrés, barre de navigation         */
  --encre: #111a28;       /* titres et texte principal                     */
  --ardoise: #33506e;     /* liens, boutons, accents, numéros de section    */
  --correction: #b03a2e;  /* LA CORRECTION, ET RIEN D'AUTRE — voir plus bas */
  --texte-2: #5c6b7f;     /* texte secondaire, légendes, mentions          */
  --filet: #dde3ea;       /* tous les traits de séparation                 */

  /* Deux dérivées, pas des couleurs nouvelles : un bleu ardoise assombri
     pour le survol des boutons, et un voile d'ardoise très clair pour les
     fonds de blocs. */
  --ardoise-fonce: #263c53;
  --ardoise-voile: #eef2f6;

  /* RÈGLE DU ROUGE — à ne pas enfreindre.
     --correction ne sert qu'à deux choses : le trait de rature qui barre le
     montant de la compagnie, et le montant corrigé en monospace juste à côté.
     Jamais un bouton, jamais une bordure décorative, jamais une icône.
     C'est ce qui lui donne son sens : le rouge = l'expert a repris le chiffre. */

  /* Couleur d'état pour les erreurs de formulaire. On réutilise
     --correction : c'est le seul cas où le rouge sort de son rôle, et il y
     garde le même sens (« ceci est à corriger »). */
  --erreur: var(--correction);

  /* -----------------------------------------------------------------------
     TYPOGRAPHIE — trois rôles, une superfamille.
     --------------------------------------------------------------------- */
  --f-titre: 'Plex Serif', 'Iowan Old Style', 'Palatino Linotype', Palatino,
    Georgia, 'Times New Roman', serif;
  --f-texte: 'Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --f-mono: 'Plex Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas,
    'Liberation Mono', monospace;

  /* Échelle fluide de 320 px à 2560 px. Aucune media query pour le texte :
     modifiez les bornes des clamp() plutôt que d'en ajouter. */
  --t-h1: clamp(2.125rem, 1.45rem + 3.05vw, 3.5rem);      /* 34 → 56 px */
  --t-h2: clamp(1.625rem, 1.29rem + 1.5vw, 2.375rem);     /* 26 → 38 px */
  --t-h3: clamp(1.25rem, 1.15rem + 0.44vw, 1.5rem);       /* 20 → 24 px */
  --t-h4: clamp(1.125rem, 1.1rem + 0.11vw, 1.1875rem);    /* 18 → 19 px */
  --t-lead: clamp(1.1875rem, 1.1rem + 0.33vw, 1.375rem);  /* 19 → 22 px */
  --t-base: clamp(1.0625rem, 1.04rem + 0.11vw, 1.125rem); /* 17 → 18 px */
  --t-petit: 0.9375rem;                                   /* 15 px      */
  --t-mini: 0.8125rem;                                    /* 13 px      */

  /* Données en monospace */
  --t-num: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);   /* 14 → 15 px */
  --t-montant: clamp(1.25rem, 1.05rem + 0.9vw, 1.75rem);  /* 20 → 28 px */
  --t-cle: clamp(2rem, 1.6rem + 1.8vw, 2.75rem);          /* 32 → 44 px */
  --t-tel: clamp(1.75rem, 1.15rem + 2.7vw, 3rem);         /* 28 → 48 px */

  /* Interlignages */
  --i-titre: 1.12;
  --i-h3: 1.25;
  --i-texte: 1.65;
  --i-serre: 1.4;

  /* Mesure de lecture : environ 70 caractères, jamais plus. */
  --mesure: 68ch;

  /* -----------------------------------------------------------------------
     RYTHME ET MISE EN PAGE
     --------------------------------------------------------------------- */
  --e-1: 0.25rem;
  --e-2: 0.5rem;
  --e-3: 0.75rem;
  --e-4: 1rem;
  --e-5: 1.5rem;
  --e-6: 2rem;
  --e-7: 3rem;
  --e-8: 4rem;
  --e-9: 6rem;

  /* Espacement vertical entre deux sections, fluide. */
  --section-y: clamp(3.5rem, 2.5rem + 4.5vw, 6.5rem);

  --largeur-max: 1180px;
  --largeur-large: 1400px;
  --nav-h: 60px;
  --gouttiere: clamp(1.125rem, 0.8rem + 1.6vw, 2.5rem);

  /* Rayons : quasi nuls. Pas de coins très arrondis. */
  --r-1: 2px;
  --r-2: 3px;

  /* Pas d'ombre portée marquée. Une seule, très discrète, réservée à la
     barre de navigation une fois la page défilée. */
  --ombre-nav: 0 1px 0 var(--filet);

  --transition: 180ms ease;
  --transition-lente: 420ms cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Épaisseur du contour de focus clavier. */
  --focus: 2px;
}
