/*
 * Motion-only styles. Starting states for GSAP effects live under .motion-ready, which is set in <head>
 * and removed again by js/loader.js if GSAP never arrives, so content is never stuck hidden.
 */

/* ---------- Lenis (smooth scroll, laptops only) ---------- */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-3) var(--gutter);
  color: var(--color-on-dark);
  background: var(--color-dark);
  clip-path: inset(0 0 0 0);
}
.is-loading .loader,
.loader.is-leaving { display: flex; }
.loader[hidden] { display: none; }
.is-loading body { overflow: hidden; }
.loader.is-leaving {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1s var(--ease-out);
}
.loader-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
  font-family: var(--font-caps);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-on-dark-muted);
}
.loader-brand { display: block; }
.loader-mark { width: auto; height: 1.5rem; }
@media (min-width: 640px) { .loader-mark { height: 2rem; } }
.loader-center { display: grid; justify-items: center; gap: var(--space-2); text-align: center; }
/* Fixed width (3 digits) so the box does not move as the Oswald digits change width */
.loader-count { width: 3.2ch; overflow: hidden; line-height: 1; font-family: var(--font-condensed); font-size: clamp(5rem, min(4rem + 12vw, 30svh), 14rem); font-weight: 600; text-align: center; }
.loader-num {
  display: block;
  letter-spacing: -0.01em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: transform 0.7s var(--ease-out);
}
.loader-status { margin: 0; font-size: var(--text-sm); color: var(--color-on-dark-muted); transition: opacity 0.4s var(--ease); }
.loader.is-done .loader-num { transform: translateY(-105%); transition-delay: 0.25s; }
.loader.is-leaving .loader-status { opacity: 0; }
.loader-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.loader-bar span {
  display: block;
  height: 100%;
  background: var(--color-highlight);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- Starting states (GSAP animates them in) ---------- */
.motion-ready [data-hero-fade],
.motion-ready [data-split],
.motion-ready .hero-title { visibility: hidden; }
/* Hero intro mode: the photo starts as a small centred window and grows to full screen after the loader. */
.motion-ready .hero--intro .hero-media { clip-path: inset(24% 30% 24% 30%); }
@media (max-width: 767px) { .motion-ready .hero--intro .hero-media { clip-path: inset(28% 12% 28% 12%); } }
/* SplitText line masks */
.split-line { padding-bottom: 0.08em; margin-bottom: -0.08em; }
/* Oswald at line-height 0.95: descenders (g, y) reach ~0.24em below the baseline, so the hero mask needs more room */
.hero-title .split-line { padding-bottom: 0.24em; margin-bottom: -0.24em; }

/* Word wheel: words stacked on top of each other; motion.js rolls them and sizes the wheel. */
.motion-ready .wheel { transition: none; }
.motion-ready .wheel-track { position: relative; display: block; height: 1.15em; }
.motion-ready .wheel-word { position: absolute; left: 0; top: 0; }
html:not(.motion-ready) .wheel-word + .wheel-word { display: none; }

/* Blur-to-sharp words and statement characters (split by motion.js) */
.word, .char { display: inline-block; will-change: opacity, filter, transform; }
