/* Kayzit motion + cursor layer */

/* Ambient page orbs */
.page-overlay {
  overflow: hidden;
}

.page-overlay::before,
.page-overlay::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.55;
  animation: ambient-drift 18s var(--ease-in-out) infinite alternate;
  will-change: transform;
}

.page-overlay::before {
  width: min(42vw, 420px);
  height: min(42vw, 420px);
  top: 8%;
  left: 6%;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.35), transparent 70%);
}

.page-overlay::after {
  width: min(48vw, 480px);
  height: min(48vw, 480px);
  right: 4%;
  bottom: 12%;
  background: radial-gradient(circle, rgba(31, 111, 241, 0.32), transparent 68%);
  animation-delay: -6s;
  animation-duration: 22s;
}

.ambient-blob {
  position: fixed;
  width: min(36vw, 360px);
  height: min(36vw, 360px);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(56px);
  opacity: 0.4;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.28), transparent 70%);
  animation: ambient-drift 20s var(--ease-in-out) infinite alternate;
  animation-delay: -3s;
}

@keyframes ambient-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(4%, -3%, 0) scale(1.08);
  }
  100% {
    transform: translate3d(-3%, 4%, 0) scale(0.96);
  }
}

/* Scroll reveal */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity var(--dur-enter) var(--ease-out-expo),
    transform var(--dur-enter) var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Custom cursor — fine pointer only */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: var(--z-cursor);
  border-radius: 50%;
  transform: translate3d(-50%, -50%, 0);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.cursor-dot {
  width: var(--cursor-size);
  height: var(--cursor-size);
  background: linear-gradient(145deg, #8ec0ff, #b08cff);
  box-shadow: 0 0 18px rgba(142, 192, 255, 0.7);
  mix-blend-mode: screen;
}

.cursor-ring {
  width: var(--cursor-ring);
  height: var(--cursor-ring);
  border: 1.5px solid rgba(31, 111, 241, 0.55);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(2px);
  transition:
    width 0.22s var(--ease-spring),
    height 0.22s var(--ease-spring),
    border-color 0.22s ease,
    background 0.22s ease,
    opacity 0.2s ease;
}

html.has-custom-cursor,
html.has-custom-cursor body,
html.has-custom-cursor a,
html.has-custom-cursor button {
  cursor: none;
}

html.has-custom-cursor .cursor-dot,
html.has-custom-cursor .cursor-ring {
  opacity: 1;
}

html.has-custom-cursor.is-cursor-hover .cursor-ring {
  width: 52px;
  height: 52px;
  border-color: rgba(124, 92, 255, 0.75);
  background: rgba(124, 92, 255, 0.1);
}

html.has-custom-cursor.is-cursor-down .cursor-dot {
  transform: translate3d(-50%, -50%, 0) scale(0.72);
}

html.has-custom-cursor.is-cursor-down .cursor-ring {
  width: 28px;
  height: 28px;
  border-color: rgba(236, 72, 153, 0.8);
}

/* Click ripple */
.click-ripple {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  pointer-events: none;
  z-index: calc(var(--z-cursor) - 1);
  transform: translate3d(-50%, -50%, 0) scale(0);
  background: radial-gradient(circle, rgba(124, 92, 255, 0.45), rgba(31, 111, 241, 0.12) 55%, transparent 70%);
  animation: click-ripple-out 0.55s var(--ease-out-expo) forwards;
}

@keyframes click-ripple-out {
  0% {
    opacity: 0.9;
    transform: translate3d(-50%, -50%, 0) scale(0.4);
  }
  100% {
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) scale(18);
  }
}

/* Magnetic press feedback */
[data-magnetic] {
  transition: transform var(--dur-base) var(--ease-spring);
  will-change: transform;
}

/* Shine sweep on cards */
.product-card {
  position: relative;
  isolation: isolate;
}

.product-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255, 255, 255, 0.28) 48%,
    transparent 62%
  );
  transform: translateX(-120%) skewX(-12deg);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 3;
}

.product-card:hover::after {
  opacity: 1;
  animation: card-shine 0.85s var(--ease-out-expo);
}

@keyframes card-shine {
  from {
    transform: translateX(-120%) skewX(-12deg);
  }
  to {
    transform: translateX(140%) skewX(-12deg);
  }
}

/* Hero spotlight follows pointer (set via CSS vars) */
.hero-shell {
  --spot-x: 72%;
  --spot-y: 28%;
}

.hero-shell .hero-spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    420px circle at var(--spot-x) var(--spot-y),
    rgba(124, 92, 255, 0.28),
    transparent 55%
  );
  transition: background 0.12s linear;
  mix-blend-mode: screen;
}

/* Top bar sticky polish */
.top-bar {
  position: sticky;
  top: 0.65rem;
  z-index: 40;
  transition:
    box-shadow var(--dur-base) ease,
    background var(--dur-base) ease,
    transform var(--dur-base) var(--ease-spring);
}

.top-bar.is-scrolled {
  box-shadow: 0 16px 40px rgba(17, 34, 60, 0.16);
  background: rgba(255, 255, 255, 0.92);
}

/* Modal backdrop fade */
.product-detail-backdrop {
  opacity: 0;
  transition: opacity 0.28s var(--ease-out-expo);
}

.product-detail-overlay.is-open .product-detail-backdrop {
  opacity: 1;
}

.product-detail-sheet {
  transition:
    transform 0.38s var(--ease-out-expo),
    opacity 0.32s var(--ease-out-expo);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .page-overlay::before,
  .page-overlay::after,
  .ambient-blob {
    animation: none !important;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .product-card::after {
    display: none;
  }

  .click-ripple {
    display: none;
  }

  html.has-custom-cursor,
  html.has-custom-cursor body,
  html.has-custom-cursor a,
  html.has-custom-cursor button {
    cursor: auto;
  }

  .cursor-dot,
  .cursor-ring {
    display: none !important;
  }
}

@media (hover: none), (pointer: coarse) {
  html.has-custom-cursor,
  html.has-custom-cursor body,
  html.has-custom-cursor a,
  html.has-custom-cursor button {
    cursor: auto;
  }

  .cursor-dot,
  .cursor-ring {
    display: none !important;
  }

  [data-magnetic] {
    transform: none !important;
  }
}
