/* Design tokens — see DESIGN.md. Pages use these names, never raw values.
   Fonts: <link href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500&display=swap" rel="stylesheet"> */

:root {
  /* Color — dark (default) */
  --bg: #0E0F11;
  --surface: #16171A;
  --surface-2: #1E2024;
  --stage: #131417;
  --border: #2A2C31;
  --border-strong: #3A3D44;
  --text: #EDEEF0;
  --text-muted: #9A9DA4;
  --primary: #C8F031;
  --on-primary: #0E0F11;
  --primary-hover: #D6F75E;
  --link: #C8F031;
  --focus: #C8F031;
  --success: #3DDC97;
  --warning: #F5B544;
  --error: #FF6B6B;
  color-scheme: dark;

  /* Typography */
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --text-xs: 0.75rem;   --lh-xs: 1rem;
  --text-sm: 0.875rem;  --lh-sm: 1.25rem;
  --text-base: 1rem;    --lh-base: 1.625rem;
  --text-lg: 1.25rem;   --lh-lg: 1.75rem;
  --text-xl: 1.75rem;   --lh-xl: 2.125rem;
  --text-2xl: 2.5rem;   --lh-2xl: 2.75rem;
  --text-3xl: 4rem;     --lh-3xl: 4rem;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --tracking-heading: -0.02em;
  --tracking-label: 0.04em;

  /* Spacing (4px 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 */
  --content-max: 1280px;
  --prose-max: 68ch;
  --gutter: 16px;
  --section-gap: 64px;
  --nav-height: 64px;
  --control-height: 40px;
  --card-min: 260px;

  /* Shape and depth */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-overlay: 0 12px 32px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);

  /* Motion */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --duration-fast: 120ms;
  --duration: 200ms;
}

@media (min-width: 768px) {
  :root {
    --gutter: 32px;
    --section-gap: 96px;
  }
}

/* Light theme — follows the OS unless the user picked dark */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F6F6F4;
    --surface: #FFFFFF;
    --surface-2: #EEEEEB;
    --stage: #E9E9E6;
    --border: #DCDCD8;
    --border-strong: #B9BAB5;
    --text: #111214;
    --text-muted: #5E6168;
    --primary-hover: #B5DC1F;
    --link: #4A6600;
    --focus: #4A6600;
    --success: #1E7F4F;
    --warning: #A15C00;
    --error: #C62828;
    --shadow-overlay: 0 12px 32px rgba(17, 18, 20, 0.12), 0 2px 6px rgba(17, 18, 20, 0.08);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #F6F6F4;
  --surface: #FFFFFF;
  --surface-2: #EEEEEB;
  --stage: #E9E9E6;
  --border: #DCDCD8;
  --border-strong: #B9BAB5;
  --text: #111214;
  --text-muted: #5E6168;
  --primary-hover: #B5DC1F;
  --link: #4A6600;
  --focus: #4A6600;
  --success: #1E7F4F;
  --warning: #A15C00;
  --error: #C62828;
  --shadow-overlay: 0 12px 32px rgba(17, 18, 20, 0.12), 0 2px 6px rgba(17, 18, 20, 0.08);
  color-scheme: light;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration: 0ms;
  }
}
