/**
 * Rally - Design tokens.
 * One accent per phase drives the whole UI (ring, buttons, highlights), so the colour
 * itself tells you "work" vs "rest" without reading anything.
 */

:root {
  /* Neutrals */
  --color-ink-950: #07090e;
  --color-ink-900: #0b0f17;
  --color-ink-850: #121824;
  --color-ink-800: #1a2130;
  --color-ink-700: #334155;
  --color-white: #ffffff;

  /* Phase palettes — mirrored in js/config.js (MODE_COLORS) */
  --sprint-bg: #0d0f17;
  --sprint-accent: #fbbf24;
  --short-bg: #071612;
  --short-accent: #34d399;
  --long-bg: #0f1123;
  --long-accent: #a78bfa;

  /* Active theme (sprint by default; switched by [data-theme-mode]) */
  --app-bg: var(--sprint-bg);
  --theme-accent: var(--sprint-accent);
  --theme-glow: color-mix(in srgb, var(--theme-accent) 24%, transparent);
  --theme-tint: color-mix(in srgb, var(--theme-accent) 9%, transparent);
  --theme-track: rgba(255, 255, 255, 0.07);
  --on-accent: #0b0f17;

  /* Surfaces */
  --surface-card: color-mix(in srgb, var(--color-ink-850) 88%, var(--theme-accent) 2%);
  --surface-raised: var(--color-ink-800);
  --surface-subtle: rgba(255, 255, 255, 0.035);
  --surface-input: rgba(0, 0, 0, 0.28);
  --surface-border: rgba(148, 163, 184, 0.14);
  --surface-border-strong: rgba(148, 163, 184, 0.28);
  --surface-overlay: rgba(5, 7, 12, 0.78);

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #a3afc2;
  --text-muted: #7b879b;

  /* Status */
  --color-danger: #f87171;
  --color-success: #34d399;
  --color-warning: #fbbf24;

  /* Type */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-numeric: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-timer: clamp(3.75rem, 17vw, 5.75rem);

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Space */
  --space-3xs: 2px;
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --max-content-width: 1040px;
  --tap-size: 44px;

  /* Elevation & motion */
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 32px -16px rgba(0, 0, 0, 0.6);
  --shadow-modal: 0 24px 64px -12px rgba(0, 0, 0, 0.7);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 140ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-mode: 600ms var(--ease-out);
}

[data-theme-mode="sprint"] {
  --app-bg: var(--sprint-bg);
  --theme-accent: var(--sprint-accent);
}

[data-theme-mode="shortRest"] {
  --app-bg: var(--short-bg);
  --theme-accent: var(--short-accent);
}

[data-theme-mode="longRest"] {
  --app-bg: var(--long-bg);
  --theme-accent: var(--long-accent);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0.01ms;
    --transition-base: 0.01ms;
    --transition-mode: 0.01ms;
  }
}
