/* ============================================================
   BASE — reset, document, typography primitives, utilities
============================================================ */

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

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* offset anchor landings for the fixed nav */
  scroll-padding-top: var(--nav-h);
}

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

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

ul, ol { list-style: none; }

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

::selection {
  background: var(--white);
  color: var(--black);
}

/* Focus — visible, but only for keyboard users */
:focus-visible {
  outline: 1px solid var(--white);
  outline-offset: 4px;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--white-12); }
::-webkit-scrollbar-thumb:hover { background: var(--white-25); }

/* ============================================================
   TYPE PRIMITIVES
============================================================ */

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
}

.display {
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
}

.display--lg { font-size: var(--fs-lg); }

/* Payoff phrase inside a statement — used sparingly, one per section at most */
.hl { color: var(--accent); }

.display--muted {
  color: var(--white-25);
  transition: color var(--dur-slow) var(--ease);
}
.display--muted.is-in { color: var(--white); }
.display--muted .hl { color: var(--accent); }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.45;
  letter-spacing: var(--ls-snug);
  color: var(--white-90);
  max-width: var(--maxw-text);
}

.body {
  font-size: var(--fs-body);
  color: var(--white-55);
  max-width: var(--maxw-text);
}

/* ============================================================
   LAYOUT
============================================================ */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

/* A hairline between major sections, drawn on scroll */
.section::before {
  content: "";
  position: absolute;
  inset-inline: var(--gutter);
  top: 0;
  height: 1px;
  background: var(--line-soft);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1200;
  background: var(--white);
  color: var(--black);
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ============================================================
   ANIMATION PRIMITIVES
   Two mechanisms only:
   1. [data-reveal]  → fade + rise
   2. [data-split]   → per-word mask reveal (words wrapped by JS)
============================================================ */

/* Gated on `.js` so the page is fully readable if JavaScript never loads */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity var(--dur-slow) var(--ease),
    transform var(--dur-slow) var(--ease);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* word masking */
.word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.06em;   /* room for descenders inside the mask */
  margin-bottom: -0.06em;
}
.word > i {
  display: inline-block;
  font-style: inherit;
  transform: translate3d(0, 110%, 0);
  transition: transform 1s var(--ease);
  transition-delay: var(--d, 0ms);
  will-change: transform;
}
[data-split].is-in .word > i { transform: none; }

/* Preloader only exists with JS — hide it otherwise */
html:not(.js) .preloader { display: none; }

/* ============================================================
   REDUCED MOTION — everything resolves instantly, nothing moves
============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .word > i { transform: none !important; }
  .grain { display: none !important; }
  .marquee__track { animation: none !important; }
}
