/**
 * DinkSync design tokens. Every color, spacing, radius and shadow used
 * anywhere in the app is a variable defined here — app.css and every
 * page reference these, never a raw hex value, so the brand can be
 * retuned from one file.
 *
 * Brand palette (from brand guide): Court Neon #CCFF00, Dark Slate
 * #0F172A, Slate Gray #475569, Clean White #F8FAFC.
 *
 * Contrast note: raw neon-on-white text is ~1.2:1 and fails WCAG, so
 * neon is used as a FILL (dark text on top, ~13:1) — exactly how the
 * brand mockups use it on buttons/badges — never as small foreground
 * text on a light background. Where light-theme copy needs the accent
 * color as text (links, active nav), --ds-accent-ink is a darkened
 * lime instead, which is what the light-theme wordmark already does.
 */

:root {
  /* Brand core */
  --ds-neon: #ccff00;
  --ds-neon-ink: #365314; /* dark-lime, accessible on white/light surfaces */
  --ds-slate-900: #0f172a;
  --ds-slate-700: #334155;
  --ds-slate-600: #475569;
  --ds-slate-400: #94a3b8;
  --ds-slate-200: #e2e8f0;
  --ds-slate-100: #f1f5f9;
  --ds-white: #f8fafc;

  /* Semantic surface tokens (light theme default) */
  --ds-bg: var(--ds-white);
  --ds-surface: #ffffff;
  --ds-surface-raised: #ffffff;
  --ds-text: var(--ds-slate-900);
  --ds-text-muted: var(--ds-slate-600);
  --ds-border: var(--ds-slate-200);
  --ds-accent: var(--ds-neon);
  --ds-accent-ink: var(--ds-neon-ink);
  --ds-accent-fg: var(--ds-slate-900); /* text color when placed ON the accent fill */

  /* Status colors */
  --ds-success: #16a34a;
  --ds-danger: #dc2626;
  --ds-warning: #d97706;

  /* Reliability meter */
  --ds-reliability-provisional: #94a3b8;
  --ds-reliability-building: #eab308;
  --ds-reliability-established: #16a34a;

  /* Typography */
  --ds-font-display: 'DinkSans', 'Montserrat', 'Inter', system-ui, sans-serif;
  --ds-font-body: 'DinkSans', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Spacing scale */
  --ds-space-1: 0.25rem;
  --ds-space-2: 0.5rem;
  --ds-space-3: 0.75rem;
  --ds-space-4: 1rem;
  --ds-space-5: 1.5rem;
  --ds-space-6: 2rem;
  --ds-space-8: 3rem;

  /* Radius + shadow */
  --ds-radius-sm: 0.375rem;
  --ds-radius-md: 0.75rem;
  --ds-radius-lg: 1.25rem;
  --ds-radius-pill: 999px;
  --ds-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --ds-shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --ds-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);

  /* Layout */
  --ds-bottom-nav-height: 64px;
  --ds-sidebar-width: 260px;
  --ds-max-content-width: 480px; /* mobile-first player views */
}

/* Dark theme: token overrides only. Toggled via
   document.documentElement.setAttribute('data-theme', 'dark'), no
   reload — see assets/js/theme.js. */
:root[data-theme='dark'] {
  --ds-bg: var(--ds-slate-900);
  --ds-surface: #16213a;
  --ds-surface-raised: #1c2b4a;
  --ds-text: var(--ds-white);
  --ds-text-muted: #a8b3c7;
  --ds-border: #2a3b5c;
  --ds-accent: var(--ds-neon);
  --ds-accent-ink: var(--ds-neon); /* on dark surfaces the raw neon reads fine as text */
  --ds-accent-fg: var(--ds-slate-900);
}

/* Respect system preference when the user hasn't chosen explicitly
   (assets/js/theme.js sets data-theme once they do, which then wins). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']):not([data-theme='dark']) {
    --ds-bg: var(--ds-slate-900);
    --ds-surface: #16213a;
    --ds-surface-raised: #1c2b4a;
    --ds-text: var(--ds-white);
    --ds-text-muted: #a8b3c7;
    --ds-border: #2a3b5c;
    --ds-accent: var(--ds-neon);
    --ds-accent-ink: var(--ds-neon);
    --ds-accent-fg: var(--ds-slate-900);
  }
}
