/* Couleurs et mesures de l'interface.
 *
 * Tout passe par des variables : le thème clair est défini sur :root, le thème sombre le
 * redéfinit. Sans réglage dans le profil, le thème suit celui du système.
 * La couleur est réservée aux catégories, aux statuts et aux espèces historiques.
 */

:root {
  color-scheme: light;

  --fond: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e7eaef;
  --bord: #e2e5ea;
  --bord-fort: #c9ced7;
  --texte: #1c2029;
  --texte-2: #5b6472;
  --texte-3: #8a93a3;

  --accent: #4f5bd5;
  --accent-survol: #434fc2;
  --accent-texte: #ffffff;
  --accent-doux: #eceefd;

  --danger: #cf3f37;
  --danger-doux: #fdecea;
  --succes: #2b9459;
  --succes-doux: #e6f5ec;
  --avertissement: #b87a0a;
  --avertissement-doux: #fdf3dc;

  --statut-brouillon: #8a93a3;
  --statut-en-revue: #c98a14;
  --statut-valide: #2f9e60;

  --lien-graphe: #9aa2b1;
  --couloir: #ffffff;
  --couloir-alterne: #fafbfc;

  --ombre: 0 1px 2px rgb(16 24 40 / 6%), 0 4px 14px rgb(16 24 40 / 7%);
  --ombre-forte: 0 4px 10px rgb(16 24 40 / 10%), 0 16px 40px rgb(16 24 40 / 14%);

  /* Arbre « Strates × Codex » (D45) : une teinte par ère, reprise en boucle après la
     sixième ; doré pour les racines et les coûts ; capacités en médaillons. */
  --strate-racines: #f1f2f5;
  --strate-1: #e3f0f3;
  --strate-2: #e2eafa;
  --strate-3: #e3f1e4;
  --strate-4: #f6ecda;
  --strate-5: #f7e4dc;
  --strate-6: #ece6f6;
  --strate-texte-1: #2a7486;
  --strate-texte-2: #2f5cad;
  --strate-texte-3: #3c7a42;
  --strate-texte-4: #94661c;
  --strate-texte-5: #a2492b;
  --strate-texte-6: #6a4aa8;
  --hachure-gel: rgb(70 55 25 / 11%);
  --survol-entete: rgb(16 24 40 / 4%);
  --or: #9a7420;
  --lieu: #0f8a6c;
  --medaillon: #ffffff;
  --opacite-lien: 0.45;
  --opacite-halo-lien: 0.12;

  --rayon: 6px;
  --rayon-grand: 10px;
  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --police-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --hauteur-barre: 48px;
  --largeur-menu: 208px;
}

/* Thème sombre choisi dans le profil. */
:root[data-theme="sombre"] {
  color-scheme: dark;

  --fond: #14161a;
  --surface: #1c1f25;
  --surface-2: #23272f;
  --surface-3: #2b3039;
  --bord: #2d323b;
  --bord-fort: #414856;
  --texte: #e8eaee;
  --texte-2: #a3abb8;
  --texte-3: #737c8c;

  --accent: #7f89f2;
  --accent-survol: #939cf5;
  --accent-texte: #11131a;
  --accent-doux: #262a45;

  --danger: #f0736b;
  --danger-doux: #3a2221;
  --succes: #4cc083;
  --succes-doux: #1c3327;
  --avertissement: #e0a93b;
  --avertissement-doux: #3a2f17;

  --statut-brouillon: #737c8c;
  --statut-en-revue: #e0a93b;
  --statut-valide: #4cc083;

  --lien-graphe: #5d6676;
  --couloir: #1a1d22;
  --couloir-alterne: #1e2127;

  /* Arbre « Strates × Codex » (D45). */
  --strate-racines: #191b20;
  --strate-1: #11252b;
  --strate-2: #141f37;
  --strate-3: #15271a;
  --strate-4: #2a2315;
  --strate-5: #2c1a14;
  --strate-6: #211a33;
  --strate-texte-1: #7cc3d3;
  --strate-texte-2: #8eb0ee;
  --strate-texte-3: #8ccf94;
  --strate-texte-4: #dfb267;
  --strate-texte-5: #e99a7c;
  --strate-texte-6: #b9a2ee;
  --hachure-gel: rgb(255 240 210 / 8%);
  --survol-entete: rgb(255 255 255 / 5%);
  --or: #d9c48f;
  --lieu: #3fc4a5;
  --medaillon: #1d2130;
  --opacite-lien: 0.65;
  --opacite-halo-lien: 0.22;

  --ombre: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 14px rgb(0 0 0 / 30%);
  --ombre-forte: 0 4px 10px rgb(0 0 0 / 40%), 0 16px 40px rgb(0 0 0 / 50%);
}

/* Thème du système : sombre si le système l'est et que le profil ne dit rien. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;

    --fond: #14161a;
    --surface: #1c1f25;
    --surface-2: #23272f;
    --surface-3: #2b3039;
    --bord: #2d323b;
    --bord-fort: #414856;
    --texte: #e8eaee;
    --texte-2: #a3abb8;
    --texte-3: #737c8c;

    --accent: #7f89f2;
    --accent-survol: #939cf5;
    --accent-texte: #11131a;
    --accent-doux: #262a45;

    --danger: #f0736b;
    --danger-doux: #3a2221;
    --succes: #4cc083;
    --succes-doux: #1c3327;
    --avertissement: #e0a93b;
    --avertissement-doux: #3a2f17;

    --statut-brouillon: #737c8c;
    --statut-en-revue: #e0a93b;
    --statut-valide: #4cc083;

    --lien-graphe: #5d6676;
    --couloir: #1a1d22;
    --couloir-alterne: #1e2127;

    /* Arbre « Strates × Codex » (D45). */
    --strate-racines: #191b20;
    --strate-1: #11252b;
    --strate-2: #141f37;
    --strate-3: #15271a;
    --strate-4: #2a2315;
    --strate-5: #2c1a14;
    --strate-6: #211a33;
    --strate-texte-1: #7cc3d3;
    --strate-texte-2: #8eb0ee;
    --strate-texte-3: #8ccf94;
    --strate-texte-4: #dfb267;
    --strate-texte-5: #e99a7c;
    --strate-texte-6: #b9a2ee;
    --hachure-gel: rgb(255 240 210 / 8%);
    --survol-entete: rgb(255 255 255 / 5%);
    --or: #d9c48f;
    --lieu: #3fc4a5;
    --medaillon: #1d2130;
    --opacite-lien: 0.65;
    --opacite-halo-lien: 0.22;

    --ombre: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 14px rgb(0 0 0 / 30%);
    --ombre-forte: 0 4px 10px rgb(0 0 0 / 40%), 0 16px 40px rgb(0 0 0 / 50%);
  }
}
