/* ggnomz pop motion — tier 1–3 engagement (works with scroll-motion + reference-aesthetic) */

/* --- Richer reveal variants (scroll-motion adds classes) --- */
.motion-reveal--hero {
  transform: translate3d(0, 16px, 0) scale(0.94);
  transition-duration: 0.95s;
}

.motion-reveal--hero.motion-reveal--in {
  transform: translate3d(0, 0, 0) scale(1);
}

.motion-reveal--title {
  transform: translate3d(0, 14px, 0);
  transition-duration: 0.8s;
}

.motion-reveal--title.motion-reveal--in {
  transform: translate3d(0, 0, 0);
}

.motion-reveal--card {
  transform: translate3d(0, 24px, 0) rotate(-2.5deg);
  transform-origin: 50% 80%;
  transition-duration: 0.72s;
}

.motion-reveal--card.motion-reveal--in {
  transform: translate3d(0, 0, 0) rotate(0deg);
}

/* --- Parallax layers --- */
html.pop-motion-ready {
  --pop-parallax-sky: 0px;
  --pop-parallax-glow: 0px;
  --pop-parallax-deco: 0px;
}

html.pop-motion-ready body::before {
  transform: translate3d(0, var(--pop-parallax-glow), 0);
  transition: transform 0.12s linear;
}

html.pop-motion-ready .motion-sky {
  transform: translate3d(0, var(--pop-parallax-sky), 0);
  transition: transform 0.12s linear;
}

html.pop-motion-ready .feed-arrow-deco {
  transform: scaleY(-1) translateY(var(--pop-parallax-deco));
  transition: transform 0.12s linear;
}

/* --- Tier 1: spotlight lantern pulse --- */
.card.card--feed-spotlight {
  animation: pop-spotlight-breathe 3.4s ease-in-out infinite;
}

.card.card--feed-spotlight:hover {
  animation-duration: 2.2s;
}

@keyframes pop-spotlight-breathe {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.06);
  }
}

.pop-launch-spotlight-out {
  animation: pop-spotlight-exit 0.42s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

@keyframes pop-spotlight-exit {
  to {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
}

/* Launch feed entrance */
.pop-feed-enter {
  animation: pop-feed-wrap-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes pop-feed-wrap-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pop-feed-card-stagger {
  opacity: 0;
  transform: translateY(28px) scale(0.94) rotate(-1deg);
  animation: pop-feed-card-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--pop-i, 0) * 95ms + 80ms);
}

@keyframes pop-feed-card-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

/* Clip tile hover rim */
html.motion-feed-live [data-clip-slot],
html.motion-feed-live [data-clip-spotlight] {
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease !important;
}

html.motion-feed-live [data-clip-slot]:hover,
html.motion-feed-live [data-clip-spotlight]:hover {
  transform: translateY(-4px) scale(1.02) !important;
  box-shadow:
    0 0 0 1px rgba(212, 255, 122, 0.25),
    0 16px 40px rgba(8, 4, 24, 0.35),
    0 0 36px var(--glow-pink, rgba(255, 143, 212, 0.4)),
    0 0 56px var(--glow-violet, rgba(155, 140, 255, 0.35)) !important;
}

/* Button press squash */
.btn.pop-btn-press {
  transform: translateY(1px) scale(0.97) !important;
}

/* --- Tier 2: emoji chips --- */
.pop-emoji-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35em;
  height: 1.35em;
  margin: 0 0.12em;
  vertical-align: -0.15em;
  font-size: 1.05em;
  line-height: 1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 16px var(--glow-lime, rgba(212, 255, 122, 0.35));
}

