/* Tokens de design Kreyol IA — SEUL fichier où figurent des valeurs de couleur, de taille et de durée.
   Nuit (défaut) : identité Kreyol IA #07080F / teal #00D4C8 / or #E8931A.
   Jour : même identité, fonds teintés teal, catégories colorées. Suit le réglage du téléphone ;
   le bouton de thème (data-theme sur <html>) a priorité. Le bloc « jour » figure deux fois (media + attribut) :
   un test vérifie qu'ils restent identiques. */

:root {
  color-scheme: dark;

  /* Couleurs — nuit */
  --bg: #07080f;
  --surface: #10131f;
  --surface-2: #1a1e2e;
  --line: #2a3045;
  --line-strong: #7a84a0; /* bordures de champs : ≥ 3:1 */
  --text: #eef2f8;
  --muted: #a9b2c6;
  --primary: #00d4c8;
  --on-primary: #07080f;
  --primary-ui: #00d4c8; /* teal des bordures, jalons et indicateurs (≥ 3:1 sur les fonds) */
  --primary-text: #2ee6da; /* teal utilisé comme texte */
  --accent: #e8931a;
  --on-accent: #07080f;
  --accent-text: #f0a53a; /* or utilisé comme texte */
  --danger-text: #ff9a9a;
  --danger-bg: #3a1620;
  --ok-text: #5be3a0;
  --ok-bg: #0f3326;
  --focus: #ffd27a;
  --hero-from: #0b3b3d;
  --hero-to: #2a1d08;
  --on-hero: #eef2f8;
  --scrim: rgb(7 8 15 / 0.82);

  /* Catégories (fond / texte) */
  --cat-guides-bg: #0c3a3a;
  --cat-guides-fg: #7ff0e8;
  --cat-tools-bg: #3d2a0a;
  --cat-tools-fg: #f5c071;
  --cat-courses-bg: #2d2459;
  --cat-courses-fg: #c9bfff;
  --cat-packs-bg: #4a1f1a;
  --cat-packs-fg: #ffb4a6;

  /* Formes, espacements, typographie */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-icon: 22%;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.625rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 2px 10px rgb(0 0 0 / 0.35);
  --nav-h: 60px;
  --buybar-h: 72px;
  --tap: 48px;

  /* Mouvement */
  --t-fast: 140ms;
  --t-med: 280ms;
  --t-slow: 520ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="nuit"]) {
    color-scheme: light;
    --bg: #f1fbf9;
    --surface: #ffffff;
    --surface-2: #dff5f2;
    --line: #bfe3de;
    --line-strong: #5b7a80;
    --text: #0a1a24;
    --muted: #41565e;
    --primary: #00d4c8;
    --on-primary: #07080f;
    --primary-ui: #00807a;
    --primary-text: #006862;
    --accent: #e8931a;
    --on-accent: #07080f;
    --accent-text: #834a00;
    --danger-text: #a3161f;
    --danger-bg: #ffe3e3;
    --ok-text: #0b6b3f;
    --ok-bg: #d9f7e8;
    --focus: #8a4e00;
    --hero-from: #00d4c8;
    --hero-to: #ffc46b;
    --on-hero: #07080f;
    --scrim: rgb(241 251 249 / 0.9);
    --cat-guides-bg: #cdf3ee;
    --cat-guides-fg: #00504b;
    --cat-tools-bg: #ffe6bf;
    --cat-tools-fg: #663800;
    --cat-courses-bg: #e5deff;
    --cat-courses-fg: #38288f;
    --cat-packs-bg: #ffdbd2;
    --cat-packs-fg: #84260f;
    --shadow: 0 2px 10px rgb(10 60 60 / 0.14);
  }
}

:root[data-theme="jour"] {
  color-scheme: light;
  --bg: #f1fbf9;
  --surface: #ffffff;
  --surface-2: #dff5f2;
  --line: #bfe3de;
  --line-strong: #5b7a80;
  --text: #0a1a24;
  --muted: #41565e;
  --primary: #00d4c8;
  --on-primary: #07080f;
  --primary-ui: #00807a;
  --primary-text: #006862;
  --accent: #e8931a;
  --on-accent: #07080f;
  --accent-text: #834a00;
  --danger-text: #a3161f;
  --danger-bg: #ffe3e3;
  --ok-text: #0b6b3f;
  --ok-bg: #d9f7e8;
  --focus: #8a4e00;
  --hero-from: #00d4c8;
  --hero-to: #ffc46b;
  --on-hero: #07080f;
  --scrim: rgb(241 251 249 / 0.9);
  --cat-guides-bg: #cdf3ee;
  --cat-guides-fg: #00504b;
  --cat-tools-bg: #ffe6bf;
  --cat-tools-fg: #663800;
  --cat-courses-bg: #e5deff;
  --cat-courses-fg: #38288f;
  --cat-packs-bg: #ffdbd2;
  --cat-packs-fg: #84260f;
  --shadow: 0 2px 10px rgb(10 60 60 / 0.14);
}
