/* base.css — reset + design tokens */
*,
*::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;
  scroll-padding-top: var(--space-16);
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  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 {
  text-wrap: balance;
  line-height: 1.15;
}

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;
}

/* ---- Design tokens ---- */
:root,
[data-theme='light'] {
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Sage & clay — calm, organic yoga palette */
  --color-bg: #f4f1ea;
  --color-surface: #faf8f3;
  --color-surface-2: #fbfaf6;
  --color-surface-offset: #ece7dd;
  --color-surface-offset-2: #e3ddd0;
  --color-divider: #ddd6c8;
  --color-border: #c9c1b1;

  --color-text: #2c2a22;
  --color-text-muted: #6f6a5e;
  --color-text-faint: #a8a294;
  --color-text-inverse: #f9f7f1;

  /* Primary: deep sage green */
  --color-primary: #46603f;
  --color-primary-hover: #324829;
  --color-primary-active: #243319;
  --color-primary-highlight: #d6ddd0;

  /* Accent: soft clay/terracotta */
  --color-accent: #b15a3c;
  --color-accent-hover: #8f4631;

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

  --transition-interactive: 220ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px oklch(0.2 0.02 80 / 0.06);
  --shadow-md: 0 6px 20px oklch(0.2 0.02 80 / 0.08);
  --shadow-lg: 0 18px 48px oklch(0.2 0.02 80 / 0.14);

  --content-narrow: 640px;
  --content-default: 1120px;
  --content-wide: 1240px;

  --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;

  --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.2rem + 2.5vw, 3.25rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 4.5rem);
  --text-hero: clamp(3rem, 0.5rem + 7vw, 6.5rem);
}

[data-theme='dark'] {
  --color-bg: #1a1c16;
  --color-surface: #20221b;
  --color-surface-2: #24261e;
  --color-surface-offset: #1e2019;
  --color-surface-offset-2: #262820;
  --color-divider: #2a2c23;
  --color-border: #3a3d31;

  --color-text: #d6d3c9;
  --color-text-muted: #8a8778;
  --color-text-faint: #5f5d52;
  --color-text-inverse: #1c1e17;

  --color-primary: #8fa67c;
  --color-primary-hover: #9fb58a;
  --color-primary-active: #6e8559;
  --color-primary-highlight: #2c3326;

  --color-accent: #c97a5a;
  --color-accent-hover: #d88a6a;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
  --shadow-md: 0 6px 20px oklch(0 0 0 / 0.3);
  --shadow-lg: 0 18px 48px oklch(0 0 0 / 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #1a1c16;
    --color-surface: #20221b;
    --color-surface-2: #24261e;
    --color-surface-offset: #1e2019;
    --color-surface-offset-2: #262820;
    --color-divider: #2a2c23;
    --color-border: #3a3d31;
    --color-text: #d6d3c9;
    --color-text-muted: #8a8778;
    --color-text-faint: #5f5d52;
    --color-text-inverse: #1c1e17;
    --color-primary: #8fa67c;
    --color-primary-hover: #9fb58a;
    --color-primary-active: #6e8559;
    --color-primary-highlight: #2c3326;
    --color-accent: #c97a5a;
    --color-accent-hover: #d88a6a;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
    --shadow-md: 0 6px 20px oklch(0 0 0 / 0.3);
    --shadow-lg: 0 18px 48px oklch(0 0 0 / 0.4);
  }
}
