/**
 * Digi Create Pakistan - Lightweight Professional Animations
 * Strict Performance: Only transform & opacity, zero layout shift (CLS)
 * Progressive Enhancement: Non-JS / NoScript users see all content immediately
 */

/* 1. Hero Entrance (Above-the-fold, load-triggered) */
.js .hero-fade {
  opacity: 0;
  transform: translateY(24px);
  animation: heroFadeUp 600ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  will-change: transform, opacity;
}

@keyframes heroFadeUp {
  0% {
    opacity: 0;
    transform: translateY(24px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 2. Scroll Reveal: General Sections & Blocks */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 3. Cards Stagger Reveal (Services, Principles, Process, Team, Portfolio, Blog) */
.js .reveal-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

.js .reveal-card.is-visible {
  opacity: 1 !important;
  transform: none !important;
}

/* 4. Preserve Cards Hover Transitions (translateY -4px) */
.js .reveal-card.is-visible:hover {
  transform: translateY(-4px) !important;
}

/* 5. Heading Accent Lines (Orange #FF6B3D scaleX 0 to 1 in 500ms) */
.js .section-header .section-title::after,
.js .section-header h2::after,
.js .final-cta-section h2::after {
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1) 200ms;
}

/* Left-aligned heading accent lines origin */
.js .about-intro-title::after,
.js .team-page-heading::after,
.js .service-section-title::after,
.js .section-header.text-left .section-title::after,
.js .section-header.text-left h2::after {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1) 200ms;
}

.js .section-header.is-visible .section-title::after,
.js .section-header.is-visible h2::after,
.js .about-intro-title.is-visible::after,
.js .team-page-heading.is-visible::after,
.js .service-section-title.is-visible::after,
.js .about-intro-section.is-visible .about-intro-title::after,
.js .final-cta-section.is-visible h2::after {
  transform: scaleX(1);
}

/* 6. Buttons Active (Click) State: scale(0.98) */
.btn:active,
.btn-primary:active,
.wp-block-button__link:active,
.wp-element-button:active {
  transform: scale(0.98) !important;
  transition: transform 100ms ease !important;
}

/* 7. Strict Exclusions: Sticky Header and Footer must NEVER animate */
.site-header,
.site-header *,
.site-footer,
.site-footer * {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

/* 8. Accessibility: prefers-reduced-motion: reduce */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal,
  .js .reveal-card,
  .js .hero-fade {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
  .js .section-header .section-title::after,
  .js .section-header h2::after,
  .js .about-intro-title::after,
  .js .team-page-heading::after,
  .js .service-section-title::after,
  .js .final-cta-section h2::after {
    transform: scaleX(1) !important;
    transition: none !important;
  }
}

/* ==========================================================================
   Our Team Page Rows Animations
   ========================================================================== */

/* Row Entrance: translateX(-32px) to 0, opacity 0 to 1, 650ms */
.js .team-row,
.js .reveal-card.team-row {
  opacity: 0;
  transform: translateX(-32px) !important;
  transition: opacity 650ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 650ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.js .team-row.is-visible,
.js .reveal-card.team-row.is-visible {
  opacity: 1;
  transform: translateX(0) !important;
}

/* Left Orange 4px Border Grows Top to Bottom (600ms) */
.js .team-row::before {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.js .team-row.is-visible::before {
  transform: scaleY(1);
}

/* Initials Badge Pop: scale(0.6) to 1, opacity 0 to 1, 500ms, delay 150ms, cubic-bezier(0.34, 1.56, 0.64, 1) */
.js .team-row .team-avatar-initials {
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 500ms ease 150ms,
              transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1) 150ms;
  will-change: opacity, transform;
}

.js .team-row.is-visible .team-avatar-initials {
  opacity: 1;
  transform: scale(1);
}

/* Name, Role, Bio Fade-Up: translateY(16px) to 0, delays 250ms, 330ms, 410ms */
.js .team-row .team-name,
.js .team-row .team-role,
.js .team-row .team-bio {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.js .team-row .team-name {
  transition-delay: 250ms;
}

.js .team-row .team-role {
  transition-delay: 330ms;
}

.js .team-row .team-bio {
  transition-delay: 410ms;
}

.js .team-row.is-visible .team-name,
.js .team-row.is-visible .team-role,
.js .team-row.is-visible .team-bio {
  opacity: 1;
  transform: translateY(0);
}

/* Desktop Hover: Row shifts 6px right, deeper shadow (200ms), badge scale(1.06) */
@media (hover: hover) and (min-width: 1024px) {
  .team-row:hover,
  .js .team-row.is-visible:hover,
  .js .reveal-card.team-row.is-visible:hover {
    transform: translateX(6px) !important;
    box-shadow: 0 12px 32px rgba(0, 24, 255, 0.14) !important;
    transition: transform 200ms ease, box-shadow 200ms ease !important;
  }

  .team-row:hover .team-avatar-initials,
  .js .team-row.is-visible:hover .team-avatar-initials {
    transform: scale(1.06) !important;
    transition: transform 200ms ease !important;
  }
}

/* Reduced Motion Safety */
@media (prefers-reduced-motion: reduce) {
  .js .team-row,
  .js .team-row.is-visible,
  .js .team-row::before,
  .js .team-row .team-avatar-initials,
  .js .team-row .team-name,
  .js .team-row .team-role,
  .js .team-row .team-bio {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
  .js .team-row::before {
    transform: scaleY(1) !important;
  }
}