:root {
  /* Colors — dark mode default */
  --bg-base:      #0d0d0d;
  --bg-surface:   #1a1a1a;
  --bg-elevated:  #242424;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  /* Accent is tuned PER THEME for WCAG AA, and the two themes pull in
     opposite directions: accent-as-text needs to contrast with the page, while
     accent-as-button-background needs to contrast with its own label.
     On dark, that means a light purple with DARK text on it.
       #a99bff on #0d0d0d = 8.16:1   |  #12082e on #a99bff = 8.02:1
     White on this accent is only 2.38:1, so never hardcode #fff on it --
     always use var(--on-accent). The original #7c6af7 failed AA in light mode
     both as text (3.82:1) and under white (3.99:1). */
  --accent:       #a99bff;
  --accent-hover: #c2b8ff;
  --on-accent:    #12082e;
  --border:       rgba(255, 255, 255, 0.08);

  /* Fluid type scale via clamp() */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.9rem  + 0.5vw,  1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.6vw,  1.375rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.5vw,  2.25rem);
  --text-hero: clamp(2.5rem,   1.8rem  + 3.5vw,  5rem);

  /* 4px base spacing grid */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* Motion */
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
}

[data-theme="light"] {
  --bg-base:      #fafafa;
  --bg-surface:   #ffffff;
  --bg-elevated:  #f0f0f0;
  --text-primary: #111111;
  --text-secondary: #555555;
  --border:       rgba(0, 0, 0, 0.08);

  /* Darker purple so it clears AA both ways on a light page:
       #5b3fd4 on #fafafa = 6.48:1  |  #ffffff on #5b3fd4 = 6.76:1 */
  --accent:       #5b3fd4;
  --accent-hover: #4a30bd;
  --on-accent:    #ffffff;
}
