/* ============================================================
   LIVSTYL — motion layer styles ("Golden hour")
   Paired with assets/js/magic.js — see its header for the concept.
   Everything here degrades: without JS (no html.mx class) or with
   prefers-reduced-motion, every section renders as a normal static
   layout. Only transform / opacity / clip-path are animated.
   html.mx      = magic.js running and motion allowed
   html.mx-hi   = + fine pointer, >4 cores, no Save-Data (WebGL, dust, cursor)
   html.lenis   = smooth scrolling active (added by Lenis)
   ============================================================ */

/* ---------- Lenis (smooth scroll) ---------- */
html.lenis, html.lenis body { height: auto; }
html.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Page change: golden-hour light wash ----------
   Leave: warm ivory→gold light floods out from the click point (circle clip-path), a soft sun
   glows, and the mandala blooms petal by petal (conic mask). Enter (next page): the light lifts
   upward and away, revealing the page. Light surfaces only — no dark panel. */
@property --pt-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.pt { display: none; }
html.js .pt {
  --px: 50vw; --py: 50vh;
  position: fixed; inset: 0; z-index: var(--z-curtain, 950); display: grid; place-items: center; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(60% 55% at 50% 52%, #FFF6E6 0%, rgba(255, 238, 210, .9) 35%, rgba(255, 238, 210, 0) 70%),
    radial-gradient(120% 90% at 50% 120%, #F4C7A1 0%, #F7DDB8 35%, #FAF1E4 70%),
    #FAF4EA;
  clip-path: circle(0% at var(--px) var(--py)); visibility: hidden;
}
/* low warm sun + drifting light beams */
.pt__sun { position: absolute; left: 50%; bottom: -38vmax; width: 90vmax; aspect-ratio: 1; translate: -50% 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 160, .75) 0%, rgba(240, 160, 110, .28) 40%, transparent 68%); filter: blur(8px); opacity: 0; }
html.js .pt::before { content: ""; position: absolute; inset: -20% -40%; pointer-events: none; mix-blend-mode: soft-light; opacity: 0;
  background: repeating-linear-gradient(112deg, transparent 0 7%, rgba(255, 236, 200, .55) 7% 9%, transparent 9% 16%); }
