/* ============================================
   Animations & motion layer
   ============================================ */

@keyframes preload {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(1.05); }
}

@keyframes bubbleRise {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  8% { opacity: 1; }
  85% { opacity: 0.5; }
  100% { transform: translateY(-110vh) scale(0.4); opacity: 0; }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.8); }
  50% { opacity: 1; transform: scaleY(1); }
}

@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes meshShift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(2%, -1%) rotate(1deg); }
  66% { transform: translate(-1%, 2%) rotate(-1deg); }
}

@keyframes hopsFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.04; }
  50% { transform: translateY(-20px) rotate(5deg); opacity: 0.07; }
}

@keyframes liquidPulse {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(-4px) scaleY(1.02); }
}

@keyframes foamWave {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-8px); }
}

@keyframes iconGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(232, 168, 48, 0.3)); }
  50% { filter: drop-shadow(0 0 20px rgba(232, 168, 48, 0.6)); }
}

@keyframes docFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-12px) rotate(2deg); }
}

@keyframes pinBounce {
  0%, 100% { transform: rotate(-45deg) translateY(0); }
  50% { transform: rotate(-45deg) translateY(-8px); }
}

@keyframes drawStroke {
  from { stroke-dashoffset: 200; }
  to { stroke-dashoffset: 0; }
}

@keyframes wordReveal {
  from { transform: translateY(110%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes grainMove {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-2%, -2%); }
}

@keyframes condense {
  0%, 100% { opacity: 0; transform: translateY(0); }
  10%, 90% { opacity: 0.6; }
  50% { transform: translateY(8px); opacity: 0; }
}

/* Reveal system */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92) translateY(20px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible,
.reveal-scale.visible {
  opacity: 1;
  transform: none;
}

.reveal--delay-1 { transition-delay: 0.12s; }
.reveal--delay-2 { transition-delay: 0.24s; }
.reveal--delay-3 { transition-delay: 0.36s; }
.reveal--delay-4 { transition-delay: 0.48s; }

[data-stagger] > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-stagger].visible > *,
[data-stagger] > *.visible {
  opacity: 1;
  transform: none;
}

/* Icon draw on reveal */
.icon-draw svg {
  animation: iconGlow 4s ease-in-out infinite;
}

.icon-draw.visible svg use,
.icon-draw.visible svg path,
.icon-draw.visible svg circle {
  animation: drawStroke 1.2s ease forwards;
}

/* Hero words */
.hero__word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.hero__word-inner {
  display: inline-block;
  animation: wordReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.hero__word:nth-child(1) .hero__word-inner { animation-delay: 0.5s; }
.hero__word:nth-child(2) .hero__word-inner { animation-delay: 0.65s; }

/* Dynamic bubbles */
.hero__bubbles .bubble,
.hero__bubbles > span {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.25), rgba(255,255,255,0.05));
  border: 1px solid rgba(255,255,255,0.08);
  animation: bubbleRise linear infinite;
  bottom: -20px;
}

.hero__bubbles > span:nth-child(1) { width: 8px; height: 8px; left: 10%; animation-duration: 8s; }
.hero__bubbles > span:nth-child(2) { width: 12px; height: 12px; left: 20%; animation-duration: 10s; animation-delay: 1s; }
.hero__bubbles > span:nth-child(3) { width: 6px; height: 6px; left: 35%; animation-duration: 7s; animation-delay: 2s; }
.hero__bubbles > span:nth-child(4) { width: 10px; height: 10px; left: 50%; animation-duration: 9s; animation-delay: 0.5s; }
.hero__bubbles > span:nth-child(5) { width: 14px; height: 14px; left: 65%; animation-duration: 11s; animation-delay: 3s; }
.hero__bubbles > span:nth-child(6) { width: 7px; height: 7px; left: 78%; animation-duration: 8s; animation-delay: 1.5s; }
.hero__bubbles > span:nth-child(7) { width: 9px; height: 9px; left: 88%; animation-duration: 10s; animation-delay: 2.5s; }
.hero__bubbles > span:nth-child(8) { width: 5px; height: 5px; left: 95%; animation-duration: 6s; animation-delay: 4s; }

/* Cursor glow */
.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 134, 10, 0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 9998;
  mix-blend-mode: multiply;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal, .reveal-scale, [data-stagger] > * {
    opacity: 1;
    transform: none;
  }

  .cursor-glow { display: none; }
}
