/* ═══════════════════════════════════════════════════════════════════
   tool-wow.css — Illustrations "cadran de précision" (Audit/Analyseur/
   Objections/Simulateur/Openers), rouages Pipeline, et moment de
   déblocage Badge. Complète tool.css, ne redéfinit aucun sélecteur
   existant. Contenu généré par tool-wow.js dans les .pg-illus déjà
   présents dans index.html.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Cadrans (Audit / Analyseur / Objections / Simulateur / Openers) ── */
.instr-illus [class^="reveal-"] { opacity: 0; }
.instr-illus .needle-grp { transform: rotate(-120deg); }
.instr-illus.playing .needle-grp { transition: transform 1s cubic-bezier(.22,1,.36,1); transition-delay: .55s; }
.instr-illus .num-val { opacity: 0; }
.instr-illus .pulse-ring { opacity: 0; }

@keyframes wow-reveal-mesh { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
@keyframes wow-num-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes wow-ring-broadcast { 0% { opacity: .55; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.9); } }
@keyframes wow-tension-wobble { 0%, 100% { transform: rotate(var(--rot)); } 50% { transform: rotate(calc(var(--rot) + 4deg)); } }

.instr-illus.playing .reveal-1 { animation: wow-reveal-mesh .5s cubic-bezier(.2,1.3,.4,1) .05s both; }
.instr-illus.playing .reveal-2 { animation: wow-reveal-mesh .5s cubic-bezier(.2,1.3,.4,1) .18s both; }
.instr-illus.playing .reveal-3 { animation: wow-reveal-mesh .5s cubic-bezier(.2,1.3,.4,1) .31s both; }
.instr-illus.playing .num-val { animation: wow-num-in .4s ease-out 1.15s both; }
.instr-illus.playing .pulse-ring { animation: wow-ring-broadcast 2.6s ease-out 1.4s infinite; }
.instr-illus.playing .pulse-ring.r2 { animation-delay: 2.15s; }
.instr-illus.playing .pulse-ring.r3 { animation-delay: 2.9s; }
.instr-illus.playing .tension { animation: wow-tension-wobble 2.2s ease-in-out 1.6s infinite; }

@media (prefers-reduced-motion: reduce) {
  .instr-illus [class^="reveal-"], .instr-illus .num-val { animation: none !important; opacity: 1 !important; transform: none !important; }
  .instr-illus .needle-grp { transition: none !important; }
  .instr-illus .pulse-ring, .instr-illus .tension { animation: none !important; opacity: 0 !important; }
}

/* ── Rouages (Pipeline) ── */
.gear-illus [class^="reveal-"] { opacity: 0; }
.gear-illus .gear-num { opacity: 0; }

@keyframes wow-gear-reveal { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }

.gear-illus.playing .reveal-1 { animation: wow-gear-reveal .5s cubic-bezier(.2,1.4,.4,1) .05s both; }
.gear-illus.playing .reveal-2 { animation: wow-gear-reveal .5s cubic-bezier(.2,1.4,.4,1) .22s both; }
.gear-illus.playing .reveal-3 { animation: wow-gear-reveal .5s cubic-bezier(.2,1.4,.4,1) .39s both; }
.gear-illus.playing .reveal-4 { animation: wow-gear-reveal .5s cubic-bezier(.2,1.4,.4,1) .56s both; }
.gear-illus.playing .reveal-5 { animation: wow-gear-reveal .5s cubic-bezier(.2,1.4,.4,1) .73s both; }
.gear-illus.playing .gear-num { animation: wow-num-in .4s ease-out both; }
.gear-illus.playing .g1-num { animation-delay: .35s; }
.gear-illus.playing .g2-num { animation-delay: .52s; }
.gear-illus.playing .g3-num { animation-delay: .69s; }
.gear-illus.playing .g5-num { animation-delay: 1.02s; }

