/* =====================================================================
   Psyditor design tokens
   ---------------------------------------------------------------------
   Two tiers, as most design-system guides recommend for a small system:

     1. PRIMITIVES  raw values with no meaning ("lime-400", "space-4").
                    Never used directly by components.
     2. SEMANTIC    what a value is FOR ("--color-action", "--space-gap").
                    Components only ever read these, so changing the
                    palette or the spacing scale is a one-line change here.

   Brand colour, chosen with colour theory and a look at the category:
     - The category is crowded: purple (most AI video tools), black and
       white (big editors), red (YouTube), the pink-orange gradient
       (Instagram). Red or purple would make us look like someone else.
     - Chartreuse (hue ~124) is unowned in the category and has the
       highest perceived brightness of any hue, so on a near-black
       ground it is the first thing the eye finds: right for one action
       per screen and for the word that pops in a caption.
     - Its complement, magenta (hue ~345), is the second voice, used
       sparingly (under 10%): the studio key light, the focus ring.
       Complementary pairs vibrate the way a reel caption should.
     - Neutrals lean slightly green (hue 155) so the blacks belong to
       the chartreuse instead of fighting it.
     - Chartreuse is a light colour (L 0.90), so text on it is dark;
       white text on it would fail contrast.

   Colours are OKLCH: equal steps in L look like equal steps to the eye,
   which keeps contrast predictable across the ramp.
   ===================================================================== */

:root {
  /* ---------- 1. Primitives ---------- */

  /* Neutrals: a hair of green (hue 155) so the blacks sit with the brand. */
  --ink-950: oklch(0.15 0.012 155);
  --ink-900: oklch(0.19 0.012 155);
  --ink-850: oklch(0.23 0.012 155);
  --ink-800: oklch(0.29 0.012 155);
  --ink-600: oklch(0.45 0.012 155);
  --ink-400: oklch(0.75 0.012 155);   /* about 8:1 on ink-950: safe for body text */
  --ink-100: oklch(0.97 0.008 155);

  /* Brand: chartreuse (primary) and its complement, magenta (accent). */
  --lime-400: oklch(0.90 0.21 124);
  --lime-300: oklch(0.94 0.17 124);
  --lime-950: oklch(0.18 0.03 140);   /* text that sits on lime */
  --magenta-500: oklch(0.62 0.25 345);
  --magenta-400: oklch(0.74 0.20 345);
  --coral-400: oklch(0.72 0.17 25);    /* errors only */

  /* Type: one family (Archivo) used across its width axis:
     condensed + heavy for display, normal width for reading. */
  --font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Modular type scale, ratio 1.25. Display sizes are fluid. */
  --size-xs: 0.8rem;
  --size-sm: 0.9rem;
  --size-md: 1rem;
  --size-lg: 1.25rem;
  --size-xl: 1.563rem;
  --size-2xl: clamp(2rem, 4vw, 2.75rem);
  --size-3xl: clamp(2.75rem, 7.5vw, 5.75rem);

  /* Spacing: a 4px base, doubling-ish steps. */
  --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;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  /* Motion: exponential ease-out; short for UI state, longer for the hero. */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 160ms;
  --dur-base: 240ms;
  --dur-slow: 700ms;

  /* ---------- 2. Semantic tokens (components use only these) ---------- */

  --color-bg: var(--ink-950);
  --color-surface: var(--ink-900);
  --color-surface-raised: var(--ink-850);
  --color-border: var(--ink-800);
  --color-text: var(--ink-100);
  --color-text-muted: var(--ink-400);
  --color-text-faint: var(--ink-600);      /* decoration only, never for reading */

  --color-action: var(--lime-400);         /* the one main action per screen */
  --color-action-hover: var(--lime-300);
  --color-on-action: var(--lime-950);      /* dark text: lime is a light colour */
  --color-highlight: var(--lime-400);      /* the word that pops */
  --color-on-highlight: var(--lime-950);
  --color-key: var(--magenta-500);         /* the studio key light in the hero */
  --color-danger: var(--coral-400);
  --color-success: var(--lime-400);
  --color-focus: var(--magenta-400);       /* focus ring differs from the action colour */

  --text-body: var(--size-md);
  --leading-body: 1.6;                     /* light text on dark needs extra air */
  --leading-tight: 0.95;

  --gutter: clamp(var(--space-4), 4vw, var(--space-12));
  --content-max: 1200px;
  --form-max: 420px;

  /* Layering scale: named, never arbitrary numbers. */
  --z-sticky: 10;
  --z-toast: 30;
}

/* Users who ask for less motion get instant state changes. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur-base: 0ms;
    --dur-slow: 0ms;
  }
}
