/* ==========================================================================
   digitalraum TCC — Animations
   ========================================================================== */

/* --- Scroll Reveal --- */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children within service/project grids */
.services__grid [data-animate]:nth-child(1) { transition-delay: 0ms; }
.services__grid [data-animate]:nth-child(2) { transition-delay: 80ms; }
.services__grid [data-animate]:nth-child(3) { transition-delay: 160ms; }
.services__grid [data-animate]:nth-child(4) { transition-delay: 240ms; }

.projects__grid [data-animate]:nth-child(1) { transition-delay: 0ms; }
.projects__grid [data-animate]:nth-child(2) { transition-delay: 80ms; }
.projects__grid [data-animate]:nth-child(3) { transition-delay: 160ms; }
.projects__grid [data-animate]:nth-child(4) { transition-delay: 240ms; }
.projects__grid [data-animate]:nth-child(5) { transition-delay: 320ms; }


/* --- Marquee --- */
.marquee__track {
  animation: marquee 20s linear infinite;
}

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

/* --- Button Hover Ripple --- */
.btn--accent::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, transparent 70%);
  transition: opacity 0.3s ease;
}

.btn--accent {
  position: relative;
  overflow: hidden;
}

.btn--accent:hover::after {
  opacity: 1;
}

/* --- Service Card Hover Glow --- */
.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.service-card:hover::before {
  opacity: 1;
}

/* --- Project Card — always show content on mobile (no hover) --- */
@media (max-width: 767px) {
  .project-card__content {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Stats count-up pulse --- */
.stat__number.counting {
  color: var(--color-accent);
  transition: color 0.3s ease;
}

.stat__number.done {
  color: var(--color-text);
  transition: color 0.5s ease 0.2s;
}

/* --- Nav link underline animation --- */
.nav__link::after {
  content: '';
  display: block;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width 0.3s ease;
}

.nav__link:hover::after {
  width: 100%;
}

/* --- Mobile menu link stagger --- */
.mobile-menu.active .mobile-menu__link:nth-child(1) { animation: menuFadeIn 0.3s ease 0.05s both; }
.mobile-menu.active .mobile-menu__link:nth-child(2) { animation: menuFadeIn 0.3s ease 0.1s both; }
.mobile-menu.active .mobile-menu__link:nth-child(3) { animation: menuFadeIn 0.3s ease 0.15s both; }
.mobile-menu.active .mobile-menu__link:nth-child(4) { animation: menuFadeIn 0.3s ease 0.2s both; }
.mobile-menu.active .mobile-menu__cta { animation: menuFadeIn 0.3s ease 0.25s both; }

@keyframes menuFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Testimonial dot pulse --- */
.testimonial-carousel__dot.active {
  animation: dotPulse 0.3s ease;
}

@keyframes dotPulse {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-animate] {
    opacity: 1;
    transform: none;
  }

  .marquee__track {
    animation: none;
  }

}
