body { width: 100vw; height: 100vh; }

.buehne {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.buehne::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(232, 164, 48, 0.03), transparent 55%),
    radial-gradient(ellipse at 80% 70%, rgba(80, 212, 200, 0.02), transparent 55%);
  pointer-events: none;
}

/* ============================================================
   Basis-Folien
   ============================================================ */

.folie {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  padding: 60px 80px;
}

.folie.aktiv { opacity: 1; pointer-events: auto; }

.folie .folien-nr {
  position: absolute;
  top: 32px;
  left: 48px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--akzent);
  text-transform: uppercase;
}

/* Folientitel oben links unter der Nummer */
.folie-titel {
  position: absolute;
  top: 32px;
  left: 130px;
  font-family: var(--schrift);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text-2);
  letter-spacing: -0.01em;
}

.fortschritt-leiste {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--akzent);
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 0 20px rgba(232, 164, 48, 0.3);
}

.vollbild-btn {
  position: absolute;
  top: 28px;
  right: 48px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 16px;
  border: 1px solid var(--rand);
  border-radius: var(--r-s);
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}

.vollbild-btn:hover { border-color: var(--akzent); color: var(--akzent); }

/* Platzhalter */
.folie--visuell {
  flex-direction: column;
  gap: 20px;
}

.platzhalter-box {
  width: 100%;
  max-width: 1100px;
  flex: 1;
  max-height: 70vh;
  border: 1px dashed var(--rand-hell);
  border-radius: var(--r-l);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--flaeche);
}

.platzhalter-box .icon { font-size: 1.4rem; color: var(--text-3); }
.platzhalter-box .label { font-family: var(--mono); font-size: 0.8rem; color: var(--text-3); text-align: center; max-width: 500px; line-height: 1.5; }

/* Minimal (Titel + Fragen) */
.folie--minimal { flex-direction: column; gap: 16px; }
.folie--minimal h1 { font-weight: 700; font-size: clamp(3rem, 7vw, 7rem); letter-spacing: -0.03em; line-height: 1; text-align: center; }
.folie--minimal .unter { font-weight: 300; font-size: clamp(1rem, 1.8vw, 1.6rem); color: var(--text-2); text-align: center; }
.folie--minimal .end-autor { margin-top: 32px; font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.1em; color: var(--text-3); }

/* Demo */
.folie--demo { flex-direction: column; padding: 40px 48px; gap: 16px; }
.demo-kopf { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.demo-kopf h2 { font-weight: 600; font-size: 1.4rem; }
.demo-info { display: flex; gap: 24px; font-family: var(--mono); font-size: 0.8rem; }
.tag { padding: 6px 14px; border-radius: var(--r-s); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.tag.baseline { background: rgba(232, 140, 48, 0.15); color: var(--baseline); }
.tag.ppo { background: rgba(80, 212, 200, 0.15); color: var(--ppo); }
.demo-inhalt { flex: 1; width: 100%; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--r-l); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.demo-inhalt video { width: 100%; height: 100%; object-fit: contain; }

/* ============================================================
   Animations-Grundlagen
   ============================================================ */

/* Alles mit .anim-ein startet unsichtbar und fadet beim Aktivieren rein */
.anim-ein {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: calc(var(--delay, 0) * 1s);
}

.folie.aktiv .anim-ein {
  opacity: 1;
  transform: translateY(0);
}

/* SVG-Linien zeichnen sich */
.kurve-draw {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  transition: stroke-dashoffset 2s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--delay, 2.5) * 1s);
}

.folie.aktiv .kurve-draw {
  stroke-dashoffset: 0;
}

/* ============================================================
   Folie 3 — RL-Kreislauf (SVG-basiert)
   ============================================================ */

