/* === Design Tokens === */
:root {
  /* Light mode (default) */
  --bg: #fafafa;
  --bg-nav: rgba(250, 250, 250, 0.85);
  --bg-hover: #f0f0f0;
  --text-primary: #171717;
  --text-secondary: #636363;
  --text-tertiary: #9a9a9a;
  --accent: #171717;
  --border: #e5e5e5;
  --tag-bg: #f0f0f0;
  --tag-text: #555555;

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

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  --leading-tight: 1.3;
  --leading-normal: 1.7;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Layout */
  --max-width: 640px;
  --nav-height: 56px;

  /* Transitions */
  --transition: 150ms ease;
}

@media (max-width: 640px) {
  :root {
    --text-sm: 0.875rem;
    --text-base: 0.9375rem;
    --text-xl: 1.375rem;
    --text-2xl: 1.625rem;
    --space-lg: 1.25rem;
    --space-xl: 2rem;
    --nav-height: auto;
  }
}

[data-theme="dark"] {
  --bg: #111111;
  --bg-nav: rgba(17, 17, 17, 0.85);
  --bg-hover: #1a1a1a;
  --text-primary: #ededed;
  --text-secondary: #a0a0a0;
  --text-tertiary: #666666;
  --accent: #ededed;
  --border: #262626;
  --tag-bg: #1e1e1e;
  --tag-text: #999999;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111111;
    --bg-nav: rgba(17, 17, 17, 0.85);
    --bg-hover: #1a1a1a;
    --text-primary: #ededed;
    --text-secondary: #a0a0a0;
    --text-tertiary: #666666;
    --accent: #ededed;
    --border: #262626;
    --tag-bg: #1e1e1e;
    --tag-text: #999999;
  }
}
