/* ============================================
   Ferna — Premium Scroll & Entrance Animations
   Pure CSS + IntersectionObserver, no libraries.
   Only animates opacity & transform (GPU-composited).
   ============================================ */

/* ----- Base hidden states ----- */

[data-animate] {
  opacity: 0;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  will-change: opacity, transform;
}

[data-animate="fade-up"] {
  transform: translateY(24px);
}

[data-animate="scale-in"] {
  transform: scale(0.95);
}

/* fade-in is opacity-only — no transform override needed */

/* ----- Visible state ----- */

[data-animate].is-visible {
  opacity: 1;
  transform: none;
}

/* ----- Sticky header + shrink on scroll ----- */

.section-header {
  position: sticky;
  top: 0;
  z-index: 100;
  transition: padding 0.35s ease, box-shadow 0.35s ease;
}

.section-header.is-scrolled {
  padding: 10px 0;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.section-header.is-scrolled .header__logo img {
  transition: max-width 0.35s ease;
  max-width: 130px;
}

/* ----- Button hover lift ----- */

.btn {
  transition: transform 0.25s ease, box-shadow 0.25s ease,
    background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
  transition-duration: 0.1s;
}

.btn-disabled:hover {
  transform: none;
  box-shadow: none;
}

/* ----- Decorative pattern float ----- */

.aboutus-pattern,
.services-pattern,
.work-pattern,
.contact-patten,
.guarantee__pattern,
.lead-magnet__pattern {
  animation: patternFloat 5s ease-in-out infinite;
}

@keyframes patternFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ----- Continuous logo sliders ----- */

.certificates-slider .swiper-wrapper,
.clients-slider .swiper-wrapper {
  transition-timing-function: linear !important;
}

/* ----- Nav link underline effect ----- */

.header .nav-link {
  position: relative;
}

.header .nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background-color: #c5dc09;
  transition: width 0.3s ease;
}

.header .nav-link:hover::after {
  width: 100%;
}

/* ----- Sectors card hover ----- */

.sectors-list__item {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sectors-list__item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* ----- Counter number glow on count finish ----- */

[data-counter].is-counted .getintouch-count {
  transition: color 0.4s ease;
}

/* ----- FAQ accordion — coordinated open/close ----- */

/* Override the old snap-open sweep animation */
details[open] summary ~ * {
  animation: none;
}

/* Transition on BOTH states so closing also animates */
.faq-details .faq-content {
  transition: background-color 0.35s ease;
}

.faq-details .faq-icon {
  transition: transform 0.35s ease;
}

.faq-details .faq-icon path {
  transition: stroke 0.35s ease;
}

/* Height + opacity wrapper for smooth expand/collapse */
.faq-answer-wrap {
  overflow: hidden;
  height: 0;
  opacity: 0;
  transition-property: height, opacity;
  transition-duration: 0.4s, 0.25s;
  transition-timing-function: ease, ease;
}

/* ----- Reduced motion: respect user preference ----- */

@media (prefers-reduced-motion: reduce) {
  [data-animate] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  .aboutus-pattern,
  .services-pattern,
  .work-pattern,
  .contact-patten,
  .guarantee__pattern,
  .lead-magnet__pattern {
    animation: none !important;
  }

  .btn:hover {
    transform: none !important;
  }

  .sectors-list__item:hover {
    transform: none !important;
  }

  .section-header {
    transition: none !important;
  }

  .faq-answer-wrap {
    transition: none !important;
    height: auto !important;
    opacity: 1 !important;
  }

  .faq-details .faq-content,
  .faq-details .faq-icon,
  .faq-details .faq-icon path {
    transition: none !important;
  }
}

/* ----- Mobile tweaks: shorter distances, faster ----- */

@media (max-width: 767px) {
  [data-animate] {
    transition-duration: 0.4s;
  }

  [data-animate="fade-up"] {
    transform: translateY(16px);
  }
}
