/* Design tokens. Cool neutrals + one teal accent, shared by both themes.
   Light is the default; dark applies via the OS preference (also without JS)
   or <html data-theme="dark">, which the inline head script / toggle set. */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* type */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Code",
    Menlo, Consolas, monospace;

  --text-xs: 0.8125rem;
  --text-sm: 0.9rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.625rem;
  --text-2xl: clamp(2rem, 1.4rem + 2.2vw, 2.75rem);
  --text-3xl: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem);

  /* spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --space-7: 6rem;

  /* shape: interactive elements 10px, containers 16px */
  --radius: 10px;
  --radius-lg: 16px;
  --container: 72rem;
  --prose: 42rem;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* z-index scale */
  --z-header: 20;
  --z-menu: 30;
  --z-skip: 40;
  --z-grain: 50;

  /* light theme (default) */
  color-scheme: light;
  --bg: #f5f6f6;
  --bg-raised: #fcfdfd;
  --bg-inset: #eceeee;
  --text: #17191a;
  --text-muted: #555b5e;
  --accent: #0f766e;
  --accent-strong: #0b5f58;
  --accent-soft: rgb(15 118 110 / 0.09);
  --accent-contrast: #f3fffd;
  --error: #b42318;
  --error-soft: rgb(180 35 24 / 0.08);
  --border: #dde1e1;
  --code-bg: #eef0f0;
  --shadow: 0 1px 2px rgb(23 40 40 / 0.06), 0 8px 24px -12px rgb(23 40 40 / 0.18);
  --header-bg: rgb(245 246 246 / 0.78);
  --glow: rgb(15 118 110 / 0.13);
  --grain-opacity: 0.035;

  --cube-face-bg: #121a1b;
  --cube-face-text: #e6f6f3;
  --cube-edge: #14b8a6;

  --tok-comment: #7d8589;
  --tok-keyword: #9d2069;
  --tok-string: #246a3a;
  --tok-function: #0f766e;
  --tok-number: #a35a0c;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c0f10;
    --bg-raised: #131819;
    --bg-inset: #1a2021;
    --text: #e6eaea;
    --text-muted: #9ba5a7;
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --accent-soft: rgb(45 212 191 / 0.1);
    --accent-contrast: #052622;
    --error: #f97066;
    --error-soft: rgb(249 112 102 / 0.1);
    --border: #252d2f;
    --code-bg: #111617;
    --shadow: 0 1px 2px rgb(0 8 8 / 0.4), 0 12px 32px -16px rgb(0 10 10 / 0.7);
    --header-bg: rgb(12 15 16 / 0.72);
    --glow: rgb(45 212 191 / 0.1);
    --grain-opacity: 0.05;

    --cube-face-bg: #0a0e0f;
    --cube-edge: #2dd4bf;

    --tok-comment: #6b7678;
    --tok-keyword: #f48fb1;
    --tok-string: #8fd4a8;
    --tok-function: #5eead4;
    --tok-number: #f0b27a;
  }
}

/* Same values as above, for an explicit choice that differs from the OS. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0f10;
  --bg-raised: #131819;
  --bg-inset: #1a2021;
  --text: #e6eaea;
  --text-muted: #9ba5a7;
  --accent: #2dd4bf;
  --accent-strong: #5eead4;
  --accent-soft: rgb(45 212 191 / 0.1);
  --accent-contrast: #052622;
  --error: #f97066;
  --error-soft: rgb(249 112 102 / 0.1);
  --border: #252d2f;
  --code-bg: #111617;
  --shadow: 0 1px 2px rgb(0 8 8 / 0.4), 0 12px 32px -16px rgb(0 10 10 / 0.7);
  --header-bg: rgb(12 15 16 / 0.72);
  --glow: rgb(45 212 191 / 0.1);
  --grain-opacity: 0.05;

  --cube-face-bg: #0a0e0f;
  --cube-edge: #2dd4bf;

  --tok-comment: #6b7678;
  --tok-keyword: #f48fb1;
  --tok-string: #8fd4a8;
  --tok-function: #5eead4;
  --tok-number: #f0b27a;
}
