/* ==========================================================================
   DA SCHLEIFA — animations.css
   Keyframes + Animations-Klassen (GSAP setzt Inline-Styles/Transforms,
   diese Klassen definieren Ausgangszustände & CSS-only Fallbacks)
   ========================================================================== */

/* Hero-Illustration: Schleifscheibe dreht sich kontinuierlich */
@keyframes wheel-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Ausgangszustand für scroll-getriggerte Elemente (GSAP animiert daraus) */
.reveal-up {
  opacity: 0;
  transform: translateY(40px);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
}
.reveal-right {
  opacity: 0;
  transform: translateX(60px);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
}

/* Wenn JS deaktiviert ist oder GSAP nicht lädt: nach kurzer Verzögerung sichtbar machen */
.no-js .reveal-up,
.no-js .reveal-left,
.no-js .reveal-right,
.no-js .reveal-scale {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-up, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Hero-Headline: Buchstaben/Wörter starten unsichtbar, GSAP staggert ein */
.hero__headline .char,
.hero__headline .word {
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  .hero__headline .char, .hero__headline .word { opacity: 1 !important; transform: none !important; }
}

/* Pulse-Animation für den "Eisen tauschen"-CTA */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(30, 111, 255, 0.45); }
  50% { box-shadow: 0 0 0 12px rgba(30, 111, 255, 0); }
}
.btn--pulse { animation: pulse-glow 2.2s ease-out infinite; }
@media (prefers-reduced-motion: reduce) { .btn--pulse { animation: none; } }

/* Success-Checkmark (Formular) */
@keyframes draw-check {
  from { stroke-dashoffset: 24; }
  to { stroke-dashoffset: 0; }
}
.form-success.is-visible .form-success__check svg path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: draw-check 0.5s var(--ease-out) 0.15s forwards;
}

/* Funken-Partikel-Fallback (CSS-only, für statisches SVG auf Mobile) */
@keyframes spark-fly {
  0% { transform: translate(0, 0) scale(1.3); opacity: 1; }
  10% { opacity: 1; }
  60% { opacity: 0.85; }
  100% {
    transform: translate(var(--spark-x, 40px), calc(var(--spark-y, -40px) + 26px)) scale(0.1);
    opacity: 0;
  }
}
.spark {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 9px 2px currentColor;
  animation: spark-fly 0.7s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}

/* Nummern-Ticker (Stats-Leiste) — Zahl wird per JS/GSAP hochgezählt, Klasse nur für Transition */
.stats-bar__value { transition: opacity 0.3s; }

/* Abo-Schritte: sequentielles Einblenden */
.step { opacity: 0; transform: translateY(24px); }
.step.is-visible { opacity: 1; transform: none; transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .step { opacity: 1 !important; transform: none !important; } }

/* Mobile-Menu Fade der Links */
.mobile-menu__links a { opacity: 0; transform: translateX(20px); transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out); }
.mobile-menu.is-open .mobile-menu__links a { opacity: 1; transform: none; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(2) { transition-delay: 0.1s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(3) { transition-delay: 0.15s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(4) { transition-delay: 0.2s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(5) { transition-delay: 0.25s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(6) { transition-delay: 0.3s; }

/* Diagramm-Linien (SVG stroke-draw beim Sichtbarwerden) */
.diagram-block svg .draw-line {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
}
.diagram-block.is-visible svg .draw-line {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.4s var(--ease-out);
}
