/* ══════════════════════════════════════════════
   ANIMATIONS — Keyframes, Scroll Reveals, Transitions
   ══════════════════════════════════════════════ */

/* ── Page Load Keyframes ── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pawBounce {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(-5deg); }
}

@keyframes wag {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
}

/* ── Staggered Load Sequence ── */
.load-animate {
  opacity: 0;
  animation: fadeUp 0.6s var(--ease-out) forwards;
}

.load-animate:nth-child(1) { animation-delay: 0.1s; }
.load-animate:nth-child(2) { animation-delay: 0.2s; }
.load-animate:nth-child(3) { animation-delay: 0.3s; }
.load-animate:nth-child(4) { animation-delay: 0.4s; }
.load-animate:nth-child(5) { animation-delay: 0.5s; }
.load-animate:nth-child(6) { animation-delay: 0.6s; }

/* ── Scroll Reveal Classes ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal--left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal--right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal--scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal--rotate {
  opacity: 0;
  transform: rotate(-2deg) translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

/* Revealed state */
.reveal.revealed,
.reveal--left.revealed,
.reveal--right.revealed,
.reveal--scale.revealed,
.reveal--rotate.revealed {
  opacity: 1;
  transform: none;
}

/* Stagger delays for children */
.stagger-children > .reveal:nth-child(1),
.stagger-children > *:nth-child(1) .reveal { transition-delay: 0s; }
.stagger-children > .reveal:nth-child(2),
.stagger-children > *:nth-child(2) .reveal { transition-delay: 0.1s; }
.stagger-children > .reveal:nth-child(3),
.stagger-children > *:nth-child(3) .reveal { transition-delay: 0.15s; }
.stagger-children > .reveal:nth-child(4),
.stagger-children > *:nth-child(4) .reveal { transition-delay: 0.2s; }
.stagger-children > .reveal:nth-child(5),
.stagger-children > *:nth-child(5) .reveal { transition-delay: 0.25s; }
.stagger-children > .reveal:nth-child(6),
.stagger-children > *:nth-child(6) .reveal { transition-delay: 0.3s; }
.stagger-children > .reveal:nth-child(7),
.stagger-children > *:nth-child(7) .reveal { transition-delay: 0.35s; }
.stagger-children > .reveal:nth-child(8),
.stagger-children > *:nth-child(8) .reveal { transition-delay: 0.4s; }

/* ── Decorative Animations ── */
.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-wiggle {
  animation: wiggle 2s ease-in-out infinite;
}

.animate-paw {
  animation: pawBounce 2s ease-in-out infinite;
}

.animate-wag {
  animation: wag 0.5s ease-in-out infinite;
}

/* ── Custom Cursor ── */
@media (hover: hover) and (pointer: fine) {
  .cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    background: var(--color-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transition: width 0.3s var(--ease-out),
                height 0.3s var(--ease-out),
                background 0.3s var(--ease-out),
                opacity 0.3s var(--ease-out);
    transform: translate(-50%, -50%);
    mix-blend-mode: normal;
    opacity: 0;
  }

  .cursor.visible {
    opacity: 1;
  }

  .cursor.expanded {
    width: 44px;
    height: 44px;
    background: var(--color-primary-ghost);
    border: 2px solid var(--color-primary);
  }

  body.custom-cursor {
    cursor: none;
  }

  body.custom-cursor a,
  body.custom-cursor button,
  body.custom-cursor [role="button"],
  body.custom-cursor input,
  body.custom-cursor textarea,
  body.custom-cursor select {
    cursor: none;
  }
}

/* ── Back to Top Button ── */
.back-to-top {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-base);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--color-primary-dark);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* ── Image Hover Zoom ── */
.img-zoom {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.img-zoom img {
  transition: transform 0.6s var(--ease-out);
  will-change: transform;
}

.img-zoom:hover img {
  transform: scale(1.04);
}

/* ── Parallax Layer ── */
.parallax-layer {
  will-change: transform;
}

/* ── Decorative Paw Prints ── */
.paw-accent {
  position: absolute;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}

.paw-accent--1 {
  top: 10%;
  right: 5%;
  width: 80px;
  transform: rotate(25deg);
}

.paw-accent--2 {
  bottom: 15%;
  left: 3%;
  width: 60px;
  transform: rotate(-15deg);
}

.paw-accent--3 {
  top: 50%;
  right: 8%;
  width: 50px;
  transform: rotate(45deg);
}