.folie--custom {
  padding: 40px 60px;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Folien-Ueberschrift */
.folie-titel {
  font-family: var(--schrift);
  font-weight: 600;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  letter-spacing: -0.01em;
  color: var(--text);
  text-align: center;
  width: 100%;
  flex-shrink: 0;
  margin-top: 20px;
}

.rl-container {
  width: 100%;
  max-width: 1000px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rl-svg { width: 100%; height: auto; }

/* Boxen faden ein */
.rl-box {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: calc(var(--delay) * 1s);
}

.folie.aktiv .rl-box { opacity: 1; transform: translateY(0); }

/* Linien zeichnen sich */
.rl-linie {
  stroke-dasharray: 1500;
  stroke-dashoffset: 1500;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--delay) * 1s);
}

.folie.aktiv .rl-linie { stroke-dashoffset: 0; }

/* Texte faden ein */
.rl-text {
  opacity: 0;
  transition: opacity 0.6s ease;
  transition-delay: calc(var(--delay) * 1s);
}

.folie.aktiv .rl-text { opacity: 1; }

/* Animierter Datenpunkt fadet ein */
.rl-datenpunkt {
  opacity: 0;
  transition: opacity 1s ease;
  transition-delay: calc(var(--delay) * 1s);
}

.folie.aktiv .rl-datenpunkt { opacity: 1; }

/* ============================================================
   Folie 6 & 7 — Split-Layout (Links: Info, Rechts: Kurve)
   ============================================================ */

.split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  width: 100%;
  max-width: 1200px;
  align-items: center;
}

.split-links, .split-rechts { display: flex; flex-direction: column; }

/* Naiver Versuch Rechnung */
.naiv-rechnung {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.naiv-zahl {
  font-family: var(--mono);
  font-size: 3rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.naiv-label {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--text-2);
  margin-left: 16px;
}

.naiv-op {
  font-family: var(--mono);
  font-size: 2rem;
  color: var(--text-3);
  margin-right: 12px;
}

.naiv-trenn {
  height: 2px;
  background: var(--rand-hell);
  width: 100%;
  max-width: 380px;
}

.naiv-formel {
  font-family: var(--mono);
  font-size: 2rem;
  color: var(--text-2);
  margin-right: 12px;
}

.naiv-formel sup { font-size: 1.2rem; }

.naiv-gross {
  font-family: var(--mono);
  font-size: 4.5rem;
  font-weight: 800;
  color: var(--rot);
  letter-spacing: -0.03em;
}

.naiv-sub {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-3);
  letter-spacing: 0.05em;
}

/* Kurven-Box (verwendet in Folie 6 und 7) */
.kurve-box {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--r-l);
  padding: 24px;
}

.kurve-titel {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}

.kurve-svg { width: 100%; height: auto; }

/* ============================================================
   Folie 7 — Cluster (Punkte faerben sich, Ringe pulsieren rot/gruen)
   Gesamte Animation loopt alle 10 Sekunden.
   ============================================================ */

.cluster-vis {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cluster-karte {
  position: relative;
  width: 100%;
  aspect-ratio: 1.2;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--r-l);
}

/* Punkte: starten grau, faerben sich dann in Cluster-Farben, Loop */
.cl-punkt {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #5a6478;
  box-shadow: 0 0 6px rgba(90,100,120,0.3);
  opacity: 0;
}

.folie.aktiv .cl-punkt {
  animation: clPunktEin 0.4s ease var(--punkt-delay, 0.5s) forwards, clPunktFarbe 12s ease infinite;
}

