/* ==========================================================================
   base.css  —  Reset, element defaults, typography & small utilities
   --------------------------------------------------------------------------
   Loads AFTER variables.css. Sets global element styling only. Reusable
   component styling lives in components.css; page chrome in layout.css.
   ========================================================================== */

/* ---- Reset ----------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg-page);
  color: var(--text-base);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---- Film grain ------------------------------------------------------ */
/* A single fixed, ultra-low-opacity noise layer over everything. The eye
   never "sees" it; the subconscious reads the surface as material, not
   flat pixels. pointer-events:none so it never interferes. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

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

/* ---- Typography ------------------------------------------------------ */
/* Primary headlines use the sans for power & attention. The serif is kept
   as a TERTIARY accent only — italic emphasis words, the pull-quote and the
   wordmark (see rules below). */
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--color-forest-800);
  letter-spacing: -0.022em;
}

/* Tertiary serif: italic accent words set inside otherwise-sans headlines */
h1 em, h2 em, h3 em,
.hero__title em,
.framed-band__line em,
.serif-accent {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); }

/* Headlines: balanced wrapping so no orphan word ever sits alone */
h1, h2, h3 { text-wrap: balance; }

p { max-width: 66ch; text-wrap: pretty; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

ul, ol { list-style: none; }

strong { font-weight: 600; }

/* Quiet, on-brand text selection (a small detail the eye trusts) */
::selection { background: var(--color-forest-800); color: var(--color-cream-50); }

em { font-style: italic; }

/* ---- Shared text helpers -------------------------------------------- */
.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-ink);   /* AA contrast on light backgrounds */
}

.lead {
  font-size: var(--fs-lead);
  color: var(--text-muted);
  line-height: 1.6;
}

.serif-accent { font-family: var(--font-serif); font-style: italic; }

.text-center { text-align: center; }

/* ---- Accessibility --------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

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

/* Skip link — WCAG 2.4.1 Bypass Blocks */
.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -120%);
  z-index: 300;
  background: var(--color-forest-800);
  color: #fff;
  padding: 0.7em 1.4em;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: var(--fs-small);
  font-weight: 600;
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;   /* stop looping (Ken Burns, cue) */
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}
