/* ==========================================================================
   XOMEXO — motion layer
   Campaign film, pinned sequences and scroll reveals.

   Every "before" state below is scoped to html.has-motion, which motion.js
   adds only when JS runs and prefers-reduced-motion is not set. Without it
   the page renders fully, statically and readably.
   ========================================================================== */

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- opening curtain (homepage, once per session) ---------- */
.curtain {
  position: fixed; inset: 0; z-index: 200;
  background: var(--dark);
  display: none; place-items: center;
  pointer-events: none;
}
html.has-motion.is-opening .curtain { display: grid; }
.curtain-word {
  font-family: var(--serif); font-weight: 300; color: #efece6;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: .5em; text-indent: .5em; text-transform: uppercase;
  overflow: hidden;
}
.curtain-word span { display: inline-block; }

/* ---------- hero film ---------- */
.hero { min-height: 100svh; }
.hero-media { position: absolute; inset: 0; overflow: hidden; }
.hero-media video,
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-inner h1 { font-size: clamp(2.8rem, 7.5vw, 6.6rem); max-width: none; } /* lines are set by hand */

.film-toggle {
  position: absolute; z-index: 3;
  right: var(--gutter); bottom: clamp(3rem, 7vw, 6rem);
  background: none; border: 1px solid rgba(255,255,255,.5); color: #fff;
  font-size: .5625rem; letter-spacing: .24em; text-transform: uppercase;
  padding: .7rem 1.1rem;
  transition: background .4s var(--ease), color .4s var(--ease);
}
.film-toggle:hover { background: #fff; color: var(--ink); }

.scroll-cue {
  position: absolute; left: 50%; bottom: 1.6rem; z-index: 3;
  transform: translateX(-50%);
  font-size: .5625rem; letter-spacing: .3em; text-transform: uppercase;
  color: rgba(255,255,255,.7);
  display: grid; justify-items: center; gap: .7rem;
}
.scroll-cue::after {
  content: ""; width: 1px; height: 42px; background: rgba(255,255,255,.6);
  transform-origin: top; animation: cue 2.4s var(--ease) infinite;
}
@keyframes cue {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* headings split into lines: each line clips its own text */
.line { display: block; overflow: hidden; padding-bottom: .08em; }
.line > span { display: block; }

/* ---------- statement, revealed word by word ---------- */
.words {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.9rem, 4.4vw, 4rem); line-height: 1.2;
  max-width: 24ch; margin: 0 auto; text-align: center;
}
.words .w { display: inline-block; }
html.has-motion .words .w { opacity: .14; }

/* ---------- campaign lookbook ---------- */
.campaign {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: clamp(1rem, 2vw, 2rem); align-items: start;
}
.look { display: block; }
.look-media { overflow: hidden; background: var(--bone); position: relative; }
.look-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
html.has-motion .look-media img { height: 118%; }
.look--a { grid-column: 1 / span 6; }
.look--a .look-media { aspect-ratio: 3 / 4.3; }
.look--b { grid-column: 8 / span 5; margin-top: clamp(4rem, 14vw, 14rem); }
.look--b .look-media { aspect-ratio: 4 / 5; }
.look--c { grid-column: 2 / span 4; margin-top: clamp(2rem, 4vw, 4rem); }
.look--c .look-media { aspect-ratio: 4 / 5; }
.look--d { grid-column: 7 / span 6; margin-top: clamp(-8rem, -9vw, -2rem); }
.look--d .look-media { aspect-ratio: 3 / 2; }
.look-cap {
  display: flex; justify-content: space-between; gap: 1rem; padding-top: 1rem;
  font-size: .625rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-faint);
}
.look-cap b { font-weight: 400; color: var(--ink); }
.look:hover .look-cap b { text-decoration: underline; text-underline-offset: .4rem; }
html.has-motion .look-media { clip-path: inset(100% 0 0 0); }

