/*
 * Carbonvalid – Bewegung (Entscheidung Jörg 09.11.2026)
 * Drei Arten, sonst nichts:
 *   1. Einstieg: Hero beim Laden (Foto zoomt leicht heraus, Text gleitet ein)
 *   2. Zeichnen: Diagramm, Messablauf-, Vorteile-, Modul- und Methoden-Piktogramme bauen sich beim Hereinscrollen auf (motion.js)
 *   3. Parallaxe: nur Fotos (Hero, Band „Renaturiertes Moor“, Duo, Eddy), nur ab 900 px (motion.js)
 * Grundsatz: Ohne JavaScript, im Elementor-Editor und bei „Bewegung reduzieren“ ist alles sofort sichtbar.
 * Die Klasse .cv-motion setzt ein Inline-Skript im <head> (functions.php). Nichts wird gespeichert.
 */
:root {
	--cv-ease: cubic-bezier(.2, .7, .2, 1);
}

/* 1. Einstieg Hero */
@keyframes cv-zoom { from { transform: scale(1.05); } to { transform: none; } }
@keyframes cv-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.cv-motion .hero-f__bg img { animation: cv-zoom 1.8s var(--cv-ease) both; }
.cv-motion .hero-f__copy > * { animation: cv-up .9s var(--cv-ease) both; }
.cv-motion .hero-f__copy > :nth-child(1) { animation-delay: .15s; }
.cv-motion .hero-f__copy > :nth-child(2) { animation-delay: .3s; }
.cv-motion .hero-f__copy > :nth-child(3) { animation-delay: .45s; }
/* Seitenkopf der Unterseiten: derselbe Einstieg */
.cv-motion .hero-c > * { animation: cv-up .9s var(--cv-ease) both; }
.cv-motion .hero-c > :nth-child(1) { animation-delay: .15s; }
.cv-motion .hero-c > :nth-child(2) { animation-delay: .3s; }
.cv-motion .hero-c > :nth-child(3) { animation-delay: .45s; }

/* 3. Parallaxe: Werte setzt motion.js (--cv-py in px, --cv-fade 0–1) */
.cv-motion .hero-f__bg { transform: translate3d(0, var(--cv-py, 0), 0); }
.cv-motion .hero-f__copy { transform: translate3d(0, var(--cv-cy, 0), 0); opacity: var(--cv-fade, 1); }
.cv-motion .is-parallax img { transform: translate3d(0, var(--cv-py, 0), 0) scale(var(--cv-ps, 1.2)); }
.cv-motion .hero-f__bg, .cv-motion .hero-f__copy, .cv-motion .is-parallax img { will-change: transform; }

/* Aufhellen (Band „Renaturiertes Moor“): weißer Schleier, Deckkraft setzt motion.js beim Scrollen */
.cv-motion .is-lift::after {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: #fff; opacity: calc(var(--cv-lift, 0) * var(--cv-lift-max, .4));
	will-change: opacity;
}

/* 2. Zeichnen: Ausgangszustand nur, wenn motion.js das Element vorbereitet hat (.cv-m-pre) */
/* Übergänge erst ab .is-in: Verstecken geschieht sofort, nur das Erscheinen ist animiert */
.cv-m-pre.is-in .cv-m-draw { transition: stroke-dashoffset .9s var(--cv-ease); }
/* Einblenden: vorher 0, danach wieder die Deckkraft aus components.css (z. B. Band .45) */
.cv-m-pre.is-in .cv-m-fade { transition: opacity .7s var(--cv-ease); }
.cv-m-pre:not(.is-in) .cv-m-fade { opacity: 0; }

/* Diagramm: Messpunkte erscheinen entlang der Lichtachse, dann Kurve, dann 95-%-Bereich */
.cv-m-pre .cv-m-sweep { clip-path: inset(-2% 100% -2% -2%); }
.cv-m-pre.is-in .cv-m-sweep { clip-path: inset(-2% -2% -2% -2%); transition: clip-path 1.4s var(--cv-ease); }
.cv-m-pre.is-in .ch-line.cv-m-draw { transition-duration: 1.1s; transition-delay: .9s; }
.cv-m-pre.is-in .ch-band.cv-m-fade { transition-delay: 1.7s; }

/* Aufsteigen: Label und Überschrift wie der Hero-Text, ausgelöst beim Hereinscrollen (Liste RISE in motion.js) */
.cv-m-pre.is-in.cv-m-rise > .cv-label, .cv-m-pre.is-in.cv-m-rise > .cv-head, .cv-m-pre.is-in.cv-m-rise > .statement__txt { transition: opacity .9s var(--cv-ease), transform .9s var(--cv-ease); }
.cv-m-pre.is-in.cv-m-rise > .cv-head { transition-delay: .15s; }
.cv-m-pre.cv-m-rise:not(.is-in) > .cv-label, .cv-m-pre.cv-m-rise:not(.is-in) > .cv-head, .cv-m-pre.cv-m-rise:not(.is-in) > .statement__txt { opacity: 0; transform: translateY(14px); }

/* Sicherheitsnetz */
@media (prefers-reduced-motion: reduce) {
	.cv-motion .hero-f__bg img, .cv-motion .hero-f__copy > *, .cv-motion .hero-c > * { animation: none; }
	.cv-motion .hero-f__bg, .cv-motion .hero-f__copy, .cv-motion .is-parallax img { transform: none; opacity: 1; }
	.cv-motion .is-lift::after { display: none; }
	.cv-m-pre .cv-m-draw { stroke-dashoffset: 0 !important; transition: none !important; }
	.cv-m-pre:not(.is-in) .cv-m-fade { opacity: inherit; }
	.cv-m-pre:not(.is-in) .ch-band.cv-m-fade { opacity: .45; }
	.cv-m-fade { transition: none !important; }
	.cv-m-pre .cv-m-sweep { clip-path: none; transition: none; }
	.cv-m-pre.cv-m-rise:not(.is-in) > .cv-label, .cv-m-pre.cv-m-rise:not(.is-in) > .cv-head, .cv-m-pre.cv-m-rise:not(.is-in) > .statement__txt { opacity: 1; transform: none; }
}
.elementor-editor-active .hero-f__bg img, .elementor-editor-active .hero-f__copy > *, .elementor-editor-active .hero-c > * { animation: none !important; }
