:root {
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Font sizes — modular scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: clamp(1.5rem, 1.375rem + 0.6vw, 2rem);
  --text-4xl: clamp(1.75rem, 1.5rem + 1vw, 2.5rem);
  --text-5xl: clamp(2rem, 1.625rem + 1.5vw, 3.25rem);
  --text-6xl: clamp(2.5rem, 1.75rem + 3vw, 4rem);

  /* Font weights */
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Line heights */
  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  /* Letter spacing */
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;

  /* Spacing scale */
  --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;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Container */
  --container-max: 1120px;
  --container-narrow: 720px;
  --container-padding: var(--space-6);

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --ease-default: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);

  /* Z-index scale */
  --z-base: 0;
  --z-above: 10;
  --z-header: 100;
  --z-overlay: 200;
  --z-modal: 300;

  /* Header */
  --header-height: 56px;
}

[data-theme="light"], :root {
  --color-bg: #fafafa;
  --color-bg-elevated: #ffffff;
  --color-bg-subtle: #f4f5f7;
  --color-text: #17181c;
  --color-text-secondary: #464d58;
  --color-text-muted: #6a7280;
  --color-border: #e3e6ea;
  --color-border-subtle: #edeef2;
  --color-accent: #2d93fd;
  --color-accent-hover: #1f7fea;
  --color-accent-strong: #1a6fce;
  --color-accent-subtle: rgba(45, 147, 253, 0.1);
  --color-brand: #7add73;
  --color-brand-hover: #6ed069;
  --color-brand-subtle: rgba(122, 221, 115, 0.16);
  --color-on-brand: #10290f;
  --color-surface: #ffffff;
  --color-surface-hover: #f5f6f8;
  --color-tag-bg: #eef0f3;
  --color-tag-text: #3f4753;
  --color-code-bg: #f2f3f5;
  --shadow-sm: 0 1px 2px rgba(15, 18, 25, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 18, 25, 0.07);
  --shadow-lg: 0 12px 32px rgba(15, 18, 25, 0.1);
}

[data-theme="dark"] {
  --color-bg: #0f1115;
  --color-bg-elevated: #171a21;
  --color-bg-subtle: #1b1f27;
  --color-text: #eef1f5;
  --color-text-secondary: #a3abb8;
  --color-text-muted: #7f8894;
  --color-border: #2a2f3a;
  --color-border-subtle: #21262f;
  --color-accent: #2d93fd;
  --color-accent-hover: #4ca4ff;
  --color-accent-strong: #66b3ff;
  --color-accent-subtle: rgba(45, 147, 253, 0.14);
  --color-brand: #7add73;
  --color-brand-hover: #8ce685;
  --color-brand-subtle: rgba(122, 221, 115, 0.16);
  --color-on-brand: #0d260c;
  --color-surface: #171a21;
  --color-surface-hover: #1e232c;
  --color-tag-bg: #242a35;
  --color-tag-text: #a7b0bf;
  --color-code-bg: #1a1e26;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}
