/* ==========================================================================
   MONARCHY — Motion layer (Apple-grade scroll choreography)
   Scenes are driven by js/motion.js setting --p (0→1) on [data-scene].
   Everything animates transform/opacity only. Reduced motion = static.
   ========================================================================== */

/* ---------- scene scaffolding ---------- */
.scene { position: relative; }
.scene-pin { position: sticky; top: 0; height: 100vh; overflow: hidden; }

/* ---------- word cascade (headlines) ---------- */
[data-split] .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em);
  transition: opacity 0.55s ease, transform 0.7s cubic-bezier(0.2, 0.75, 0.2, 1);
  transition-delay: calc(var(--wi) * 52ms);
  will-change: transform, opacity;
}
[data-split].on .w { opacity: 1; transform: none; }

/* ---------- cinematic hero (scene: hero) ---------- */
.vhero { height: 178vh; }
.vhero .scene-pin { display: flex; align-items: flex-end; }
.vhero-media { position: absolute; inset: 0; z-index: 0; }
.vhero-media video, .vhero-media img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(calc(1 + var(--p, 0) * 0.16));
  will-change: transform;
}
.vhero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(58% 52% at 50% 48%, rgba(11,11,13,0.62) 0%, rgba(11,11,13,0.28) 45%, transparent 72%),
    linear-gradient(to bottom, rgba(11,11,13,0.5) 0%, rgba(11,11,13,0.24) 30%, rgba(11,11,13,0.42) 62%, rgba(11,11,13,0.97) 100%);
}
.vhero-dim {
  position: absolute; inset: 0; z-index: 1; background: var(--ink);
  opacity: calc(var(--p, 0) * 0.9); pointer-events: none;
}
.vhero-content {
  position: relative; z-index: 2; width: 100%;
  max-width: var(--w); margin: 0 auto; padding: 8rem 1.5rem 5.5rem;
  transform: translateY(calc(var(--p, 0) * -9vh));
  opacity: calc(1 - var(--p, 0) * 1.45);
  will-change: transform, opacity;
}
.scroll-cue {
  position: absolute; z-index: 2; left: 50%; bottom: 2.2rem; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  opacity: calc(1 - var(--p, 0) * 4);
}
.scroll-cue span { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--bone-55); }
.scroll-cue i {
  width: 1px; height: 2.6rem; background: linear-gradient(to bottom, transparent, var(--brand));
  animation: cue-drop 1.8s ease-in-out infinite;
}
@keyframes cue-drop { 0% { transform: scaleY(0); transform-origin: top; } 55% { transform: scaleY(1); transform-origin: top; } 56% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------- pinned chapter (scene: chapter) — the product ---------- */
.chapter { height: 420vh; }
.chapter .scene-pin { display: flex; align-items: center; }
.chapter-bg { position: absolute; inset: 0; z-index: 0; }
.chapter-bg video { width: 100%; height: 100%; object-fit: cover; opacity: 0.34; }
.chapter-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(10, 10, 12, 0.96) 0%, rgba(10, 10, 12, 0.75) 46%, rgba(10, 10, 12, 0.3) 100%),
              linear-gradient(to bottom, rgba(10, 10, 12, 0.9) 0%, transparent 25%, transparent 75%, rgba(10, 10, 12, 0.9) 100%);
}
.chapter-in { position: relative; z-index: 1; max-width: var(--w); margin: 0 auto; padding: 0 1.5rem; width: 100%; }
.chapter-rail { display: flex; gap: 0.5rem; margin-bottom: 3rem; }
.chapter-rail b {
  font-family: var(--mono); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.14em;
  color: var(--bone-35); padding-bottom: 0.7rem; border-bottom: 1.5px solid var(--line);
  width: 4.5rem; transition: color 0.35s, border-color 0.35s;
}
.chapter-rail b.live { color: var(--brand-soft); border-color: var(--brand); }
.chapter-stage { position: relative; min-height: 21rem; }
.chapter-card {
  position: absolute; inset: 0; max-width: 44rem;
  opacity: 0; transform: translateY(34px); pointer-events: none;
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.chapter-card.live { opacity: 1; transform: none; pointer-events: auto; }
.chapter-kicker { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--brand); margin-bottom: 1.1rem; }
.chapter-title { font-family: var(--serif); font-size: clamp(2.4rem, 4.6vw, 4rem); line-height: 1.03; letter-spacing: -0.02em; }
.chapter-body { margin-top: 1.4rem; font-size: 1.1rem; line-height: 1.7; color: var(--bone-70); max-width: 46ch; }
.chapter-meta { margin-top: 1.8rem; }

