/* ============================================================
   Base — reset, body, typography, grain overlay, layout primitives
   ============================================================ */

/* Modern reset (trimmed Meyer/Andy-Bell hybrid) */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text-loam);
  background: var(--bg-rice-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}
img, picture, svg { max-width: 100%; display: block; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
:focus-visible {
  outline: 3px solid var(--moss);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Grain overlay — fixed pseudo on body, subtle paper texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
/* Keep app content above the grain */
body > * { position: relative; z-index: 2; }

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--text-loam);
}
h1 { font-size: var(--fs-hero); font-weight: 800; }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p { max-width: 65ch; }
a:hover { color: var(--moss); }

/* Layout primitives */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}
.container--narrow { max-width: var(--container-narrow); }
.container--prose { max-width: var(--container-prose); }

.section {
  padding-block: var(--space-section);
  position: relative;
}
.section--stone { background: color-mix(in oklab, var(--stone) 55%, transparent); }
.section--sand { background: color-mix(in oklab, var(--sand) 45%, transparent); }
.section--moss { background: var(--moss); color: var(--moss-fg); }
.section--moss h1, .section--moss h2, .section--moss h3 { color: var(--moss-fg); }

/* Eyebrow label */
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--fs-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 1rem;
}

/* Visually hidden */
.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;
}

/* Skip link */
.skip-link {
  position: absolute; top: -100px; left: 1rem;
  background: var(--moss); color: var(--moss-fg);
  padding: 0.75rem 1.25rem; border-radius: var(--r-pill);
  z-index: 100;
}
.skip-link:focus { top: 1rem; }
