/*
 * Variables de conception : couleurs (thèmes clair et sombre), typographie, dimensions.
 * Toute couleur de l'interface et de l'éditeur doit venir d'ici.
 * Couleurs des catégories de codes (--c-*) : une par catégorie (src/data/categories.js),
 * appliquées par css/editor.css, contrastées sur le fond de l'éditeur dans les deux thèmes.
 */

:root {
  --font-ui: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Consolas, 'DejaVu Sans Mono', 'Liberation Mono', monospace;
  --editor-font-size: 15px;

  --radius: 8px;
  --radius-lg: 12px;
  --topbar-height: 52px;
  --tap: 40px;
  --gutter: 16px;
}

:root,
[data-theme='light'] {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --sim-stock: #9aa5b4;
  --sim-chuck: #4b5563;
  --sim-holder: #5b6472;
  /* Visu de position des simulateurs : écran sombre aux chiffres clairs, comme à la machine. */
  --dro-bg: #16202e;
  --dro-border: #0b121c;
  --dro-text: #f2f6fb;
  --dro-letter: #8cc8ff;
  --surface-3: #e3e6eb;
  --border: #d7dbe1;
  --border-strong: #b9bfc8;
  --text: #1c2128;
  --text-muted: #5c6572;
  --accent: #2563eb;
  --accent-hover: #1d4fd0;
  --accent-contrast: #ffffff;
  --accent-soft: #e2eafd;
  --danger: #c0352b;
  --danger-soft: #fbe7e5;
  --warning: #a35f00;
  --warning-soft: #fdf1dc;
  --success: #2c7a3f;
  --shadow: 0 8px 28px rgb(15 23 42 / 0.16);
  --backdrop: rgb(15 23 42 / 0.38);

  --editor-bg: #ffffff;
  --editor-text: #1c2128;
  --editor-gutter-bg: #f7f8fa;
  --editor-gutter-text: #8b94a1;
  --editor-active-line: #f0f4fa;
  --editor-selection: #cddfff;
  --editor-cursor: #1c2128;

  --c-motion: #1a5fd0;
  --c-cycle: #8b2fc9;
  --c-mode: #0b7a75;
  --c-tool: #b55400;
  --c-mcode: #c4262e;
  --c-program: #7a5c00;
  --c-macro: #1f7a35;
  --c-macro-bg: #e6f4ea;
  --c-macroKeyword: #a1307c;
  --c-address: #3f5872;
  --c-value: #1c2128;
  --c-blockNumber: #8b94a1;
  --c-comment: #737c89;
  --c-unknown: #c4262e;
  --occurrence-bg: #ffe58a;
  --occurrence-current: #f2c200;
  --diff-insert: #e3f6e8;
  --diff-insert-text: #1d6b35;
  --diff-delete: #fde8e7;
  --diff-delete-text: #a32a24;
}

[data-theme='dark'] {
  color-scheme: dark;
  --bg: #121418;
  --surface: #1b1e23;
  --surface-2: #23272e;
  --sim-stock: #6b7889;
  --sim-chuck: #3a414c;
  --sim-holder: #a3acb9;
  --dro-bg: #0b0f14;
  --dro-border: #3a414c;
  --dro-text: #eef3f8;
  --dro-letter: #8cc8ff;
  --surface-3: #2d323a;
  --border: #323843;
  --border-strong: #48505d;
  --text: #e4e7ec;
  --text-muted: #9ba4b1;
  --accent: #5b9cff;
  --accent-hover: #7cb0ff;
  --accent-contrast: #0b1424;
  --accent-soft: #1f2f4b;
  --danger: #f07167;
  --danger-soft: #3a2224;
  --warning: #e5a442;
  --warning-soft: #3a2f1c;
  --success: #62c47a;
  --shadow: 0 10px 32px rgb(0 0 0 / 0.5);
  --backdrop: rgb(0 0 0 / 0.55);

  --editor-bg: #171a1f;
  --editor-text: #dfe3e9;
  --editor-gutter-bg: #15171b;
  --editor-gutter-text: #69717e;
  --editor-active-line: #1f232a;
  --editor-selection: #2c4a78;
  --editor-cursor: #e4e7ec;

  --c-motion: #6aa6ff;
  --c-cycle: #c792ea;
  --c-mode: #4cc9c0;
  --c-tool: #f5a25d;
  --c-mcode: #ff7b72;
  --c-program: #e5c07b;
  --c-macro: #8fd694;
  --c-macro-bg: #1d3324;
  --c-macroKeyword: #f08fc8;
  --c-address: #a9bccf;
  --c-value: #e4e7ec;
  --c-blockNumber: #69717e;
  --c-comment: #7f8896;
  --c-unknown: #ff7b72;
  --occurrence-bg: #5a4b12;
  --occurrence-current: #8a7316;
  --diff-insert: #17321f;
  --diff-insert-text: #8fd694;
  --diff-delete: #3a1d1f;
  --diff-delete-text: #ff9a92;
}
