/* Tokens: the single source of values. Components use var() only. */

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

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

:root {
  /* Layout */
  --content-max: 1200px;
  --section-pad: clamp(4.5rem, 9vw, 7.5rem);
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --rail: 0rem;
  --header-h: 4.25rem;

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

  /* Type */
  --font-heading: "Geist", Arial, "Helvetica Neue", sans-serif;
  --font-body: "Geist", Arial, "Helvetica Neue", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: clamp(1.375rem, 2.2vw, 1.75rem);
  --text-2xl: clamp(2rem, 4.2vw, 3.25rem);
  --text-hero: clamp(2.5rem, 6.4vw, 5.25rem);
  --leading-tight: 1.06;
  --leading-snug: 1.25;
  --leading-body: 1.6;
  --weight-regular: 400;
  --weight-medium: 500;

  /* Colour: neutrals tinted toward the ink hue, one accent */
  --color-bg: oklch(0.967 0.008 85);
  --color-surface: oklch(0.99 0.004 85);
  --color-ink: oklch(0.2 0.02 165);
  --color-ink-soft: oklch(0.43 0.02 165);
  --color-line: oklch(0.2 0.02 165 / 0.14);
  --color-accent: #ef652f;
  --color-accent-ink: oklch(0.2 0.02 165);
  --color-accent-strong: oklch(0.52 0.17 42);
  --color-trace: oklch(0.6 0.012 165 / 0.45);
  --btn-sweep: var(--color-accent);

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 10px;

  /* Borders */
  --border-hairline: 1px;

  /* Shadow: one system */
  --shadow-md: 0 0 0 1px rgb(0 0 0 / 0.05), 0 1px 3px rgb(0 0 0 / 0.05), 0 4px 10px -4px rgb(0 0 0 / 0.05);

  /* Motion */
  --duration-fast: 150ms;
  --duration-base: 280ms;
  --duration-slow: 640ms;
  --duration-draw: 1800ms;
  --duration-pulse: 2600ms;
  --duration-loop: 38s;
  --stagger: 90ms;
  --ease-out: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

@media (min-width: 1024px) {
  :root {
    --rail: 4.5rem;
  }
}

@media (min-resolution: 192dpi) {
  :root {
    --border-hairline: 0.5px;
  }
}

/* Themed sections remap the same roles; no parallel palette. */
@media (max-width: 767.98px) {
  .nav, .site-header:has(.nav.is-open) {
    --color-bg: oklch(0.2 0.02 165);
    --color-surface: oklch(0.255 0.02 165);
    --color-ink: oklch(0.955 0.008 85);
    --color-ink-soft: oklch(0.77 0.015 165);
    --color-line: oklch(0.34 0.02 165);
  }
  .site-header:has(.nav.is-open) { color: var(--color-ink); }
}

.theme-dark {
  --color-bg: oklch(0.2 0.02 165);
  --color-surface: oklch(0.255 0.02 165);
  --color-ink: oklch(0.955 0.008 85);
  --color-ink-soft: oklch(0.77 0.015 165);
  --color-line: oklch(0.34 0.02 165);
  --color-accent-strong: oklch(0.72 0.19 40);
  --shadow-md: 0 0 0 1px rgb(255 255 255 / 0.08);
  background: var(--color-bg);
  color: var(--color-ink);
}

.theme-accent {
  --color-bg: #ef652f;
  --color-surface: oklch(0.72 0.17 45);
  --btn-bg: oklch(0.99 0.004 85);
  --btn-fg: oklch(0.2 0.02 165);
  --btn-sweep: oklch(0.2 0.02 165);
  --btn-sweep-fg: oklch(0.967 0.008 85);
  --color-ink: oklch(0.2 0.02 165);
  --color-ink-soft: oklch(0.23 0.03 30);
  --color-line: oklch(0.2 0.02 165 / 0.28);
  --color-accent-strong: oklch(0.2 0.02 165);
  background: var(--color-bg);
  color: var(--color-ink);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}