.pt__halo { position: absolute; width: 220px; aspect-ratio: 1; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, rgba(255, 253, 248, .95) 0%, rgba(255, 246, 228, .7) 40%, transparent 70%); }
.pt__mark { position: relative; width: clamp(64px, 9vw, 92px); aspect-ratio: 1;
  -webkit-mask-image: conic-gradient(from -90deg, #000 var(--pt-a), transparent 0); mask-image: conic-gradient(from -90deg, #000 var(--pt-a), transparent 0);
  transform: rotate(-50deg) scale(.85); }
.pt__mark-fill { position: absolute; inset: 0; background: conic-gradient(from 210deg, var(--coral), #EE7B6B, var(--gold-2), var(--gold), var(--coral));
  -webkit-mask: url(../img/logo-mark.png) center / contain no-repeat; mask: url(../img/logo-mark.png) center / contain no-repeat; }

/* leaving: light floods in, mandala blooms */
html.pt-leave .pt { visibility: visible; animation: liv-pt-flood .62s cubic-bezier(.6, 0, .2, 1) forwards; }
html.pt-leave .pt__sun { animation: liv-pt-sun .9s var(--ease-out) .05s forwards; }
html.pt-leave .pt::before { animation: liv-pt-beams 1.4s ease-out .1s forwards; }
html.pt-leave .pt__halo { animation: liv-pt-halo .7s var(--ease-out) .18s forwards; }
html.pt-leave .pt__mark { animation: liv-pt-bloom .75s cubic-bezier(.45, 0, .2, 1) .16s forwards; }
/* arriving: fully lit curtain, the light lifts away upward */
html.pt-enter .pt { visibility: visible; clip-path: circle(150% at 50% 50%); animation: liv-pt-lift .8s cubic-bezier(.65, 0, .25, 1) .12s forwards; }
html.pt-enter .pt__sun { opacity: 1; }
html.pt-enter .pt__halo { opacity: 1; }
html.pt-enter .pt__mark { --pt-a: 360deg; transform: none; animation: liv-pt-mark-out .45s var(--ease) forwards; }
html.pt-enter main { animation: liv-pt-main .9s var(--ease-out) .22s both; }

@keyframes liv-pt-flood { to { clip-path: circle(150% at var(--px) var(--py)); } }
@keyframes liv-pt-sun { to { opacity: 1; transform: translateY(-6vmax); } }
@keyframes liv-pt-beams { 40% { opacity: .9; } to { opacity: .5; transform: translateX(6%); } }
@keyframes liv-pt-halo { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes liv-pt-bloom { 75% { --pt-a: 360deg; } to { --pt-a: 360deg; transform: none; } }
@keyframes liv-pt-lift { to { clip-path: circle(0% at 50% -10%); visibility: hidden; } }
@keyframes liv-pt-mark-out { to { opacity: 0; transform: translateY(-18px) scale(.92); } }
@keyframes liv-pt-main { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }

/* ---------- Hero: WebGL light sweep, sunbeam, dust, depth ---------- */
.hero__gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .8s var(--ease); }
.hero--gl .hero__gl { opacity: 1; }
.hero--gl .hero__slide { opacity: 0 !important; transition: none; }
.hero__beam { position: absolute; inset: -20% -10% auto auto; z-index: -1; width: 75%; height: 140%; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,214,160,.10) 44%, rgba(255,226,186,.16) 50%, rgba(255,214,160,.08) 56%, transparent 70%);
  mix-blend-mode: screen; transform-origin: 100% 0; transform: rotate(-4deg); animation: liv-beam 9s ease-in-out infinite alternate; }
@keyframes liv-beam { to { opacity: .55; transform: rotate(2deg) translate3d(-3%, 0, 0); } }
.dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; opacity: 0; transition: opacity 1.2s var(--ease); }
.dust.is-on { opacity: 1; }
.final .dust { z-index: -1; }
/* mouse depth (magic.js writes --hx/--hy in -1..1 on .hero) */
.mx-hi .hero__title { translate: calc(var(--hx, 0) * -10px) calc(var(--hy, 0) * -6px); transition: translate .9s var(--ease-out); }
.mx-hi .hero__chips { translate: calc(var(--hx, 0) * 18px) calc(var(--hy, 0) * 10px); transition: translate 1.1s var(--ease-out); }
.mx-hi .hero__glow { translate: calc(var(--hx, 0) * 40px) calc(var(--hy, 0) * 30px); }

/* ---------- Word-mask headings (magic.js wraps words in .mw > .mw__in) ---------- */
.mw { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .07em .14em; margin: 0 -.07em -.14em; }
.mw__in { display: inline-block; }
.mx .mw__in { transform: translate3d(0, 112%, 0) rotate(3deg); transform-origin: 0 100%;
  transition: transform 1.15s var(--ease-expo); transition-delay: calc(var(--wi, 0) * 42ms); }
.mx [data-split].is-in .mw__in, .mx [data-split].is-split-play .mw__in { transform: none; }
.mx [data-split][data-reveal] { opacity: 1 !important; transform: none !important; filter: none !important; }
/* gradient words: give every word its own copy of the parent's text gradient */
.display em .mw__in, .text-gradient .mw__in { background: inherit; -webkit-background-clip: text; background-clip: text; }

/* ---------- Image reveals (clip-path wipe + settle) ---------- */
.mx .proj[data-reveal] .proj__media, .mx .bcard[data-reveal] .bcard__media, .mx .vfeat[data-reveal] {
  clip-path: inset(16% 12% 0 12% round var(--r-lg)); transition: clip-path 1.4s var(--ease-expo); }
