/* ══════════════════════════════════════════════════════════════════════════════
   SITE KIT — the luxe effects, the CSS half.                    luxe.css v1.0 (2026-11-21)
   Adam, 11/21: "research ... luxury animation effects we can add to our skills." Measured that day: every niche recipe
   handed out the same two presets, and on the last 25 builds fade-up (rise) sat on 17, the photo reveal on 11, the word
   reveal on 7. Anthropic's own design guide names "fade-and-slide-up entrances on each section" as the look of a
   generated page. The sites this was measured against (Four Seasons, Marriott, Aesop, Porsche, Ferrari, Apple) move at
   two speeds: fast for what you touch (120 to 250 ms), slow for cinema (700 to 1000 ms), eased out, and rarely.

   Load AFTER presets.css. luxe.js drives it (after presets.js in lateJs). THE CONTRACT is presets.css's:
   - every rule that changes a starting state sits under html.mo (the head script adds it only when motion is allowed,
     and takes it away again if the motion stack never reports in): scripts off, reduced motion and a blocked script all
     get the complete still page;
   - luxe.js arms only what is still BELOW the fold when it loads (class lx-pre), plays it once on entry (lx-in), then
     takes both classes off again; nothing starts hidden: a wipe opens from more than half, ink starts at .55;
   - scrubbed effects (ink, trace, foot, the stack's scale) are plain CSS scroll-driven animations inside @supports, so
     a browser without them gets NO rule and the finished page (Chrome 115, Safari 26, Firefox 159);
   - only transform, opacity, clip-path and stroke move. No GSAP is needed for any of it (the motion budget is 220 KB).

   data-mo values (space-separate to combine; client-site-design/reference/motion-library.md says when each is luxury):
     lines   a headline arrives line by line from behind its own edge
     ink     a story paragraph fills with ink, word by word, as it is read (scrubbed)
     wipe    a photograph opens from a side; data-mo-from="right|up|down|shutter|iris|squeegee" (default left)
     stack   the steps pin and the next slides over the last (direct children)
     foot    the page lifts off the closing band beneath it (scrubbed)
     pin     one photograph holds still while the words scroll past and change it (children .pin-step, each with its photo)
     sheen   a soft light passes once across a logo, paint or metal; data-mo-mask keeps the light inside a cut-out logo
     flap    prices, dates and counts roll into place like a station board (plain text only)
     trace   a drawn line follows the scroll: a route, a hull, a vine, a wire (stroked svg shapes; scrubbed)
     living  their real photograph with a few seconds of real movement (a muted looping <video> with the still as poster)
     magnet  the main ask leans a little toward the cursor (fine pointers only; every button already presses: finish.css)
   and two attributes:  data-label="View" (a small word follows the cursor over a gallery), and on a link
   data-vt="<id>" with style="view-transition-name:<id>" on the next page's hero (the photo you tap grows into the page).
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── the two speeds, the three curves, the tempo (1 = standard; a spa runs 1.25, a gym .8: set --lx-tempo in site.css) ── */
:root{
  --t-fast:150ms; --t-std:240ms; --t-slow:400ms; --t-cinema:900ms;
  --e-out:cubic-bezier(.16,1,.3,1); --e-inout:cubic-bezier(.65,0,.35,1); --e-spring:cubic-bezier(.34,1.56,.64,1);
  --lx-tempo:1;
}

/* ── lines: each word sits in its own clip (descenders keep their room); the words of one line share a delay ── */
.lw{display:inline-block;overflow:hidden;vertical-align:top;padding:0 .05em .16em;margin:0 -.05em -.16em}
.lw>span{display:inline-block}
html.mo .lx-pre[data-mo~="lines"] .lw>span{transform:translateY(108%)}
html.mo .lx-pre.lx-in[data-mo~="lines"] .lw>span{transform:none;transition:transform calc(var(--t-cinema)*var(--lx-tempo)) var(--e-out);transition-delay:calc(var(--l,0)*115ms*var(--lx-tempo))}