/* ---------- pinned horizontal collection ---------- */
.hscroll { overflow: hidden; background: var(--bone); }
.hscroll-inner {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  padding-block: clamp(3rem, 6vw, 5rem);
}
.hscroll-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}
.hscroll-head h2 { margin: 0; }
.hscroll-track {
  display: flex; gap: clamp(1rem, 2.5vw, 2.5rem);
  padding-inline: var(--gutter); will-change: transform;
}
.hcard { flex: 0 0 clamp(240px, min(23vw, 42svh), 380px); display: block; } /* height-aware so the row and its rule fit one screen */
.hcard .pcard-media { aspect-ratio: 4 / 5; }
.hcard-index { display: block; font-size: .5625rem; letter-spacing: .24em; color: var(--ink-faint); margin-bottom: .9rem; }
.hprogress { height: 1px; background: var(--hair); margin: clamp(2rem, 4vw, 3rem) var(--gutter) 0; position: relative; }
.hprogress span { position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(0); }

/* ---------- pinned product story ---------- */
.story-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(2rem, 6vw, 6rem); }
.story-sticky { position: sticky; top: 0; height: 100svh; display: flex; align-items: center; }
.story-frame { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; background: var(--bone); }
.story-frame img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.06);
  transition: opacity 1.1s var(--ease), transform 1.6s var(--ease);
}
.story-frame img.is-on { opacity: 1; transform: none; }
html:not(.has-motion) .story-frame img:first-child { opacity: 1; transform: none; }
.story-count {
  position: absolute; left: 1.2rem; bottom: 1.2rem; z-index: 2;
  background: var(--paper); font-size: .5625rem; letter-spacing: .24em; padding: .5rem .8rem;
}
.story-steps { padding-block: 26vh; }
.story-step { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; max-width: 40ch; }
.story-step .num { font-family: var(--serif); font-size: 1rem; color: var(--ink-faint); margin-bottom: 1.4rem; }
.story-step h3 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.story-step p { color: var(--ink-soft); }
html.has-motion .story-step { opacity: .18; transition: opacity .8s var(--ease); }
html.has-motion .story-step.is-on { opacity: 1; }

/* ---------- full-bleed film that opens up as you scroll ---------- */
.film { position: relative; height: 100svh; overflow: hidden; display: grid; place-items: center; color: #fff; text-align: center; }
.film-frame { position: absolute; inset: 0; overflow: hidden; }
.film-frame video, .film-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.film-frame::after { content: ""; position: absolute; inset: 0; background: rgba(12,10,9,.5); }
html.has-motion .film-frame { clip-path: inset(12% 14% 12% 14%); }
.film-inner { position: relative; z-index: 2; padding: var(--gutter); }
.film-inner .label { color: rgba(255,255,255,.72); }
.film-inner .statement { max-width: 18ch; margin-inline: auto; font-size: clamp(2rem, 4.6vw, 4.2rem); }

/* ---------- portrait film beside copy, and parallax frames ---------- */
.split-media video { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.parallax { overflow: hidden; }
.parallax > img, .parallax > video { will-change: transform; }
html.has-motion .parallax > img,
html.has-motion .parallax > video { height: 116%; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .campaign { grid-template-columns: 1fr 1fr; }
  .look--a, .look--b, .look--c, .look--d { grid-column: auto; margin-top: 0; }
  .look--a, .look--d { grid-column: 1 / -1; }
  .story-grid { grid-template-columns: 1fr; }
  .story-sticky { position: relative; height: auto; }
  .story-steps { padding-block: 2rem 0; }
  .story-step { min-height: 0; padding-block: 2.5rem; }
  html.has-motion .story-step { opacity: 1; }
  .hscroll-inner { min-height: 0; }
  .hscroll-track { overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 1rem; -webkit-overflow-scrolling: touch; }
  .hcard { scroll-snap-align: start; flex-basis: 74vw; }
  .hprogress { display: none; }
  .film { height: 78svh; }
}
@media (max-width: 620px) {
  .campaign { grid-template-columns: 1fr; }
  .film-toggle { bottom: auto; top: 96px; }
  .scroll-cue { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-cue::after { animation: none; }
}
