:root {
  --text-xs: 0.875rem; /* was clamp(0.75rem, ...): 12px on phones. 14px is the floor for anything a visitor reads. */
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 4.75rem);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem; --space-20: 5rem; --space-24: 6rem; --space-32: 8rem;

  --radius-sm: 0.5rem; --radius-md: 0.875rem; --radius-lg: 1.25rem; --radius-full: 999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --font-display: 'Erode', 'Georgia', serif;
  --font-body: 'Satoshi', 'Helvetica Neue', Arial, sans-serif;
}

:root, [data-theme='light'] {
  --color-bg: #f6f2ea;
  --color-surface: #fffdf9;
  --color-surface-2: #efe9dd;
  --color-border: #ddd5c6;
  --color-text: #1f1d1a;
  --color-text-muted: #5f5a52;
  --color-text-faint: #6c675f; /* AA 4.5:1 on bg, surface, surface-2 and primary-soft (was #8f897e, 2.9:1) */
  --color-primary: #1e6b4a;
  --color-primary-hover: #17573c;
  --color-primary-soft: #e3eee7;
  --color-on-primary: #f6f2ea;
  --color-dark: #15302a;
  --color-dark-text: #f3efe6;
  --color-dark-accent: #8fd1a8;
  --shadow-sm: 0 1px 2px rgb(31 29 26 / 0.06);
  --shadow-lg: 0 24px 48px -16px rgb(31 29 26 / 0.18), 0 2px 6px rgb(31 29 26 / 0.06);
}

[data-theme='dark'] {
  --color-bg: #111513;
  --color-surface: #181e1b;
  --color-surface-2: #1d2420;
  --color-border: #2c3530;
  --color-text: #e8e4dc;
  --color-text-muted: #a8a397;
  --color-text-faint: #96938c;
  --color-primary: #7cc59a;
  --color-primary-hover: #95d3ad;
  --color-primary-soft: #1f2e26;
  --color-on-primary: #10201a;
  --color-dark: #0c1f19;
  --color-dark-text: #eef0ea;
  --color-dark-accent: #8fd1a8;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 24px 48px -16px rgb(0 0 0 / 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #111513; --color-surface: #181e1b; --color-surface-2: #1d2420; --color-border: #2c3530;
    --color-text: #e8e4dc; --color-text-muted: #a8a397; --color-text-faint: #96938c;
    --color-primary: #7cc59a; --color-primary-hover: #95d3ad; --color-primary-soft: #1f2e26; --color-on-primary: #10201a;
    --color-dark: #0c1f19; --color-dark-text: #eef0ea; --color-dark-accent: #8fd1a8;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: none; text-size-adjust: none;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth; scroll-padding-top: var(--space-20);
}
body {
  min-height: 100dvh; line-height: 1.6;
  font-family: var(--font-body); font-size: var(--text-base);
  color: var(--color-text); background-color: var(--color-bg);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
img, svg { display: block; max-width: 100%; }
ul[role='list'], ol[role='list'] { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
h1, h2, h3 { text-wrap: balance; line-height: 1.15; }
p, li { text-wrap: pretty; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
