/* ==========================================================================
   Clean Tri-Cities — base.css
   Design tokens + base resets (light/dark mandatory)
   ========================================================================== */

:root,
[data-theme='light'] {
  /* Surfaces — warm cream */
  --color-bg: #faf8f3;
  --color-surface: #ffffff;
  --color-surface-2: #fdfcf9;
  --color-surface-offset: #f0f4ec;
  --color-surface-offset-2: #e7ede1;
  --color-surface-dynamic: #e3eadd;
  --color-divider: #e2e6dc;
  --color-border: #d6dccc;

  /* Text — deep forest */
  --color-text: #1d2a22;
  --color-text-muted: #58665c;
  --color-text-faint: #9aa49a;
  --color-text-inverse: #fbfaf6;

  /* Primary — fresh forest green */
  --color-primary: #1f6e44;
  --color-primary-hover: #175936;
  --color-primary-active: #11472a;
  --color-primary-highlight: #d4e4d6;
  --color-primary-soft: #e8f0e6;

  /* Warm secondary accent (used sparingly) */
  --color-accent: #c2762f;
  --color-accent-hover: #a8631f;
  --color-accent-soft: #f6e9d8;

  /* Success / eco */
  --color-success: #3f7d2a;
  --color-success-soft: #e6efd9;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows — tone-matched to warm surfaces */
  --shadow-sm: 0 1px 2px oklch(0.2 0.02 140 / 0.06);
  --shadow-md: 0 6px 18px oklch(0.2 0.02 140 / 0.09);
  --shadow-lg: 0 18px 40px oklch(0.2 0.02 140 / 0.14);
  --shadow-green: 0 14px 30px oklch(0.45 0.09 150 / 0.28);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1180px;
  --content-full: 100%;

  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --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.3rem + 2.6vw, 3.5rem);

  /* Spacing */
  --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;

  /* Fonts — defined here, loaded in HTML */
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'Work Sans', 'Helvetica Neue', sans-serif;
}

/* DARK MODE */
[data-theme='dark'] {
  --color-bg: #14181a;
  --color-surface: #1b211d;
  --color-surface-2: #20271f;
  --color-surface-offset: #1e2520;
  --color-surface-offset-2: #242c26;
  --color-surface-dynamic: #2a332b;
  --color-divider: #262d27;
  --color-border: #354038;

  --color-text: #d7dcd4;
  --color-text-muted: #8b958a;
  --color-text-faint: #5c655c;
  --color-text-inverse: #1d2a22;

  --color-primary: #5fb07a;
  --color-primary-hover: #79c191;
  --color-primary-active: #3f8a5a;
  --color-primary-highlight: #283329;
  --color-primary-soft: #243029;

  --color-accent: #e09b56;
  --color-accent-hover: #f0ad6e;
  --color-accent-soft: #2e241a;

  --color-success: #84b85e;
  --color-success-soft: #243018;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
  --shadow-md: 0 6px 18px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 18px 40px oklch(0 0 0 / 0.45);
  --shadow-green: 0 14px 30px oklch(0.6 0.1 150 / 0.22);
}

/* System preference fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #14181a;
    --color-surface: #1b211d;
    --color-surface-2: #20271f;
    --color-surface-offset: #1e2520;
    --color-surface-offset-2: #242c26;
    --color-surface-dynamic: #2a332b;
    --color-divider: #262d27;
    --color-border: #354038;
    --color-text: #d7dcd4;
    --color-text-muted: #8b958a;
    --color-text-faint: #5c655c;
    --color-text-inverse: #1d2a22;
    --color-primary: #5fb07a;
    --color-primary-hover: #79c191;
    --color-primary-active: #3f8a5a;
    --color-primary-highlight: #283329;
    --color-primary-soft: #243029;
    --color-accent: #e09b56;
    --color-accent-hover: #f0ad6e;
    --color-accent-soft: #2e241a;
    --color-success: #84b85e;
    --color-success-soft: #243018;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
    --shadow-md: 0 6px 18px oklch(0 0 0 / 0.35);
    --shadow-lg: 0 18px 40px oklch(0 0 0 / 0.45);
    --shadow-green: 0 14px 30px oklch(0.6 0.1 150 / 0.22);
  }
}

/* ------------------------- Base reset ------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  hanging-punctuation: first last;
  scroll-padding-top: var(--space-20);
}

body {
  min-height: 100dvh;
  line-height: 1.65;
  font-family: var(--font-body, sans-serif);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

ul[role='list'],
ol[role='list'] {
  list-style: none;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  text-wrap: balance;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

p,
li,
figcaption {
  text-wrap: pretty;
  max-width: 72ch;
}

::selection {
  background: oklch(from var(--color-primary) l c h / 0.25);
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

button {
  cursor: pointer;
  background: none;
  border: none;
}

a {
  color: inherit;
  text-decoration: none;
}

a,
button,
[role='button'],
input,
textarea,
select {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
