/* theme.css — the tokens. Every colour, size and font in one place, so the app
   has one palette and the dark theme is a second set of values, not a second
   stylesheet.

   No web fonts are loaded: the page makes no request after it arrives, so it
   opens from a folder, a USB stick, or Pages and looks the same in all three. */

:root {
  color-scheme: light dark;

  /* palette — light */
  --bg: #f7f8fc;
  --bg-glow: #eeeaff;
  --surface: #ffffff;
  --surface-2: #fbfaff;
  --text: #191a2d;
  --muted: #646a7e;   /* 4.68:1 on the lightest surface the app uses, so muted text still reads */
  --line: #e7e8f1;
  --line-strong: #d5d3e8;
  --primary: #6246ea;
  --primary-hover: #5339d6;
  --primary-ink: #ffffff;
  --soft: #f0edff;
  --soft-ink: #4b32c3;
  --success: #168b68;
  --success-soft: #e8f8f2;
  --warn: #a2670a;
  --warn-soft: #fff4df;
  --danger: #c0263c;
  --danger-soft: #fdeef0;
  --code-bg: #f4f4fa;

  /* type */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* shape */
  --radius: 18px;
  --radius-sm: 10px;
  --pill: 999px;
  --shadow: 0 16px 40px rgba(38, 32, 80, 0.07);
  --shadow-sm: 0 2px 10px rgba(38, 32, 80, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --bg-glow: #1b1730;
    --surface: #161922;
    --surface-2: #1a1e29;
    --text: #e9eaf2;
    --muted: #9aa0b4;
    --line: #262b38;
    --line-strong: #39404f;
    --primary: #8b7bff;
    --primary-hover: #a294ff;
    --primary-ink: #14121f;
    --soft: #1e2130;
    --soft-ink: #c3b8ff;
    --success: #3ddc97;
    --success-soft: #14301f;
    --warn: #e0a94a;
    --warn-soft: #2c2413;
    --danger: #ff8794;
    --danger-soft: #331820;
    --code-bg: #1b1f2b;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  }
}

:root[data-theme="dark"] {
  --bg: #0f1115;
  --bg-glow: #1b1730;
  --surface: #161922;
  --surface-2: #1a1e29;
  --text: #e9eaf2;
  --muted: #9aa0b4;
  --line: #262b38;
  --line-strong: #39404f;
  --primary: #8b7bff;
  --primary-hover: #a294ff;
  --primary-ink: #14121f;
  --soft: #1e2130;
  --soft-ink: #c3b8ff;
  --success: #3ddc97;
  --success-soft: #14301f;
  --warn: #e0a94a;
  --warn-soft: #2c2413;
  --danger: #ff8794;
  --danger-soft: #331820;
  --code-bg: #1b1f2b;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
}