.pop-emoji-chip.pop-emoji-chip--bounce {
  animation: pop-emoji-bounce 0.65s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes pop-emoji-bounce {
  0% {
    transform: scale(0.4) rotate(-12deg);
    opacity: 0;
  }
  70% {
    transform: scale(1.15) rotate(6deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* Featured player lens sweep */
.featured-player-panel.pop-featured-wake::before {
  animation:
    featured-player-aura-breathe 9s ease-in-out infinite,
    pop-lens-sweep 1.35s ease-out 0.15s 1 !important;
}

@keyframes pop-lens-sweep {
  0% {
    opacity: 0.35;
    filter: blur(24px);
    transform: scale(0.9) translateX(-18%);
  }
  45% {
    opacity: 0.85;
    filter: blur(20px);
    transform: scale(1.05) translateX(6%);
  }
  100% {
    opacity: 0.55;
    filter: blur(24px);
    transform: scale(1) translateX(0);
  }
}

/* Nom pop */
.pop-nom-burst {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -100%);
  font-size: 11px;
  font-weight: 800;
  color: var(--green, #d4ff7a);
  text-shadow: 0 0 12px var(--glow-lime, rgba(212, 255, 122, 0.5));
  pointer-events: none;
  animation: pop-nom-float 0.75s ease-out forwards;
  z-index: 5;
}

@keyframes pop-nom-float {
  0% {
    opacity: 1;
    transform: translate(-50%, -80%) scale(0.7);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -160%) scale(1.1);
  }
}

.vote.pop-nom-flash,
.clip-like__count.pop-nom-flash {
  animation: pop-nom-flash 0.45s ease-out;
}

@keyframes pop-nom-flash {
  0%,
  100% {
    filter: none;
  }
  40% {
    filter: drop-shadow(0 0 10px var(--green, #d4ff7a));
    transform: scale(1.12);
  }
}

.actions {
  position: relative;
}

/* Thumb loading shimmer */
.thumb.pop-thumb-loading::after {
  content: "snack incoming…";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.85);
  background: linear-gradient(
    110deg,
    rgba(40, 24, 78, 0.85) 0%,
    rgba(80, 50, 140, 0.5) 45%,
    rgba(40, 24, 78, 0.85) 90%
  );
  background-size: 220% 100%;
  animation: pop-shimmer 1.4s ease-in-out infinite;
  z-index: 2;
  pointer-events: none;
}

@keyframes pop-shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

/* --- Tier 3: cursor sparkles --- */
.pop-cursor-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}

.pop-cursor-particle {
  position: fixed;
  width: calc(11px * var(--pop-cursor-scale, 1));
  height: calc(11px * var(--pop-cursor-scale, 1));
  margin: calc(-5.5px * var(--pop-cursor-scale, 1)) 0 0
    calc(-5.5px * var(--pop-cursor-scale, 1));
  border-radius: 999px;
  background: var(--green, #d4ff7a);
  box-shadow:
    0 0 12px var(--glow-lime, rgba(212, 255, 122, 0.9)),
    0 0 28px var(--glow-lime, rgba(212, 255, 122, 0.55)),
    0 0 48px rgba(255, 255, 255, 0.15);
  animation: pop-cursor-fade 0.78s ease-out forwards;
  pointer-events: none;
}

.pop-cursor-particle--pink {
  width: calc(9px * var(--pop-cursor-scale, 1));
  height: calc(9px * var(--pop-cursor-scale, 1));
  background: var(--pink, #ff8fd4);
  box-shadow:
    0 0 14px var(--glow-pink, rgba(255, 143, 212, 0.85)),
    0 0 32px var(--glow-pink, rgba(255, 143, 212, 0.45));
}

.pop-cursor-particle--violet {
  width: calc(7px * var(--pop-cursor-scale, 1));
  height: calc(7px * var(--pop-cursor-scale, 1));
  background: var(--blue, #9b8cff);
  box-shadow:
    0 0 12px var(--glow-violet, rgba(155, 140, 255, 0.9)),
    0 0 26px var(--glow-violet, rgba(155, 140, 255, 0.5));
}

@keyframes pop-cursor-fade {
  0% {
    opacity: 1;
    transform: scale(0.35) translate(0, 0);
  }
  100% {
    opacity: 0;
    transform: scale(0.15) translateY(-28px) translateX(var(--pop-cursor-drift, 0));
  }
}

/* Page transition */
body.pop-page-exit {
  opacity: 0;
  transform: scale(0.992);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}

body.pop-page-enter {
  animation: pop-page-enter 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes pop-page-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card.card--feed-spotlight,
  .pop-feed-enter,
  .pop-feed-card-stagger,
  .pop-emoji-chip--bounce,
  .featured-player-panel.pop-featured-wake::before,
  body.pop-page-enter {
    animation: none !important;
  }

  .pop-launch-spotlight-out {
    animation: none !important;
    opacity: 0;
  }

  html.motion-feed-live [data-clip-slot]:hover {
    transform: none !important;
  }

  .thumb.pop-thumb-loading::after {
    animation: none;
    content: "loading…";
  }
}
