/* Icon Tech — Animations */

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

@keyframes float-orb {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -20px); }
}

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

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

html[dir="rtl"] .tech-track,
html[dir="rtl"] .testimonials-track {
  animation-name: marquee-rtl;
}

@media (prefers-reduced-motion: reduce) {
  #testimonials .testimonials-marquee {
    overflow-x: auto;
    overflow-y: hidden;
    mask-image: none;
    -webkit-mask-image: none;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  #testimonials .testimonials-track {
    animation: none !important;
    flex-wrap: nowrap !important;
    width: max-content !important;
    transform: none !important;
  }

  #testimonials .testimonial-card[aria-hidden="true"] {
    display: none;
  }
}

@keyframes marquee-rtl {
  0% { transform: translateX(0); }
  100% { transform: translateX(50%); }
}

@keyframes loader-pulse {
  0%, 100% { opacity: 0.6; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1); }
}

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

.reveal {
  opacity: 0;
  transform: translateY(40px);
}

@media (max-width: 768px) {
  .reveal,
  .stagger-children {
    opacity: 1;
    transform: none;
  }
  .reveal.revealed {
    animation: none;
  }
}

.reveal.revealed {
  animation: fade-up 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.reveal-delay-1 { animation-delay: 0.1s; }
.reveal-delay-2 { animation-delay: 0.2s; }
.reveal-delay-3 { animation-delay: 0.3s; }
.reveal-delay-4 { animation-delay: 0.4s; }

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(24px);
}

.stagger-children.revealed > * {
  animation: fade-up 0.55s ease forwards;
}

.stagger-children.revealed > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children.revealed > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children.revealed > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children.revealed > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children.revealed > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children.revealed > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children.revealed > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children.revealed > *:nth-child(8) { animation-delay: 0.4s; }
.stagger-children.revealed > *:nth-child(9) { animation-delay: 0.45s; }
.stagger-children.revealed > *:nth-child(10) { animation-delay: 0.5s; }
.stagger-children.revealed > *:nth-child(11) { animation-delay: 0.55s; }
.stagger-children.revealed > *:nth-child(12) { animation-delay: 0.6s; }
.stagger-children.revealed > *:nth-child(n+13) { animation-delay: 0.65s; }

/* Mobile: always show section content (avoid stuck opacity:0 with content-visibility / late API) */
@media (max-width: 768px) {
  .reveal,
  .stagger-children > * {
    opacity: 1;
    transform: none;
    animation: none !important;
  }
}

/* ── Micro-interactions — buttons, cards, links ── */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn:active {
  transform: translateY(0) scale(0.97);
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* Light sweep across the main CTA */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: -45%;
  width: 40%;
  z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-18deg);
  opacity: 0;
}

.btn-primary:hover::after,
.btn-primary:focus-visible::after {
  animation: btn-sheen 0.8s ease;
}

html[dir="rtl"] .btn-primary:hover::after,
html[dir="rtl"] .btn-primary:focus-visible::after {
  animation-name: btn-sheen-rtl;
}

@keyframes btn-sheen {
  from { opacity: 1; transform: translateX(0) skewX(-18deg); }
  to { opacity: 0; transform: translateX(340%) skewX(-18deg); }
}

@keyframes btn-sheen-rtl {
  from { opacity: 1; transform: translateX(0) skewX(18deg); }
  to { opacity: 0; transform: translateX(-340%) skewX(18deg); }
}

/* Brand wash on secondary buttons */
.btn-outline::before,
.btn-ghost::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--gradient-btn);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity var(--transition), transform var(--transition);
}

.btn-outline:hover::before,
.btn-ghost:hover::before {
  opacity: 0.16;
  transform: scale(1);
}

.btn-outline:hover {
  transform: translateY(-2px);
}

/* Hero badge — breathing halo */
.hero-badge {
  animation: badge-halo 4.5s ease-in-out infinite;
}

@keyframes badge-halo {
  0%, 100% { box-shadow: 0 0 0 rgba(233, 104, 46, 0); }
  50% { box-shadow: 0 0 22px rgba(233, 104, 46, 0.18); }
}

/* Slow gradient pan on highlighted headline words */
.text-gradient {
  background-size: 220% 100%;
  animation: gradient-pan 9s ease-in-out infinite;
}

@keyframes gradient-pan {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Service icon pop */
.service-icon {
  transition: transform var(--transition), box-shadow var(--transition);
}

.service-card:hover .service-icon {
  transform: translateY(-3px) scale(1.07);
  box-shadow: var(--shadow-glow);
}

.stat-card,
.trust-item {
  transition: transform var(--transition), color var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
}

.trust-item:hover {
  transform: translateY(-2px);
  color: var(--color-white);
}

/* Arrow nudge on "read more" links */
.blog-card__more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: gap var(--transition), color var(--transition);
}

.blog-card:hover .blog-card__more,
.blog-card__more:hover {
  gap: 0.7rem;
  color: var(--color-primary);
}

/* Scroll progress line (scroll-driven, no JS) */
@supports (animation-timeline: scroll()) {
  body::after {
    content: '';
    position: fixed;
    top: 0;
    inset-inline: 0;
    height: 3px;
    z-index: 1150;
    background: var(--gradient-btn);
    transform-origin: left center;
    scale: 0 1;
    animation: scroll-progress linear;
    animation-timeline: scroll(root block);
    pointer-events: none;
  }

  html[dir="rtl"] body::after {
    transform-origin: right center;
  }

  @keyframes scroll-progress {
    to { scale: 1 1; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-badge,
  .text-gradient,
  .btn-primary:hover::after,
  .btn-primary:focus-visible::after {
    animation: none !important;
  }

  .btn:active,
  .btn-outline:hover,
  .stat-card:hover,
  .trust-item:hover,
  .service-card:hover .service-icon {
    transform: none !important;
  }
}

/* Grid pattern background */
.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, #000 20%, transparent 70%);
  pointer-events: none;
}
