/* ============================================================
   Design tokens — Apple-inspired, light + dark
   ============================================================ */
:root {
  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  /* Spacing scale (8pt-ish) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

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

  /* Motion */
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 160ms;
  --dur-mid: 320ms;
  --dur-slow: 560ms;

  /* Accent (Apple blue) */
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.12);

  /* Semantic */
  --pos: #34c759;   /* income / savings */
  --neg: #ff3b30;   /* expense / over */
  --warn: #ff9f0a;

  /* Categorical palette (used by charts) */
  --c1: #0071e3;
  --c2: #ff9f0a;
  --c3: #34c759;
  --c4: #ff375f;
  --c5: #af52de;
  --c6: #5ac8fa;
  --c7: #ffcc00;
  --c8: #ff2d55;
  --c9: #64d2ff;
  --c10: #bf5af2;
}

/* Light theme (default) */
:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-grad-a: #fbfbfd;
  --bg-grad-b: #eef0f4;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --surface-2: #f2f2f5;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --text: #1d1d1f;
  --text-2: #55555a;
  --text-3: #6e6e73;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  --blur: saturate(180%) blur(20px);
  --grid-line: rgba(0, 0, 0, 0.06);
}

/* Dark theme */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-grad-a: #16161a;
  --bg-grad-b: #08080a;
  --surface: rgba(28, 28, 30, 0.66);
  --surface-solid: #1c1c1e;
  --surface-2: #2c2c2e;
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #8a8a8f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
  --blur: saturate(180%) blur(22px);
  --grid-line: rgba(255, 255, 255, 0.08);
  --accent: #0a84ff;
  --accent-hover: #409cff;
  --accent-soft: rgba(10, 132, 255, 0.18);
  --pos: #30d158;
  --neg: #ff453a;
  --warn: #ffd60a;
}
