/* ============================================================
   Schwimmschule Wally – Bewegung & Leben
   Ergänzt style.css. Ausschließlich transform/opacity (läuft auf
   der Grafikkarte, kostet kein Layout). Alles Dekorative schaltet
   sich ab, wenn das Gerät „Bewegung reduzieren" eingestellt hat.
   ============================================================ */

/* ---------- Ebenen im Hero: Deko hinten, Inhalt vorn ---------- */
.hero .hero-grid { position: relative; z-index: 2; }
.hero-bubbles, .hero-fish {
    position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0;
}

/* ---------- Text gleitet nacheinander herein ---------- */
.hero-text > * { opacity: 0; animation: wlyRiseIn .7s cubic-bezier(.22, .9, .3, 1.15) forwards; }
.hero-text > :nth-child(1) { animation-delay: .05s; }
.hero-text > :nth-child(2) { animation-delay: .18s; }
.hero-text > :nth-child(3) { animation-delay: .32s; }
.hero-text > :nth-child(4) { animation-delay: .46s; }
.hero-text > :nth-child(5) { animation-delay: .60s; }
@keyframes wlyRiseIn {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Wally: erscheint mit Schwung, schwimmt statt nur zu schweben ---------- */
.hero-figure { opacity: 0; animation: wlyPop .9s cubic-bezier(.2, .8, .3, 1.25) .25s forwards; }
@keyframes wlyPop {
    from { opacity: 0; transform: scale(.82) translateY(14px); }
    to   { opacity: 1; transform: none; }
}
.hero-figure .wally-big {
    animation: wlySwim 6s ease-in-out infinite;
    transform-origin: 50% 60%;
}
@keyframes wlySwim {
    0%, 100% { transform: translateY(0)     rotate(-1.6deg); }
    50%      { transform: translateY(-18px) rotate(1.6deg); }
}
/* Sonnenstrahlen hinter dem Medaillon – drehen sich sehr langsam */
.hero-figure::after {
    content: ""; position: absolute; left: 50%; top: 47%;
    width: min(540px, 124%); aspect-ratio: 1; border-radius: 50%;
    z-index: 0; pointer-events: none;
    transform: translate(-50%, -50%);
    background: repeating-conic-gradient(from 0deg,
        rgba(255,255,255,.16) 0deg 8deg, rgba(255,255,255,0) 8deg 22deg);
    -webkit-mask: radial-gradient(circle, #000 28%, transparent 66%);
            mask: radial-gradient(circle, #000 28%, transparent 66%);
    animation: wlyRays 50s linear infinite;
}
@keyframes wlyRays { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* ---------- Blasen: außen steigt, innen glänzt und schwankt ---------- */
.hero-bubbles .bub { position: absolute; bottom: -60px; animation: wlyBubRise linear infinite; }
.hero-bubbles .bub i {
    display: block; width: 100%; height: 100%; border-radius: 50%;
    background: radial-gradient(circle at 32% 30%,
        rgba(255,255,255,.78) 0%, rgba(255,255,255,.26) 42%,
        rgba(255,255,255,.08) 68%, rgba(255,255,255,0) 72%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
    animation: wlyBubSway ease-in-out infinite alternate;
}
@keyframes wlyBubRise {
    0%   { transform: translateY(0) scale(.7);      opacity: 0; }
    12%  { opacity: 1; }
    100% { transform: translateY(-115vh) scale(1.1); opacity: 0; }
}
@keyframes wlyBubSway { from { transform: translateX(-9px); } to { transform: translateX(9px); } }

/* ---------- Kleine Fische ziehen fast unsichtbar durchs Bild ---------- */
.hero-fish .fish { position: absolute; left: -90px; animation: wlyFishSwim linear infinite; }
.hero-fish .fish.rev { left: auto; right: -90px; animation-name: wlyFishSwimRev; }
.hero-fish .fish svg {
    display: block; width: var(--fs, 44px); height: auto;
    fill: #fff; opacity: var(--fo, .2);
    animation: wlyFishBob 2.8s ease-in-out infinite;
}
.hero-fish .fish.rev svg { animation-name: wlyFishBobRev; }
@keyframes wlyFishSwim    { from { transform: translateX(0); } to { transform: translateX(calc(100vw + 180px)); } }
@keyframes wlyFishSwimRev { from { transform: translateX(0); } to { transform: translateX(calc(-100vw - 180px)); } }
@keyframes wlyFishBob {
    0%, 100% { transform: translateY(0)    rotate(-3deg); }
    50%      { transform: translateY(-7px) rotate(3deg); }
}
@keyframes wlyFishBobRev {
    0%, 100% { transform: scaleX(-1) translateY(0)    rotate(3deg); }
    50%      { transform: scaleX(-1) translateY(-7px) rotate(-3deg); }
}

/* ---------- Welle am Hero-Rand bewegt sich in zwei Ebenen ---------- */
.hero-wave { position: absolute; left: 0; right: 0; bottom: -1px; height: 90px; overflow: hidden; line-height: 0; z-index: 1; }
.hero-wave .wl { position: absolute; left: 0; bottom: 0; width: 200%; height: 100%; animation: wlyWave linear infinite; }
.hero-wave .wl svg { width: 100%; height: 100%; display: block; }
.hero-wave .wl-back  { animation-duration: 17s; opacity: .45; bottom: 12px; }
.hero-wave .wl-front { animation-duration: 11s; animation-direction: reverse; }
@keyframes wlyWave { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Sanftes, gestaffeltes Erscheinen beim Scrollen ---------- */
.reveal {
    opacity: 0; transform: translateY(26px);
    transition: opacity .6s ease, transform .65s cubic-bezier(.22, .9, .3, 1);
    transition-delay: calc(var(--i, 0) * 90ms);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Statistik: Zahl ploppt beim Hochzählen ---------- */
.stat.is-visible b { animation: wlyStatPop .7s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes wlyStatPop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ---------- Die vier Schritte: verbunden, springen ins Bild, wackeln beim Hover ---------- */
/* Altfehler in style.css: „.steps" ist dort zweimal definiert – erst als 4-Spalten-Raster
   (Startseite), später als Flex-Leiste für den Formular-Fortschritt. Die spätere Regel
   gewinnt, deshalb standen die vier Schritte auf der Startseite seit jeher als Liste
   untereinander. Hier bekommt nur die Startseite ihr Raster zurück (steps-home);
   der Formular-Stepper in anmeldung.php bleibt unberührt. */
.steps-home {
    position: relative; display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 24px; margin: 0; justify-content: stretch; align-items: start;
}
.steps-home .step {
    display: block; text-align: center; padding-top: 20px;
    color: var(--ink); font-weight: 400; font-size: 1rem;
}
@media (max-width: 899px) { .steps-home { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 559px) { .steps-home { grid-template-columns: 1fr; gap: 18px; } }
@media (min-width: 900px) {
    .steps-home::before {
        content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 48px;
        border-top: 3px dashed rgba(10, 111, 181, .28); z-index: 0;
    }
}
.steps-home .step { z-index: 1; }
.steps-home .step .step-num {
    transform: scale(.5); opacity: 0;
    transition: transform .6s cubic-bezier(.34, 1.56, .64, 1), opacity .4s ease;
    transition-delay: calc(var(--i, 0) * 140ms + .1s);
}
.steps-home .step.is-visible .step-num { transform: none; opacity: 1; }
.steps-home .step:hover .step-num { animation: wlyWiggle .65s ease-in-out; }

/* ---------- Karten: Symbol wackelt beim Darüberfahren ---------- */
.card:hover .card-icon { animation: wlyWiggle .7s ease-in-out; }
@keyframes wlyWiggle {
    0%, 100% { transform: rotate(0); }
    25%      { transform: rotate(-9deg) scale(1.08); }
    75%      { transform: rotate(9deg)  scale(1.08); }
}
.quote-card { transition: transform .25s ease, box-shadow .25s ease; }
.quote-card:hover { transform: translateY(-5px) rotate(-.4deg); box-shadow: var(--shadow-lg); }

/* ---------- Buttons: Lichtstreifen beim Hover, Haupt-Knopf pulsiert sanft ---------- */
.btn { position: relative; overflow: hidden; }
.btn::before {
    content: ""; position: absolute; top: 0; left: -80%; width: 55%; height: 100%;
    background: linear-gradient(115deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.5) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg); pointer-events: none; transition: left .55s ease;
}
.btn:hover::before { left: 130%; }
.btn.btn-lg:not(.btn-ghost) { animation: wlyPulse 3.8s ease-out infinite; }
@keyframes wlyPulse {
    0%   { box-shadow: 0 8px 20px rgba(255,183,3,.35), 0 0 0 0    rgba(255,183,3,.55); }
    55%  { box-shadow: 0 8px 20px rgba(255,183,3,.35), 0 0 0 16px rgba(255,183,3,0); }
    100% { box-shadow: 0 8px 20px rgba(255,183,3,.35), 0 0 0 0    rgba(255,183,3,0); }
}

/* ---------- Bewegung reduzieren: alles Dekorative aus, Inhalt sofort sichtbar ---------- */
@media (prefers-reduced-motion: reduce) {
    .hero-text > *, .hero-figure, .hero-figure .wally-big, .hero-figure::after,
    .hero-wave .wl, .btn::before, .btn.btn-lg, .stat.is-visible b,
    .card:hover .card-icon, .steps-home .step:hover .step-num {
        animation: none !important;
    }
    .hero-text > *, .hero-figure { opacity: 1; transform: none; }
    .reveal, .steps-home .step .step-num { opacity: 1 !important; transform: none !important; transition: none !important; }
    .hero-bubbles, .hero-fish { display: none; }
}