.gear-illus .gear-spin { transform-box: fill-box; transform-origin: center; }
.gear-illus.playing .g1-spin { animation: wow-spin-cw 13s linear infinite; }
.gear-illus.playing .g2-spin { animation: wow-spin-ccw 11.1s linear infinite; }
.gear-illus.playing .g3-spin { animation: wow-spin-cw 9.3s linear infinite; }
.gear-illus.playing .g4-spin { animation: wow-spin-ccw 8.3s linear infinite; }
.gear-illus.playing .g5-spin { animation: wow-spin-cw 7.4s linear infinite; }
@keyframes wow-spin-cw { to { transform: rotate(360deg); } }
@keyframes wow-spin-ccw { to { transform: rotate(-360deg); } }

@media (prefers-reduced-motion: reduce) {
  .gear-illus [class^="reveal-"], .gear-illus .gear-num { animation: none !important; opacity: 1 !important; transform: none !important; }
  .gear-illus .gear-spin { animation: none !important; }
}

/* ── Badge — moment de déblocage ── */
#confetti-canvas { position: fixed; inset: 0; z-index: 10000; pointer-events: none; }

.badge-card { position: relative; overflow: hidden; }
.badge-card--just-unlocked {
  animation: wow-badge-pop .7s cubic-bezier(.2,1.5,.4,1), wow-badge-glow-pulse 1.1s ease-out;
}
@keyframes wow-badge-pop {
  0%   { transform: scale(.92); }
  45%  { transform: scale(1.045); }
  100% { transform: scale(1); }
}
@keyframes wow-badge-glow-pulse {
  0%   { filter: drop-shadow(0 0 0 transparent); }
  28%  { filter: drop-shadow(0 0 26px var(--badge-c)); }
  100% { filter: drop-shadow(0 0 0 transparent); }
}
.badge-card--just-unlocked::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.5) 48%, transparent 62%);
  background-size: 250% 250%; background-position: 120% -20%;
  animation: wow-badge-shine 1.1s ease-out;
  mix-blend-mode: overlay;
}
@keyframes wow-badge-shine {
  0%   { background-position: 140% -40%; opacity: 0; }
  15%  { opacity: 1; }
  100% { background-position: -40% 140%; opacity: 0; }
}
.badge-card--just-unlocked::before {
  content: ""; position: absolute; left: 50%; top: 96px;
  width: 130px; height: 130px; margin: -65px 0 0 -65px;
  border-radius: 50%; border: 2px solid var(--badge-c);
  opacity: 0; pointer-events: none;
  animation: wow-badge-shockwave .85s cubic-bezier(.2,.8,.3,1);
}
@keyframes wow-badge-shockwave {
  0%   { transform: scale(.3); opacity: .85; }
  100% { transform: scale(2.6); opacity: 0; }
}
.badge-toast {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%) translateY(-8px);
  background: var(--badge-c, var(--acc)); color: #0a0704;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .1em;
  padding: 6px 12px; white-space: nowrap; opacity: 0; z-index: 5;
  animation: wow-badge-toast-in .5s ease-out .15s forwards, wow-badge-toast-out .5s ease-in 2.4s forwards;
}
@keyframes wow-badge-toast-in { to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes wow-badge-toast-out { to { opacity: 0; transform: translateX(-50%) translateY(-8px); } }

@media (prefers-reduced-motion: reduce) {
  .badge-card--just-unlocked,
  .badge-card--just-unlocked::after,
  .badge-card--just-unlocked::before,
  .badge-toast { animation: none !important; }
}

/* ── Audit (test) — cadran placeholder "respire" pendant l'attente API ── */
.aud-waiting--scanning .aud-ring-placeholder {
  animation: wow-scan-pulse 1.4s ease-in-out infinite;
}
@keyframes wow-scan-pulse {
  0%, 100% { opacity: .6; filter: drop-shadow(0 0 0 rgba(0,212,255,0)); }
  50% { opacity: 1; filter: drop-shadow(0 0 9px rgba(0,212,255,.55)); }
}
@media (prefers-reduced-motion: reduce) {
  .aud-waiting--scanning .aud-ring-placeholder { animation: none !important; }
}
