*, *::before, *::after { box-sizing: border-box; }
/* Scroll anchoring fights Lenis and in-place filtering, nudging the page on reflow. */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 112px; overflow-anchor: none; }
a, button, input, textarea, select, label { touch-action: manipulation; }
body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink-deep);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 var(--space-5); font-weight: 400; }
h1, h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: 0.005em;
}
h1 { font-size: clamp(3rem, 8vw, 6.75rem); }
h2 { font-size: clamp(2.4rem, 5.4vw, 4.75rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0 0 var(--space-4); }
::selection { background: var(--color-ochre); color: var(--color-ink-deep); }
:focus-visible { outline: 2px solid var(--color-clay); outline-offset: 3px; border-radius: 4px; }
[data-theme="dark"] :focus-visible { outline-color: var(--color-ochre); }

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 var(--gutter); }
.font-accent { font-family: var(--font-accent); font-weight: 600; text-transform: none; letter-spacing: 0; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

/* Paper grain: a fixed, non-interactive noise layer for the tactile feel the brand
   guidelines describe. Fixed so it never repaints while scrolling. */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 90;
  pointer-events: none;
  opacity: 0.045;
  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");
}

/* Cross-document page transitions (Chromium/Safari 18+); other browsers just navigate. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 0.35s var(--ease-in-out) both; }
::view-transition-new(root) { animation: vt-in 0.55s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(16px); } }

/* Scroll reveal, resolved once when the element first enters the viewport
   (main.js adds .in). Only hidden when JS has run (html.js). */
.js .reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s var(--ease-out), transform 1.1s var(--ease-out);
}
.js .reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 90ms; }
.reveal.d2 { transition-delay: 180ms; }
.reveal.d3 { transition-delay: 270ms; }
.reveal.d4 { transition-delay: 360ms; }
.reveal.d5 { transition-delay: 450ms; }

/* Split headings stay hidden until GSAP has split them (no flash of unsplit text). */
.js [data-split] { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js [data-split] { visibility: visible; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
