/* ============================================================
   JASCO TECH — ANIMATIONS CSS
   Page-load animations, hero text entry, section transitions
   ============================================================ */

/* ---- PAGE LOAD ANIMATIONS ---- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeRight {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---- HERO ENTRY ANIMATIONS ---- */
.hero-eyebrow {
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.hero-title {
  animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

.hero-desc {
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

.hero-actions {
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.65s both;
}

.hero-stats {
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
}

.hero-scroll {
  animation: fadeIn 1s ease 1.2s both;
}

/* ---- MARQUEE ---- */
@keyframes marqueeScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---- GRADIENT BACKGROUND SHIFT (subtle, perpetual) ---- */
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Apply to gradient text in CTA for a living feel */
.cta-title {
  /* No extra background needed - inherits from .gradient-text span inside */
}

@media (prefers-reduced-motion: no-preference) {
  /* Pulsing hero glow spots */
  .hero-glow-1 {
    animation: breathe-glow 6s ease-in-out infinite;
  }

  .hero-glow-2 {
    animation: breathe-glow 8s ease-in-out 1s infinite;
  }
}

@keyframes breathe-glow {
  0%, 100% { transform: scale(1) translate(0, 0); opacity: 0.8; }
  50%       { transform: scale(1.1) translate(20px, -20px); opacity: 1; }
}

/* ---- COUNTER UP ANIMATION ---- */
.counter {
  display: inline-block;
  transition: all 0.05s ease;
}

/* ---- SOLUTION CARD HOVER STATE ---- */
.solution-card .solution-icon {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.solution-card:hover .solution-icon {
  transform: scale(1.08) rotate(-2deg);
}

/* ---- PROCESS STEP ICON HOVER ---- */
.process-step:hover .process-step-number {
  animation: pulse-step 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pulse-step {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ---- GRADIENT BORDER BUTTON hover ripple ---- */
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255,255,255,0.15);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.btn-primary:hover::after {
  opacity: 1;
  transform: scale(1);
}

/* ---- SPINNER (contact form loading) ---- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: var(--color-lime);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* ---- INDUSTRY CARD NUMBER BADGE ---- */
.industry-card .industry-num {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-left: auto;
  align-self: flex-start;
}

/* ---- SCROLL PROGRESS BAR ---- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--gradient-brand);
  z-index: calc(var(--z-nav) + 1);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.1s linear;
  pointer-events: none;
  will-change: transform;
}

/* ============================================================
   SCROLL-ANIMATE SYSTEM
   Elements with [data-anim] start hidden via CSS.
   GSAP ScrollTrigger fires gsap.to() to reveal them.
   This approach is bulletproof: CSS hides, GSAP shows.
   ============================================================ */

/* Fade up — default animation */
[data-anim="fade-up"] {
  opacity: 0;
  transform: translateY(36px);
  will-change: opacity, transform;
}

/* Fade in from left */
[data-anim="fade-left"] {
  opacity: 0;
  transform: translateX(-36px);
  will-change: opacity, transform;
}

/* Fade in from right */
[data-anim="fade-right"] {
  opacity: 0;
  transform: translateX(36px);
  will-change: opacity, transform;
}

/* Scale in from slightly smaller */
[data-anim="scale-up"] {
  opacity: 0;
  transform: scale(0.88) translateY(20px);
  will-change: opacity, transform;
}

/* Stagger children — parent wrapper is always visible */
[data-anim-group] > [data-anim] {
  /* Children inherit the data-anim hidden state */
}

/* Once animated, fully visible — in case GSAP clearProps isn't called */
[data-anim].anim-done {
  opacity: 1 !important;
  transform: none !important;
}

/* Mobile screens: Always display solutions carousel items fully */
@media (max-width: 768px) {
  .jt-solutions-grid .hl-card,
  .jt-solutions-grid [data-anim] {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
  }
}

/* Reduced motion: skip all scroll animations */
@media (prefers-reduced-motion: reduce) {
  [data-anim] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
