/* ============================================================
   tokens.css — design tokens, theming, vector palette
   ============================================================ */

:root {
  /* ---- Vector colors (shared by both themes) ----
     Every canvas, legend chip and table swatch reads these. */
  --vec-a: #4cc9f0; /* vector A */
  --vec-b: #ffc145; /* vector B */
  --vec-c: #f072c8; /* vector C */
  --vec-r: #34c759; /* resultant */
  --vec-x: #ff8a5b; /* x-component */
  --vec-y: #a66bff; /* y-component */
  --vec-angle: #ffb020; /* angle arcs */

  /* ---- Semantic accents ---- */
  --accent: #4f7cff;
  --accent-2: #2ee6a8;
  --accent-grad: linear-gradient(120deg, #4f7cff, #2ee6a8);
  --ok: #34c759;
  --warn: #ffb020;
  --bad: #ff5d73;

  /* ---- Radii ---- */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* ---- Spacing scale ---- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;

  /* ---- Type ---- */
  --font: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, -apple-system,
    "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "SF Mono", ui-monospace, monospace;

  --t-xs: 0.78rem;
  --t-sm: 0.88rem;
  --t-base: 1rem;
  --t-md: 1.09rem;
  --t-lg: 1.35rem;
  --t-xl: 1.75rem;
  --t-2xl: 2.35rem;
  --t-3xl: 3.1rem;

  /* Reading comfort — this is a study tool, not a marketing page */
  --leading: 1.72;
  --measure: 68ch;

  --dur: 260ms;
  --ease: cubic-bezier(0.22, 0.75, 0.28, 1);
}

/* ---------------- DARK (default) ---------------- */
:root,
[data-theme="dark"] {
  --bg: #070c14;
  --bg-2: #0c1220;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --surface-solid: #121a2c;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);

  --ink: #eaf1fb;
  --ink-2: #b4c1d8;
  --ink-3: #7c89a4;

  --glow: radial-gradient(900px 520px at 10% -10%, rgba(79, 124, 255, 0.28), transparent 62%),
    radial-gradient(760px 480px at 96% 4%, rgba(46, 230, 168, 0.16), transparent 60%),
    radial-gradient(700px 600px at 62% 104%, rgba(240, 114, 200, 0.1), transparent 62%);

  --shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  --grid-line: rgba(255, 255, 255, 0.055);
  --grid-axis: rgba(255, 255, 255, 0.28);
  --plane-bg: rgba(255, 255, 255, 0.03);
}

/* ---------------- LIGHT (paper / study mode) ---------------- */
[data-theme="light"] {
  --bg: #f5f7fc;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef2fa;
  --surface-solid: #ffffff;
  --line: rgba(16, 24, 46, 0.11);
  --line-strong: rgba(16, 24, 46, 0.22);

  --ink: #101a2e;
  --ink-2: #45536f;
  --ink-3: #74809a;

  --accent: #2f5ce0;
  --accent-2: #0d9b74;

  --vec-a: #0b8bbd;
  --vec-b: #c98600;
  --vec-c: #c9349a;
  --vec-r: #17913c;
  --vec-x: #d2541f;
  --vec-y: #7a3ee0;
  --vec-angle: #b57400;

  --glow: radial-gradient(900px 520px at 10% -10%, rgba(79, 124, 255, 0.13), transparent 60%),
    radial-gradient(760px 480px at 96% 4%, rgba(46, 230, 168, 0.14), transparent 58%);

  --shadow: 0 12px 30px rgba(16, 24, 46, 0.09);
  --grid-line: rgba(16, 24, 46, 0.07);
  --grid-axis: rgba(16, 24, 46, 0.4);
  --plane-bg: rgba(16, 24, 46, 0.02);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur: 1ms;
  }
}
