:root,
[data-theme="dark"] {
  --bg-deepest: #100d09;
  --bg: #14110c;
  --bg-elevated: #1c1810;
  --bg-elevated-2: #262013;
  --card-bg: #1c1810;
  --code-bg: #1a160e;
  --code-border: #33291a;

  --text: #e9dfc8;
  --text-muted: #a8987a;
  --text-faint: #5c5138;
  --heading: #f3e6c4;

  --accent: #d4a857;
  --accent-strong: #e6bd6c;
  --accent-2: #c97b5c;

  --border: #332918;
  --border-strong: #453720;

  --shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 25px color-mix(in srgb, var(--accent) 15%, transparent);
  --particle: 212, 168, 87;
  --scrollbar: #3a2f1c;

  --tok-keyword: #e0a458;
  --tok-string: #9bc177;
  --tok-comment: #8a7a5c;
  --tok-number: #e08b5c;
  --tok-function: #6fb3c9;
  --tok-class: #b98fde;
  --tok-operator: #c7b892;
  --tok-punct: #a8987a;
}

[data-theme="light"] {
  --bg-deepest: #e9ddc0;
  --bg: #faf6ec;
  --bg-elevated: #f3ecdc;
  --bg-elevated-2: #ede2c9;
  --card-bg: #ffffff;
  --code-bg: #f1e8d2;
  --code-border: #ddccA3;

  --text: #2b2417;
  --text-muted: #6b5d45;
  --text-faint: #93805c;
  --heading: #241d10;

  --accent: #9c6b2e;
  --accent-strong: #7a5322;
  --accent-2: #7a3b2e;

  --border: #e2d5b8;
  --border-strong: #cdbb90;

  --shadow: 0 2px 10px rgba(60, 45, 15, 0.08);
  --shadow-glow: 0 0 25px color-mix(in srgb, var(--accent) 15%, transparent);
  --particle: 156, 107, 46;
  --scrollbar: #d8c79a;

  --tok-keyword: #8b4513;
  --tok-string: #4b6b3a;
  --tok-comment: #93805c;
  --tok-number: #b85c38;
  --tok-function: #2e5c6e;
  --tok-class: #6b3fa0;
  --tok-operator: #6b5d45;
  --tok-punct: #6b5d45;
}

:root {

  --font-heading: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-body: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  --font-persian: "Vazirmatn", "IRANSansX", sans-serif;
  --font-default: system-ui, -apple-system, sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;

  --radius-lg: 20px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-med: 300ms;
  --dur-slow: 400ms;

  --content-width: 1100px;

  --radius: 10px;
  --sidebar-w: 300px;
  --header-h: 64px;
  --max-content-w: 860px;
  --transition: 180ms ease;
  --font-scale: 1;
}

[data-font-size="small"] { --font-scale: 0.875; }
[data-font-size="large"] { --font-scale: 1.15; }

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) {
  z-index: 2;
  animation: theme-sweep 650ms var(--ease) both;
}
@keyframes theme-sweep {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}
