/* ==========================================================================
   Design tokens
   Everything visual is derived from these. Change a value here and the whole
   site follows. Theme switching only touches the colour block.
   ========================================================================== */

:root {
  /* Type families */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Fluid type scale (min 360px → max 1280px viewport) */
  --step--1: clamp(0.8125rem, 0.79rem + 0.12vw, 0.875rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1:  clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);
  --step-2:  clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  --step-3:  clamp(2rem, 1.6rem + 1.8vw, 3rem);
  --step-4:  clamp(2.5rem, 1.7rem + 3.6vw, 4.75rem);

  /* Spacing scale */
  --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;
  --space-9: 6rem;
  --section-pad: clamp(4rem, 6vw + 2rem, 8rem);

  /* Layout */
  --container: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius-sm: 6px;
  --radius: 14px;
  --radius-lg: 22px;
  --header-h: 4.25rem;

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 180ms;
  --dur: 420ms;
  --dur-slow: 800ms;

  /* ---- Colour: dark (default) ---- */
  color-scheme: dark;
  --bg: #0b0c10;
  --bg-elev: #12141a;
  --bg-soft: #171a21;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #ebe9e4;
  --text-2: #a9a79f;
  --text-3: #6f6e68;
  --accent: #e9b44c;
  --accent-soft: rgba(233, 180, 76, 0.12);
  --accent-ink: #1a1304;
  --glow: rgba(233, 180, 76, 0.16);
  --selection: rgba(233, 180, 76, 0.35);
  --shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 20px 50px -20px rgba(0,0,0,0.6);
}

/* ---- Colour: light ---- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f3ed;
  --bg-elev: #fffdf9;
  --bg-soft: #efeae1;
  --line: rgba(20, 18, 12, 0.1);
  --line-strong: rgba(20, 18, 12, 0.2);
  --text: #15151a;
  --text-2: #5a5852;
  --text-3: #8a877f;
  --accent: #a8641a;
  --accent-soft: rgba(168, 100, 26, 0.1);
  --accent-ink: #fffaf2;
  --glow: rgba(168, 100, 26, 0.12);
  --selection: rgba(168, 100, 26, 0.25);
  --shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 20px 50px -24px rgba(40,30,10,0.25);
}

/* Follow the system when the visitor has not chosen explicitly */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f6f3ed;
    --bg-elev: #fffdf9;
    --bg-soft: #efeae1;
    --line: rgba(20, 18, 12, 0.1);
    --line-strong: rgba(20, 18, 12, 0.2);
    --text: #15151a;
    --text-2: #5a5852;
    --text-3: #8a877f;
    --accent: #a8641a;
    --accent-soft: rgba(168, 100, 26, 0.1);
    --accent-ink: #fffaf2;
    --glow: rgba(168, 100, 26, 0.12);
    --selection: rgba(168, 100, 26, 0.25);
    --shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 20px 50px -24px rgba(40,30,10,0.25);
  }
}
