/* ============================================================
   LE QG MOTORSPORT — Couche animations
   Transform/opacity uniquement (perf), ease-out, reduced-motion ok.
   ============================================================ */

/* ---------- Barre de progression de scroll ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  z-index: 80; pointer-events: none;
}
.scroll-progress i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--red-deep), var(--accent), #ff4d47);
  transform: scaleX(0); transform-origin: left;
  box-shadow: 0 0 12px rgba(225,6,0,0.7);
}

/* ---------- Entrée du hero (cascade) ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(46px); }
  to   { opacity: 1; transform: none; }
}
.hero-tag, .hero h1, .hero .sub, .hero-actions, .hero-stats {
  animation: rise 0.9s var(--ease) both;
}
.hero h1        { animation-delay: 0.15s; }
.hero .sub      { animation-delay: 0.32s; }
.hero-actions   { animation-delay: 0.48s; }
.hero-stats     { animation-delay: 0.65s; }

/* Titre : balayage lumineux métallique */
.hero h1 .text-red {
  background: linear-gradient(110deg, var(--accent) 40%, #ff6b66 50%, var(--accent) 60%);
  background-size: 240% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: rise 0.9s var(--ease) 0.15s both, sheen 5s ease-in-out 1.4s infinite;
}
@keyframes sheen { 0%, 100% { background-position: 120% 0; } 50% { background-position: -20% 0; } }

/* Ken Burns très lent sur le média hero */
@keyframes kenburns { from { transform: scale(1.06); } to { transform: scale(1.14) translateY(-1.5%); } }
.hero-media .ph { animation: kenburns 22s ease-in-out infinite alternate; }

/* Drapeau à damier discret qui défile en bas du hero */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; z-index: 3;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.18) 0 14px, transparent 14px 28px);
  animation: checker 1.6s linear infinite;
  opacity: 0.5;
}
@keyframes checker { to { background-position: 28px 0; } }

/* ---------- Variantes de reveal (gauche / droite / zoom) ---------- */
[data-reveal="left"]  { transform: translateX(-46px); }
[data-reveal="right"] { transform: translateX(46px); }
[data-reveal="zoom"]  { transform: scale(0.92); }
[data-reveal].in      { transform: none; }

/* ---------- Boutons : balayage lumineux + press ---------- */
.btn::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -80%;
  width: 50%; transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transition: left 0.6s var(--ease);
  pointer-events: none;
}
.btn:hover::after { left: 130%; }
.btn:active { transform: translateY(1px) scale(0.98); }

/* ---------- Logo : rotation du cadre au survol ---------- */
.logo-mark { transition: transform 0.5s var(--ease); }
.logo:hover .logo-mark { transform: rotate(45deg); }
.logo-mark span { transition: transform 0.5s var(--ease); display: inline-block; }
.logo:hover .logo-mark span { transform: rotate(-45deg); }

/* ---------- Cartes services : tilt 3D + icône vivante ---------- */
.svc-grid { perspective: 1200px; }
.svc-card {
  transform-style: preserve-3d;
  transition: background 0.4s var(--ease), transform 0.25s ease-out, box-shadow 0.4s var(--ease);
  will-change: transform;
  cursor: pointer;
}
.svc-card:hover { box-shadow: 0 24px 60px -28px rgba(225,6,0,0.35); z-index: 3; }
.svc-icon { transition: transform 0.4s var(--ease), filter 0.4s var(--ease); }
.svc-card:hover .svc-icon {
  transform: translateZ(30px) scale(1.12) rotate(-4deg);
  filter: drop-shadow(0 0 14px rgba(225,6,0,0.6));
}
.svc-num { transition: color 0.4s var(--ease), transform 0.4s var(--ease); }
.svc-card:hover .svc-num { color: var(--accent); transform: translateX(6px); }
.svc-card h3 { transition: transform 0.4s var(--ease); }
.svc-card:hover h3 { transform: translateZ(18px); }

