/* =====================================================================
   DESIGN TOKENS — colours, type, spacing, radius, shadow, motion
   Theme presets: set theme.preset in config/site.config.js
   To add a preset, copy one [data-theme] block and change the values.
   ===================================================================== */
:root {
  /* Brand (overridden by presets / config) */
  --primary: #0d5c47;
  --accent: #e3a33b;

  /* Derived brand tones — computed from --primary, no extra work needed */
  --primary-strong: color-mix(in oklab, var(--primary) 82%, black);
  --primary-soft: color-mix(in oklab, var(--primary) 10%, var(--bg));
  --primary-line: color-mix(in oklab, var(--primary) 28%, transparent);
  --primary-text: var(--primary);
  --on-primary: #ffffff;
  --accent-soft: color-mix(in oklab, var(--accent) 18%, var(--bg));

  /* Neutrals — light mode */
  --bg: #f7f5f0;
  --bg-alt: #efece4;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #15191b;
  --ink-2: #2d3437;
  --muted: #5d6669;
  --line: rgba(21, 25, 27, 0.11);
  --line-strong: rgba(21, 25, 27, 0.2);
  --inverse-bg: #111517;
  --inverse-ink: #f2f0ea;
  --inverse-muted: #a3aaad;
  --inverse-line: rgba(255, 255, 255, 0.12);
  --success: #1e7a4c;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --focus: color-mix(in oklab, var(--primary) 70%, #4c8dff);

  /* Typography */
  --font-heading: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 0.78rem;
  --fs-sm: 0.9rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.2rem;
  --fs-lg: clamp(1.35rem, 1.1rem + 0.9vw, 1.7rem);
  --fs-xl: clamp(1.7rem, 1.25rem + 1.6vw, 2.4rem);
  --fs-2xl: clamp(2.1rem, 1.4rem + 2.8vw, 3.5rem);
  --fs-3xl: clamp(2.6rem, 1.5rem + 4.4vw, 5.2rem);
  --lh-tight: 1.08;
  --lh-snug: 1.25;
  --lh-body: 1.65;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --section: clamp(4.5rem, 3rem + 6vw, 8.5rem);
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --container: 1240px;
  --header-h: 76px;

  /* Shape */
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(16, 20, 22, 0.05), 0 2px 8px rgba(16, 20, 22, 0.04);
  --shadow: 0 2px 6px rgba(16, 20, 22, 0.05), 0 18px 40px -18px rgba(16, 20, 22, 0.22);
  --shadow-lg: 0 30px 70px -30px rgba(16, 20, 22, 0.38);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 0.35s;
}

/* Corner styles */
[data-corners="sharp"] { --radius-sm: 4px; --radius: 6px; --radius-lg: 10px; }
[data-corners="round"] { --radius-sm: 14px; --radius: 26px; --radius-lg: 38px; }

/* ---------- Colour presets ---------- */
[data-theme="emerald"]  { --primary: #0d5c47; --accent: #e3a33b; }
[data-theme="indigo"]   { --primary: #3b3aa8; --accent: #f08a5d; }
[data-theme="crimson"]  { --primary: #a3183a; --accent: #d9a441; }
[data-theme="ocean"]    { --primary: #0c5b8c; --accent: #2ec4b6; }
[data-theme="amber"]    { --primary: #9a5b06; --accent: #2f6f5e; }
[data-theme="graphite"] { --primary: #2a3036; --accent: #c8a24a; }

/* ---------- Dark mode ---------- */
[data-mode="dark"] {
  --bg: #0e1214;
  --bg-alt: #131719;
  --surface: #171c1f;
  --surface-2: #1b2124;
  --ink: #ecebe5;
  --ink-2: #cfd2cf;
  --muted: #9aa3a5;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --inverse-bg: #090c0d;
  --primary-text: color-mix(in oklab, var(--primary) 55%, #ffffff);
  --primary-soft: color-mix(in oklab, var(--primary) 22%, var(--bg));
  --primary-line: color-mix(in oklab, var(--primary) 50%, transparent);
  --danger: #f97066;
  --danger-soft: rgba(249, 112, 102, 0.1);
  --success: #4fbf87;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 18px 40px -18px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}
