/* ============================================================
   LeakBox / Motion Layer
   Pure progressive enhancement: original shop styles and theme
   colors stay untouched. All effects honor reduced-motion.
   ============================================================ */

/* Ambient spotlight follows the pointer behind the whole page. */
.ambient__spotlight {
  position: absolute;
  top: 0;
  left: 0;
  width: min(680px, 80vw);
  height: min(680px, 80vw);
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-18) 0%, var(--accent-08) 29%, transparent 72%);
  filter: blur(35px);
  opacity: .54;
  transform: translate3d(var(--motion-pointer-x, 44vw), var(--motion-pointer-y, 3vh), 0) translate(-50%, -50%);
  will-change: transform;
  pointer-events: none;
}
.ambient__grid {
  transform: translate3d(0, var(--motion-grid-y, 0px), 0);
  transition: transform .18s linear;
}

/* Frame with a luminous edge that slowly travels around the hero. */
.hero__frame {
  --hero-pointer-x: 55%;
  --hero-pointer-y: 30%;
  --hero-shift-x: 0px;
  --hero-shift-y: 0px;
  --hero-scroll-y: 0px;
  border-color: var(--line-accent);
  transition: box-shadow .8s var(--ease-out), border-color .5s var(--ease-out);
}
.hero__frame::after {
  content: '';
  position: absolute;
  z-index: 6;
  inset: 0;
  border: 1px solid transparent;
  border-radius: inherit;
  background: conic-gradient(from var(--angle, 0deg), transparent 0 15%, var(--accent-45) 25%, transparent 34% 59%, color-mix(in srgb, var(--site-text) 35%, var(--accent)) 69%, transparent 80% 100%) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: spin-angle 16s linear infinite;
  pointer-events: none;
}
.hero__frame:hover {
  box-shadow: var(--shadow-lg), 0 0 105px var(--accent-18);
}
.hero__media img {
  animation: motion-hero-enter 1.8s var(--ease-out) both;
  transform: translate3d(var(--hero-shift-x), calc(var(--hero-shift-y) + var(--hero-scroll-y)), 0) scale(1.065);
  transition: transform .75s var(--ease-out);
  backface-visibility: hidden;
}
@keyframes motion-hero-enter {
  0% { transform: translate3d(0, 16px, 0) scale(1.18); opacity: .5; filter: brightness(.7); }
  100% { transform: translate3d(var(--hero-shift-x), calc(var(--hero-shift-y) + var(--hero-scroll-y)), 0) scale(1.065); opacity: 1; filter: brightness(1); }
}
.hero__motion-light,
.hero__motion-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.hero__motion-light {
  background: radial-gradient(520px circle at var(--hero-pointer-x) var(--hero-pointer-y), var(--accent-28), transparent 72%);
  mix-blend-mode: screen;
  opacity: .56;
  transition: opacity .45s ease;
}
.hero__frame:hover .hero__motion-light { opacity: .85; }
.hero__motion-scan {
  z-index: 2;
  inset: -40% -10%;
  background: linear-gradient(160deg, transparent 42%, color-mix(in srgb, var(--site-text) 7%, transparent) 49%, var(--accent-08) 50%, transparent 57%);
  transform: translate3d(-70%, 0, 0);
  animation: motion-scan-pass 11s ease-in-out 1.5s infinite;
  opacity: .8;
}
@keyframes motion-scan-pass {
  0%, 24% { transform: translate3d(-70%, 0, 0); }
  54%, 100% { transform: translate3d(75%, 0, 0); }
}

