/* ==========================================================================
   Reset + primitives
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto; /* JS smooth-scroll owns this */
  /* Applied here as well as on body: `overflow-x: clip` against a `visible`
     y-axis computes the y-axis to `auto`, which turns the viewport into a
     scroll container and reintroduces the very sideways scroll it was meant
     to remove. Clipping at the root closes that off. */
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}

/* Locked while the preloader runs and while the lightbox is open. */
body[data-locked] {
  overflow: hidden;
}

img,
picture,
video,
canvas {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
  /* Photos are the content — never let them stretch. */
  object-fit: cover;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

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

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

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

::selection {
  background: var(--flare);
  color: var(--bone);
}

/* ---- Typography primitives ---- */

.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.82;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.serif {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.15;
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lede {
  font-family: var(--font-serif);
  font-size: var(--step-2);
  line-height: 1.3;
  max-width: 34ch;
}

/* ---- Layout primitives ---- */

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

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

.stack {
  display: flex;
  flex-direction: column;
}

/* Section eyebrow: mono label + hairline rule. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--ash);
  margin-bottom: clamp(1.5rem, 1rem + 2vw, 3.5rem);
}

.eyebrow::after {
  content: '';
  flex: 1;
  height: var(--rule);
  background: currentColor;
  opacity: 0.35;
}

.eyebrow .dot {
  width: 0.45rem;
  height: 0.45rem;
  background: var(--flare);
  border-radius: 50%;
  flex: none;
}

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

/* Skip link */
.skip {
  position: absolute;
  top: 0;
  left: 50%;
  translate: -50% -120%;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--flare);
  color: var(--bone);
  transition: translate var(--dur) var(--ease-out);
}

.skip:focus {
  translate: -50% 0;
}

/* ==========================================================================
   Reveal primitives — driven by IntersectionObserver in reveal.js
   ========================================================================== */

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, var(--reveal-y, 2rem), 0);
  transition:
    opacity 700ms var(--ease-out),
    transform 900ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Line-by-line masked text reveal */
.reveal-line {
  display: block;
  overflow: hidden;
}

.reveal-line > span {
  display: block;
  transform: translate3d(0, 105%, 0);
  transition: transform 1000ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.is-in .reveal-line > span,
.reveal-line.is-in > span {
  transform: none;
}

/* ==========================================================================
   Reduced motion — keep meaning, drop movement
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .reveal-line > span {
    transform: none;
  }
}