/* ---------- Build cards : glow + badge vibrant + shimmer dyno ---------- */
.build-card { cursor: pointer; }
.build-card:hover {
  border-color: rgba(225,6,0,0.45);
  box-shadow: 0 30px 70px -30px rgba(225,6,0,0.4);
}
.build-badge { transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.build-card:hover .build-badge {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px -8px var(--accent);
}
.dyno-bar { border-radius: 1px; }
.dyno-bar i { overflow: hidden; }
.dyno-bar i::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: translateX(-100%);
  animation: shimmer 2.4s ease-in-out 1.6s infinite;
}
@keyframes shimmer { 60%, 100% { transform: translateX(100%); } }
.dyno .gain { transition: border-color 0.3s var(--ease), background 0.3s var(--ease), transform 0.3s var(--ease); }
.build-card:hover .dyno .gain { border-color: var(--accent); background: rgba(225,6,0,0.1); transform: scale(1.06); }

/* HUD : coins qui s'étendent au survol */
.hud::before, .hud::after { transition: width 0.35s var(--ease), height 0.35s var(--ease); }
.build-card:hover .hud::before, .build-card:hover .hud::after { width: 34px; height: 34px; }

/* ---------- Why cards : lift + halo + index animé ---------- */
.why-card { transition: background 0.4s var(--ease), transform 0.4s var(--ease); cursor: default; }
.why-card:hover { background: var(--bg-3); transform: translateY(-6px); }
.why-card .why-icon { transition: transform 0.45s var(--ease), color 0.45s var(--ease); }
.why-card:hover .why-icon { transform: scale(1.15) rotate(6deg); color: var(--white); }
.why-card .idx { position: relative; display: inline-block; }
.why-card .idx::after {
  content: ""; position: absolute; left: 0; bottom: -5px; height: 2px; width: 0;
  background: var(--accent); transition: width 0.4s var(--ease);
}
.why-card:hover .idx::after { width: 100%; }

/* ---------- Témoignages : entrée animée du slide actif ---------- */
.testi-slide .testi-card { opacity: 0.35; transform: scale(0.96); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.testi-slide.active .testi-card { opacity: 1; transform: none; }
.testi-slide.active .stars svg { animation: starPop 0.5s var(--ease) backwards; }
.testi-slide.active .stars svg:nth-child(1) { animation-delay: 0.10s; }
.testi-slide.active .stars svg:nth-child(2) { animation-delay: 0.18s; }
.testi-slide.active .stars svg:nth-child(3) { animation-delay: 0.26s; }
.testi-slide.active .stars svg:nth-child(4) { animation-delay: 0.34s; }
.testi-slide.active .stars svg:nth-child(5) { animation-delay: 0.42s; }
@keyframes starPop { from { opacity: 0; transform: scale(0) rotate(-40deg); } to { opacity: 1; transform: none; } }

/* ---------- Formulaire : focus vivant + shake erreur ---------- */
.field input, .field textarea { transition: border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.field input:focus, .field textarea:focus { box-shadow: 0 0 0 3px rgba(225,6,0,0.18); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}
.field.error input, .field.error textarea { animation: shake 0.45s ease-in-out; }
.form-success.show { animation: rise 0.6s var(--ease); }

/* ---------- Liens sociaux : pop ---------- */
.socials a { transition: transform 0.25s var(--ease), border-color 0.3s, color 0.3s; }
.socials a:hover { transform: translateY(-4px); }

/* ---------- Nav : soulignement déjà présent, ajoute un glow header ---------- */
.site-header.scrolled { box-shadow: 0 10px 40px -20px rgba(0,0,0,0.8); }

/* ---------- Compteur stats : tick lumineux ---------- */
.hero-stats .stat strong { transition: color 0.3s; }
.hero-stats .stat:hover strong { color: var(--accent); }

/* ---------- Reduced motion : on coupe tout ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-tag, .hero h1, .hero .sub, .hero-actions, .hero-stats,
  .hero h1 .text-red, .hero-media .ph, .hero::after,
  .dyno-bar i::after, .testi-slide.active .stars svg,
  .field.error input, .field.error textarea, .form-success.show {
    animation: none !important;
  }
  .svc-card, .build-card, .why-card, .socials a, .btn { transition-duration: 0.01ms !important; }
  .scroll-progress { display: none; }
}
