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

:root {
  /* ---- Spectrum band colors (shared by both themes) ---- */
  --band-radio: #ff8a5b;
  --band-micro: #ffc145;
  --band-ir: #ff5d73;
  --band-visible: #34c759;
  --band-uv: #a66bff;
  --band-xray: #4cc9f0;
  --band-gamma: #f072c8;

  --visible-ramp: linear-gradient(
    90deg,
    #ff3b30 0%,
    #ff9500 18%,
    #ffcc00 34%,
    #34c759 54%,
    #00a3ff 74%,
    #5856d6 88%,
    #7b5cff 100%
  );

  /* ---- Semantic accents ---- */
  --accent: #7b5cff;
  --accent-2: #4cc9f0;
  --accent-grad: linear-gradient(120deg, #7b5cff, #4cc9f0);
  --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: #080b16;
  --bg-2: #0d1122;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --surface-solid: #131832;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);

  --ink: #eef1fb;
  --ink-2: #b9c0da;
  --ink-3: #7f88a8;

  --glow: radial-gradient(
      900px 520px at 12% -10%,
      rgba(123, 92, 255, 0.28),
      transparent 62%
    ),
    radial-gradient(760px 480px at 96% 4%, rgba(76, 201, 240, 0.2), transparent 60%),
    radial-gradient(700px 600px at 60% 104%, rgba(240, 114, 200, 0.13), transparent 62%);

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

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

  --ink: #131832;
  --ink-2: #4a5372;
  --ink-3: #79819e;

  --accent: #5b3ce0;
  --accent-2: #0b8bbd;

  --glow: radial-gradient(900px 520px at 12% -10%, rgba(123, 92, 255, 0.13), transparent 60%),
    radial-gradient(760px 480px at 96% 4%, rgba(76, 201, 240, 0.14), transparent 58%);

  --shadow: 0 12px 30px rgba(19, 24, 50, 0.09);
  --grid-line: rgba(19, 24, 50, 0.06);
  --wave-bg: rgba(19, 24, 50, 0.025);
}

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