/* ── wipe: the frame opens from a side while the print settles. It starts more than half open (nothing hidden to animate). ── */
html.mo .lx-pre[data-mo~="wipe"]{clip-path:inset(0 44% 0 0)}
html.mo .lx-pre[data-mo~="wipe"][data-mo-from="right"]{clip-path:inset(0 0 0 44%)}
html.mo .lx-pre[data-mo~="wipe"][data-mo-from="up"]{clip-path:inset(44% 0 0 0)}
html.mo .lx-pre[data-mo~="wipe"][data-mo-from="down"]{clip-path:inset(0 0 44% 0)}
html.mo .lx-pre[data-mo~="wipe"][data-mo-from="shutter"]{clip-path:inset(0 23% 0 23%)}
html.mo .lx-pre[data-mo~="wipe"][data-mo-from="iris"]{clip-path:circle(36% at 50% 50%)}
html.mo .lx-pre[data-mo~="wipe"][data-mo-from="squeegee"]{clip-path:polygon(0 0,64% 0,40% 100%,0 100%)}
html.mo .lx-pre[data-mo~="wipe"] :is(img,video){transform:scale(1.1)}
html.mo .lx-pre.lx-in[data-mo~="wipe"]{clip-path:inset(0 0 0 0);transition:clip-path calc(var(--t-cinema)*var(--lx-tempo)) var(--e-out)}
html.mo .lx-pre.lx-in[data-mo~="wipe"][data-mo-from="iris"]{clip-path:circle(75% at 50% 50%)}
html.mo .lx-pre.lx-in[data-mo~="wipe"][data-mo-from="squeegee"]{clip-path:polygon(0 0,132% 0,108% 100%,0 100%)}
html.mo .lx-pre.lx-in[data-mo~="wipe"] :is(img,video){transform:none;transition:transform calc(var(--t-cinema)*1.45*var(--lx-tempo)) var(--e-out)}

/* ── sheen: one pass of light. The wrapper hugs the logo or the photograph; data-mo-mask keeps it inside the logo's own shape. ── */
html.mo .lx-sheen{position:relative;overflow:hidden;isolation:isolate}
html.mo .lx-sheen::after{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;transform:translateX(-130%);
  background:linear-gradient(105deg,transparent 38%,rgba(255,255,255,.62) 50%,transparent 62%);
  -webkit-mask:var(--lx-mask,none) center/contain no-repeat;mask:var(--lx-mask,none) center/contain no-repeat}
html.mo .lx-sheen.lx-in::after{animation:lx-sheen calc(1400ms*var(--lx-tempo)) var(--e-inout) .12s 1 both}
@keyframes lx-sheen{to{transform:translateX(130%)}}

/* ── flap: the real digit keeps the baseline and the width; a column of ten rolls over it ── */
[data-mo~="flap"]{font-variant-numeric:tabular-nums}
.fn{white-space:nowrap}   /* a number stays on one line while it rolls (a year split "198 / 7" on a phone, 11/21) */
.fd{position:relative;display:inline-block}
.fx{display:none}
html.mo .lx-pre[data-mo~="flap"] .fr{color:transparent}
html.mo .lx-pre[data-mo~="flap"] .fx{display:block;position:absolute;inset:0;overflow:hidden}
html.mo .lx-pre[data-mo~="flap"] .fc{display:block}
html.mo .lx-pre[data-mo~="flap"] .fc>i{display:block;font-style:normal}
html.mo .lx-pre.lx-in[data-mo~="flap"] .fc{transform:translateY(calc(var(--d)*-1lh));transition:transform calc(1150ms*var(--lx-tempo)) var(--e-out);transition-delay:calc(var(--k,0)*70ms)}

