/**
 * GOD'S PRICELESS JEWELS (GPJ) & GPJ KIDS
 * GPU-ACCELERATED MICRO-ANIMATIONS, TRANSITIONS & ANTI-AI FEEL ENGINE
 * 
 * Standard: ISO/IEC/IEEE 12207 SDLC · WCAG 2.2 AA SC 2.3.3 (Animation from Interactions)
 * Authority: GPJ Master Development Playbook (Micro-Step 18)
 * Performance Target: Steady 60 FPS on mobile 4G hardware (Zero Layout Trashing)
 * Target File: css/animations.css
 * 
 * RED FLAG ARCHITECTURAL RULE:
 * NEVER animate top, left, bottom, right, width, or height!
 * Animations strictly modulate `transform` (composited via GPU) and `opacity`.
 */

:root {
  /* ==========================================================================
     1. ORGANIC ANTI-AI TIMING CURVES (Springs & Luxury Editorial Deceleration)
     Avoids sterile linear/standard CSS easing in favor of natural human physics.
     ========================================================================== */
  --ease-luxury: cubic-bezier(0.16, 1, 0.3, 1);       /* Smooth luxury deceleration */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);    /* Tactile playful spring for Kids wing */
  --ease-gentle: cubic-bezier(0.25, 1, 0.5, 1);        /* Subtle warm presence */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);        /* Standard material curve */

  /* Duration Tokens */
  --anim-duration-instant: 120ms;
  --anim-duration-fast: 200ms;
  --anim-duration-normal: 350ms;
  --anim-duration-slow: 600ms;
  --anim-duration-ambient: 3000ms;
}

/* ==========================================================================
   2. HARDWARE ACCELERATION COMPOSITOR BASE
   Forces dedicated GPU render layers via 3D transform and backface isolation.
   ========================================================================== */
.gpu-accelerated,
.fade-in,
.slide-up,
.slide-down,
.slide-left,
.slide-right,
.scale-in,
.hover-lift,
.shimmer-gold,
.confetti-burst {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  perspective: 1000px;
  -webkit-perspective: 1000px;
}

/* ==========================================================================
   3. DELIVERABLE 1: .fade-in (Smooth Atmospheric Reveal)
   ========================================================================== */
