/* Lazy Haven — reset, rhythm, shared components. Section-specific rules live in css/sections/. */

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  /* Guard against any element bleeding past the viewport on small screens. */
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  font-optical-sizing: auto;
  font-variant-numeric: tabular-nums;
  color: var(--c-reed);
  background: var(--c-mist);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--c-thermal);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
  color: var(--c-thermal-bright);
}

button {
  font: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--c-thermal);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--c-thermal);
  color: var(--c-mist);
}

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

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section {
  padding-block: var(--section-pad);
}

/* Shared type components ---------------------------------------------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-sage);
  margin-bottom: var(--space-3);
}

.heading-xl,
.heading-lg,
.heading-md {
  font-family: var(--font-display);
  font-weight: 620;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: inherit;
  text-wrap: balance;
}

.heading-xl {
  font-size: var(--text-3xl);
}

.heading-lg {
  font-size: var(--text-2xl);
}

.heading-md {
  font-size: var(--text-xl);
}

.heading-xl em,
.heading-lg em,
.heading-md em {
  font-style: italic;
  font-weight: 480;
  color: var(--c-thermal);
}

/* On dark panels, the italic accent reads amber instead of teal */
.on-dark .heading-xl em,
.on-dark .heading-lg em,
.on-dark .heading-md em {
  color: var(--c-amber);
}

.lede {
  font-size: var(--text-lg);
  line-height: 1.55;
  max-width: 34em;
}

.text-dim {
  color: var(--c-sage);
}

/* Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--c-mist);
  background: var(--c-thermal);
  border: 1px solid var(--c-thermal);
  border-radius: 999px;
  padding: 0.85em 1.9em;
  transition: background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.btn:hover {
  background: var(--c-thermal-bright);
  border-color: var(--c-thermal-bright);
  color: var(--c-mist);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--c-reed);
  border-color: var(--c-line);
}

.btn--ghost:hover {
  background: transparent;
  color: var(--c-thermal);
  border-color: var(--c-thermal);
  transform: translateY(-1px);
}

.on-dark .btn--ghost {
  color: var(--c-text-on-dark);
  border-color: var(--c-line-dark);
}

.on-dark .btn--ghost:hover {
  color: var(--c-amber);
  border-color: var(--c-amber);
}

/* Scroll reveal (driven by js/reveal.js) ------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}

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

/* Curtain reveal for editorial imagery: the frame uncovers from the bottom
   while the image settles from a slight zoom — one cinematic move.
   Desktop-only: on small screens these fall back to the standard fade-up.

   The curtain is a mask, not a clip-path. Blink (Chrome/Edge) clips a
   target's IntersectionObserver rect by the target's own clip-path, so a
   frame sitting at inset(100%) measures 0x0 and js/reveal.js never sees it
   enter the viewport — the frame stays curtained forever and the photo
   never appears. Gecko ignores clip-path there, which is why Firefox was
   fine. A mask hides the same pixels without touching the geometry the
   observer measures. */
@media (min-width: 720px) {
  [data-reveal="wipe"] {
    opacity: 1;
    transform: none;
    -webkit-mask-image: linear-gradient(#000, #000);
    mask-image: linear-gradient(#000, #000);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: bottom;
    mask-position: bottom;
    -webkit-mask-size: 100% 0%;
    mask-size: 100% 0%;
    transition: -webkit-mask-size var(--dur-cinematic) var(--ease-luxe),
      mask-size var(--dur-cinematic) var(--ease-luxe);
  }

  [data-reveal="wipe"] img {
    transform: scale(1.12);
    transition: transform calc(var(--dur-cinematic) + 400ms) var(--ease-luxe);
  }

  [data-reveal="wipe"].is-revealed {
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
  }

  [data-reveal="wipe"].is-revealed img {
    transform: none;
  }
}

[data-reveal-delay="1"] { transition-delay: 90ms; }
[data-reveal-delay="2"] { transition-delay: 180ms; }
[data-reveal-delay="3"] { transition-delay: 270ms; }
[data-reveal-delay="4"] { transition-delay: 360ms; }

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

  [data-reveal="wipe"] {
    -webkit-mask-image: none;
    mask-image: none;
  }

  [data-reveal="wipe"] img {
    transform: none;
  }

  [data-parallax] {
    transform: none !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Utilities ------------------------------------------------------------ */

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