/* ==========================================================
   HYLA · Scroll-Szenen aus dem Labor (js/szenen/*)
   Alles unter dem Namensraum .lab-… – kollidiert nicht mit neu.css
   (.tafel, .buehne, .szene, .fortschritt bleiben dort unberührt).
   Nutzt die Tokens aus neu.css (--bg, --text, --grau, --gold, --radius, --gutter, --ease …).
   ========================================================== */

/* ---------- Grundgerüst: hohe Sektion, klebende Bühne ---------- */
.lab-szene { --hyla: #DE6640; --lab-kopf: calc(var(--leiste-h) + var(--header-h)); position: relative; height: var(--laenge, 500svh); background: var(--bg); }
.lab-buehne { position: sticky; top: 0; height: 100svh; overflow: hidden; background: var(--bg); }
.lab-leinwand { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; }

/* ---------- Fortschritt (wie .makro__fortschritt) ---------- */
.lab-fortschritt { position: absolute; z-index: 6; top: calc(var(--lab-kopf) + 22px); left: var(--gutter); right: var(--gutter); height: 2px; background: rgba(0,0,0,.08); border-radius: 2px; overflow: hidden; pointer-events: none; }
.lab-fortschritt::after { content: ''; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, 0)); background: var(--text); }

/* ---------- Tafeln: gleicher Stil wie .makro__kasten ---------- */
.lab-tafel { position: absolute; z-index: 5; left: var(--gutter); right: var(--gutter); bottom: 6svh; max-width: 480px; padding: 26px 26px 28px; border-radius: var(--radius);
  background: rgba(255,255,255,.8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 20px 60px rgba(0,0,0,.08);
  opacity: 0; visibility: hidden; transform: translateY(16px); transition: opacity .55s var(--ease), transform .55s var(--ease), visibility 0s .55s; pointer-events: none; }
.lab-tafel.ist-aktiv { opacity: 1; visibility: visible; transform: none; transition: opacity .55s var(--ease), transform .55s var(--ease), visibility 0s; }
.lab-tafel small { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.lab-tafel small i { font-style: normal; color: var(--grau-hell); font-variant-numeric: tabular-nums; }
.lab-tafel h2 { font-size: clamp(1.9rem, 4.4vw, 3.4rem); letter-spacing: -.04em; }
.lab-tafel p { margin-top: 14px; font-size: clamp(1rem, 1.4vw, 1.1rem); color: #3B3A37; max-width: 440px; }
.lab-tafel--dunkel { background: rgba(18,18,18,.72); color: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.lab-tafel--dunkel small { color: var(--gold-hell); }
.lab-tafel--dunkel p { color: rgba(255,255,255,.78); }
@media (min-width: 900px) {
  .lab-tafel { left: auto; right: calc(var(--gutter) + 2vw); bottom: 12svh; }
  .lab-tafel--links { right: auto; left: calc(var(--gutter) + 2vw); }
}
@media (max-width: 899px) {
  .lab-tafel { padding: 20px 22px 22px; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }   /* über der schwebenden WhatsApp-Leiste */
  .lab-tafel p { font-size: 15px; }
  .lab-tafel--oben-handy { top: calc(var(--lab-kopf) + 40px); bottom: auto; }
}

/* ---------- Ladeanzeige ---------- */
.lab-laden { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; background: inherit; transition: opacity .9s var(--ease), visibility .9s; }
.lab-laden.fertig { opacity: 0; visibility: hidden; }
.lab-laden div { width: min(220px, 60vw); text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--grau); font-variant-numeric: tabular-nums; }
.lab-laden b { display: block; height: 1px; margin-top: 14px; background: rgba(0,0,0,.1); position: relative; overflow: hidden; }
.lab-laden b::after { content: ''; position: absolute; inset: 0; background: var(--text); transform-origin: left; transform: scaleX(var(--l, 0)); transition: transform .3s linear; }
.lab-ladehinweis { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; font-size: 13px; color: var(--grau); transition: opacity .6s var(--ease); }
.ist-bereit .lab-ladehinweis { opacity: 0; pointer-events: none; }

/* ==========================================================
   07 · Zeitlupen-Tropfen  (section.lab-szene--zeitlupe)
   Die Filmbilder sind auf den Seitenton #FBFAF7 umgefärbt, der weiche Rand verschwindet im Hintergrund.
   ========================================================== */
.lab-szene--zeitlupe { --laenge: 620svh; }
.zl-hud { position: absolute; z-index: 3; left: 0; top: 0; width: 0; height: 0; pointer-events: none; color: rgba(21,21,21,.62);
  font-size: 10.5px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; font-variant-numeric: tabular-nums; transition: opacity .6s var(--ease); }
.zl-hud .ecke { position: absolute; width: 18px; height: 18px; border: 0 solid rgba(21,21,21,.38); }
.zl-hud .ecke.lo { left: 0; top: 0; border-left-width: 1px; border-top-width: 1px; }
.zl-hud .ecke.ro { right: 0; top: 0; border-right-width: 1px; border-top-width: 1px; }
.zl-hud .ecke.lu { left: 0; bottom: 0; border-left-width: 1px; border-bottom-width: 1px; }
.zl-hud .ecke.ru { right: 0; bottom: 0; border-right-width: 1px; border-bottom-width: 1px; }
.zl-hud .oben, .zl-hud .unten { position: absolute; left: 28px; right: 28px; display: flex; justify-content: space-between; align-items: center; gap: 12px; white-space: nowrap; }
.zl-hud .oben { top: 2px; }
.zl-hud .unten { bottom: 2px; }
.zl-hud .rec { display: inline-flex; align-items: center; gap: 8px; }
.zl-hud .rec::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--hyla); box-shadow: 0 0 0 3px rgba(222,102,64,.16); }
.zl-hud .leiste { position: absolute; left: 28px; right: 28px; bottom: 26px; height: 13px;
  background: linear-gradient(rgba(21,21,21,.22), rgba(21,21,21,.22)) bottom / 100% 1px no-repeat,
              repeating-linear-gradient(to right, rgba(21,21,21,.3) 0 1px, transparent 1px 10%) bottom / calc(100% + 1px) 7px no-repeat,
              repeating-linear-gradient(to right, rgba(21,21,21,.16) 0 1px, transparent 1px 2%) bottom / calc(100% + 1px) 4px no-repeat; }
.zl-hud .leiste i { position: absolute; bottom: 0; left: 0; width: 1px; height: 13px; background: var(--text); will-change: transform; }
.zl-hud .leiste i::before { content: ''; position: absolute; left: -2px; top: -6px; width: 5px; height: 5px; border-radius: 50%; background: var(--hyla); }
@media (max-width: 899px) { .zl-hud { font-size: 9.5px; letter-spacing: .16em; } }
.lab-szene--zeitlupe .lab-tafel--wasser p { color: #2f3a3c; }
.lab-szene--zeitlupe .lab-tafel--wasser small i { color: #2f3a3c; }
/* Desktop: Film links, Text frei rechts auf dem Seitenton (gleiche Typografie wie die Tafeln) */
@media (min-width: 900px) {
  .lab-szene--zeitlupe .lab-tafel { top: 50%; bottom: auto; left: 58vw; right: auto; max-width: min(520px, 36vw); padding: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
    transform: translateY(calc(-50% + 16px)); }
  .lab-szene--zeitlupe .lab-tafel.ist-aktiv { transform: translateY(-50%); }
  .lab-szene--zeitlupe .lab-tafel h2 { font-size: clamp(2.2rem, 4.2vw, 3.9rem); letter-spacing: -.045em; }
  .lab-szene--zeitlupe .lab-tafel p { font-size: 17px; max-width: 400px; margin-top: 16px; color: var(--grau); }
}

/* ==========================================================
   08 · Text versinkt  (section.lab-szene--versinkt)
   ========================================================== */
.lab-szene--versinkt { --laenge: 620svh; }
.lab-szene--versinkt .lab-buehne { background: #EEEAE2; }
.lab-szene--versinkt .lab-tafel { max-width: 440px; }
/* weicher Übergang am Ende: unten läuft das dunkle Türkis in den hellen Ton von #ablauf aus.
   Liegt am Ende der Sektion (nicht an der klebenden Bühne) – sichtbar erst, wenn die Szene ausläuft.
   z-index 3: über der Leinwand, unter den Tafeln. */
.lab-szene--versinkt::after { content: ''; position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: 22svh; pointer-events: none;
  background: linear-gradient(to bottom, rgba(251,250,247,0) 0%, rgba(251,250,247,.12) 25%, rgba(251,250,247,.45) 55%, rgba(251,250,247,.82) 80%, var(--bg) 100%); }
@media (max-width: 899px) {
  .lab-szene--versinkt::after { height: 16svh; }
  /* Schluss-Tafel oben kompakt, damit „Wasser statt“ darunter frei bleibt */
  .lab-szene--versinkt .lab-tafel--oben-handy { top: calc(var(--lab-kopf) + 34px); padding: 16px 20px 18px; }
  .lab-szene--versinkt .lab-tafel--oben-handy h2 { font-size: 1.6rem; }
  .lab-szene--versinkt .lab-tafel--oben-handy p { margin-top: 8px; line-height: 1.5; }
}

/* ==========================================================
   05 · Beutel oder Wasser  (section #vergleich, div.lab-szene--luftwasser über der Tabelle)
   2D: Überschrift, drei nummerierte Schritte, zwei Geräte (Canvas) mit Texten direkt daneben/darunter.
   .k05-flaeche hat exakt das Seitenverhältnis des Zeichenraums (400 × 520), Marken sitzen in % darauf.
   ========================================================== */
.lab-szene--luftwasser { --laenge: 560svh; margin-bottom: 56px; }
.lab-szene--luftwasser .lab-buehne { background: #F3EFE7; }
.k05 { position: absolute; inset: calc(var(--lab-kopf) + 20px) var(--gutter) 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.k05-titel { text-align: center; max-width: 900px; }
.k05-augenbraue { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: 0 0 8px; }
.k05-titel h3 { margin: 0; font-size: clamp(1.7rem, 3.1vw, 2.6rem); line-height: 1.1; letter-spacing: -.035em; font-weight: 800; }
.k05-schritte { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; justify-content: center; flex-wrap: nowrap; }
.k05-schritte li { display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 7px; border-radius: 999px; font-size: 15px; font-weight: 700; color: var(--grau-hell); background: rgba(255,255,255,.45); white-space: nowrap; transition: color .4s var(--ease), background .4s var(--ease), box-shadow .4s var(--ease); }
.k05-schritte b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 13px; font-weight: 800; background: rgba(0,0,0,.06); color: var(--grau); transition: inherit; }
.k05-kurz { display: none; }
.k05-schritte li.ist-fertig { color: var(--grau); }
.k05-schritte li.ist-aktiv { color: var(--text); background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.07); }
.k05-schritte li.ist-aktiv b { background: var(--gold); color: #fff; }
.k05-paar { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(16px, 4vw, 64px); width: 100%; max-width: 1180px; flex: 0 1 auto; min-height: 0; }
.k05-geraet { margin: 0; display: grid; justify-items: center; align-content: start; min-width: 0; }
.k05-name { display: flex; align-items: baseline; gap: 10px; justify-content: center; text-align: center; flex-wrap: wrap; }
.k05-name b { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.k05-name span { font-size: 15px; font-weight: 600; color: var(--grau); }
.k05-geraet--wasser .k05-name b::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); margin-left: 8px; vertical-align: 3px; }
.k05-flaeche { position: relative; aspect-ratio: 400 / 520; height: var(--k05-h, 420px); max-width: 100%; }
.k05-flaeche canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.k05-marke { position: absolute; z-index: 2; left: 50%; top: 2%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px 6px 8px; border-radius: 999px; background: rgba(255,255,255,.88); box-shadow: 0 4px 14px rgba(0,0,0,.06);
  font-size: 15px; font-weight: 700; line-height: 1.2; color: var(--text); white-space: nowrap; opacity: 0; transition: opacity .45s var(--ease); pointer-events: none; }
.k05-marke::before { flex: 0 0 auto; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 800; color: #fff; }
.k05-marke--nein::before { content: '✗'; background: #8A8276; }
.k05-marke--ja::before { content: '✓'; background: var(--gold); }
.k05-marke.ist-aktiv { opacity: 1; }
/* Texte: alle in derselben Rasterzelle, nur der aktuelle ist sichtbar (keine Sprünge in der Höhe) */
.k05-texte { display: grid; width: 100%; max-width: 400px; margin-top: 12px; }
.k05-texte p { grid-area: 1 / 1; margin: 0; text-align: center; font-size: 16px; line-height: 1.45; color: #3B3A37; opacity: 0; transform: translateY(8px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.k05-texte p.ist-aktiv { opacity: 1; transform: none; }
.k05-texte p b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin-bottom: 3px; }
.k05-texte .k05-ergebnis i { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-style: normal; font-size: 18px; font-weight: 800; color: #fff; background: #8A8276; margin-bottom: 6px; }
.k05-geraet--wasser .k05-ergebnis i { background: var(--gold); }
.k05-texte .k05-ergebnis b { font-size: 24px; }
@media (min-width: 900px) {
  .k05 { bottom: 72px; }
  .k05-flaeche { --k05-h: clamp(260px, calc(100svh - var(--lab-kopf) - 420px), 560px); }
}
/* breite Bildschirme: Texte direkt seitlich an den Geräten (außen), Geräte dadurch größer */
@media (min-width: 1200px) {
  .k05 { bottom: 76px; }   /* Platz für die schwebende WhatsApp-Leiste unten rechts */
  .k05-paar { max-width: 1320px; gap: 0 clamp(24px, 3vw, 56px); }
  .k05-geraet { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 28px; align-items: end; }
  .k05-name { grid-column: 2; grid-row: 1; }
  .k05-flaeche { grid-column: 2; grid-row: 2; --k05-h: clamp(300px, min(calc(100svh - var(--lab-kopf) - 300px), 34vw), 600px); }
  .k05-texte { grid-column: 1; grid-row: 2; align-self: end; margin: 0 0 9%; max-width: 300px; justify-self: end; }
  .k05-texte p { text-align: right; }
  .k05-geraet--wasser { grid-template-columns: auto minmax(0, 1fr); }
  .k05-geraet--wasser .k05-name, .k05-geraet--wasser .k05-flaeche { grid-column: 1; }
  .k05-geraet--wasser .k05-texte { grid-column: 2; justify-self: start; }
  .k05-geraet--wasser .k05-texte p { text-align: left; }
  .k05-texte p { font-size: 17px; }
  .k05-texte p b { font-size: 23px; margin-bottom: 6px; }
  .k05-texte .k05-ergebnis b { font-size: 28px; }
}
@media (max-width: 899px) {
  .k05 { inset: calc(var(--lab-kopf) + 10px) var(--gutter) calc(96px + env(safe-area-inset-bottom, 0px)); gap: 16px; justify-content: center; }
  .k05-augenbraue { font-size: 11.5px; margin-bottom: 6px; }
  .k05-titel h3 { font-size: 1.6rem; }
  .k05-schritte { gap: 6px; }
  .k05-lang { display: none; }
  .k05-kurz { display: inline; }
  .k05-schritte li { font-size: 15px; padding: 5px 10px 5px 5px; gap: 6px; }
  .k05-schritte b { width: 21px; height: 21px; font-size: 12px; }
  .k05-paar { gap: 0 6px; width: calc(100% + 20px); margin: 0 -10px; }
  .k05-name { flex-direction: column; align-items: center; gap: 0; }
  .k05-name b { font-size: 17px; }
  .k05-name span { font-size: 13px; line-height: 1.3; }
  .k05-flaeche { height: auto; width: 100%; }
  .k05-marke { font-size: 15px; white-space: normal; width: max-content; max-width: 100%; text-align: left; padding: 5px 9px 5px 6px; }
  .k05-texte { margin-top: 12px; }
  .k05-texte p { font-size: 15px; line-height: 1.4; }
  .k05-texte p b { font-size: 17px; }
  .k05-texte .k05-ergebnis b { font-size: 19px; }
  .k05-texte .k05-ergebnis i { width: 28px; height: 28px; font-size: 15px; }
}
.lab-szene--luftwasser.ist-fehler .k05 { position: relative; inset: auto; }
.lab-szene--luftwasser.ist-fehler .k05-texte p { grid-area: auto; opacity: 1; transform: none; margin-bottom: 12px; }

/* ==========================================================
   11 · Sturm ins Glas  (section#prinzip.lab-szene--sturm, ersetzt die frühere Makro-Bildfolge)
   ========================================================== */
.lab-szene--sturm { --laenge: 880svh; }
.lab-szene--sturm .lab-buehne { background: #EAE5DC; }   /* Studio-Ton des Produktfotos: beim Laden springt nichts */
.lab-szene--sturm .lab-tafel h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.lab-szene--sturm .lab-tafel--einstieg h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); }   /* Kernaussage oben auf der Seite */
/* Handy: Tafeln oben unter dem Fortschrittsbalken, das Gerät steht im unteren Bildteil */
@media (max-width: 899px) {
  .lab-szene--sturm .lab-tafel { top: calc(var(--lab-kopf) + 36px); bottom: auto; padding: 18px 20px; transform: translateY(-12px); }
  .lab-szene--sturm .lab-tafel.ist-aktiv { transform: none; }
  .lab-szene--sturm .lab-tafel h2 { font-size: 1.55rem; }
  .lab-szene--sturm .lab-tafel--einstieg h2 { font-size: 1.9rem; }
  .lab-szene--sturm .lab-tafel p { font-size: 15px; margin-top: 8px; line-height: 1.5; }
}

/* ---------- Fehlerfall (kein WebGL o. ä.): Tafeln ruhig untereinander ---------- */
.lab-szene.ist-fehler { height: auto; }
.lab-szene.ist-fehler .lab-buehne { position: relative; height: auto; display: grid; gap: 16px; padding: 64px var(--gutter); }
.lab-szene.ist-fehler .lab-leinwand, .lab-szene.ist-fehler .k05-flaeche, .lab-szene.ist-fehler::after, .lab-szene.ist-fehler .lab-fortschritt, .lab-szene.ist-fehler .zl-hud, .lab-szene.ist-fehler .lab-laden, .lab-szene.ist-fehler .lab-ladehinweis { display: none; }
.lab-szene.ist-fehler .lab-tafel { position: relative; inset: auto; transform: none; opacity: 1; visibility: visible; margin: 0 auto; max-width: 620px; width: 100%; }

/* ---------- Reduzierte Bewegung: eine Bildschirmhöhe, Standbild statt Scroll-Film ---------- */
@media (prefers-reduced-motion: reduce) {
  .lab-szene { height: 100svh; }
  .lab-buehne { position: relative; }
  .lab-tafel { transition: none; }
}

/* ---------- Testmodus (?szene=name&p=0.4): genau diese Szene fest im Bild ---------- */
.lab-testmodus .lab-szene.ist-test { position: fixed; inset: 0; z-index: 45; height: 100svh; }
.lab-testmodus .lab-szene.ist-test .lab-buehne { position: absolute; inset: 0; }
.lab-testmodus .lab-szene.ist-test .lab-tafel, .lab-testmodus .lab-szene.ist-test .lab-laden { transition: none; }
.lab-fortschritt, .makro__fortschritt { display: none !important; }
