/* ==========================================================================
   Jeshureatech — Animations & micro-interactions
   All motion is gated behind prefers-reduced-motion at the bottom.
   ========================================================================== */

/* ── Keyframes ──────────────────────────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translate3d(0, 26px, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: none; }
}
@keyframes slide-right {
  from { opacity: 0; transform: translate3d(-30px, 0, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes slide-left {
  from { opacity: 0; transform: translate3d(30px, 0, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes nav-item-in {
  to { opacity: 1; transform: none; }
}
@keyframes dot-progress {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(34, 211, 238, .65); }
  70%  { box-shadow: 0 0 0 10px rgba(34, 211, 238, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}
@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(24px, -18px, 0) scale(1.06); }
}
@keyframes shimmer {
  from { background-position: -220% 0; }
  to   { background-position: 220% 0; }
}
@keyframes dash-flow {
  to { stroke-dashoffset: -260; }
}
@keyframes wa-ping {
  0%, 100% { box-shadow: 0 10px 26px rgba(37, 211, 102, .38), 0 0 0 0 rgba(37, 211, 102, .55); }
  70%      { box-shadow: 0 10px 26px rgba(37, 211, 102, .38), 0 0 0 16px rgba(37, 211, 102, 0); }
}
@keyframes wave-bar {
  0%, 100% { transform: scaleY(.35); }
  50%      { transform: scaleY(1); }
}

/* ── Scroll reveal (driven by IntersectionObserver in animations.js) ─────── */
[data-reveal] {
  opacity: 0;
  will-change: opacity, transform;
}
[data-reveal="up"]    { transform: translate3d(0, 26px, 0); }
[data-reveal="left"]  { transform: translate3d(-30px, 0, 0); }
[data-reveal="right"] { transform: translate3d(30px, 0, 0); }
[data-reveal="scale"] { transform: scale(.94); }

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

/* No-JS fallback: everything visible */
.no-js [data-reveal] { opacity: 1; transform: none; }

/* ── Hero slide text choreography ───────────────────────────────────────── */
.hero-slide.is-active .hero-tag    { animation: fade-up .65s var(--ease) .05s both; }
.hero-slide.is-active .hero-title  { animation: fade-up .75s var(--ease) .14s both; }
.hero-slide.is-active .hero-sub    { animation: fade-up .75s var(--ease) .24s both; }
.hero-slide.is-active .hero-actions{ animation: fade-up .75s var(--ease) .34s both; }
.hero-slide.is-active .hero-visual { animation: fade-up .8s var(--ease) .18s both; }

/* Ambient background motion */
.hero-orb { animation: drift 16s ease-in-out infinite; }
.hero-orb--b { animation-duration: 21s; animation-direction: reverse; }
.float-slow { animation: float-y 7s ease-in-out infinite; }

/* Animated network / particle canvas layer */
.hero-particles {
  position: absolute; inset: 0; z-index: 0;
  opacity: .55; pointer-events: none;
}

/* ── Micro-interactions ─────────────────────────────────────────────────── */
.hover-lift { transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.hover-lift:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.shimmer {
  background-image: linear-gradient(100deg,
    transparent 25%, rgba(255, 255, 255, .18) 50%, transparent 75%);
  background-size: 220% 100%;
  animation: shimmer 3.2s linear infinite;
}

/* Waveform used in the AI-voice visual */
.wave { display: flex; align-items: center; gap: 4px; height: 42px; }
.wave span {
  display: block; width: 4px; height: 100%; border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan-300), var(--blue-400));
  transform-origin: center;
  animation: wave-bar 1.1s ease-in-out infinite;
}
.wave span:nth-child(2) { animation-delay: .12s; }
.wave span:nth-child(3) { animation-delay: .24s; }
.wave span:nth-child(4) { animation-delay: .36s; }
.wave span:nth-child(5) { animation-delay: .18s; }
.wave span:nth-child(6) { animation-delay: .3s; }
.wave span:nth-child(7) { animation-delay: .08s; }
.wave span:nth-child(8) { animation-delay: .26s; }
.wave span:nth-child(9) { animation-delay: .14s; }

/* Flowing connector lines inside SVG placeholders */
.flow-line {
  stroke-dasharray: 6 10;
  animation: dash-flow 6s linear infinite;
}

/* Counter numbers settle in */
.stat.is-revealed .val { animation: scale-in .6s var(--ease) both; }

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .hero-slide.is-active * { animation: none !important; }
  .hero-orb, .float-slow, .shimmer, .wave span, .flow-line { animation: none !important; }
  .wa-float { animation: none !important; }
  .card:hover, .hover-lift:hover, .step:hover, .btn:hover { transform: none !important; }
}
