/* ==========================================================================
   MI Brothers Tech — Motion
   Keyframes + reveal states. GSAP drives scroll reveals when loaded;
   these CSS fallbacks keep everything working without it.
   ========================================================================== */

/* Scroll reveal (fallback & initial state). The .motion-ready class is only
   added by animations.js, so content is never hidden if JS fails. */
.motion-ready [data-reveal] { opacity: 0; transform: translateY(28px); }
.motion-ready [data-reveal="left"] { transform: translateX(-36px); }
.motion-ready [data-reveal="right"] { transform: translateX(36px); }
.motion-ready [data-reveal="zoom"] { transform: scale(.94); }
.motion-ready.no-gsap [data-reveal] { transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--reveal-delay, 0s); }
.motion-ready [data-reveal].is-revealed { opacity: 1; transform: none; }

/* Word-by-word headline reveal */
.split-word { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; margin-bottom: -.08em; }
.split-word > span { display: inline-block; will-change: transform; }

/* Animated gradient background on dark sections */
.section--dark, .cta-band, .voice-shell { background-size: 180% 180%; animation: gradient-shift 16s ease-in-out infinite alternate; }

/* Floating cards (CSS fallback if GSAP is absent) */
.no-gsap .float-card { animation: float 6s ease-in-out infinite; }
.no-gsap .float-card:nth-of-type(2) { animation-delay: -1.5s; }
.no-gsap .float-card:nth-of-type(3) { animation-delay: -3s; }
.no-gsap .float-card:nth-of-type(4) { animation-delay: -4.5s; }

/* Page load fade */
body { animation: page-in .5s var(--ease) both; }

@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes page-cover { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes pulse-dot { 0% { box-shadow: 0 0 0 0 rgba(37, 185, 165, .6); } 70% { box-shadow: 0 0 0 8px rgba(37, 185, 165, 0); } 100% { box-shadow: 0 0 0 0 rgba(37, 185, 165, 0); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes flow-dash { to { background-position: 22px 0; } }
@keyframes flow-dash-svg { to { stroke-dashoffset: -26; } }
@keyframes wave { 0%, 100% { height: 25%; } 50% { height: 100%; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
@keyframes ring { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.45); opacity: 0; } }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(14px); } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes gradient-shift { 0% { background-position: 0% 0%; } 100% { background-position: 100% 100%; } }

/* ---------- Reduced motion: honour user preference ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .motion-ready [data-reveal] { opacity: 1 !important; transform: none !important; }
  .marquee-track { animation: none !important; }
}
