:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  --font-ui: "Inter", "InterVariable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "JetBrainsMono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-15: 15px;
  --fs-16: 16px;
  --fs-18: 18px;
  --fs-22: 22px;
  --fs-28: 28px;
  --fs-36: 36px;
  --fs-48: 48px;

  --lh-tight: 1.2;
  --lh-normal: 1.5;
  --lh-loose: 1.7;

  --motion-fast: 120ms;
  --motion-mid: 180ms;
  --ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);

  --max-w: 1280px;
  --content-w: 1180px;
}

:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0e1014;
  --bg-elev: #14171d;
  --surface: #181c24;
  --surface-2: #1d212a;
  --surface-3: #232834;
  --surface-hover: #20242e;

  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-focus: rgba(110, 231, 209, 0.55);

  --text: #e6e9ef;
  --text-strong: #f3f5f9;
  --text-muted: #9aa3b2;
  --text-faint: #6b7280;

  --accent: #6ee7d1;
  --accent-strong: #34d3b6;
  --accent-soft: rgba(110, 231, 209, 0.12);
  --accent-on: #07171a;

  --success: #6dd29a;
  --success-soft: rgba(109, 210, 154, 0.12);
  --warning: #e6c06b;
  --warning-soft: rgba(230, 192, 107, 0.12);
  --danger: #ec7676;
  --danger-soft: rgba(236, 118, 118, 0.12);
  --info: #7eb6e6;
  --info-soft: rgba(126, 182, 230, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);

  --syntax-key: #b8c8e6;
  --syntax-string: #a7e0b9;
  --syntax-number: #e0c389;
  --syntax-bool: #d49ce3;
  --syntax-null: #888;
  --syntax-comment: #6b7280;
  --syntax-punct: #8c95a6;
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #faf9f6;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f2ee;
  --surface-3: #ebeae5;
  --surface-hover: #f0efea;

  --border: rgba(20, 22, 28, 0.10);
  --border-strong: rgba(20, 22, 28, 0.18);
  --border-focus: rgba(20, 130, 110, 0.55);

  --text: #1e2230;
  --text-strong: #0c1018;
  --text-muted: #5b6373;
  --text-faint: #8a92a1;

  --accent: #0e9d82;
  --accent-strong: #0a8770;
  --accent-soft: rgba(14, 157, 130, 0.10);
  --accent-on: #ffffff;

  --success: #1f9d63;
  --success-soft: rgba(31, 157, 99, 0.10);
  --warning: #b08416;
  --warning-soft: rgba(176, 132, 22, 0.10);
  --danger: #c1453f;
  --danger-soft: rgba(193, 69, 63, 0.10);
  --info: #2d6cb6;
  --info-soft: rgba(45, 108, 182, 0.10);

  --shadow-sm: 0 1px 2px rgba(20, 22, 28, 0.06);
  --shadow-md: 0 4px 16px rgba(20, 22, 28, 0.08);

  --syntax-key: #2d4a8a;
  --syntax-string: #1e7a3c;
  --syntax-number: #8a5a16;
  --syntax-bool: #7a3aa2;
  --syntax-null: #888;
  --syntax-comment: #8a92a1;
  --syntax-punct: #5b6373;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;

    --bg: #faf9f6;
    --bg-elev: #ffffff;
    --surface: #ffffff;
    --surface-2: #f3f2ee;
    --surface-3: #ebeae5;
    --surface-hover: #f0efea;

    --border: rgba(20, 22, 28, 0.10);
    --border-strong: rgba(20, 22, 28, 0.18);
    --border-focus: rgba(20, 130, 110, 0.55);

    --text: #1e2230;
    --text-strong: #0c1018;
    --text-muted: #5b6373;
    --text-faint: #8a92a1;

    --accent: #0e9d82;
    --accent-strong: #0a8770;
    --accent-soft: rgba(14, 157, 130, 0.10);
    --accent-on: #ffffff;

    --success: #1f9d63;
    --success-soft: rgba(31, 157, 99, 0.10);
    --warning: #b08416;
    --warning-soft: rgba(176, 132, 22, 0.10);
    --danger: #c1453f;
    --danger-soft: rgba(193, 69, 63, 0.10);
    --info: #2d6cb6;
    --info-soft: rgba(45, 108, 182, 0.10);

    --shadow-sm: 0 1px 2px rgba(20, 22, 28, 0.06);
    --shadow-md: 0 4px 16px rgba(20, 22, 28, 0.08);

    --syntax-key: #2d4a8a;
    --syntax-string: #1e7a3c;
    --syntax-number: #8a5a16;
    --syntax-bool: #7a3aa2;
    --syntax-null: #888;
    --syntax-comment: #8a92a1;
    --syntax-punct: #5b6373;
  }
}