/* First-screen choreography: the site is readable even without JS. */
.site-header { animation: motion-header-enter .8s var(--ease-out) both; }
.hero__frame { animation: motion-frame-enter 1.1s var(--ease-out) both; }
.hero__content > * { animation: motion-copy-enter .9s var(--ease-out) both; }
.hero__content > :nth-child(1) { animation-delay: .45s; }
.hero__content > :nth-child(2) { animation-delay: .62s; }
.hero__content > :nth-child(3) { animation-delay: .78s; }
@keyframes motion-header-enter {
  from { opacity: 0; transform: translate3d(0, -26px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes motion-frame-enter {
  from { opacity: 0; transform: translate3d(0, 24px, 0) scale(.982); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes motion-copy-enter {
  from { opacity: 0; transform: translate3d(0, 19px, 0); filter: blur(5px); }
  to { opacity: 1; transform: translate3d(0, 0, 0); filter: blur(0); }
}

/* Smooth sequenced entrances for the rest of the storefront. */
.motion-ready .motion-reveal {
  opacity: 0;
  transform: translate3d(0, var(--motion-enter-distance, 30px), 0) scale(.985);
  filter: blur(5px);
  transition: opacity .85s var(--ease-out), transform .9s var(--ease-out), filter .8s var(--ease-out);
  transition-delay: var(--motion-delay, 0ms);
}
.motion-ready .motion-reveal.is-motion-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}
.motion-ready .motion-reveal.section-head { --motion-enter-distance: 22px; }
.motion-ready .motion-reveal.footer-bottom { --motion-enter-distance: 12px; }

/* A sweep across section dividers and price tags when hovered. */
.section-head__rule { position: relative; overflow: hidden; }
.section-head__rule::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 35%;
  background: linear-gradient(90deg, transparent, var(--accent-70), transparent);
  transform: translateX(-130%);
  animation: motion-rule-pulse 7s ease-in-out infinite;
}
@keyframes motion-rule-pulse {
  0%, 42% { transform: translateX(-130%); }
  76%, 100% { transform: translateX(390%); }
}

/* Cursor gravity is independent of existing :hover transforms. */
.motion-magnetic {
  translate: var(--magnet-x, 0px) var(--magnet-y, 0px);
  transition: translate .3s var(--ease-out), transform .25s var(--ease-out),
              box-shadow .25s var(--ease-out), background-color .25s var(--ease), border-color .25s var(--ease);
}
.motion-magnetic.is-magnet-active { transition-duration: .12s; }
.motion-ripple-host { position: relative; overflow: hidden; isolation: isolate; }
.motion-ripple {
  position: absolute;
  top: var(--ripple-y);
  left: var(--ripple-x);
  width: var(--ripple-size);
  height: var(--ripple-size);
  border-radius: 50%;
  background: color-mix(in srgb, var(--site-text) 32%, transparent);
  transform: translate(-50%, -50%) scale(0);
  opacity: .55;
  pointer-events: none;
  z-index: 10;
  animation: motion-ripple-expand .62s ease-out forwards;
}
@keyframes motion-ripple-expand {
  85% { opacity: .2; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* Rich, interactive catalog without interrupting purchase mechanics. */
.card { backface-visibility: hidden; }
.card__media { isolation: isolate; }
.card__media::after {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px solid var(--accent-18);
  border-radius: inherit;
  opacity: 0;
  transform: scale(.89) rotate(-5deg);
  transition: transform .65s var(--ease-out), opacity .5s var(--ease-out);
  pointer-events: none;
}
.card:hover .card__media::after { opacity: 1; transform: scale(1) rotate(0); }
.card:hover .card__price-value { text-shadow: 0 0 32px var(--accent-70); }
.card__price-value { transition: text-shadow .4s ease, color .4s ease; }
.card:hover .card__cta svg { animation: motion-cart-pop .45s var(--ease-out) both; }
@keyframes motion-cart-pop {
  0% { transform: translate3d(-7px, 5px, 0) scale(.8); opacity: .5; }
  100% { transform: none; opacity: 1; }
}
.shop-profile,
.shop-offer,
.hero-bar,
.footer-card { position: relative; }
.shop-profile,
.shop-offer {
  transition: border-color .4s ease, box-shadow .4s ease;
}
.shop-profile:hover,
.shop-offer:hover { border-color: var(--accent-70); box-shadow: var(--glow-md); }
.shop-offer-item:not(:disabled) {
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), border-color .3s ease;
}
.shop-offer-item:not(:disabled):hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-sm), var(--glow-sm);
}
.shop-offer-item:not(:disabled):active { transform: translateY(0) scale(.985); }

/* Modal sequence: preserve every original button, form and event handler. */
.modal.is-open .modal__preview { animation: motion-modal-side .6s .05s var(--ease-out) both; }
.modal.is-open .modal__form-side { animation: motion-modal-side .65s .12s var(--ease-out) both; }
@keyframes motion-modal-side {
  from { opacity: .5; transform: translate3d(0, 16px, 0); }
  to { opacity: 1; transform: none; }
}
.shop-profile-dialog[open] { animation: motion-dialog-show .4s var(--ease-out) both; }
@keyframes motion-dialog-show {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 760px) {
  .hero__motion-scan { opacity: .35; }
  .hero__motion-light { opacity: .4; }
  .ambient__spotlight { display: none; }
  .motion-ready .motion-reveal { --motion-enter-distance: 20px; filter: none; }
  .hero__media img { transform: scale(1.065); }
  @keyframes motion-hero-enter {
    from { transform: scale(1.14); opacity: .55; }
    to { transform: scale(1.065); opacity: 1; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header, .hero__frame, .hero__content > *, .hero__media img,
  .hero__frame::after, .hero__motion-scan, .section-head__rule::after,
  .modal.is-open .modal__preview, .modal.is-open .modal__form-side,
  .shop-profile-dialog[open] { animation: none !important; }
  .ambient__spotlight, .hero__motion-scan { display: none !important; }
  .ambient__grid { transform: none !important; }
  .hero__media img { transform: none !important; filter: none !important; }
  .motion-ready .motion-reveal, .motion-ready .motion-reveal.is-motion-visible {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  .motion-magnetic { translate: none !important; }
  .motion-ripple { display: none !important; }
}

/* Keep interactive hero copy above all decorative layers. */
.hero__vignette, .hero__embers { z-index: 3; }
.hero__content { z-index: 4; }
