@layer reset, base, components, modules, utilities;

:root {
  /* Primitives: OKLCH lightness, chroma, hue. Dark mode overrides these only. */
  --lch-ink: 24% 0.02 260;
  --lch-ink-muted: 48% 0.02 260;
  --lch-canvas: 99% 0.003 260;
  --lch-surface: 100% 0 0;
  --lch-subtle: 96.5% 0.006 260;
  --lch-border: 89% 0.01 260;
  /* Form controls need 3:1 against their surface (WCAG 1.4.11); panels and dividers keep the quiet border. */
  --lch-border-strong: 62% 0.02 260;
  --lch-primary: 48% 0.15 255;
  --lch-primary-tint: 95% 0.03 255;
  --lch-positive: 48% 0.12 150;
  --lch-positive-tint: 95% 0.04 150;
  --lch-negative: 50% 0.18 25;
  --lch-negative-tint: 95% 0.03 25;
  --lch-warning: 52% 0.12 70;
  --lch-warning-tint: 95% 0.05 85;

  --color-ink: oklch(var(--lch-ink));
  --color-ink-muted: oklch(var(--lch-ink-muted));
  --color-canvas: oklch(var(--lch-canvas));
  --color-surface: oklch(var(--lch-surface));
  --color-subtle: oklch(var(--lch-subtle));
  --color-border: oklch(var(--lch-border));
  --color-border-strong: oklch(var(--lch-border-strong));
  --color-primary: oklch(var(--lch-primary));
  --color-primary-tint: oklch(var(--lch-primary-tint));
  --color-positive: oklch(var(--lch-positive));
  --color-positive-tint: oklch(var(--lch-positive-tint));
  --color-negative: oklch(var(--lch-negative));
  --color-negative-tint: oklch(var(--lch-negative-tint));
  --color-warning: oklch(var(--lch-warning));
  --color-warning-tint: oklch(var(--lch-warning-tint));

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: ui-serif, "Iowan Old Style", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
  --text-small: 0.875rem;
  --text-x-small: 0.75rem;
  --text-large: 1.25rem;
  --text-x-large: 1.75rem;

  --inline-space: 1ch;
  --inline-space-double: 2ch;
  --block-space: 1rem;
  --block-space-half: 0.5rem;
  --block-space-double: 2rem;
  --radius: 0.5rem;
  --radius-small: 0.25rem;
  --radius-pill: 999px;
  --shadow: 0 1px 2px oklch(0% 0 0 / 6%), 0 2px 8px oklch(0% 0 0 / 6%);
  --focus-ring: 2px solid var(--color-primary);
  --main-width: 80rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --lch-ink: 93% 0.01 260;
    --lch-ink-muted: 72% 0.02 260;
    --lch-canvas: 18% 0.01 260;
    --lch-surface: 22% 0.012 260;
    --lch-subtle: 26% 0.012 260;
    --lch-border: 34% 0.015 260;
    --lch-border-strong: 58% 0.02 260;
    --lch-primary: 74% 0.12 255;
    --lch-primary-tint: 30% 0.06 255;
    --lch-positive: 76% 0.12 150;
    --lch-positive-tint: 30% 0.05 150;
    --lch-negative: 74% 0.14 25;
    --lch-negative-tint: 30% 0.06 25;
    --lch-warning: 80% 0.12 80;
    --lch-warning-tint: 32% 0.05 80;
  }
}
