/* Jetons de design — source unique des couleurs, polices, espaces, rayons et mouvements.
 *
 * Direction : docs/da/direction.md (mélange Resend × EBX). Le comité : une couleur par
 * IA, le blanc (ou le noir en clair) pour la décision humaine, le cyan pour ce qui se
 * clique. Aucune autre feuille ne pose de couleur en dur : elles lisent ces variables.
 *
 * Thème : sombre par défaut ; clair si le système le demande ; un choix explicite
 * (data-theme sur <html>, posé par theme.js) l'emporte sur les deux.
 */

@font-face {
  font-family: "Instrument Serif";
  src: url("/polices/instrument-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("/polices/instrument-serif-400-italique.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("/polices/geist-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/polices/geist-mono-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Polices */
  --police-titre: "Instrument Serif", "Iowan Old Style", "Times New Roman", serif;
  --police-texte: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --police-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Échelle typographique (le héros plafonne à 6rem) */
  --t-heros: clamp(3rem, 1.4rem + 6.4vw, 6rem);
  --t-1: clamp(2.25rem, 1.55rem + 2.8vw, 3.5rem);
  --t-2: clamp(1.625rem, 1.3rem + 1.3vw, 2.25rem);
  --t-3: 1.25rem;
  --t-corps: 1rem;
  --t-chapeau: 1.125rem;
  --t-petit: 0.875rem;
  --t-micro: 0.75rem;
  --interligne-titre: 1.04;
  --interligne-corps: 1.6;
  --approche-titre: -0.025em;
  --mesure: 68ch;

  /* Espaces : base 4 px, rythme serré dans un groupe, large entre groupes */
  --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-section: clamp(4rem, 2.5rem + 6vw, 8rem);
  --gouttiere: clamp(1rem, 0.6rem + 1.6vw, 2rem);

  /* Rayons */
  --r-panneau: 24px;
  --r-carte: 14px;
  --r-controle: 12px;
  --r-petit: 8px;
  --r-pilule: 999px;

  /* Mouvement : sortie exponentielle depuis un état déjà visible */
  --duree-1: 150ms;
  --duree-2: 240ms;
  --duree-3: 600ms;
  --courbe-sortie: cubic-bezier(0.16, 1, 0.3, 1);
  --courbe-standard: cubic-bezier(0.4, 0, 0.2, 1);

  /* Plans */
  --plan-bandeau: 30;
  --plan-menu: 40;
  --plan-fenetre: 50;
  --plan-toast: 60;

  /* ---- Couleurs : thème sombre (défaut) ---- */
  color-scheme: dark;
  --fond: #000000;
  --fond-profond: #000000;
  --surface: #0a0a0b;
  --surface-2: #111214;
  --surface-3: #1a1b1e;
  --filet: rgb(214 235 253 / 0.11);
  --filet-fort: rgb(214 235 253 / 0.19);
  --texte: #f0f0f0;
  --texte-2: #a1a4a5;
  --texte-3: #8a8e91;
  --sur-accent: #03141a;

  --accent: #22d3ee;
  --accent-fort: #06b6d4;
  --accent-doux: rgb(34 211 238 / 0.14);

  --ia-claude: #f2a65a;
  --ia-codex: #5ee6a8;
  --ia-locale: #a38bfa;
  --decision: #ffffff;
  --sur-decision: #000000;
  --refus: #ff6b6b;
  --refus-doux: rgb(255 107 107 / 0.12);
  --attente: #e6c35c;
  --succes: #5ee6a8;

  --verre: linear-gradient(104deg, rgb(253 253 253 / 0.05) 5%, rgb(240 240 228 / 0.1) 100%);
  --halo-panneau: radial-gradient(60% 45% at 50% 0%, rgb(255 255 255 / 0.07), transparent 70%);
  --marque: linear-gradient(115deg, var(--ia-claude) 0%, var(--ia-codex) 52%, var(--ia-locale) 100%);

  --ombre-1: 0 1px 2px rgb(0 0 0 / 0.45);
  --ombre-2: 0 12px 32px -14px rgb(0 0 0 / 0.75);
  --ombre-3: 0 30px 80px -30px rgb(0 0 0 / 0.85);
  --lueur-action: 0 10px 30px -12px rgb(34 211 238 / 0.6);
  --anneau-focus: 0 0 0 2px var(--fond), 0 0 0 4px var(--accent);
  --reflet: rgb(255 255 255 / 0.28);
  --voile: rgb(3 4 6 / 0.62);
}

/* ---- Thème clair : demandé par le système, ou choisi ---- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --fond: #f6f6f4;
    --fond-profond: #ededea;
    --surface: #ffffff;
    --surface-2: #f8f8f6;
    --surface-3: #efefec;
    --filet: rgb(12 20 40 / 0.1);
    --filet-fort: rgb(12 20 40 / 0.2);
    --texte: #0b0c0e;
    --texte-2: #5a616a;
    --texte-3: #646b72;
    --sur-accent: #ffffff;
    --accent: #0e7490;
    --accent-fort: #155e75;
    --accent-doux: rgb(14 116 144 / 0.1);
    --ia-claude: #a85a14;
    --ia-codex: #0f7a55;
    --ia-locale: #6247d9;
    --decision: #0b0c0e;
    --sur-decision: #ffffff;
    --refus: #c42b2b;
    --refus-doux: rgb(196 43 43 / 0.08);
    --attente: #8a6a00;
    --succes: #0f7a55;
    --verre: linear-gradient(104deg, rgb(12 20 40 / 0.02) 5%, rgb(12 20 40 / 0.05) 100%);
    --halo-panneau: radial-gradient(60% 45% at 50% 0%, rgb(14 116 144 / 0.05), transparent 70%);
    --ombre-1: 0 1px 2px rgb(12 20 40 / 0.08);
    --ombre-2: 0 12px 32px -16px rgb(12 20 40 / 0.22);
    --ombre-3: 0 30px 80px -32px rgb(12 20 40 / 0.3);
    --lueur-action: 0 10px 26px -14px rgb(14 116 144 / 0.55);
  }
}

:root[data-theme="clair"] {
  color-scheme: light;
  --fond: #f6f6f4;
  --fond-profond: #ededea;
  --surface: #ffffff;
  --surface-2: #f8f8f6;
  --surface-3: #efefec;
  --filet: rgb(12 20 40 / 0.1);
  --filet-fort: rgb(12 20 40 / 0.2);
  --texte: #0b0c0e;
  --texte-2: #5a616a;
  --texte-3: #646b72;
  --sur-accent: #ffffff;
  --accent: #0e7490;
  --accent-fort: #155e75;
  --accent-doux: rgb(14 116 144 / 0.1);
  --ia-claude: #a85a14;
  --ia-codex: #0f7a55;
  --ia-locale: #6247d9;
  --decision: #0b0c0e;
  --sur-decision: #ffffff;
  --refus: #c42b2b;
  --refus-doux: rgb(196 43 43 / 0.08);
  --attente: #8a6a00;
  --succes: #0f7a55;
  --verre: linear-gradient(104deg, rgb(12 20 40 / 0.02) 5%, rgb(12 20 40 / 0.05) 100%);
  --halo-panneau: radial-gradient(60% 45% at 50% 0%, rgb(14 116 144 / 0.05), transparent 70%);
  --ombre-1: 0 1px 2px rgb(12 20 40 / 0.08);
  --ombre-2: 0 12px 32px -16px rgb(12 20 40 / 0.22);
  --ombre-3: 0 30px 80px -32px rgb(12 20 40 / 0.3);
  --lueur-action: 0 10px 26px -14px rgb(14 116 144 / 0.55);
}

:root[data-theme="sombre"] {
  color-scheme: dark;
}
