/* Shared design tokens (theme-agnostic) */
:root {
  --font-sans: "Vazirmatn", system-ui, sans-serif;
  --font-display: "Vazirmatn", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;
  --text-2xl: clamp(1.75rem, 3.5vw, 2.25rem);
  --text-3xl: clamp(2.25rem, 5vw, 3.25rem);
  --text-4xl: clamp(2.75rem, 6vw, 4rem);
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 140ms;
  --dur: 220ms;
  --dur-slow: 420ms;
  --header-h: 3.75rem;
  --inspector-w: 380px;
  --dock-h: 4.5rem;
  --max-w: 1280px;
}

/* Dark theme (default) */
:root,
html:not([data-theme]),
html[data-theme="dark"] {
  color-scheme: dark;
  --bg-0: #050608;
  --bg-1: #0b0e14;
  --bg-2: #121722;
  --bg-3: #1a2130;
  --bg-elevated: #1e2738;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f1ec;
  --text-secondary: #a8b0c0;
  --text-muted: #6e788c;
  --accent: #6b9fff;
  --accent-strong: #4d86f5;
  --accent-soft: rgba(107, 159, 255, 0.12);
  --accent-glow: rgba(107, 159, 255, 0.35);
  --accent-border: rgba(107, 159, 255, 0.35);
  --accent-focus: rgba(107, 159, 255, 0.5);
  --link-hover: #9bc0ff;
  --violet: #9b87f5;
  --violet-soft: rgba(155, 135, 245, 0.14);
  --mint: #4fd1a5;
  --mint-soft: rgba(79, 209, 165, 0.12);
  --amber: #e8b35a;
  --amber-soft: rgba(232, 179, 90, 0.12);
  --slate: #8b95a8;
  --slate-soft: rgba(139, 149, 168, 0.1);
  --status-measured: var(--mint);
  --status-verified: var(--amber);
  --status-indexed: var(--slate);
  --header-bg: rgba(5, 6, 8, 0.82);
  --hover-surface: rgba(255, 255, 255, 0.04);
  --hover-surface-strong: rgba(255, 255, 255, 0.06);
  --stat-card-bg: rgba(18, 23, 34, 0.72);
  --principle-bg: linear-gradient(145deg, rgba(18, 23, 34, 0.92), rgba(12, 15, 22, 0.72));
  --hero-dot: rgba(255, 255, 255, 0.035);
  --hero-glow-1: rgba(107, 159, 255, 0.16);
  --hero-glow-2: rgba(155, 135, 245, 0.12);
  --hero-glow-3: rgba(79, 209, 165, 0.06);
  --refs-glow: rgba(107, 159, 255, 0.08);
  --footer-end: #07090d;
  --cmd-backdrop: rgba(0, 0, 0, 0.6);
  --dock-bg: rgba(11, 14, 20, 0.92);
  --row-hover: rgba(107, 159, 255, 0.04);
  --btn-primary-bg: #6b9fff;
  --btn-primary-fg: #050608;
  --btn-primary-hover-bg: #8ab4ff;
  --shadow-panel: 0 0 0 1px var(--line), 0 24px 48px rgba(0, 0, 0, 0.45);
  --shadow-float: 0 8px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--line);
}

/* Light theme */
html[data-theme="light"] {
  color-scheme: light;
  --bg-0: #faf7f2;
  --bg-1: #fffdf9;
  --bg-2: #f3ede4;
  --bg-3: #e8e0d4;
  --bg-elevated: #fffdf9;
  --line: rgba(34, 28, 20, 0.1);
  --line-strong: rgba(34, 28, 20, 0.16);
  --text: #1c1916;
  --text-secondary: #4a433c;
  --text-muted: #6f655c;
  --accent: #0d5c44;
  --accent-strong: #084a36;
  --accent-soft: rgba(13, 92, 68, 0.09);
  --accent-glow: rgba(13, 92, 68, 0.14);
  --accent-border: rgba(13, 92, 68, 0.22);
  --accent-focus: rgba(13, 92, 68, 0.35);
  --link-hover: #084a36;
  --violet: #5b4a8f;
  --violet-soft: rgba(91, 74, 143, 0.09);
  --mint: #0d5c44;
  --mint-soft: rgba(13, 92, 68, 0.09);
  --amber: #9a5b12;
  --amber-soft: rgba(154, 91, 18, 0.1);
  --slate: #6f655c;
  --slate-soft: rgba(111, 101, 92, 0.1);
  --status-measured: var(--mint);
  --status-verified: var(--amber);
  --status-indexed: var(--slate);
  --header-bg: rgba(250, 247, 242, 0.94);
  --hover-surface: rgba(34, 28, 20, 0.04);
  --hover-surface-strong: rgba(34, 28, 20, 0.07);
  --stat-card-bg: #fffdf9;
  --principle-bg: #fffdf9;
  --hero-dot: transparent;
  --hero-glow-1: transparent;
  --hero-glow-2: transparent;
  --hero-glow-3: transparent;
  --refs-glow: transparent;
  --footer-end: #f0e9df;
  --cmd-backdrop: rgba(28, 25, 22, 0.28);
  --dock-bg: rgba(255, 253, 249, 0.96);
  --row-hover: rgba(13, 92, 68, 0.05);
  --btn-primary-bg: #0d5c44;
  --btn-primary-fg: #fffdf9;
  --btn-primary-hover-bg: #084a36;
  --shadow-panel: 0 1px 0 var(--line), 0 12px 28px rgba(34, 28, 20, 0.06);
  --shadow-float: 0 8px 20px rgba(34, 28, 20, 0.08), 0 1px 0 var(--line);
}

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