/* ==========================================================================
   Motion. Everything here is switched off for prefers-reduced-motion.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  /* Hero waves drifting sideways */
  .hero__waves .w1 {
    animation: wave-drift 18s linear infinite;
  }

  .hero__waves .w2 {
    animation: wave-drift 26s linear infinite reverse;
  }

  /* Water inside the hero bottle */
  .bottle-wave {
    animation: bottle-wave 6s linear infinite;
  }

  .bottle-wave--back {
    animation-duration: 9s;
    animation-direction: reverse;
  }

  .bottle-float {
    animation: bob 7s ease-in-out infinite;
    transform-origin: center;
  }

  .drop {
    animation: rise 7s ease-in infinite;
    opacity: 0;
  }

  .drop:nth-of-type(2) {
    animation-delay: 2.2s;
  }

  .drop:nth-of-type(3) {
    animation-delay: 4.1s;
  }

  .sun-glow {
    animation: glow 6s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
  }

  /* Scroll reveal — only hidden when scripting is available to reveal it again */
  @media (scripting: enabled) {
    .reveal {
      opacity: 0;
      transform: translateY(18px);
      transition: opacity 640ms var(--ease), transform 640ms var(--ease);
      transition-delay: var(--reveal-delay, 0ms);
    }

    .reveal.is-visible {
      opacity: 1;
      transform: none;
    }
  }
}

@keyframes wave-drift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes bottle-wave {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-160px);
  }
}

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

@keyframes rise {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  15% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateY(-120px);
  }
}

@keyframes glow {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.8;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
