/*
 * Digital Reef — Animation Library
 * Nature-inspired micro-interactions for reef-themed UIs.
 *
 * Usage:
 *   <link rel="stylesheet" href="path/to/dr-branding/styles/animations.css">
 *   <div class="dr-animate-wave">...</div>
 *
 * Respects prefers-reduced-motion automatically.
 */

/* ─── Wave — gentle vertical bob ─── */
.dr-animate-wave {
  animation: dr-wave 3s ease-in-out infinite;
}
@keyframes dr-wave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ─── Float — organic drifting ─── */
.dr-animate-float {
  animation: dr-float 6s ease-in-out infinite;
}
@keyframes dr-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-8px) rotate(1deg); }
  66% { transform: translateY(4px) rotate(-1deg); }
}

/* ─── Contour — slow background shift (echoes topographic patterns) ─── */
.dr-animate-contour {
  background-size: 200% 200%;
  animation: dr-contour 8s ease-in-out infinite;
}
@keyframes dr-contour {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ─── Shimmer — light sweep across element ─── */
.dr-animate-shimmer {
  position: relative;
  overflow: hidden;
}
.dr-animate-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 100%
  );
  animation: dr-shimmer 3s ease-in-out infinite;
}
@keyframes dr-shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ─── Bubble Rise — particles floating upward ─── */
.dr-animate-bubble-rise {
  animation: dr-bubble-rise 4s ease-in infinite;
}
@keyframes dr-bubble-rise {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-120px) scale(0.6);
    opacity: 0;
  }
}

/* ─── Current Flow — horizontal drift like ocean current ─── */
.dr-animate-current {
  animation: dr-current 10s linear infinite;
}
@keyframes dr-current {
  0% { transform: translateX(0); }
  50% { transform: translateX(20px); }
  100% { transform: translateX(0); }
}

/* ─── Bioluminescent Pulse — gentle glow throb ─── */
.dr-animate-bioluminescent {
  animation: dr-bioluminescent 2s ease-in-out infinite;
}
@keyframes dr-bioluminescent {
  0%, 100% {
    box-shadow: 0 0 5px rgba(86, 109, 73, 0.2),
                0 0 15px rgba(86, 109, 73, 0.1);
  }
  50% {
    box-shadow: 0 0 15px rgba(86, 109, 73, 0.4),
                0 0 40px rgba(86, 109, 73, 0.2),
                0 0 60px rgba(137, 177, 204, 0.1);
  }
}

/* ─── Tide — horizontal sway like water ─── */
.dr-animate-tide {
  animation: dr-tide 5s ease-in-out infinite;
}
@keyframes dr-tide {
  0%, 100% { transform: translateX(0) skewX(0deg); }
  25% { transform: translateX(5px) skewX(0.5deg); }
  75% { transform: translateX(-5px) skewX(-0.5deg); }
}

/* ─── Fade In variants ─── */
.dr-animate-fade-in {
  animation: dr-fade-in 0.5s ease-out forwards;
}
.dr-animate-fade-in-up {
  animation: dr-fade-in-up 0.5s ease-out forwards;
}
.dr-animate-fade-in-down {
  animation: dr-fade-in-down 0.5s ease-out forwards;
}
@keyframes dr-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes dr-fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes dr-fade-in-down {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Stagger delays for lists ─── */
.dr-stagger-1 { animation-delay: 0.1s; }
.dr-stagger-2 { animation-delay: 0.2s; }
.dr-stagger-3 { animation-delay: 0.3s; }
.dr-stagger-4 { animation-delay: 0.4s; }
.dr-stagger-5 { animation-delay: 0.5s; }
.dr-stagger-6 { animation-delay: 0.6s; }

/* ─── Respects reduced motion preference ─── */
@media (prefers-reduced-motion: reduce) {
  .dr-animate-wave,
  .dr-animate-float,
  .dr-animate-contour,
  .dr-animate-shimmer,
  .dr-animate-shimmer::after,
  .dr-animate-bubble-rise,
  .dr-animate-current,
  .dr-animate-bioluminescent,
  .dr-animate-tide,
  .dr-animate-fade-in,
  .dr-animate-fade-in-up,
  .dr-animate-fade-in-down {
    animation: none !important;
  }
}
