/* ============================================================================
 *  base.css — reset, typography, focus, motion, accessibility primitives.
 *  (.hp honeypot must stay visually hidden — forms.js relies on it.)
 * ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.65;
  font-weight: 400;
  color: var(--plum);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv05" 1, "ss01" 1;   /* Inter niceties */
  overflow-x: hidden;
}

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

/* ---- Headings: Fraunces display, optical sizing, balanced ---------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 420;
  line-height: 1.06;
  letter-spacing: -0.012em;
  color: var(--plum);
  text-wrap: balance;
}
h1 { font-size: var(--step-6); font-weight: 380; font-variation-settings: "SOFT" 45; }
h2 { font-size: var(--step-4); font-variation-settings: "SOFT" 40; }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { text-wrap: pretty; }
strong, b { font-weight: 600; }

a { color: var(--lilac-700); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--lilac); }

ul, ol { padding: 0; list-style: none; }

/* ---- Focus: visible, on-brand ------------------------------------------- */
:focus-visible {
  outline: 2.5px solid var(--lilac);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--lilac-300); color: var(--plum); }

/* ---- Honeypot (forms.js contract) — never visible ----------------------- */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ---- Screen-reader-only ------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute; left: 16px; top: -48px;
  background: var(--plum); color: #fff;
  padding: 10px 16px; border-radius: var(--r-sm);
  z-index: 100; transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 16px; color: #fff; }

/* ---- Layout primitives -------------------------------------------------- */
.container {
  width: min(100% - 2 * var(--space-m), var(--container));
  margin-inline: auto;
}
.container--wide { --container: var(--container-wide); }

.section { padding-block: var(--space-3xl); }
.section--tight { padding-block: var(--space-2xl); }

.measure { max-width: var(--measure); }
.center { text-align: center; margin-inline: auto; }

/* eyebrow / kicker */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--font);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lilac-700);
}
.eyebrow::before {
  content: ""; width: 1.75rem; height: 1px;
  background: currentColor; opacity: 0.7;
}
.eyebrow--center::after {
  content: ""; width: 1.75rem; height: 1px;
  background: currentColor; opacity: 0.7;
}

.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: color-mix(in oklab, var(--plum) 82%, var(--cream));
}

/* form status colours (forms.js toggles [hidden]) */
[data-form-success] { color: var(--lilac-700); font-weight: 600; }
[data-form-error]   { color: oklch(52% 0.17 22); font-weight: 500; }

/* ---- Motion: reveal on scroll (transform/opacity only) ------------------
   Gated on html.js so content is ALWAYS visible without JS (or if JS fails). */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
  will-change: opacity, transform;
}
html.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