.mx .proj[data-reveal].is-in .proj__media, .mx .bcard[data-reveal].is-in .bcard__media, .mx .vfeat[data-reveal].is-in { clip-path: inset(0 0 0 0 round var(--r-lg)); }
.mx .proj[data-reveal] .proj__media img, .mx .bcard[data-reveal] .bcard__media img { scale: 1.22; transition: transform 1.4s var(--ease-out), scale 1.8s var(--ease-expo); }
.mx .proj[data-reveal].is-in .proj__media img, .mx .bcard[data-reveal].is-in .bcard__media img { scale: 1; }
.mx .vfeat[data-reveal].is-in { clip-path: inset(0 0 0 0 round var(--r-xl)); }

/* ---------- Liquid buttons: a light pool spreads from the cursor ---------- */
.btn:not(.btn--ghost):not(.btn--light):not(.btn--outline-light):not(.btn--glow):not(.btn--ig)::after {
  content: ""; position: absolute; z-index: -1; left: var(--fx, 50%); top: var(--fy, 50%); width: 260%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--coral) 0%, #D9775F 40%, var(--gold) 72%);
  transform: translate(-50%, -50%) scale(0); transition: transform .6s var(--ease-out); pointer-events: none; }
.btn--gold::after { background: radial-gradient(circle, #F08A7A 0%, var(--coral) 55%, var(--coral-deep) 100%) !important; }
.btn:not(:disabled):hover::after { transform: translate(-50%, -50%) scale(1); }

/* ---------- Assemble: a home builds itself as you scroll ---------- */
.assemble { --t1: 1; --t2: 1; --t3: 1; --t4: 1; --p: 1; position: relative; background: var(--charcoal); color: var(--white); overflow-x: clip; }
.assemble__sticky { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; }
.assemble__stage { position: absolute; inset: 0; z-index: -1; }
.asm-l { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.asm-l--shell { filter: grayscale(.55) contrast(.92) brightness(.78); opacity: calc(1 - var(--t3)); }
.assemble--noshell .asm-l--shell { filter: grayscale(1) contrast(.6) brightness(.55) blur(2px); }
.asm-l--plan { color: var(--gold-3); background: rgb(20 19 17 / calc(var(--t1) * .45)); opacity: calc(min(1, var(--t1) * 4) * (1 - var(--t3))); }
.asm-grid { opacity: calc(var(--t1) * .6); }
.asm-lines path { stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--t1)); vector-effect: non-scaling-stroke; }
.asm-label { fill: currentColor; font: 600 18px var(--font-body); letter-spacing: .2em; opacity: var(--t1); }
.asm-l--mat { filter: grayscale(1) sepia(.28) brightness(1.04) contrast(.9); clip-path: inset(0 calc((1 - var(--t2)) * 100%) 0 0); }
.asm-edge { inset: 0 auto 0 0; width: 100%; height: 100%; pointer-events: none; translate: calc(var(--t2) * 100%) 0; opacity: calc(var(--t2) * (1 - var(--t2)) * 4); }
.asm-edge::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: var(--gold-3); box-shadow: 0 0 30px 8px rgba(228,207,166,.55); }
.asm-l--color { clip-path: circle(calc(var(--t3) * 120%) at 62% 60%); }
.asm-l--light { background: radial-gradient(70% 80% at 72% 30%, rgba(255,214,160,.55), transparent 60%), linear-gradient(115deg, transparent 35%, rgba(255,226,186,.22) 50%, transparent 65%);
  mix-blend-mode: soft-light; opacity: var(--t4); }
