/* ============================================================
   Q KI Consulting – Imageanimation
   Alle Größen relativ zur Bühne über --u (wird von film.js gesetzt).
   ============================================================ */

.film {
  position: fixed; inset: 0; background: #000; z-index: 100;
  opacity: 1; transition: opacity .9s var(--ease);
}
.film.is-hidden { opacity: 0; pointer-events: none; }
.film.is-off { display: none; }
.film.pulse { transition-duration: .32s; }
.film.pulse .hl { font-weight: 600; letter-spacing: -.025em; line-height: 1.1; }
.film.pulse .caption { color: rgba(255,255,255,.86); }

.stage { position: absolute; inset: 0; overflow: hidden; --u: 16px; }
.scene {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none; visibility: hidden;
}
.cue { opacity: 0; will-change: opacity, transform; }
.stage.measuring .cue { transform: none !important; }

/* Typo */
.hl { margin: 0; font-weight: 400; letter-spacing: -.015em; line-height: 1.15; font-size: calc(var(--u) * 3.2); color: #fff; }
.hl span { display: block; }
.sub { margin: calc(var(--u) * 1.3) 0 0; color: var(--fg-70); font-size: calc(var(--u) * 1.35); line-height: 1.4; font-weight: 400; }
.caption {
  position: absolute; left: 0; right: 0; bottom: calc(var(--u) * 6.4); margin: 0;
  text-align: center; color: var(--fg-70); font-size: calc(var(--u) * 1.15); padding: 0 calc(var(--u) * 4);
}

/* Split-Layout (Text links, Grafik rechts) */
.split { gap: calc(var(--u) * 4); padding: 0 calc(var(--u) * 5); }
.split .copy { flex: 0 1 auto; max-width: 52%; }
.split .hl span, .split .sub { white-space: nowrap; }
.split .visual { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.stage.portrait .split { flex-direction: column; justify-content: center; gap: calc(var(--u) * 3); padding: 0 calc(var(--u) * 4); }
.stage.portrait .split .copy { max-width: 100%; text-align: center; }

/* ---------- Szene 1 ---------- */
.s1 { flex-direction: column; text-align: center; padding: 0 calc(var(--u) * 4); }
.s1 .hl { font-size: calc(var(--u) * 3.6); }
.brand { display: flex; justify-content: center; margin-top: calc(var(--u) * 3.6); color: #fff; }
.brand .logo { display: block; fill: currentColor; width: calc(var(--u) * 12); height: calc(var(--u) * 12 * .37); }

/* ---------- Szene 2 ---------- */
.s2 { gap: calc(var(--u) * 10); padding: 0 calc(var(--u) * 8); }
.terms { list-style: none; margin: 0; padding: 0; font-size: calc(var(--u) * 2.2); line-height: 1.55; flex: 0 0 auto; }
.term { position: relative; display: table; --strike: 0; --dim: 0; color: rgba(255, 255, 255, calc(.75 - .4 * var(--dim))); }
.term::after {
  content: ""; position: absolute; left: -.05em; right: -.05em; top: 53%; height: .06em;
  background: rgba(255, 255, 255, .6); transform: scaleX(var(--strike)); transform-origin: left center;
}
.statement { font-size: calc(var(--u) * 3); white-space: nowrap; flex: 0 0 auto; }
.stage.portrait .s2 { flex-direction: column; gap: calc(var(--u) * 4); padding: 0 calc(var(--u) * 4); align-items: flex-start; }
.stage.portrait .terms { font-size: calc(var(--u) * 2); }

/* ---------- Szene 3 ---------- */
.s3 { flex-direction: column; }
.waves { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 44%; pointer-events: none; }
.rail { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; opacity: 0; }
.rail polyline { stroke: rgba(255, 255, 255, .4); stroke-width: 1; }
.nodes {
  list-style: none; margin: 0; padding: 0; display: flex; justify-content: center;
  gap: calc(var(--u) * 1.6); position: relative; transform: translateY(calc(var(--u) * -2.5));
}
.node { display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 1.1); width: calc(var(--u) * 7); }
.node .lbl { font-size: calc(var(--u) * .9); text-align: center; line-height: 1.25; color: var(--fg-70); min-height: 2.5em; display: flex; align-items: flex-end; }
.circ {
  width: calc(var(--u) * 3.6); height: calc(var(--u) * 3.6); border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .65); background: #000;
  display: grid; place-items: center; position: relative; z-index: 1;
}
.circ svg { width: 48%; height: 48%; fill: none; stroke: #fff; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.stage.portrait .waves { height: 32%; }
.stage.portrait .nodes { flex-direction: column; gap: calc(var(--u) * 1.5); transform: translateY(calc(var(--u) * -3)); }
.stage.portrait .node { flex-direction: row-reverse; width: auto; gap: calc(var(--u) * 1.6); justify-content: flex-end; }
.stage.portrait .node .lbl { text-align: left; min-height: 0; align-items: center; width: calc(var(--u) * 10); }
.stage.portrait .node .lbl br { display: none; }

/* ---------- Szene 4 ---------- */
.sphere-wrap { position: relative; width: calc(var(--u) * 22); height: calc(var(--u) * 22); }
.sphere { position: absolute; inset: 0; width: 100%; height: 100%; }
.q-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: calc(var(--u) * 5); height: calc(var(--u) * 5); color: #fff;
}
.stage.portrait .sphere-wrap { width: calc(var(--u) * 20); height: calc(var(--u) * 20); }

/* ---------- Szene 5 ---------- */
.s5 { flex-direction: column; }
.cols { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; transform: translateY(calc(var(--u) * -1.5)); }
.col {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: calc(var(--u) * 2.2); padding: calc(var(--u) * 1.2) calc(var(--u) * 1.2); width: calc(var(--u) * 9.4);
  border-left: 1px solid rgba(255, 255, 255, .22);
}
.col:first-child { border-left: 0; }
.col .lbl { font-size: calc(var(--u) * .9); text-align: center; line-height: 1.25; color: #fff; min-height: 2.5em; }
.col svg { width: calc(var(--u) * 2.6); height: calc(var(--u) * 2.6); fill: none; stroke: #fff; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.stage.portrait .cols { display: grid; grid-template-columns: 1fr 1fr; width: min(100%, calc(var(--u) * 30)); transform: translateY(calc(var(--u) * -2)); }
.stage.portrait .col { width: auto; border-left: 0; border-top: 1px solid rgba(255, 255, 255, .18); padding: calc(var(--u) * 1.6) calc(var(--u) * 1); }
.stage.portrait .col:nth-child(-n+2) { border-top: 0; }
.stage.portrait .col:nth-child(2n) { border-left: 1px solid rgba(255, 255, 255, .18); }

/* ---------- Szene 6 ---------- */
.s6 { flex-direction: column; justify-content: flex-start; padding-top: calc(var(--u) * 7); }
.paths-labels { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: calc(var(--u) * 2); position: relative; z-index: 1; }
.plabel { display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 1); width: calc(var(--u) * 9); }
.plabel .lbl { font-size: calc(var(--u) * .95); text-align: center; line-height: 1.25; min-height: 2.5em; display: flex; align-items: flex-end; color: #fff; }
.pico { width: calc(var(--u) * 1.9); height: calc(var(--u) * 1.9); fill: none; stroke: #fff; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.fan { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fan path { fill: none; stroke: rgba(255, 255, 255, .8); stroke-width: 1.1; }
.fan .fan-dot { fill: #fff; }
.stage.portrait .s6 { padding-top: calc(var(--u) * 6); }
/* Portrait: 3 oben, 2 versetzt darunter – die Linien laufen zwischen den Labels hindurch */
.stage.portrait .paths-labels { flex-wrap: wrap; gap: calc(var(--u) * 2.2) 0; width: 100%; }
.stage.portrait .plabel { width: 30%; order: 1; }
.stage.portrait .plabel:nth-child(2), .stage.portrait .plabel:nth-child(4) { order: 2; }
.stage.portrait .plabel .lbl { font-size: calc(var(--u) * .9); }

/* ---------- Szene 7 ---------- */
.way { width: calc(var(--u) * 34); height: auto; overflow: visible; }
.way .ghosts path { stroke-width: .8; }
.way .main { stroke: #fff; stroke-width: 1.6; filter: url(#glow); }
.way .end { fill: #fff; filter: url(#glow); }
.way .end-halo { fill: none; stroke: #fff; stroke-width: 1; opacity: 0; }
.stage.portrait .way { width: min(100%, calc(var(--u) * 30)); }

/* ---------- Szene 8 ---------- */
.phone {
  width: calc(var(--u) * 15); height: calc(var(--u) * 22);
  border: 1px solid rgba(255, 255, 255, .35); border-bottom: 0;
  border-radius: calc(var(--u) * 1.6) calc(var(--u) * 1.6) 0 0;
  background: linear-gradient(#0d0d0d, #000);
  padding: calc(var(--u) * 1.6) calc(var(--u) * 1.3);
  display: flex; flex-direction: column; gap: calc(var(--u) * 1.2);
  align-self: flex-end; margin-bottom: calc(var(--u) * -6);
}
.phone .q-mark { width: calc(var(--u) * 2); height: calc(var(--u) * 2); }
.bubble {
  background: #1a1a1a; border-radius: calc(var(--u) * .8); padding: calc(var(--u) * 1) calc(var(--u) * 1.1);
  font-size: calc(var(--u) * .85); line-height: 1.4; color: var(--fg-70); margin-top: calc(var(--u) * .6);
}
.dots {
  display: inline-flex; gap: calc(var(--u) * .35); background: #1a1a1a; border-radius: calc(var(--u) * .6);
  padding: calc(var(--u) * .7) calc(var(--u) * .8); width: max-content;
}
.dots i { width: calc(var(--u) * .35); height: calc(var(--u) * .35); border-radius: 50%; background: #fff; opacity: .35; animation: qdot 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
.stage.portrait .phone {
  align-self: center; margin-bottom: 0; height: auto;
  border-bottom: 1px solid rgba(255, 255, 255, .35); border-radius: calc(var(--u) * 1.6);
}
/* Szene 8 (Landscape): Untertitel links unter dem Text, damit er nicht über dem Phone liegt */
.stage[data-scene="s8"]:not(.portrait) .subtitle { right: 50%; text-align: left; padding: 0 0 0 calc(var(--u) * 5); }

/* ---------- Untertitel ---------- */
.subtitle {
  position: absolute; left: 0; right: 0; bottom: calc(var(--u) * 3.4); margin: 0; text-align: center;
  font-size: calc(var(--u) * 1); color: var(--fg-50); padding: 0 calc(var(--u) * 6);
  opacity: 0; transition: opacity .35s; pointer-events: none; letter-spacing: .01em; line-height: 1.4;
}
.subtitle.is-on { opacity: 1; }
.stage.portrait .subtitle { bottom: calc(var(--u) * 6.2); font-size: calc(var(--u) * .95); padding: 0 calc(var(--u) * 3); }
.stage.portrait .caption { bottom: calc(var(--u) * 13); }
.film.no-subs .subtitle { display: none; }

/* ---------- Bedienung ---------- */
.film-ui { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; align-items: flex-end; padding: 1.1rem 1.3rem; }
.ui-btn {
  display: inline-flex; align-items: center; gap: .45rem; background: none; border: 0; color: var(--fg-50);
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; padding: .5rem; cursor: pointer; transition: color .2s;
}
.ui-btn:hover, .ui-btn:focus-visible { color: #fff; outline: none; }
.ui-btn .ic { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ui-btn .on { display: none; }
.ui-btn[aria-pressed=true] .on { display: block; }
.ui-btn[aria-pressed=true] .off { display: none; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: rgba(255, 255, 255, .1); }
.progress i { display: block; height: 100%; width: 0; background: rgba(255, 255, 255, .5); }

@media (prefers-reduced-motion: reduce) {
  .dots i { animation: none; opacity: .6; }
}
.sound-start { position: absolute; z-index: 100; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 18px 28px; border: 1px solid #888; border-radius: 40px; background: #080808; color: white; font: inherit; cursor: pointer; white-space: nowrap; }
.sound-start[hidden] { display: none; }
