/* ==========================================================
   planungstool event – Bewegungen auf der Startseite (seit Portal 0.1.9)
   Greift nur, wenn das Skript <html class="anim"> setzt. Ohne
   JavaScript oder bei "Bewegung reduzieren" bleibt alles statisch.
   Es werden nur die Einzel-Eigenschaften translate/scale/rotate
   animiert, damit vorhandene transform-Werte (z. B. die leichte
   Schräglage der Kärtchen) erhalten bleiben.
   ========================================================== */

:root { --ease-out: cubic-bezier(.22,1,.36,1); --ease-back: cubic-bezier(.34,1.56,.64,1); }

/* ---------- Logo inline in der Kopfzeile ---------- */
.brand .pz-logo { height: 46px; width: auto; }
@media (max-width: 720px) { .brand .pz-logo { height: 30px; } }
html.logo-intro:not(.bereit) .brand .pz-logo { opacity: 0; }

/* ---------- Lader (Variante A) ---------- */
.pt-lader {
  position: fixed; inset: 0; z-index: 100; background: var(--paper);
  display: grid; place-items: center; align-content: center; gap: 18px;
  transition: opacity .4s ease, visibility 0s linear .4s;
}
.pt-lader .pz { width: 92px; height: 92px; }
.pt-lader p { font: 500 15px/1.3 var(--f-body); color: var(--ink-2); }
.pt-lader.weg { opacity: 0; visibility: hidden; }

/* Bis alles bereit ist, den oberen Bereich verdeckt halten (verhindert Aufblitzen) */
html.anim:not(.bereit) .hero .wrap,
html.anim:not(.bereit) .for .wrap { opacity: 0; }

/* ---------- Topbar bekommt beim Scrollen einen Schatten ---------- */
.topbar { transition: box-shadow .3s ease; }
.topbar.gescrollt { box-shadow: 0 8px 24px -16px rgba(13,33,64,.35); }

/* ---------- Grundtypen für "erscheint beim Scrollen" ---------- */
html.anim .a-r { opacity: 0; }
html.anim .a-r.is-in { animation: .75s var(--ease-out) var(--d, 0ms) both; }
html.anim .a-up.is-in    { animation-name: a-up; }
html.anim .a-links.is-in { animation-name: a-links; }
html.anim .a-rechts.is-in{ animation-name: a-rechts; }
html.anim .a-pop.is-in   { animation-name: a-pop; animation-timing-function: var(--ease-back); animation-duration: .6s; }
html.anim .a-blatt.is-in { animation-name: a-blatt; animation-duration: 1s; }
html.anim .a-gross.is-in { animation-name: a-gross; animation-duration: .85s; }