.asm-l--shade { background: linear-gradient(0deg, rgba(20,19,17,.92) 0%, rgba(20,19,17,.55) 42%, rgba(20,19,17,.05) 75%); }
@media (min-width: 900px) {
  .assemble__sticky { align-items: center; }
  .asm-l--shade { background: linear-gradient(90deg, rgba(20,19,17,.9) 0%, rgba(20,19,17,.6) 34%, rgba(20,19,17,0) 62%), linear-gradient(0deg, rgba(20,19,17,.5), transparent 30%); }
}
.assemble__copy { position: relative; padding-block: calc(var(--header-h) + 32px) clamp(28px, 6vh, 64px); }
.assemble__copy > * { max-width: 520px; }
.assemble__copy .display { color: var(--white); font-size: clamp(2rem, 1.4rem + 2.6vw, 3.6rem); margin-bottom: 1.4rem; }
.assemble__copy .display em { background: linear-gradient(100deg, var(--gold-2) 0%, #E8C8A0 40%, var(--coral) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.assemble__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.asm-step { display: flex; gap: 16px; align-items: baseline; transition: opacity .5s var(--ease), transform .6s var(--ease-out); }
.asm-step__num { font-size: .6875rem; font-weight: 700; letter-spacing: .2em; color: var(--gold-2); min-width: 2ch; }
.asm-step__body { display: flex; flex-direction: column; gap: .15rem; }
.asm-step strong { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.1rem, 1rem + .5vw, 1.4rem); }
.asm-step__body > span { font-size: var(--fs-sm); color: rgba(255,255,255,.72); max-width: 42ch; }
.assemble__meter { display: none; }

/* scroll-driven mode */
.mx .assemble { height: 400vh; }
.mx .assemble__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 0; }
.mx .asm-step { opacity: .32; }
.mx .asm-step.is-active { opacity: 1; }
.mx .asm-step.is-done { opacity: .55; }
.mx .assemble__meter { display: block; margin-top: 22px; width: min(240px, 60%); height: 2px; background: rgba(255,255,255,.18); border-radius: 2px; overflow: hidden; }
.mx .assemble__meter span { display: block; height: 100%; background: var(--grad-brand); transform-origin: left; transform: scaleX(var(--p)); }
@media (max-width: 899px) {
  .mx .assemble__steps { display: grid; grid-template-areas: "s"; }
  .mx .asm-step { grid-area: s; opacity: 0; transform: translateY(14px); }
  .mx .asm-step.is-active { opacity: 1; transform: none; }
  .mx .asm-step.is-done { opacity: 0; transform: translateY(-14px); }
  .assemble__copy .display { font-size: clamp(1.7rem, 1.2rem + 3vw, 2.4rem); }
}

/* ---------- Horizontal pinned gallery (styles) ---------- */
.hs__foot { display: none; }
.collections.hs-on { padding-block: 0; height: var(--hs-h, auto); }
.hs-on .hs__sticky { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding-top: calc(var(--header-h) * .6); }
.hs-on .section__head { margin-bottom: clamp(18px, 3vh, 36px); }
.hs-on .rail { overflow: visible; scroll-snap-type: none; will-change: transform; padding-bottom: 8px; }
.hs-on .rail-nav { display: none; }
.hs-on .style-card { flex-basis: calc(min(48vh, 500px) * .76); }
.hs-on .style-card__media { aspect-ratio: auto; height: min(48vh, 500px); }
.hs-on .style-card__media img { scale: 1.16; translate: var(--px, 0px) 0; }
.hs-on .style-card--all { height: min(48vh, 500px); min-height: 0; align-self: flex-start; }
.hs-on .hs__foot { display: flex; align-items: center; gap: 18px; margin-top: clamp(14px, 2.5vh, 28px); }
.hs__hint { font-size: .6875rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--text-2); white-space: nowrap; }
.hs__bar { flex: 1; max-width: 320px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.hs__bar span { display: block; height: 100%; background: var(--grad-brand); transform-origin: left; transform: scaleX(var(--hs-p, 0)); }

/* ---------- Reduced motion: everything static ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero__beam { animation: none; }
  .dust, .hero__gl { display: none !important; }
  .mw__in { transform: none !important; transition: none !important; }
  .btn::after { display: none !important; }
  html.js .pt { display: none !important; }
}
