/* ============================================================
   GENICO TECH SOLUTIONS — ANIMATIONS
   Scroll reveals, product entrances, hero motion, transitions.
   ============================================================ */

/* ---------- Page fade-in on load ---------- */
body { animation: pageFade 0.6s ease both; }
@keyframes pageFade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Scroll reveal (toggled by JS .in-view) ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

.reveal-left { opacity: 0; transform: translateX(-50px); transition: all 0.7s ease; }
.reveal-left.in-view { opacity: 1; transform: translateX(0); }

.reveal-right { opacity: 0; transform: translateX(50px); transition: all 0.7s ease; }
.reveal-right.in-view { opacity: 1; transform: translateX(0); }

.reveal-zoom { opacity: 0; transform: scale(0.9); transition: all 0.6s ease; }
.reveal-zoom.in-view { opacity: 1; transform: scale(1); }

/* ---------- Product card staggered entrance ---------- */
/* JS adds .reveal then .in-view; each card delayed by --d */
.product-card {
  opacity: 0;
  transform: translateY(45px) scale(0.96);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s, border-color 0.35s;
  transition-delay: var(--d, 0s);
}
.product-card.in-view { opacity: 1; transform: translateY(0) scale(1); }

/* ---------- Hero text entrance ---------- */
.hero-text .eyebrow { animation: slideUp 0.6s ease 0.1s both; }
.hero-text h1 { animation: slideUp 0.7s ease 0.25s both; }
.hero-text p { animation: slideUp 0.7s ease 0.4s both; }
.hero-actions { animation: slideUp 0.7s ease 0.55s both; }
.hero-stats { animation: slideUp 0.7s ease 0.7s both; }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Hero blob float + glow ---------- */
.hero-visual .blob { animation: floaty 6s ease-in-out infinite; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-22px) rotate(3deg); }
}
.hero-visual .blob img { animation: spinSlow 18s linear infinite; }
@keyframes spinSlow { /* gentle, almost imperceptible drift */
  0% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } 100% { transform: rotate(-2deg); }
}

/* floating accent rings behind blob */
.hero-visual::before, .hero-visual::after {
  content: ""; position: absolute; border: 2px dashed rgba(255,255,255,0.25); border-radius: 50%;
}
.hero-visual::before { width: 480px; height: 480px; animation: rotate 26s linear infinite; }
.hero-visual::after { width: 560px; height: 560px; animation: rotate 40s linear infinite reverse; }
@keyframes rotate { to { transform: rotate(360deg); } }

/* ---------- Floating particles (decorative) ---------- */
.particles { position: absolute; inset: 0; overflow: hidden; z-index: 1; }
.particles span {
  position: absolute; bottom: -40px; background: rgba(255,255,255,0.18); border-radius: 50%;
  animation: rise linear infinite;
}
@keyframes rise {
  to { transform: translateY(-110vh) translateX(40px); opacity: 0; }
}

/* ---------- Count-up stat pulse ---------- */
.stat strong { display: inline-block; }
.stat.pulse strong { animation: pop 0.5s ease; }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ---------- Button shine ---------- */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-20deg); transition: left 0.6s;
}
.btn-primary:hover::after { left: 130%; }

/* ---------- Chip & tile hover micro ---------- */
.chip, .cat-tile, .why-card, .fact { will-change: transform; }

/* ---------- Detail image fade ---------- */
.detail-img img { animation: zoomIn 0.7s ease both; }
@keyframes zoomIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

/* spec rows stagger */
.spec-table tr { opacity: 0; animation: rowIn 0.5s ease forwards; }
.spec-table tr:nth-child(1) { animation-delay: 0.1s; }
.spec-table tr:nth-child(2) { animation-delay: 0.2s; }
.spec-table tr:nth-child(3) { animation-delay: 0.3s; }
.spec-table tr:nth-child(4) { animation-delay: 0.4s; }
.spec-table tr:nth-child(5) { animation-delay: 0.5s; }
.spec-table tr:nth-child(6) { animation-delay: 0.6s; }
@keyframes rowIn { from { opacity: 0; transform: translateX(-15px); } to { opacity: 1; transform: translateX(0); } }

/* ---------- Scroll-to-top button ---------- */
.to-top {
  position: fixed; bottom: 26px; left: 26px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--grad); color: #fff; border: none; cursor: pointer; font-size: 1.1rem;
  box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(20px);
  transition: all 0.3s; z-index: 800;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { transform: translateY(-4px); }

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .reveal-left, .reveal-right, .reveal-zoom, .product-card { opacity: 1 !important; transform: none !important; }
}
