/* ============================================================================
   Design tokens — Entropy Sales Dashboard
   Single source of truth for colour, type, spacing, radii, motion.
   ============================================================================ */

:root {
  /* ---------- Spacing scale (8px base) ---------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* ---------- Layout ---------- */
  --page-margin-desktop: var(--space-6);
  --page-margin-mobile: var(--space-4);
  --card-padding: var(--space-5);
  --card-gap: var(--space-4);
  --section-gap: var(--space-7);
  --sidebar-width: 232px;
  --bottom-tab-height: 64px;
  --panel-width: 480px;

  /* ---------- Radii ---------- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* ---------- Borders ---------- */
  --border-width: 1px;

  /* ---------- Typography ---------- */
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* type scale */
  --fs-display: 56px;        --lh-display: 64px;
  --fs-h1: 32px;             --lh-h1: 40px;
  --fs-h2: 22px;             --lh-h2: 30px;
  --fs-h3: 16px;             --lh-h3: 22px;
  --fs-body: 14px;           --lh-body: 22px;
  --fs-small: 12px;          --lh-small: 18px;
  --fs-stat-num: 32px;       --lh-stat-num: 40px;

  /* weights */
  --fw-display: 500;          /* Space Grotesk needs a bit more body than Fraunces 400 */
  --fw-display-strong: 600;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-strong: 600;

  /* ---------- Status colours (mode-agnostic) ---------- */
  --success: #10B981;
  --warning: #F59E0B;
  --danger:  #EF4444;
  --info:    #6366F1;

  /* ---------- Accent (mode-agnostic core) ---------- */
  --accent-base: #1F4B52;

  /* ---------- Motion ---------- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);
  --dur-page: 220ms;
  --dur-card-hover: 180ms;
  --dur-stat-mount: 320ms;
  --dur-stage-pulse: 450ms;
  --dur-mrr-count: 800ms;
  --dur-panel: 280ms;
  --dur-backdrop: 180ms;
  --dur-toast: 240ms;
  --dur-skeleton: 1.4s;

  /* ---------- z-index ---------- */
  --z-toast: 80;
  --z-panel: 70;
  --z-backdrop: 60;
  --z-modal: 90;
  --z-command: 100;
  --z-sticky: 30;
}

/* ============================================================================
   Theme: Dark (default — 50/50 polish per brief)
   ============================================================================ */

:root,
html[data-theme="dark"] {
  /* Surface palette — third pass, another +6 dial up for clear separation
     on external monitors.
       page    #0A0A0A
       card    #242424   +26 brightness — distinctly raised
       elev    #353535   +17 above card  — hovers, active nav, kanban cards
       border  #3C3C3C   visible outline against the brighter cards */
  --bg-primary: #0A0A0A;
  --bg-secondary: #242424;
  --bg-tertiary: #353535;

  --border: #3C3C3C;
  --border-strong: #5A5A5A;

  --text-primary: #F5F5F5;
  --text-secondary: #A8A8A8;
  --text-tertiary: #767676;

  --accent: #1F4B52;
  --accent-hover: #2A6068;
  --accent-glow: rgba(31, 75, 82, 0.15);

  /* Card lift — slightly stronger drop-line + inner highlight to keep
     the elevation feeling at the brighter surface level. */
  --shadow-card: 0 1px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.025);
  --shadow-panel: 0 16px 48px rgba(0, 0, 0, 0.7);
  --backdrop: rgba(0, 0, 0, 0.65);

  --skeleton-base: #353535;
  --skeleton-shine: #424242;

  color-scheme: dark;
}

/* ============================================================================
   Theme: Light (50/50 polish per brief)
   ============================================================================ */

html[data-theme="light"] {
  --bg-primary: #FAFAFA;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F0F0F0;

  --border: #E5E5E5;
  --border-strong: #D0D0D0;

  --text-primary: #0A0A0A;
  --text-secondary: #525252;
  --text-tertiary: #A0A0A0;

  --accent: #1F4B52;
  --accent-hover: #163A40;
  --accent-glow: rgba(31, 75, 82, 0.08);

  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-panel: 0 16px 48px rgba(0, 0, 0, 0.12);
  --backdrop: rgba(0, 0, 0, 0.3);

  --skeleton-base: #F0F0F0;
  --skeleton-shine: #E8E8E8;

  color-scheme: light;
}
