/* ==========================================================================
   Design Tokens — Data Druid
   Forest palette, warm parchment light mode, "forest at night" dark mode.
   ========================================================================== */

/* Self-hosted IBM Plex Mono */
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Colors — Light Mode */
  --bg: #f5f2eb;
  --fg: #1a1a1a;
  --muted: #6b6459;
  --accent: #4a8c6f;
  --accent-secondary: #e9d66b;
  --border: #d4cfc5;
  --link: #2a6b4a;
  --visited: #5e4b3e;
  --code-bg: #ebe7df;

  /* Derived Colors */
  --surface: color-mix(in oklab, var(--bg) 92%, var(--fg));
  --surface-hover: color-mix(in oklab, var(--bg) 85%, var(--fg));
  --accent-dim: color-mix(in oklab, var(--accent) 40%, transparent);

  /* Typography */
  --font-heading: "IBM Plex Mono", ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --font-code: "IBM Plex Mono", ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;

  /* Type 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: 1.875rem;
  --text-4xl: 2.25rem;

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

  /* Layout */
  --maxw: 68ch;
  --pad: 1.25rem;
  --radius: 8px;
  --radius-sm: 4px;

  /* Line Height */
  --leading-tight: 1.2;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;
}

/* Dark Mode — "Forest at Night" */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1a14;
    --fg: #e8e4dc;
    --muted: #8a8477;
    --accent: #6bb896;
    --accent-secondary: #d4c15a;
    --border: #2a3a30;
    --link: #8eba9e;
    --visited: #b89c84;
    --code-bg: #162018;
  }
}

/* Theme override classes (for JS toggle) */
html[data-theme="light"] {
  --bg: #f5f2eb;
  --fg: #1a1a1a;
  --muted: #6b6459;
  --accent: #4a8c6f;
  --accent-secondary: #e9d66b;
  --border: #d4cfc5;
  --link: #2a6b4a;
  --visited: #5e4b3e;
  --code-bg: #ebe7df;
}

html[data-theme="dark"] {
  --bg: #0f1a14;
  --fg: #e8e4dc;
  --muted: #8a8477;
  --accent: #6bb896;
  --accent-secondary: #d4c15a;
  --border: #2a3a30;
  --link: #8eba9e;
  --visited: #b89c84;
  --code-bg: #162018;
}
