/* ============================================================
   base.css — reset, typography, primitives, buttons, a11y
   ============================================================ */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: var(--wp--preset--font-size--base);
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
:where(h1, h2, h3, h4) { line-height: 1.02; text-wrap: balance; }
p { text-wrap: pretty; }

/* ---- Layout primitives ---- */
.container {
  width: 100%;
  /* --content-width is the usable content area; gutters sit outside it. */
  max-width: calc(var(--content-width) + var(--gutter) + var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { position: relative; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Typography helpers ---- */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--wp--preset--font-size--display);
  line-height: 0.94;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--color-heading);
}
.h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--wp--preset--font-size--h2);
  line-height: 1.0;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--color-heading);
}
.h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--wp--preset--font-size--h3);
  line-height: 1.05;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  color: var(--color-heading);
}
.eyebrow {
  /* block, not inline-block: an inline box adds ~2px of baseline
     descender below it, which would put the eyebrow→heading gap
     off the 8pt grid no matter what the token says. */
  display: block;
  width: max-content;
  max-width: 100%;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--wp--preset--font-size--xs);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-primary);
}
.lead {
  font-size: var(--wp--preset--font-size--lg);
  line-height: 1.5;
  color: var(--color-text);
  max-width: 62ch;
}
.text-soft { color: var(--color-text-soft); }
.label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--wp--preset--font-size--xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---- Brand emblem ----
   A plain <img>, not a CSS mask. Masks fail silently on older engines
   and this mark has to survive file:// previews and a strict CSP, so
   two colour variants beat one currentColor-tinted mask. */
.logo-mark { display: block; width: 100%; height: 100%; object-fit: contain; }

/* ---- Icons (every <use> must be sized) ---- */
.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 18px; height: 18px; }
.icon--xs { width: 14px; height: 14px; }
.icon--fill { fill: currentColor; stroke: none; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--space-7);            /* 56 — grid-aligned hit target */
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--wp--preset--font-size--xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease-out-quart),
              color var(--dur-fast) var(--ease-out-quart),
              border-color var(--dur-fast) var(--ease-out-quart);
}
.btn .icon { width: 20px; height: 20px; stroke-width: 2; transition: transform var(--dur) var(--ease-out-expo); }
.btn:hover .icon--arrow { transform: translateX(6px); }
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-deep); }
.btn--dark { background: var(--color-ink); color: #fff; }
.btn--dark:hover { background: #000; }
.btn--ghost { background: transparent; color: var(--color-ink); border-color: var(--color-ink); }
.btn--ghost:hover { background: var(--color-ink); color: #fff; }
.btn--block { width: 100%; }

/* ---- Text link with arrow ---- */
.link-arrow {
  /* flex, not inline-flex — see the note on .eyebrow */
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--wp--preset--font-size--xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ink);
  padding-bottom: var(--space-1);
  border-bottom: 2px solid var(--color-ink);
  width: max-content;
}
.link-arrow .icon { width: 20px; height: 20px; stroke-width: 2; transition: transform var(--dur) var(--ease-out-expo); }
.link-arrow:hover .icon { transform: translateX(6px); }

/* ---- Accessibility ---- */
.skip-link {
  position: absolute; left: var(--space-2); top: -64px; z-index: var(--z-toast);
  background: var(--color-ink); color: #fff; padding: var(--space-2) var(--space-3);
  font-weight: 600; letter-spacing: 0.04em; transition: top var(--dur);
}
.skip-link:focus { top: var(--space-2); }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
:where(.on-dark) :focus-visible { outline-color: #fff; }

/* ---- Reveal-on-scroll (enhances an already-visible default) ---- */
.reveal { opacity: 1; transform: none; }
.has-reveal .reveal { opacity: 0; transform: translateY(22px); transition: opacity var(--dur-slow) var(--ease-out-expo), transform var(--dur-slow) var(--ease-out-expo); will-change: opacity, transform; }
.has-reveal .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
