/* ==========================================================================
   PCNY x SKLUB: Art in Motion — v3 Coordinated Directional Scroll Choreography
   GPU-only opacity, transform, and clip-path using --ease-out
   ========================================================================== */

/* Base visible state without JS */
[data-reveal] {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

html.js-motion [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 22px, 0) scale(0.985);
  transition:
    opacity 540ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

/* Section 02: Commanding "You're invited." Pop-up + Damped Side-to-Side Wiggle */
@keyframes invitePopWiggle {
  0% {
    opacity: 0;
    transform: translate3d(0, 26px, 0) scale(0.9);
  }
  38% {
    opacity: 1;
    transform: translate3d(0, -3px, 0) scale(1.035);
  }
  54% {
    transform: translate3d(-7px, 0, 0) rotate(-1.4deg) scale(1.015);
  }
  68% {
    transform: translate3d(6px, 0, 0) rotate(1.1deg) scale(1.008);
  }
  82% {
    transform: translate3d(-3px, 0, 0) rotate(-0.5deg) scale(1);
  }
  92% {
    transform: translate3d(1.5px, 0, 0) rotate(0.2deg) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
}

html.js-motion [data-reveal='invite-pop'] {
  opacity: 0;
  transform: translate3d(0, 26px, 0) scale(0.9);
}

html.js-motion [data-reveal='invite-pop'].is-revealed {
  animation: invitePopWiggle 960ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Section 02 & Section Heads: Vertical lift */
html.js-motion [data-reveal='lift'] {
  transform: translate3d(0, 22px, 0);
}

/* Section 03: Alternating side glides with 45ms stagger */
html.js-motion [data-reveal='from-left'] {
  transform: translate3d(-24px, 0, 0);
  transition-delay: 45ms;
}

html.js-motion [data-reveal='from-right'] {
  transform: translate3d(24px, 0, 0);
  transition-delay: 45ms;
}

/* Section 04 & 05: Crisp card spring pop + lift */
html.js-motion [data-reveal='card'] {
  transform: scale(0.95) translate3d(0, 18px, 0);
  transition:
    opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 640ms cubic-bezier(0.34, 1.4, 0.64, 1);
}

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

/* GPU-Only clip-path: inset(...) Scroll Reveals for Photographic Chapters */
[data-clip-reveal] {
  clip-path: inset(0 0 0 0);
  opacity: 1;
}

html.js-motion [data-clip-reveal] {
  clip-path: inset(0 0 18% 0);
  opacity: 0.15;
  transform: translate3d(0, 14px, 0);
  transition:
    clip-path 760ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 540ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 680ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

html.js-motion [data-clip-reveal].is-revealed {
  clip-path: inset(0 0 0 0);
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Mobile WKWebView / Safari: avoid clip-path repaints during scroll; keep pure GPU transform + opacity */
@media (max-width: 767px) {
  html.js-motion [data-clip-reveal] {
    clip-path: none;
    opacity: 0;
    transform: translate3d(0, 16px, 0);
    transition:
      opacity var(--dur-reveal) var(--ease-out),
      transform var(--dur-reveal) var(--ease-out);
  }

  html.js-motion [data-clip-reveal].is-revealed {
    clip-path: none;
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Reduced Motion — Everything rests, nothing hidden, gentle fades only */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 120ms !important;
  }

  html.js-motion [data-reveal],
  html.js-motion [data-reveal='invite-pop'],
  html.js-motion [data-reveal='lift'],
  html.js-motion [data-reveal='from-left'],
  html.js-motion [data-reveal='from-right'],
  html.js-motion [data-reveal='card'],
  html.js-motion [data-clip-reveal] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: inset(0 0 0 0) !important;
    animation: none !important;
    transition: opacity 150ms ease !important;
  }

  .btn:active:not(:disabled):not([aria-disabled='true']),
  .stepper__btn:active:not(:disabled),
  .video-control-btn:active,
  .hero__scroll-cue:active,
  .text-action-btn:active,
  .site-footer__link:active,
  .media-frame:hover img {
    transform: none !important;
  }

  .drawer-panel {
    transform: none !important;
    transition: opacity 150ms ease !important;
  }
}