/* Einblenden (einmalig, gestaffelt ueber --punkt-delay) */
@keyframes clPunktEin {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Farbwechsel-Loop: alle Punkte gleichzeitig.
   0-18% = grau, 18-25% = Wechsel zu Farbe, 25-72% = Farbe halten, 72-80% = zurueck zu grau, 80-100% = grau */
@keyframes clPunktFarbe {
  0%   { background: #5a6478; box-shadow: 0 0 6px rgba(90,100,120,0.3); }
  18%  { background: #5a6478; box-shadow: 0 0 6px rgba(90,100,120,0.3); }
  26%  { background: var(--ziel-farbe); box-shadow: 0 0 14px var(--ziel-farbe); }
  72%  { background: var(--ziel-farbe); box-shadow: 0 0 14px var(--ziel-farbe); }
  80%  { background: #5a6478; box-shadow: 0 0 6px rgba(90,100,120,0.3); }
  100% { background: #5a6478; box-shadow: 0 0 6px rgba(90,100,120,0.3); }
}

/* Ringe: erscheinen NACHDEM Punkte gefaerbt sind, pulsieren rot↔gruen */
.cl-ring {
  position: absolute;
  width: 115px;
  height: 115px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.folie.aktiv .cl-ring {
  animation:
    clRingLoop 12s ease infinite,
    clAmpelPuls var(--ampel-dauer, 2.5s) ease-in-out var(--ampel-versatz, 0s) infinite;
}

/* Ring erscheint bei 32% (= ~3.8s), Punkte sind bei 26% (= ~3.1s) schon gefaerbt.
   Ring verschwindet bei 75%, bevor Punkte bei 80% zurueck zu grau gehen. */
@keyframes clRingLoop {
  0%   { opacity: 0; }
  32%  { opacity: 0; }
  38%  { opacity: 0.7; }
  72%  { opacity: 0.7; }
  78%  { opacity: 0; }
  100% { opacity: 0; }
}

/* Ampel-Puls: wechselt zwischen gruen und rot */
@keyframes clAmpelPuls {
  0%   { border-color: #2dd4a0; box-shadow: 0 0 20px rgba(45, 212, 160, 0.25); }
  45%  { border-color: #2dd4a0; box-shadow: 0 0 20px rgba(45, 212, 160, 0.25); }
  50%  { border-color: #f06050; box-shadow: 0 0 20px rgba(240, 96, 80, 0.25); }
  95%  { border-color: #f06050; box-shadow: 0 0 20px rgba(240, 96, 80, 0.25); }
  100% { border-color: #2dd4a0; box-shadow: 0 0 20px rgba(45, 212, 160, 0.25); }
}

.cluster-zahlen {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
}

.cl-alt {
  font-family: var(--mono);
  font-size: 1.3rem;
  color: var(--text-3);
  text-decoration: line-through;
  text-decoration-color: var(--rot);
}

.cl-alt sup { font-size: 0.8rem; }

.cl-pfeil {
  font-size: 1.5rem;
  color: var(--text-3);
}

.cl-neu {
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--gruen);
}

.cl-neu sup { font-size: 1.2rem; }

/* ============================================================
   Folie 9 — Ergebnisse
   ============================================================ */

.ergebnis-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  width: 100%;
  max-width: 1200px;
}

.ergebnis-block {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.erg-titel {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.erg-zeile {
  display: grid;
  grid-template-columns: 140px 1fr 80px;
  align-items: center;
  gap: 16px;
}

.erg-name {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text-2);
}

.erg-range {
  font-size: 0.7rem;
  color: var(--text-3);
}

.erg-bar-bg {
  height: 28px;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--r-s);
  overflow: hidden;
}

.erg-bar {
  height: 100%;
  width: 0;
  border-radius: var(--r-s);
  transition: width 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--delay, 0) * 1s + 0.3s);
}

.folie.aktiv .erg-bar { width: var(--breite); }

.erg-wert {
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 700;
  text-align: right;
  letter-spacing: -0.01em;
}

.erg-note {
  font-size: 0.85rem;
  color: var(--text-3);
  font-style: italic;
}

/* ============================================================
   Bilder aus der Facharbeit
   ============================================================ */

/* Vollbild-Bild (Folie 4, 5) */
.bild-vollbild {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.bild-vollbild img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--r-l);
  border: 1px solid var(--rand);
}

/* Gerahmtes Bild im Split-Layout (Folie 6, 9) */
.bild-rahmen {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--r-l);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bild-rahmen img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--r-s);
}
