/* ==========================================================================
   LITTLE TODDLERS CRECHE — animations.css
   Keyframes, decorative motion, micro-interactions, reduced-motion guards
   ========================================================================== */

/* --------------------------------------------------------------------------
   KEYFRAMES
   -------------------------------------------------------------------------- */
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}
@keyframes float-y-sm {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes float-drift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  33%  { transform: translate(14px, -12px) rotate(4deg); }
  66%  { transform: translate(-10px, 8px) rotate(-3deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes cloud-slide {
  from { transform: translateX(-8%); }
  to   { transform: translateX(8%); }
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50%      { opacity: 1; transform: scale(1.1); }
}
@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: 0.75; }
  70%  { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}
@keyframes bounce-dot {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-16px); }
}
@keyframes ripple-out {
  to { transform: scale(3.2); opacity: 0; }
}
@keyframes pop-in {
  0%   { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes heart-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.45); }
  100% { transform: scale(1); }
}
@keyframes slide-in-item {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-in {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes toast-out {
  to { transform: translateY(16px); opacity: 0; }
}
@keyframes draw-circle { to { stroke-dashoffset: 0; } }
@keyframes draw-tick   { to { stroke-dashoffset: 0; } }
@keyframes gradient-pan {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes shimmer {
  0%   { background-position: -220% 0; }
  100% { background-position: 220% 0; }
}
@keyframes wobble {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(-5deg); }
  75%      { transform: rotate(5deg); }
}
@keyframes scroll-hint {
  0%   { transform: translateY(0); opacity: 0; }
  35%  { opacity: 1; }
  100% { transform: translateY(14px); opacity: 0; }
}

/* --------------------------------------------------------------------------
   DECORATIVE MOTION CLASSES
   -------------------------------------------------------------------------- */
.anim-float      { animation: float-y 6.5s ease-in-out infinite; }
.anim-float-slow { animation: float-y 9s ease-in-out infinite; }
.anim-float-sm   { animation: float-y-sm 4.5s ease-in-out infinite; }
.anim-drift      { animation: float-drift 16s ease-in-out infinite; }
.anim-cloud      { animation: cloud-slide 22s ease-in-out infinite alternate; }
.anim-twinkle    { animation: twinkle 3.4s ease-in-out infinite; }
.anim-spin-slow  { animation: spin-slow 34s linear infinite; }
.anim-wobble     { animation: wobble 5s ease-in-out infinite; }

.delay-1 { animation-delay: 0.4s; }
.delay-2 { animation-delay: 0.9s; }
.delay-3 { animation-delay: 1.4s; }
.delay-4 { animation-delay: 2s; }
.delay-5 { animation-delay: 2.6s; }

/* Animated gradient headline accent */
.grad-anim {
  background: linear-gradient(120deg, #00b3ff, #9333ff, #ff2d8e, #00e6a4, #00b3ff);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-pan 9s ease infinite;
}

/* Skeleton shimmer for lazy images */
.shimmer {
  background: linear-gradient(100deg, #f4f7fc 30%, #ffffff 50%, #f4f7fc 70%);
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}

/* Scroll hint mouse */
.scroll-hint {
  width: 26px; height: 42px;
  border: 2px solid var(--ink-300);
  border-radius: 14px;
  position: relative;
  margin-inline: auto;
  opacity: 0.7;
}
.scroll-hint::after {
  content: "";
  position: absolute;
  left: 50%; top: 8px;
  width: 4px; height: 8px;
  margin-left: -2px;
  border-radius: 3px;
  background: var(--ink-300);
  animation: scroll-hint 1.9s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   MICRO-INTERACTIONS
   -------------------------------------------------------------------------- */
/* Icon bounce on parent hover */
.hover-bounce:hover i,
.hover-bounce:focus-visible i { animation: bounce-dot 0.6s var(--ease-spring); }

/* Glow ring on hover */
.hover-glow { transition: box-shadow 0.45s var(--ease-out), transform 0.45s var(--ease-out); }
.hover-glow:hover { box-shadow: 0 0 0 4px rgba(0, 179, 255, 0.25), var(--sh-md); }

/* Image reveal (GSAP toggles .is-revealed; CSS fallback below) */
.reveal-img {
  position: relative;
  overflow: hidden;
}
.reveal-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--white);
  transform-origin: right;
  transform: scaleX(0);
}
.reveal-img.is-armed::after { transform: scaleX(1); transform-origin: left; }
.reveal-img.is-revealed::after {
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.95s var(--ease-out);
}

/* Text clip reveal used by Splitting.js / GSAP */
.split-line { display: block; overflow: hidden; }
.split-line > span { display: block; }

/* Marquee strip */
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: marquee-scroll 32s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1.05rem, 2vw, 1.5rem);
  color: var(--ink-300);
  white-space: nowrap;
}
.marquee__item i { color: var(--pink-600); font-size: 0.7em; }

/* Page transition curtain */
.page-curtain {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: var(--grad-soft);
  transform: translateY(100%);
  pointer-events: none;
}
.page-curtain.is-leaving {
  transform: translateY(0);
  transition: transform 0.55s var(--ease-out);
}

/* NOTE: deliberately no global `will-change` here. Promoting every animated
   element to its own GPU layer costs more memory than it saves, especially on
   phones. GSAP sets will-change per-tween while a tween is actually running. */

/* --------------------------------------------------------------------------
   REDUCED MOTION — respect user preference
   -------------------------------------------------------------------------- */
@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;
  }
  #particle-canvas { display: none; }
  .cursor-dot, .cursor-ring { display: none; }
  .reveal-img::after { display: none; }
}
