/* ================= Site-wide motion (js/motion.js) =================
   Scroll reveals, 3D tilt on product cards and tiles, gentle parallax, scroll progress bar.
   js/motion.js adds .m-on to <html> when motion is allowed. Without it (no JS, or the visitor
   asks for reduced motion) every rule below is inactive and the page looks exactly as before. */

/* ---------- scroll progress bar ---------- */
.m-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: 3px; pointer-events: none;
  background: var(--honey); transform-origin: 0 50%; transform: scaleX(var(--m-progress, 0)); }

/* ---------- reveal on scroll ---------- */
.m-on .m-reveal { opacity: 0; transform: translate3d(0, 34px, 0); transition: opacity .9s var(--ease, cubic-bezier(.2, .7, .2, 1)), transform 1s var(--ease, cubic-bezier(.2, .7, .2, 1)); transition-delay: var(--m-delay, 0s); }
.m-on .m-reveal.m-in { opacity: 1; transform: none; }
.m-on .m-reveal--img { transform: translate3d(0, 34px, 0) scale(.96); clip-path: inset(8% 0 0 0); transition-property: opacity, transform, clip-path; }
.m-on .m-reveal--img.m-in { transform: none; clip-path: inset(0 0 0 0); }
.m-on .grid .card { animation: none; } /* replaced by the staggered reveal */

/* ---------- 3D tilt (product cards, category tiles, two-up edits) ---------- */
.m-tilt .card__media, .m-tilt .tile__img, .m-tilt .duo__img, .m-tilt .collection, .m-tilt .trend__tile {
  transform: perspective(900px) rotateX(var(--m-rx, 0deg)) rotateY(var(--m-ry, 0deg)) translateZ(0);
  transition: transform .5s var(--ease, cubic-bezier(.2, .7, .2, 1)), box-shadow .5s var(--ease, cubic-bezier(.2, .7, .2, 1)); will-change: transform; }
.m-tilt :is(.card__media, .tile__img, .duo__img, .collection, .trend__tile).is-tilting {
  transition-duration: .12s; box-shadow: 0 24px 40px -22px rgba(var(--shade, 0, 0, 0), .55); }
/* sheen only where the theme doesn't already use ::after */
.m-tilt :is(.card__media, .tile__img, .duo__img)::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(60% 60% at var(--m-mx, 50%) var(--m-my, 50%), rgba(255, 255, 255, .32), rgba(255, 255, 255, 0) 70%); mix-blend-mode: soft-light; }
.m-tilt :is(.card__media, .tile__img, .duo__img).is-tilting::after { opacity: 1; }
.m-tilt .tile__img, .m-tilt .duo__img { position: relative; }

/* ---------- parallax photos ---------- */
.m-on [data-m-parallax] { transform: translate3d(0, var(--m-py, 0px), 0) scale(var(--m-ps, 1.12)); }
.m-on .duo__img img[data-m-parallax] { transition: none; }
.m-on .duo__item:hover .duo__img img[data-m-parallax] { --m-ps: 1.16; }

/* ---------- product page: 3D photo stack (js/pdp3d.js) ---------- */
.pdp__main { position: relative; }
.pdp__main.has-stack > #mainImg { display: none; }
.stack { position: absolute; inset: 0; perspective: 1400px; overflow: hidden; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; outline: none; }
.stack:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }
.stack.is-dragging { cursor: grabbing; }
.stack .stack__card { position: absolute; top: 6%; left: 10%; width: 80%; height: 88%; object-fit: cover; transform-origin: 50% 50%;
  box-shadow: 0 30px 50px -30px rgba(var(--shade, 0, 0, 0), .6); -webkit-user-drag: none; }

/* ---------- product page: optional 3D model ---------- */
.pdp__3d-btn { position: absolute; z-index: 200; right: 12px; bottom: 12px; padding: .6rem 1rem; background: #fff; color: var(--ink); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .4); }
.pdp__3d-btn[aria-pressed="true"] { background: var(--brand, var(--ink)); color: #fff; }
.pdp__3d { position: absolute; inset: 0; z-index: 150; display: none; background: radial-gradient(80% 80% at 50% 40%, #fff, var(--cream)); }
.pdp__main.show-3d .pdp__3d { display: block; }
.pdp__3d canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.pdp__3d-status { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font-weight: 600; pointer-events: none; }
.pdp__3d-status[hidden] { display: none; }
