/* ==========================================================================
   G WORLD — design tokens
   --------------------------------------------------------------------------
   Every colour, space, radius and shadow in the app comes from this file.
   Changing the palette is therefore a one-file change, and the dark theme is
   nothing more than a second set of values for the same names.

   Colour choices are checked against WCAG 2.2 AA (4.5:1 for body text) using the
   `--text`/`--surface` pairs defined below. `--accent` is only ever used on
   `--accent-ink`, never as a text colour on white.
   ========================================================================== */

:root {
  /* --- brand ------------------------------------------------------------ */
  --brand-50: #eef2ff;
  --brand-100: #dfe5ff;
  --brand-300: #a5b4fc;
  --brand-500: #4f46e5;
  --brand-600: #4338ca;
  --brand-700: #3730a3;
  --brand-900: #1e1b4b;

  --accent-100: #fef3c7;
  --accent-400: #fbbf24;
  --accent-500: #f59e0b;
  --accent-600: #b45309;
  --accent-700: #92400e;

  --success-100: #dcfce7;
  --success-600: #15803d;
  --success-700: #166534;
  --warning-100: #fef9c3;
  --warning-600: #a16207;
  --danger-100: #fee2e2;
  --danger-600: #b91c1c;
  --danger-700: #991b1b;
  --info-100: #e0f2fe;
  --info-600: #0369a1;

  /* --- semantic surfaces ------------------------------------------------ */
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eef1f8;
  --surface-inset: #f2f4fa;
  --border: #d9dee9;
  --border-strong: #b9c1d4;

  --text: #111827;
  --text-muted: #4b5563;
  --text-subtle: #6b7280;
  --text-on-brand: #ffffff;

  --accent: var(--accent-500);
  --accent-ink: #3f2d05;
  --link: var(--brand-600);
  --link-hover: var(--brand-700);
  --focus-ring: #2563eb;

  /* --- type ------------------------------------------------------------- */
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --step--1: clamp(0.8rem, 0.77rem + 0.15vw, 0.875rem);
  --step-0: clamp(0.95rem, 0.92rem + 0.18vw, 1rem);
  --step-1: clamp(1.1rem, 1.03rem + 0.35vw, 1.25rem);
  --step-2: clamp(1.3rem, 1.18rem + 0.6vw, 1.5rem);
  --step-3: clamp(1.55rem, 1.35rem + 1vw, 2rem);
  --step-4: clamp(1.9rem, 1.55rem + 1.7vw, 2.75rem);
  --step-5: clamp(2.3rem, 1.7rem + 2.8vw, 3.5rem);

  --leading-tight: 1.2;
  --leading: 1.6;
  --measure: 68ch;

  /* --- space (4px base) -------------------------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* --- shape + motion ---------------------------------------------------- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgb(17 24 39 / 6%), 0 1px 3px rgb(17 24 39 / 4%);
  --shadow-md: 0 4px 12px rgb(17 24 39 / 8%), 0 2px 4px rgb(17 24 39 / 4%);
  --shadow-lg: 0 18px 40px rgb(17 24 39 / 12%);

  --transition-fast: 120ms ease-out;
  --transition: 200ms ease-out;

  --container: 74rem;
  --header-height: 4rem;
  --z-header: 100;
  --z-toast: 200;
}

/* Dark theme: same token names, different values. */
@media (prefers-color-scheme: dark) {
  :root {
    --brand-50: #1e1b4b;
    --brand-100: #26235c;
    --brand-300: #818cf8;
    --brand-500: #818cf8;
    --brand-600: #a5b4fc;
    --brand-700: #c7d2fe;
    --brand-900: #e0e7ff;

    --accent-100: #422c05;
    --accent-600: #fbbf24;
    --accent-700: #fcd34d;

    --success-100: #052e16;
    --success-600: #4ade80;
    --success-700: #86efac;
    --warning-100: #422006;
    --warning-600: #facc15;
    --danger-100: #450a0a;
    --danger-600: #f87171;
    --danger-700: #fca5a5;
    --info-100: #082f49;
    --info-600: #38bdf8;

    --surface: #0f1422;
    --surface-2: #141a2b;
    --surface-3: #1b2237;
    --surface-inset: #101728;
    --border: #2a3350;
    --border-strong: #3b4670;

    --text: #eef1f8;
    --text-muted: #b4bdd2;
    --text-subtle: #93a0bb;
    --text-on-brand: #0b1020;

    --accent-ink: #1b1405;
    --link: #a5b4fc;
    --link-hover: #c7d2fe;
    --focus-ring: #93c5fd;

    --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow-md: 0 6px 16px rgb(0 0 0 / 45%);
    --shadow-lg: 0 20px 44px rgb(0 0 0 / 55%);
  }
}