@keyframes gpjFadeIn {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.fade-in {
  opacity: 0;
  animation: gpjFadeIn var(--anim-duration-normal, 350ms) var(--ease-luxury) forwards;
  will-change: opacity, transform;
}

/* ==========================================================================
   4. DELIVERABLE 2: .slide-up (Editorial Ascending Entrance)
   Elevates cards and section headers from 24px below with organic deceleration.
   ========================================================================== */
@keyframes gpjSlideUp {
  0% {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.slide-up {
  opacity: 0;
  animation: gpjSlideUp var(--anim-duration-slow, 600ms) var(--ease-luxury) forwards;
  will-change: transform, opacity;
}

/* Companion GPU Directional Entrances */
@keyframes gpjSlideDown {
  0% {
    opacity: 0;
    transform: translate3d(0, -20px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.slide-down {
  opacity: 0;
  animation: gpjSlideDown var(--anim-duration-normal, 350ms) var(--ease-luxury) forwards;
  will-change: transform, opacity;
}

@keyframes gpjSlideLeft {
  0% {
    opacity: 0;
    transform: translate3d(24px, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.slide-left {
  opacity: 0;
  animation: gpjSlideLeft var(--anim-duration-slow, 600ms) var(--ease-luxury) forwards;
  will-change: transform, opacity;
}

@keyframes gpjSlideRight {
  0% {
    opacity: 0;
    transform: translate3d(-24px, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.slide-right {
  opacity: 0;
  animation: gpjSlideRight var(--anim-duration-slow, 600ms) var(--ease-luxury) forwards;
  will-change: transform, opacity;
}

@keyframes gpjScaleIn {
  0% {
    opacity: 0;
    transform: scale3d(0.94, 0.94, 1);
  }
  100% {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}

.scale-in {
  opacity: 0;
  animation: gpjScaleIn var(--anim-duration-normal, 350ms) var(--ease-luxury) forwards;
  will-change: transform, opacity;
}

/* ==========================================================================
   5. STAGGERED ENTRANCE DELAYS (Cascading Fluidity)
   ========================================================================== */
.delay-75  { animation-delay: 75ms; }
.delay-100 { animation-delay: 100ms; }
.delay-150 { animation-delay: 150ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }

/* ==========================================================================
   6. DELIVERABLE 3: .shimmer-gold (Luxury Sovereign Gold Ambient Glisten)
   Runs completely on the GPU compositor via pseudo-element 3D translation.
   Zero repaint and zero layout reflow.
   ========================================================================== */
@keyframes gpjShimmerGleam {
  0% {
    transform: translate3d(-150%, 0, 0) skewX(-20deg);
  }
  100% {
    transform: translate3d(250%, 0, 0) skewX(-20deg);
  }
}

.shimmer-gold {
  position: relative;
  overflow: hidden;
  will-change: transform;
}

.shimmer-gold::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(197, 160, 89, 0) 30%,
    rgba(224, 194, 130, 0.38) 50%,
    rgba(197, 160, 89, 0) 70%,
    transparent 100%
  );
  transform: translate3d(-150%, 0, 0) skewX(-20deg);
  animation: gpjShimmerGleam 2.8s infinite cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  will-change: transform;
}

/* Subtle Shimmer Variation for Cards & Badges */
.shimmer-gold-hover {
  position: relative;
  overflow: hidden;
}

.shimmer-gold-hover::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(224, 194, 130, 0.45) 50%,
    transparent 100%
  );
  transform: translate3d(-150%, 0, 0) skewX(-20deg);
  pointer-events: none;
  transition: transform 0.75s var(--ease-luxury);
  will-change: transform;
}

.shimmer-gold-hover:hover::after {
  transform: translate3d(200%, 0, 0) skewX(-20deg);
}

/* ==========================================================================
   7. DELIVERABLE 4: .confetti-burst (Celebration Spring & Particle Pop)
   Used on Kids wing victories, prayer commitment triggers, and celebration gates.
   ========================================================================== */
@keyframes gpjConfettiBurst {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale3d(0.3, 0.3, 1) rotate(0deg);
  }
  30% {
    opacity: 1;
    transform: translate3d(0, -18px, 0) scale3d(1.15, 1.15, 1) rotate(-8deg);
  }
  65% {
    opacity: 1;
    transform: translate3d(0, -6px, 0) scale3d(0.96, 0.96, 1) rotate(4deg);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale3d(1, 1, 1) rotate(0deg);
  }
}

.confetti-burst {
  animation: gpjConfettiBurst 0.65s var(--ease-spring) forwards;
  will-change: transform, opacity;
}

/* Micro-Particle Bursts */
@keyframes particleFloat1 {
  0%   { transform: translate3d(0, 0, 0) scale(0); opacity: 1; }
  50%  { transform: translate3d(-24px, -36px, 0) scale(1.2) rotate(45deg); opacity: 1; }
  100% { transform: translate3d(-36px, -48px, 0) scale(0.8) rotate(90deg); opacity: 0; }
}

@keyframes particleFloat2 {
  0%   { transform: translate3d(0, 0, 0) scale(0); opacity: 1; }
  50%  { transform: translate3d(26px, -40px, 0) scale(1.3) rotate(-35deg); opacity: 1; }
  100% { transform: translate3d(40px, -52px, 0) scale(0.7) rotate(-70deg); opacity: 0; }
}

@keyframes particleFloat3 {
  0%   { transform: translate3d(0, 0, 0) scale(0); opacity: 1; }
  50%  { transform: translate3d(-10px, -44px, 0) scale(1.1) rotate(60deg); opacity: 1; }
  100% { transform: translate3d(-14px, -58px, 0) scale(0.6) rotate(120deg); opacity: 0; }
}

.confetti-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  will-change: transform, opacity;
}

.confetti-particle-1 { animation: particleFloat1 0.75s var(--ease-luxury) forwards; background: var(--gpj-gold, #C5A059); }
.confetti-particle-2 { animation: particleFloat2 0.8s var(--ease-luxury) forwards; background: var(--gpj-fuchsia, #D61C4E); }
.confetti-particle-3 { animation: particleFloat3 0.7s var(--ease-luxury) forwards; background: var(--gpj-burgundy, #4A1525); }
.confetti-particle-4 { animation: particleFloat1 0.85s var(--ease-luxury) forwards; background: #FFB703; }
.confetti-particle-5 { animation: particleFloat2 0.75s var(--ease-luxury) forwards; background: #0284C7; }

/* ==========================================================================
   8. ANTI-AI HUMANIZED MICRO-INTERACTIONS & TACTILE FEEDBACK
   Subtle physical behaviors that eliminate the cold robotic "AI template" look.
   ========================================================================== */

/* Tactile Elevation (Smooth 4px lift with shadow expansion) */
.hover-lift {
  transition: transform 0.25s var(--ease-luxury),
              box-shadow 0.25s var(--ease-luxury);
  will-change: transform, box-shadow;
}

.hover-lift:hover {
  transform: translate3d(0, -4px, 0);
  box-shadow: 0 14px 28px -6px rgba(26, 26, 26, 0.12),
              0 8px 12px -4px rgba(26, 26, 26, 0.06);
}

/* Tactile Click / Tap Compression (Spring Press) */
.active-press,
.btn-press {
  transition: transform 0.12s var(--ease-spring);
  will-change: transform;
}

.active-press:active,
.btn-press:active {
  transform: scale3d(0.97, 0.97, 1);
}

/* Ambient Sovereign Gold Halo */
.hover-glow-gold {
  transition: box-shadow 0.3s var(--ease-luxury),
              transform 0.3s var(--ease-luxury);
  will-change: box-shadow, transform;
}

.hover-glow-gold:hover {
  box-shadow: 0 0 24px rgba(197, 160, 89, 0.42);
  transform: translate3d(0, -2px, 0);
}

/* Deep Imperial Burgundy Presence Halo */
.hover-glow-burgundy {
  transition: box-shadow 0.3s var(--ease-luxury),
              transform 0.3s var(--ease-luxury);
  will-change: box-shadow, transform;
}

.hover-glow-burgundy:hover {
  box-shadow: 0 0 28px rgba(74, 21, 37, 0.32);
  transform: translate3d(0, -2px, 0);
}

/* Image Card Ken Burns Reveal (Controlled GPU Scale) */
.image-reveal-container {
  overflow: hidden;
  position: relative;
}

.image-reveal-container img,
.image-reveal-container .reveal-image {
  transition: transform 0.65s var(--ease-luxury);
  will-change: transform;
  transform: scale3d(1, 1, 1);
}

.image-reveal-container:hover img,
.image-reveal-container:hover .reveal-image {
  transform: scale3d(1.05, 1.05, 1);
}

/* Breathing Sacred Pulse (For Live Sanctuary Prayer & Badges) */
@keyframes gpjPulseGentle {
  0%, 100% {
    transform: scale3d(1, 1, 1);
    opacity: 1;
  }
  50% {
    transform: scale3d(1.04, 1.04, 1);
    opacity: 0.88;
  }
}

.pulse-gentle {
  animation: gpjPulseGentle 2.6s ease-in-out infinite;
  will-change: transform, opacity;
}

/* Kids Wing Neo-Brutalist Sticker Wiggle */
@keyframes gpjStickerWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-2.5deg); }
  75% { transform: rotate(2.5deg); }
}

.sticker-wiggle:hover {
  animation: gpjStickerWiggle 0.4s var(--ease-spring);
  will-change: transform;
}

/* ==========================================================================
   9. DELIVERABLE 5: MOTION ACCESSIBILITY (WCAG 2.2 AA SC 2.3.3)
   Instantaneous disablement for users with prefers-reduced-motion: reduce.
   Zero lag, zero stuck opacities, zero vestibular triggers.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .fade-in,
  .slide-up,
  .slide-down,
  .slide-left,
  .slide-right,
  .scale-in,
  .confetti-burst {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  .shimmer-gold::after,
  .shimmer-gold-hover::after {
    display: none !important;
    animation: none !important;
  }

  .hover-lift:hover,
  .hover-glow-gold:hover,
  .hover-glow-burgundy:hover,
  .image-reveal-container:hover img,
  .sticker-wiggle:hover {
    transform: none !important;
  }

  .pulse-gentle {
    animation: none !important;
    transform: none !important;
  }
}
