/* ===================================================================
   NAMARA — base.css
   Reset, tokens, and foundational layout rules.
=================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

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

/* ---------------- Design Tokens ---------------- */
:root, [data-theme='light'] {
  /* Surfaces — warm parchment, organic */
  --color-bg: #f5f1e8;
  --color-surface: #ffffff;
  --color-surface-2: #fbf7ef;
  --color-border: #e1d6c2;

  /* Text — warm ink */
  --color-text: #29241d;
  --color-text-muted: #6e6353;
  --color-text-faint: #a79c89;
  --color-text-inverse: #f5f1e8;

  /* Primary — deep sage / forest (grounded, body-based) */
  --color-primary: #3b5d4f;
  --color-primary-hover: #2a4438;
  --color-primary-highlight: #dce7df;

  /* Accent — terracotta (used sparingly) */
  --color-accent: #c1652f;
  --color-accent-highlight: #f1ded0;

  --shadow-sm: 0 1px 2px oklch(0.2 0.02 90 / 0.06);
  --shadow-md: 0 4px 16px oklch(0.2 0.02 90 / 0.08);
  --shadow-lg: 0 12px 40px oklch(0.2 0.02 90 / 0.12);
}

[data-theme='dark'] {
  --color-bg: #191712;
  --color-surface: #211e17;
  --color-surface-2: #26221a;
  --color-border: #3a3428;

  --color-text: #efe9dc;
  --color-text-muted: #a79c89;
  --color-text-faint: #6e6353;
  --color-text-inverse: #191712;

  --color-primary: #8fb6a3;
  --color-primary-hover: #a9cbba;
  --color-primary-highlight: #2b3a32;

  --color-accent: #e08a52;
  --color-accent-highlight: #3a2c20;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 16px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 12px 40px oklch(0 0 0 / 0.45);
}

/* ---------------- Type Scale ---------------- */
:root {
  --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.75rem);
  --text-hero: clamp(2.75rem, 0.8rem + 6vw, 6.5rem);

  --font-display: 'Zodiak', 'Georgia', serif;
  --font-body: 'Work Sans', 'Helvetica Neue', sans-serif;
}

/* ---------------- Spacing ---------------- */
:root {
  --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;
}

/* ---------------- Base Elements ---------------- */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  margin: 0;
}

p { margin: 0; }

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.prose { max-width: 68ch; }

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

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-3) var(--space-5);
  border-radius: 6px;
  z-index: 200;
  transition: top 0.2s ease;
}
.skip-link:focus { top: var(--space-4); }
