/* motion.css */

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

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

@keyframes typing-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes receipt-line {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.hero-visual .phone-frame {
  animation: phone-float 4s ease-in-out infinite;
  transform-origin: center center;
}

.hero-lofi {
  animation: lofi-wave 3.5s ease-in-out infinite;
  transform-origin: center bottom;
}

@media (max-width: 767px) {
  .hero-visual .phone-frame {
    animation: none;
  }
}

@keyframes lofi-wave {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(-2deg); }
}

.imessage-bubble.is-visible {
  transition: opacity 0.35s var(--ease-spring, ease),
              transform 0.35s var(--ease-spring, ease);
}

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

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease-out, ease),
              transform 0.5s var(--ease-out, ease);
}

.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0ms; opacity: 1; transform: none; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 80ms; opacity: 1; transform: none; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 160ms; opacity: 1; transform: none; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 240ms; opacity: 1; transform: none; }

.bento-tile.is-open .receipt-row {
  animation: receipt-line 0.4s var(--ease-out, ease) backwards;
}

.bento-tile.is-open .receipt-row:nth-child(1) { animation-delay: 0.05s; }
.bento-tile.is-open .receipt-row:nth-child(2) { animation-delay: 0.1s; }
.bento-tile.is-open .receipt-row:nth-child(3) { animation-delay: 0.15s; }
.bento-tile.is-open .receipt-row:nth-child(4) { animation-delay: 0.2s; }
.bento-tile.is-open .receipt-row:nth-child(5) { animation-delay: 0.25s; }

@media (prefers-reduced-motion: reduce) {
  .hero-visual .phone-frame { animation: none; }
  .hero-lofi { animation: none; }
  .ticker-track { animation: none !important; }
  .reveal, .reveal-stagger > *,
  .imessage-bubble,
  .bento-tile.is-open .receipt-row {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
  .imessage-typing span { animation: none; }
}
