/* Animationen: ruhig, einmalig, jede mit Zweck (Blickführung, Zustand, Rückmeldung).
   Nur transform und opacity (dazu clip-path und Strichlängen bei SVG). Bei „Bewegung reduzieren“ greift die Regel in base.css,
   alles an Scrollposition Gekoppelte steht zusätzlich nur unter prefers-reduced-motion: no-preference. */
:root { --ease-in-out: cubic-bezier(.77, 0, .175, 1); --ease-drawer: cubic-bezier(.32, .72, 0, 1); }

/* ---------- Hero: Namenskarte und Vertrauensleiste kommen nach dem Porträt ---------- */
.js .portr figcaption { opacity: 0; transform: translateY(12px); animation: hoch .6s var(--ease) .7s forwards; }
.js .hero .trust > div { opacity: 0; transform: translateY(12px); animation: hoch .7s var(--ease) .4s forwards; }
.js .hero .trust > div:nth-child(2) { animation-delay: .48s; }
.js .hero .trust > div:nth-child(3) { animation-delay: .56s; }

/* ---------- Überschriften steigen aus einer Maske auf ---------- */
.js .kopf.reveal { opacity: 1; transform: none; }
.js .kopf.reveal > * { clip-path: inset(0 0 100% 0); transform: translateY(.5em); transition: clip-path .8s var(--ease), transform .8s var(--ease); }
.js .kopf.reveal > :nth-child(2) { transition-delay: .08s; } .js .kopf.reveal > :nth-child(3) { transition-delay: .16s; }
.js .kopf.reveal.is-in > * { clip-path: inset(0 0 -20% 0); transform: none; }

/* ---------- Buttons: leicht anheben beim Überfahren, Rückmeldung beim Drücken (in base.css) ---------- */
@media (hover: hover) and (pointer: fine) {
  .btn-p:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -6px rgba(1, 109, 156, .45); }
  .btn-p:active { transform: scale(.97); box-shadow: none; }
  .btn-p { transition: background-color .15s ease, transform .2s var(--ease), box-shadow .2s var(--ease); }
}

/* ---------- Leistungen: Licht folgt dem Mauszeiger, Icon hebt sich ---------- */
.service { overflow: hidden; isolation: isolate; }
.service::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(260px circle at var(--x, 50%) var(--y, 50%), rgba(1, 109, 156, .09), transparent 70%); }
.service > .ic { transition: transform .3s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  a.service:hover::before { opacity: 1; }
  a.service:hover > .ic { transform: translateY(-3px); }
}

/* ---------- Beispielrechnung: Ring um die Abfindung zeichnet sich, Apricot-Strich unter der Summe läuft ein ---------- */
.ausgang__kreis { position: relative; }
.ausgang__ring { position: absolute; inset: -12px; width: calc(100% + 24px); height: calc(100% + 24px); max-width: none; overflow: visible; transform: rotate(-90deg); pointer-events: none; }
.ausgang__ring circle { fill: none; stroke: var(--blau); stroke-width: 1.4; stroke-linecap: round; }
.js .ausgang__ring circle { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.8s var(--ease-in-out) .2s; }
.js .ausgang.is-in .ausgang__ring circle { stroke-dashoffset: 0; }
.bz--summe mark { position: relative; z-index: 0; box-shadow: none; }
.bz--summe mark::after { content: ''; position: absolute; left: 0; right: 0; bottom: .04em; height: .22em; z-index: -1; background: var(--akzent); transform-origin: left; }
.js .bz--summe mark::after { transform: scaleX(0); transition: transform .9s var(--ease) 2.2s; }
.js .blatt.is-in .bz--summe mark::after { transform: none; }

/* ---------- Ablauf: Linie verbindet die Schritte, Punkte füllen sich nacheinander ---------- */
.schritte { position: relative; padding-top: 36px; }
.schritte::before, .schritte::after { content: ''; position: absolute; top: 7px; left: 24px; right: calc((100% - 32px) / 3 - 24px); height: 2px; border-radius: 2px; background: var(--line-2); }
.schritte::after { background: var(--blau); transform-origin: left; }
.schritte li { position: relative; }
.schritte li::after { content: ''; position: absolute; top: -36px; left: 17px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--line-2); box-sizing: border-box; transition: background-color .3s ease, border-color .3s ease, transform .3s var(--ease); }
.js .schritte::after { transform: scaleX(0); transition: transform 1.4s var(--ease-in-out) .2s; }
.js .schritte.is-in::after { transform: none; }
.schritte.is-in li::after { background: var(--blau); border-color: var(--blau); }
.js .schritte li:nth-child(1)::after { transition-delay: .2s; } .js .schritte li:nth-child(2)::after { transition-delay: .9s; } .js .schritte li:nth-child(3)::after { transition-delay: 1.55s; }
@media (max-width: 900px) {
  .schritte { padding-top: 0; padding-left: 32px; }
  .schritte::before, .schritte::after { top: 34px; bottom: 34px; left: 7px; right: auto; width: 2px; height: auto; }
  .schritte::after { transform-origin: top; }
  .js .schritte::after { transform: scaleY(0); }
  .schritte li::after { top: 26px; left: -32px; }
}

/* ---------- Häufige Fragen: Antwort klappt weich auf (wo der Browser es kann, sonst sofort) ---------- */
@supports (interpolate-size: allow-keywords) {
  .faq { interpolate-size: allow-keywords; }
  .faq details::details-content { height: 0; overflow: clip; transition: height .3s var(--ease), content-visibility .3s allow-discrete; }
  .faq details[open]::details-content { height: auto; }
}

/* ---------- „Jetzt erreichbar“: sanftes Pulsieren, nur wenn wirklich erreichbar ---------- */
[data-status].is-open .status-dot { animation: puls 2.4s ease-out infinite; }
@keyframes puls { from { box-shadow: 0 0 0 0 rgba(43, 122, 75, .45); } to { box-shadow: 0 0 0 7px rgba(43, 122, 75, 0); } }

/* ---------- Mobile Kontaktleiste: fährt beim Runterscrollen hinaus und beim Hochscrollen wieder herein ---------- */
@media (max-width: 760px) {
  .js .kbar { transform: translateY(110%); transition: transform .4s var(--ease-drawer); }
  .js .kbar.is-sichtbar { transform: none; }
}

/* ---------- An die Scrollposition gekoppelt (nur moderne Browser, nie bei „Bewegung reduzieren“) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    /* Lesefortschritt unter der Kopfleiste, Schatten erscheint nach den ersten Pixeln */
    .bar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--blau); transform-origin: left; transform: scaleX(0); animation: fortschritt linear both; animation-timeline: scroll(root); }
    @keyframes fortschritt { to { transform: scaleX(1); } }
    .bar { animation: schatten linear both; animation-timeline: scroll(root); animation-range: 0 120px; }
    @keyframes schatten { to { box-shadow: 0 8px 24px -16px rgba(20, 35, 44, .35); } }
    /* Fotos zoomen beim Hereinscrollen leicht heraus */
    .ich__foto img, .leistung__bild img { animation: herauszoomen linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
    @keyframes herauszoomen { from { transform: scale(1.1); } to { transform: none; } }
  }
}
