/* Tokens AntiScam : rôles uniquement, consommés par les composants.
   Noir et blanc intégral (choix de l'utilisateur) : l'accent est le blanc en sombre, le noir en clair ;
   les verdicts se distinguent par la forme (inversion, pointillés), l'icône et le libellé, jamais la couleur.
   Sombre par défaut (scène : un dev, le soir, entre son éditeur et son terminal) ;
   clair si le système le demande ou si l'utilisateur le choisit (data-theme). */

:root {
  color-scheme: dark light;

  /* neutres purs */
  --bg: oklch(0.165 0 0);
  --surface: oklch(0.2 0 0);
  --surface-2: oklch(0.182 0 0);
  --raised: oklch(0.245 0 0);
  --line: oklch(0.3 0 0);
  --line-strong: oklch(0.38 0 0);
  --text: oklch(0.955 0 0);
  --text-2: oklch(0.8 0 0);
  --text-3: oklch(0.7 0 0);

  --accent: oklch(0.97 0 0);
  --accent-hover: oklch(0.86 0 0);
  --accent-ink: oklch(0.14 0 0);
  --accent-soft: color-mix(in oklch, var(--accent) 7%, transparent);

  --scam: var(--text);
  --scam-soft: color-mix(in oklch, var(--text) 10%, transparent);
  --suspect: var(--text);
  --suspect-soft: color-mix(in oklch, var(--text) 6%, transparent);
  --safe: var(--text-2);
  --safe-soft: var(--raised);
  --danger: var(--text);

  --focus: oklch(0.97 0 0);
  --shadow-color: oklch(0.05 0 0 / 0.55);
  --code-bg: oklch(0.14 0 0);

  /* graphique */
  --chart-bar: var(--text-2);
  --chart-grid: oklch(0.28 0 0);

  /* typographie : une famille système, une mono pour les clés et le code */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-md: 0.875rem;
  --fs-lg: 1rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;

  /* espacement base 4 */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;

  /* rayons dérivés d'une base */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  --shadow-1: 0 1px 2px var(--shadow-color);
  --shadow-2: 0 12px 32px -8px var(--shadow-color), 0 2px 6px var(--shadow-color);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 150ms;
  --t-med: 220ms;

  /* z-index sémantique */
  --z-sticky: 10;
  --z-drawer: 20;
  --z-modal: 40;
  --z-toast: 50;
  --z-tooltip: 60;

  --sidebar-w: 232px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: oklch(0.982 0 0);
    --surface: oklch(1 0 0);
    --surface-2: oklch(0.962 0 0);
    --raised: oklch(0.945 0 0);
    --line: oklch(0.9 0 0);
    --line-strong: oklch(0.82 0 0);
    --text: oklch(0.22 0 0);
    --text-2: oklch(0.4 0 0);
    --text-3: oklch(0.49 0 0);
    --accent: oklch(0.16 0 0);
    --accent-hover: oklch(0.3 0 0);
    --accent-ink: oklch(1 0 0);
    --focus: oklch(0.16 0 0);
    --shadow-color: oklch(0.3 0 0 / 0.14);
    --code-bg: oklch(0.965 0 0);
    --chart-grid: oklch(0.91 0 0);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: oklch(0.982 0 0);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.962 0 0);
  --raised: oklch(0.945 0 0);
  --line: oklch(0.9 0 0);
  --line-strong: oklch(0.82 0 0);
  --text: oklch(0.22 0 0);
  --text-2: oklch(0.4 0 0);
  --text-3: oklch(0.49 0 0);
  --accent: oklch(0.16 0 0);
  --accent-hover: oklch(0.3 0 0);
  --accent-ink: oklch(1 0 0);
  --focus: oklch(0.16 0 0);
  --shadow-color: oklch(0.3 0 0 / 0.14);
  --code-bg: oklch(0.965 0 0);
  --chart-grid: oklch(0.91 0 0);
}

:root[data-theme="dark"] {
  color-scheme: dark;
}
