/* Design tokens — the single source of truth. DESIGN.md's front matter mirrors this file exactly.
   Primitive tier: raw values. Semantic tier: what pages read. Pages never use a primitive directly. */
:root {
	/* primitives */
	--spruce-700: #2d5b4f;
	--spruce-300: #86c7b2;
	--ink-900: #1b2421;
	--ink-950: #121816;
	--ink-950-deep: #0f1a17;
	--stone-50: #f6f7f4;
	--stone-0: #ffffff;
	--stone-200: #e6ebe7;
	--stone-600: #4d5a55;
	--stone-400: #a9b5af;
	--stone-500: #76837d;
	--stone-500-dark: #6e7c76;
	--red-700: #b42318;
	--red-300: #f49b8f;
	--amber-700: #8a5a00;
	--amber-300: #e8b65c;

	/* semantic — light */
	--color-background: var(--stone-50);
	--color-surface: var(--stone-0);
	--color-text: var(--ink-900);
	--color-text-secondary: var(--stone-600);
	--color-border: #dfe5e1;
	--color-control-border: var(--stone-500);
	--color-primary: var(--spruce-700);
	--color-on-primary: var(--stone-0);
	--color-selected-bg: #e3efea;
	--color-destructive: var(--red-700);
	--color-warning: var(--amber-700);
	--color-focus-ring: var(--spruce-700);
	--color-link: var(--spruce-700);

	/* type: the platform UI face — fast on a phone, familiar, excellent at small sizes */
	--font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--text-display: 600 1.75rem/1.2 var(--font-body);
	--text-title: 600 1.375rem/1.25 var(--font-body);
	--text-heading: 600 1.125rem/1.35 var(--font-body);
	--text-body: 400 1.0625rem/1.55 var(--font-body);
	--text-label: 500 0.9375rem/1.35 var(--font-body);
	--text-caption: 400 0.8125rem/1.4 var(--font-body);

	/* spacing (4pt base) */
	--space-1: 4px;
	--space-2: 8px;
	--space-3: 12px;
	--space-4: 16px;
	--space-6: 24px;
	--space-8: 32px;
	--space-12: 48px;
	--gutter: 16px;
	--content-max: 640px;
	--tap: 48px;

	/* shape */
	--radius-sm: 6px;
	--radius-md: 10px;
	--radius-lg: 16px;
	--radius-full: 9999px;

	/* elevation */
	--shadow-1: 0 1px 2px rgba(18, 24, 22, 0.06);
	--shadow-2: 0 6px 18px rgba(18, 24, 22, 0.12);

	/* motion */
	--motion-fast: 120ms;
	--motion-base: 220ms;
	--ease-standard: cubic-bezier(0.2, 0, 0, 1);

	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root {
		--color-background: var(--ink-950);
		--color-surface: var(--ink-900);
		--color-text: var(--stone-200);
		--color-text-secondary: var(--stone-400);
		--color-border: #2a3531;
		--color-control-border: var(--stone-500-dark);
		--color-primary: var(--spruce-300);
		--color-on-primary: var(--ink-950-deep);
		--color-selected-bg: #1f3a33;
		--color-destructive: var(--red-300);
		--color-warning: var(--amber-300);
		--color-focus-ring: var(--spruce-300);
		--color-link: var(--spruce-300);
		--shadow-1: none;
		--shadow-2: 0 6px 18px rgba(0, 0, 0, 0.5);
	}
}

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