/* ── stack: the steps pin under the header and the next slides over the last. A step keeps its own ground. ── */
:where(html.mo .lx-stack > *){background:var(--lx-stack-bg,var(--paper-2,#fff))}
html.mo .lx-stack>*{position:sticky;top:calc(var(--nav-h,100px) + 14px + var(--i,0)*16px);transform-origin:50% 0}

/* ── pin: on a wide screen the photographs gather in one frame that holds still; on a phone each stays in its step ── */
@media (min-width:1024px){
  html.mo .lx-pin{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,6fr);column-gap:clamp(28px,4vw,80px);align-items:start}
  html.mo .lx-pin>.pin-step{grid-column:1;min-height:72svh;display:flex;flex-direction:column;justify-content:center}
  html.mo .lx-pin .lx-moved{display:none}
  html.mo .lx-pin>.lx-pin-media{grid-column:2;grid-row:1/span 40;position:sticky;top:calc(var(--nav-h,100px) + 3vh);height:calc(100svh - var(--nav-h,100px) - 6vh);overflow:hidden}
  .lx-pin-media>*{position:absolute;inset:0;width:100%;height:100%;opacity:0;transition:opacity calc(650ms*var(--lx-tempo)) var(--e-inout)}
  .lx-pin-media>.on{opacity:1}
  .lx-pin-media img,.lx-pin-media video{display:block;width:100%;height:100%;object-fit:cover}
}

/* ── magnet + the cursor label (fine pointers; the native cursor stays) ── */
@media (hover:hover) and (pointer:fine){html.mo [data-mo~="magnet"]{transition:translate .45s var(--e-out)}}
.lx-label{position:fixed;left:0;top:0;z-index:70;pointer-events:none;padding:10px 17px;border-radius:100px;background:var(--ink,#1B2419);color:var(--paper,#fff);
  font:600 13px/1 var(--sans,system-ui,sans-serif);letter-spacing:.04em;opacity:0;scale:.6;transition:opacity var(--t-std) ease,scale var(--t-slow) var(--e-out)}
.lx-label.on{opacity:1;scale:1}

/* ── living: the still is the poster, so the frame never opens empty ── */
video[data-mo~="living"]{display:block;width:100%;height:100%;object-fit:cover}

/* ── the photograph you tap grows into the next page (cross-document view transition; finish.css opts the site in) ── */
@media (prefers-reduced-motion:no-preference){
  ::view-transition-group(*){animation-duration:calc(520ms*var(--lx-tempo,1));animation-timing-function:var(--e-out)}
}

/* ── the scrubbed effects: plain CSS scroll-driven animation, or nothing at all ── */
@supports (animation-timeline:view()){
  @media (prefers-reduced-motion:no-preference){
    /* ink: each word waits its turn on the paragraph's own timeline (--p is the word's place, 0 to 1) */
    html.mo .lx-ink{view-timeline-name:--lx-ink}
    html.mo .lx-ink .iw{animation:lx-ink linear both;animation-timeline:--lx-ink;animation-range:cover calc(8% + var(--p,0)*34%) cover calc(16% + var(--p,0)*34%)}
    @keyframes lx-ink{from{opacity:.55}}
    /* trace: the stroke is as long as the scroll has gone (--len is the shape's own length, set by luxe.js) */
    html.mo .lx-trace{view-timeline-name:--lx-trace}
    html.mo .lx-trace .lx-t{stroke-dasharray:var(--len);stroke-dashoffset:var(--len);animation:lx-trace linear both;animation-timeline:--lx-trace;animation-range:cover 10% cover 60%}
    @keyframes lx-trace{to{stroke-dashoffset:0}}
    /* foot: the band's contents stay where a fixed footer would sit while the band's own top edge uncovers them */
    html.mo .lx-foot{view-timeline-name:--lx-foot;overflow:clip}
    html.mo .lx-foot>*{animation:lx-foot linear both;animation-timeline:--lx-foot;animation-range:entry 0% entry 100%}
    @keyframes lx-foot{from{transform:translateY(calc(-1*var(--lx-h,0px)))}}
    /* stack: a pinned step gives a little as the next one covers it */
    html.mo .lx-stack{view-timeline-name:--lx-stack}
    html.mo .lx-stack>*{animation:lx-stack linear both;animation-timeline:--lx-stack;animation-range:contain calc((var(--i,0) + 1)/var(--n,1)*100%) contain calc((var(--i,0) + 2)/var(--n,1)*100%)}
    @keyframes lx-stack{to{transform:scale(.955)}}
  }
}
