@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400..700;1,9..144,400..600&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Caveat:wght@500;600;700&family=DM+Serif+Display:ital@1&display=swap');

:root {
  /* Color System — Warm Neighborhood Café Palette */
  --color-espresso: #2B1E1A;
  --color-oat-milk: #F7F3EC;
  --color-clay: #355B4A;
  --color-clay-deep: #203D32;
  --color-sage: #A7B59E;
  --color-sage-deep: #7C9271;
  --color-butter: #F4D35E;
  --color-berry: #D96C75;
  --color-berry-deep: #C14F58;
  --color-forest: #355B4A;
  --color-dusty-teal: #4B8A8E;
  --color-dusty-teal-deep: #366D71;

  /* Foundational surfaces — cream & espresso carry the page, accents stay selective */
  --color-bg-primary: var(--color-oat-milk);
  --color-bg-surface: #FFFDF8;
  --color-bg-elevated: #FBF3E4;
  --color-bg-espresso: var(--color-espresso);
  --color-bg-espresso-elevated: #3A2921;
  --color-bg-glass: rgba(247, 243, 236, 0.9);

  --color-border: #E5D8C4;
  --color-border-subtle: #EEE4D3;
  --color-border-accent: rgba(53, 91, 74, 0.35);
  --color-border-espresso: rgba(247, 243, 236, 0.16);

  --color-text-primary: var(--color-espresso);
  --color-text-secondary: #5E4C40;
  --color-text-muted: #7C6A5A;
  --color-text-inverse: var(--color-oat-milk);
  --color-text-inverse-muted: rgba(247, 243, 236, 0.68);

  /* Text-safe accent colors — verified 4.5:1+ against Oat Milk for small running text.
     Clay/Berry stay reserved for backgrounds, borders, and large display text only. */
  --color-text-accent: var(--color-forest);
  --color-text-accent-hover: #203D32;
  --color-berry-text: #A83E47;

  /* Primary interactive accent — Clay */
  --color-accent: var(--color-clay);
  --color-accent-hover: var(--color-clay-deep);
  --color-accent-subtle: rgba(53, 91, 74, 0.14);

  /* Warm highlight — Butter, used sparingly as backing for badges/marks, not running text */
  --color-highlight: var(--color-butter);
  --color-highlight-subtle: rgba(244, 211, 94, 0.22);

  /* Secondary accents — used contextually, never uniformly */
  --color-forest-subtle: rgba(53, 91, 74, 0.12);
  --color-teal-subtle: rgba(75, 138, 142, 0.14);
  --color-berry-subtle: rgba(217, 108, 117, 0.14);
  --color-sage-subtle: rgba(167, 181, 158, 0.22);

  /* High-visibility focus ring — verified 3:1+ against both the cream page
     and the dark espresso surfaces (nav overlay, footer, TOC rail) */
  --color-focus: var(--color-dusty-teal);

  --color-error: #B3413B;

  /* Typography */
  --font-family-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-family-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-family-serif: 'Fraunces', Georgia, serif;
  --font-family-hand: 'Caveat', cursive;
  /* Header wordmark only — not used anywhere else on the site. */
  --font-family-wordmark: 'DM Serif Display', 'Fraunces', Georgia, serif;

  --text-xs: clamp(0.75rem, 0.72rem + 0.2vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.83rem + 0.25vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  --text-xl: clamp(1.375rem, 1.22rem + 0.75vw, 1.875rem);
  --text-2xl: clamp(1.75rem, 1.45rem + 1.5vw, 2.75rem);
  --text-3xl: clamp(2.25rem, 1.75rem + 2.5vw, 3.75rem);
  --text-4xl: clamp(3rem, 2.2rem + 4vw, 5rem);

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.15;
  --line-height-snug: 1.3;
  --line-height-base: 1.6;
  --line-height-relaxed: 1.75;

  /* Spacing (8pt base grid) */
  --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;

  /* Container Widths */
  --container-max-width: 1200px;
  --container-narrow-width: 800px;
  --header-height: 4.5rem;

  /* Border Radii — mostly soft/rounded, a couple organic options for selective use */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --radius-organic: 255px 15px 225px 15px / 15px 225px 15px 255px;

  /* Shadows — warm brown-based, not pure black, so cards read as "paper" not "glass" */
  --shadow-sm: 0 1px 3px rgba(43, 30, 26, 0.1);
  --shadow-md: 0 8px 20px rgba(43, 30, 26, 0.12);
  --shadow-lg: 0 16px 36px rgba(43, 30, 26, 0.16);
  --shadow-pin: 0 6px 14px rgba(43, 30, 26, 0.18);

  /* Motion */
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 250ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 450ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-wave: 700ms;
  --duration-wag: 600ms;
  --duration-steam: 3200ms;
}
