/* ==========================================================================
   INITIATIVE TARN — ANIMATIONS AU CHARGEMENT & AU SCROLL (TOUTES PAGES)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Animation d'Entrée au Chargement (Header, Hero & En-têtes de pages)
   -------------------------------------------------------------------------- */
@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes promesseEnter {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes cardPop {
  from {
    opacity: 0;
    transform: translateY(35px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header & Top Bar */
.top-notice-bar {
  animation: slideDownFade 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.site-header {
  animation: slideDownFade 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

/* Hero Accueil */
.hero-banner-section {
  overflow: hidden;
}

.hero-banner-content {
  animation: heroFadeUp 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.hero-title {
  animation: heroFadeUp 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.hero-subtitle {
  animation: heroFadeUp 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

.hero-cta-buttons {
  animation: heroFadeUp 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

/* 4 Promesses Accueil */
.promesses-grid .promesse-card:nth-child(1) { animation: promesseEnter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both; }
.promesses-grid .promesse-card:nth-child(2) { animation: promesseEnter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.60s both; }
.promesses-grid .promesse-card:nth-child(3) { animation: promesseEnter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.75s both; }
.promesses-grid .promesse-card:nth-child(4) { animation: promesseEnter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.90s both; }

/* En-têtes des pages dédiées (Entrepreneurs & Map) */
.page-intro-header {
  animation: pageHeaderEnter 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.page-main-block {
  animation: cardPop 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

/* Stagger sur les cartes d'entreprises */
.companies-grid .company-card:nth-child(1) { animation: cardPop 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both; }
.companies-grid .company-card:nth-child(2) { animation: cardPop 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.42s both; }
.companies-grid .company-card:nth-child(3) { animation: cardPop 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.49s both; }
.companies-grid .company-card:nth-child(4) { animation: cardPop 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.56s both; }
.companies-grid .company-card:nth-child(5) { animation: cardPop 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.63s both; }
.companies-grid .company-card:nth-child(6) { animation: cardPop 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.70s both; }
.companies-grid .company-card:nth-child(7) { animation: cardPop 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.77s both; }
.companies-grid .company-card:nth-child(8) { animation: cardPop 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.84s both; }
.companies-grid .company-card:nth-child(9) { animation: cardPop 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.91s both; }
.companies-grid .company-card:nth-child(10) { animation: cardPop 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.98s both; }
.companies-grid .company-card:nth-child(11) { animation: cardPop 0.7s cubic-bezier(0.16, 1, 0.3, 1) 1.05s both; }
.companies-grid .company-card:nth-child(12) { animation: cardPop 0.7s cubic-bezier(0.16, 1, 0.3, 1) 1.12s both; }

/* --------------------------------------------------------------------------
   2. Barre de Progression au Défilement
   -------------------------------------------------------------------------- */
.scroll-progress-line {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, #72C91F 0%, #E51968 100%);
  z-index: 9999;
  pointer-events: none;
  transition: width 0.1s ease-out;
}

/* --------------------------------------------------------------------------
   3. Classes d'Animation au Scroll (Sections Inférieures)
   -------------------------------------------------------------------------- */
.reveal-init {
  opacity: 0;
  transform: translateY(38px) scale(0.97);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-init.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Stagger sur les Partenaires lors de l'apparition uniquement */
.partners-row .partner-card:nth-child(1).reveal-init { transition-delay: 0.05s; }
.partners-row .partner-card:nth-child(2).reveal-init { transition-delay: 0.12s; }
.partners-row .partner-card:nth-child(3).reveal-init { transition-delay: 0.19s; }
.partners-row .partner-card:nth-child(4).reveal-init { transition-delay: 0.26s; }
.partners-row .partner-card:nth-child(5).reveal-init { transition-delay: 0.33s; }
.partners-row .partner-card:nth-child(6).reveal-init { transition-delay: 0.40s; }
.partners-row .partner-card:nth-child(7).reveal-init { transition-delay: 0.47s; }
.partners-row .partner-card:nth-child(8).reveal-init { transition-delay: 0.54s; }
.partners-row .partner-card:nth-child(9).reveal-init { transition-delay: 0.61s; }

/* Micro-interactions au survol instantanées (0s de délai) */
.promesse-card, .actu-card, .sidebar-module, .mod-contact-gradient, .mod-accompagnement, .mod-permanences, .partner-card, .contact-form-card, .company-card {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.15s ease !important;
  transition-delay: 0s !important;
}

.promesse-card:hover, .actu-card:hover, .sidebar-module:hover, .partner-card:hover, .company-card:hover {
  transform: translateY(-6px);
}

.mod-contact-gradient:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(229, 25, 104, 0.4);
}

.mod-accompagnement:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.25);
}

/* Compteur de stats animé */
.stat-val {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-item-row:hover .stat-val {
  transform: scale(1.08);
  color: var(--it-tertiary-pink);
}

.stat-icon-circle {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.35s ease;
}

.stat-item-row:hover .stat-icon-circle {
  transform: scale(1.15) rotate(8deg);
  background-color: var(--it-tertiary-pink-light);
}

.stat-item-row:hover .stat-icon-circle svg {
  stroke: var(--it-tertiary-pink);
}