@keyframes a-up     { from { opacity: 0; translate: 0 24px; } to { opacity: 1; translate: 0 0; } }
@keyframes a-links  { from { opacity: 0; translate: -44px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes a-rechts { from { opacity: 0; translate: 44px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes a-pop    { from { opacity: 0; scale: .82; translate: 0 10px; } to { opacity: 1; scale: 1; translate: 0 0; } }
@keyframes a-blatt  { from { opacity: 0; translate: 0 34px; rotate: 2.8deg; } 60% { opacity: 1; } to { opacity: 1; translate: 0 0; rotate: 0deg; } }
@keyframes a-gross  { from { opacity: 0; translate: 0 30px; scale: .94; } to { opacity: 1; translate: 0 0; scale: 1; } }

/* ---------- 1 Hero ---------- */
.hero h1 .a-zeile { display: block; }
html.anim .hero h1 .mark::after { scale: 0 1; transform-origin: 0 50%; }
html.anim .hero h1.is-in .mark::after { animation: marker .55s cubic-bezier(.6,0,.2,1) .95s both; }
@keyframes marker { from { scale: 0 1; } to { scale: 1 1; } }

html.anim .float-poll .bar span { scale: 0 1; transform-origin: 0 50%; }
html.anim .float-poll.is-in .bar span { animation: fuellen 1s var(--ease-out) calc(var(--d) + .35s) both; }
html.anim .float-poll.is-in .bar + .poll-row + .bar span { animation-delay: calc(var(--d) + .55s); }
@keyframes fuellen { from { scale: 0 1; } to { scale: 1 1; } }

.avatars i.besetzt { background: var(--blau-m); color: var(--white); border-style: solid; }
html.anim .avatars i.besetzt { animation: a-pop .5s var(--ease-back) both; }

/* ---------- 3 Drei Schritte: Ziffer als Stempel ---------- */
html.anim .step::before { opacity: 0; transform-origin: 0 60%; }
html.anim .step.is-in::before { animation: stempel .5s var(--ease-back) calc(var(--d) + .3s) both; }
@keyframes stempel { from { opacity: 0; scale: 1.7; rotate: -8deg; } to { opacity: 1; scale: 1; rotate: 0deg; } }

/* ---------- Überschrift-Linie (Eyebrow) zieht sich auf ---------- */
html.anim .eyebrow.is-in::before { animation: linie .6s var(--ease-out) calc(var(--d) + .15s) both; transform-origin: 0 50%; }
@keyframes linie { from { scale: 0 1; } to { scale: 1 1; } }

/* ---------- 5 Kacheln: Symbole zeichnen sich ---------- */
html.anim .card svg { stroke-dasharray: 100; stroke-dashoffset: 100; }
html.anim .card.is-in svg { animation: zeichnen 1.1s ease-out calc(var(--d) + .2s) both; }
@keyframes zeichnen { to { stroke-dashoffset: 0; } }
.card { transition: background-color .25s ease, translate .25s ease; }
html.anim .card:hover { background-color: #31598F; }

/* ---------- 6 Datenschutz: Schloss schnappt zu ---------- */
html.anim .room .lock { opacity: 0; }
html.anim .room.is-in .lock { animation: schloss .55s var(--ease-back) calc(var(--d) + .45s) both; }
@keyframes schloss {
  0%   { opacity: 0; translate: 0 -7px; rotate: -14deg; }
  55%  { opacity: 1; translate: 0 1.5px; rotate: 0deg; }
  100% { opacity: 1; translate: 0 0; rotate: 0deg; }
}
html.anim .room.wide.is-in svg { animation: wackeln .6s ease-in-out calc(var(--d) + .5s) both; }
@keyframes wackeln { 0%, 100% { rotate: 0deg; } 25% { rotate: -10deg; } 50% { rotate: 8deg; } 75% { rotate: -4deg; } }

/* ---------- 7 Tarife: Schildchen fällt auf die Karte ---------- */
html.anim .plan.featured .badge { opacity: 0; }
html.anim .plan.featured.is-in .badge { animation: fallen .55s var(--ease-back) calc(var(--d) + .45s) both; }
@keyframes fallen { from { opacity: 0; translate: 0 -18px; rotate: -6deg; } to { opacity: 1; translate: 0 0; rotate: 0deg; } }

/* ---------- 8 Fragen: weich aufklappen ---------- */
html.anim .faq details[open] > p { animation: a-up .4s var(--ease-out) both; }
@supports (interpolate-size: allow-keywords) {
  html.anim { interpolate-size: allow-keywords; }
  html.anim .faq details::details-content { height: 0; overflow: clip; transition: height .35s var(--ease-out), content-visibility .35s allow-discrete; }
  html.anim .faq details[open]::details-content { height: auto; }
}

/* ---------- Schluss: Zeichen dreht sich ganz langsam ---------- */
html.anim .final-box.is-in .deco { animation: drehen 90s linear infinite; }
@keyframes drehen { to { rotate: 360deg; } }

/* ---------- Knöpfe: Pfeil rückt beim Drüberfahren nach rechts ---------- */
html.anim .btn svg { transition: translate .25s var(--ease-out); }
html.anim .btn:hover svg { translate: 4px 0; }

/* ---------- Weniger Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
  html.anim .a-r, html.anim .a-r.is-in { opacity: 1; animation: none !important; }
}
