/*
 * Electric Force GT — homepage scroll animations
 * Add this file after your existing stylesheet.
 */

/* Keep all animation settings in one place for easy tuning. */
:root {
  --efgt-motion-duration: 650ms;
  --efgt-motion-easing: cubic-bezier(0.22, 1, 0.36, 1);
  --efgt-motion-distance: 32px;
  --efgt-motion-stagger: 120ms;
}

/*
 * Elements only start hidden once JavaScript has initialized successfully.
 * If JavaScript is disabled, the page content remains visible.
 */
html.has-scroll-animations .scroll-reveal {
  opacity: 0;
  transition:
    opacity var(--efgt-motion-duration) ease,
    transform var(--efgt-motion-duration) var(--efgt-motion-easing);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

html.has-scroll-animations .scroll-reveal.reveal-up {
  transform: translate3d(0, var(--efgt-motion-distance), 0);
}

html.has-scroll-animations .scroll-reveal.reveal-left {
  transform: translate3d(-var(--efgt-motion-distance), 0, 0);
}

html.has-scroll-animations .scroll-reveal.reveal-right {
  transform: translate3d(var(--efgt-motion-distance), 0, 0);
}

html.has-scroll-animations .scroll-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

/* Hero content enters on page load rather than waiting for a scroll. */
.hero .hero-content > * {
  animation: efgt-hero-enter 700ms var(--efgt-motion-easing) both;
}

.hero .hero-content > *:nth-child(1) {
  animation-delay: 100ms;
}
.hero .hero-content > *:nth-child(2) {
  animation-delay: 230ms;
}
.hero .hero-content > *:nth-child(3) {
  animation-delay: 360ms;
}

.hero .hero-right {
  animation: efgt-hero-image-enter 900ms var(--efgt-motion-easing) both;
  animation-delay: 180ms;
}

/* Project gallery hover effects */
.projects-grid .project-card {
  transition:
    transform 250ms ease,
    box-shadow 250ms ease;
}

.projects-grid .project-card img {
  transition: transform 350ms ease;
}

/* About Us: founders image */
.panel-video-layout .div-pictures img {
  transition: transform 350ms ease;
}

@keyframes efgt-hero-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes efgt-hero-image-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Optional, restrained hover movement for service cards and action links. */
@media (hover: hover) and (pointer: fine) {
  .poster-card,
  .quick-link,
  .info-card-container,
  .review {
    transition:
      transform 220ms ease,
      box-shadow 220ms ease;
  }

  .poster-card:hover,
  .quick-link:hover,
  .info-card-container:hover,
  .review:hover {
    transform: translateY(-4px);
  }

  .poster-card .poster-image {
    transition: transform 350ms ease;
  }

  .poster-card:hover .poster-image {
    transform: scale(1.035);
  }

  .projects-grid .project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgb(0 0 0 / 12%);
  }

  .projects-grid .project-card:hover img {
    transform: scale(1.04);
  }

  .panel-video-layout .div-pictures {
    overflow: hidden;
    border-radius: 10px;
  }

  .panel-video-layout .div-pictures:hover img {
    transform: scale(1.03);
  }
}

/* A gentle fade-in for the quick-contact row as a group. */
.quick-links.scroll-reveal {
  --efgt-motion-distance: 18px;
}

/* Respect visitors who have requested reduced motion. */
@media (prefers-reduced-motion: reduce) {
  html.has-scroll-animations .scroll-reveal,
  html.has-scroll-animations .scroll-reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
    transition-delay: 0ms;
    will-change: auto;
  }

  .hero .hero-content > *,
  .hero .hero-right {
    animation: none !important;
  }

  .poster-card,
  .quick-link,
  .info-card-container,
  .review,
  .poster-card .poster-image {
    transition: none !important;
  }

  .poster-card:hover,
  .quick-link:hover,
  .info-card-container:hover,
  .review:hover,
  .poster-card:hover .poster-image {
    transform: none;
  }

  .projects-grid .project-card,
  .projects-grid .project-card img {
    transition: none;
  }

  .projects-grid .project-card:hover {
    transform: none;
  }

  .projects-grid .project-card:hover img {
    transform: none;
  }

  .panel-video-layout .div-pictures img {
    transition: none;
  }
}