/* ---------- zoom moment (scene: zoom) — one number fills the room ---------- */
.zoom { height: 260vh; }
.zoom .scene-pin { display: flex; align-items: center; justify-content: center; background: var(--ink); }
.zoom-stack { text-align: center; padding: 0 1.5rem; }
.zoom-num {
  font-family: var(--serif); font-variant-numeric: tabular-nums; line-height: 1;
  font-size: clamp(5rem, 17vw, 15.5rem); letter-spacing: -0.03em;
  transform: scale(calc(0.62 + min(var(--p, 0) * 1.9, 1) * 0.38));
  opacity: calc(min(var(--p, 0) * 2.4, 1));
  will-change: transform, opacity;
}
.zoom-caption {
  margin-top: 1.6rem;
  opacity: calc((var(--p, 0) - 0.38) * 3.2);
  transform: translateY(calc((1 - min(var(--p, 0) * 1.8, 1)) * 18px));
}
.zoom-sub {
  margin-top: 1.1rem; font-size: 1.1rem; color: var(--bone-70); max-width: 44ch; margin-left: auto; margin-right: auto;
  opacity: calc((var(--p, 0) - 0.52) * 3.2);
}
.zoom-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(46% 46% at 50% 52%, rgba(252, 80, 0, calc(var(--p, 0) * 0.16)) 0%, transparent 70%);
}

/* ---------- parallax media ---------- */
[data-plx] { will-change: transform; }

/* ---------- media card with video ---------- */
.vid-card { position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.vid-card video { width: 100%; display: block; }
.vid-card .vid-tag {
  position: absolute; left: 1rem; bottom: 1rem;
  font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase;
  background: rgba(10, 10, 12, 0.72); border: 1px solid var(--line-strong);
  padding: 0.4rem 0.8rem; border-radius: 999px; color: var(--bone-70); backdrop-filter: blur(6px);
}

/* ---------- page hero video variant ---------- */
.hero-media video { width: 100%; height: 100%; object-fit: cover; animation: drift 28s ease-in-out infinite alternate; }

/* ---------- reduced motion: everything lands, nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  [data-split] .w { opacity: 1; transform: none; filter: none; transition: none; }
  .vhero { height: auto; }
  .vhero .scene-pin { position: relative; height: auto; min-height: 92vh; }
  .vhero-media video, .vhero-media img { transform: none; }
  .vhero-dim { display: none; }
  .vhero-content { transform: none; opacity: 1; }
  .chapter { height: auto; }
  .chapter .scene-pin { position: relative; height: auto; padding: 6rem 0; }
  .chapter-stage { min-height: 0; }
  .chapter-card { position: relative; opacity: 1; transform: none; pointer-events: auto; margin-bottom: 3rem; }
  .zoom { height: auto; }
  .zoom .scene-pin { position: relative; height: auto; padding: 7rem 0; }
  .zoom-num { transform: none; opacity: 1; }
  .zoom-caption, .zoom-sub { opacity: 1; transform: none; }
  .scroll-cue i { animation: none; }
  .hero-media video { animation: none; }
  [data-plx] { transform: none !important; }
}
@media (max-width: 760px) {
  .vhero { height: 150vh; }
  .chapter { height: 340vh; }
  .zoom { height: 190vh; }
}

/* ---------- hero showcase fit: one viewport, no clipping ---------- */
.vhero .vhero-content { padding: 6.2rem 1.5rem 2.6rem; }
.vhero .vhero-grid { gap: 2.4rem; }
.vhero .h-display { font-size: clamp(2.3rem, 4.6vw, 3.9rem); }
.vhero .hero-sub { margin-top: 1.2rem; font-size: 1.06rem; }
.vhero .hero-ctas { margin-top: 1.8rem; }
.vhero .hero-tile video { aspect-ratio: 16/6.4; }
.vhero .hero-tiles { gap: 0.9rem; }
.vhero .grid-4 { margin-top: 2.6rem !important; }
.vhero .stat-value { font-size: clamp(2rem, 3.2vw, 2.9rem); }
@media (max-height: 820px) {
  .vhero .grid-4 { display: none; } /* short screens: stats live below the fold sections */
}

/* accent words are solid brand now — inherit cleanly through split spans */
.accent .w, [data-split] .accent.w { color: var(--brand); }

/* ---------- showcase: the work in motion (clean, captions below) ---------- */
.showcase-grid { gap: 1.5rem; }
.showcase-media { border-radius: 1.15rem; overflow: hidden; border: 1px solid var(--line); background: #0a0a0c; }
.showcase-media video { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.showcase-card figcaption { padding: 1.55rem 0.15rem 0; }
.showcase-line { color: var(--bone-55); font-size: 1.05rem; line-height: 1.45; }
@media (max-width: 640px) { .showcase-media video { aspect-ratio: 16/10; } }

/* hero: quiet, centered, one thought */
.vhero .vhero-content { padding: 7rem 1.5rem 4rem; }
.vhero .scene-pin { align-items: center; }
.vhero .h-display { font-size: clamp(2.6rem, 5.4vw, 4.8rem); }
