/* Coming-Soon-Seite „Something is moving.“ (Art Direction V2)
   Hinter einem hellen, bewegten Stoff läuft eine kurze Motion-Komposition (15 s, nahtlos).
   Komposition: HTML und CSS (Schrift, Flächen, Kreise), Schleier: WebGL-Shader in moving.js.
   Ohne WebGL bleibt ein ruhiger CSS-Schleier. Bei reduzierter Bewegung steht ein Standbild. */

@property --sp { syntax: "<length>"; inherits: true; initial-value: 0px; }

.projekt-moving { --rhythmus: clamp(56px, 8vh, 72px); --dauer: 15s; }

.moving-buehne {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
  max-width: 760px;
  margin: 0 0 var(--rhythmus);
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f5f3ee;
  box-shadow: 0 22px 50px -26px rgb(23 23 23 / 32%);
  animation: buehne-ein 1400ms ease both;
}

.mo-szene { position: absolute; inset: 0; overflow: hidden; }
.akt { position: absolute; inset: 0; }

/* Grundlage: ein warmer Hauch, der mit dem zweiten Bild kommt und geht */
.mo-wasche {
  position: absolute; inset: 0;
  background: radial-gradient(60% 70% at 50% 48%, rgb(255 105 74 / 16%), rgb(255 105 74 / 0%) 70%);
  opacity: 0;
  animation: wasche var(--dauer) linear infinite;
}

/* Schrift: Zeilen mit Maske, Buchstaben steigen von unten auf */
.wort { position: absolute; margin: 0; max-width: none; color: #171717; font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.025em; line-height: 1.1; white-space: nowrap; }
.ml { display: block; overflow: hidden; padding: 0 0.04em 0.22em; }
.b { display: inline-block; will-change: transform; }

.wort-a { left: 7%; bottom: 9%; color: #fff; mix-blend-mode: difference; font-size: 18cqw; }
.wort-a .b { animation: a-b var(--dauer) cubic-bezier(.65, 0, .35, 1) infinite; animation-delay: calc(var(--dauer) * -1 + var(--i) * 55ms); }

.wort-b { left: 0; right: 0; top: 50%; translate: 0 -54%; text-align: center; font-size: 12.5cqw; opacity: 0; animation: b-wort var(--dauer) linear infinite; }
.wort-b .ml { overflow: visible; }
.wort-b .b { transform: translateX(calc((var(--i) - 5) * var(--sp))); }
.wort-b .b-leer { width: 0.22em; }

.wort-c { left: 7%; bottom: 9%; color: #fff; mix-blend-mode: difference; font-size: 15cqw; }
.wort-c .b { animation: c-b var(--dauer) cubic-bezier(.65, 0, .35, 1) infinite; animation-delay: calc(var(--dauer) * -1 + var(--i) * 60ms); }

/* Bild 1: ein dunkler Bogen steigt auf, die Schrift kehrt sich dort um */
.mo-arch {
  position: absolute; right: 9%; bottom: -1px; width: 31%; height: 78%;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, #2a2a29, #171717);
  transform-origin: 50% 100%;
  transform: scaleY(0);
  animation: a-arch var(--dauer) cubic-bezier(.65, 0, .35, 1) infinite;
}

/* Bild 2: Koralle, ein Kreis wächst, zwei feine Ringe atmen nach außen */
.mo-scheibe, .mo-ring { position: absolute; left: 50%; top: 48%; border-radius: 50%; translate: -50% -50%; }
.mo-scheibe { width: 27cqw; aspect-ratio: 1; background: var(--coral); transform: scale(0); animation: b-scheibe var(--dauer) cubic-bezier(.65, 0, .35, 1) infinite; }
.mo-ring { width: 56cqw; aspect-ratio: 1; border: 1px solid rgb(255 105 74 / 70%); opacity: 0; transform: scale(0.3); animation: b-ring var(--dauer) cubic-bezier(.3, .1, .2, 1) infinite; }
.mo-ring-2 { animation-delay: 700ms; }

/* Bild 3: schmale Streifen gleiten mit Parallaxe herein, darüber die dritte Zeile */
.mo-slat {
  position: absolute; left: var(--x); bottom: 0; width: 8.5%; height: var(--h);
  background: #171717; transform: translateY(104%);
  animation: c-slat var(--dauer) cubic-bezier(.65, 0, .35, 1) infinite;
  animation-delay: calc(var(--dauer) * -1 + var(--i) * 85ms);
}
.mo-slat-hell { background: #d9d5cc; }
.mo-slat-grau { background: #a9aca6; }
.mo-slat-koralle { width: 0.5%; background: var(--coral); }

.mo-zeile { position: absolute; right: 7%; bottom: 10.5%; margin: 0; max-width: none; color: #707070; font-size: clamp(8px, 1.5cqw, 12px); letter-spacing: 0.14em; text-transform: uppercase; opacity: 0; animation: c-zeile var(--dauer) linear infinite; }

/* Der Punkt auf der Bahn bleibt immer sichtbar und schließt den Kreislauf: eine Umdrehung pro Durchlauf */
.mo-bahn { position: absolute; left: 50%; top: 50%; width: 47cqw; aspect-ratio: 1; translate: -50% -50%; border: 1px solid rgb(23 23 23 / 10%); border-radius: 50%; animation: kreisen var(--dauer) linear infinite; }
.mo-bahn i { position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--coral); }

/* Schleier: Shader-Canvas über der Komposition. Der CSS-Schleier ist nur der Ersatz ohne WebGL. */
.mo-schleier { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; display: none; pointer-events: none; }
.moving-buehne.hat-webgl .mo-schleier { display: block; }
.moving-schleier {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgb(235 236 240 / 95%) 0, rgb(235 236 240 / 95%) 4px, rgb(255 255 255 / 0%) 5px, rgb(214 219 228 / 22%) 20px, rgb(255 255 255 / 0%) 60px),
    repeating-linear-gradient(90deg, rgb(255 255 255 / 30%) 0, rgb(205 212 224 / 32%) 22px, rgb(255 255 255 / 52%) 46px, rgb(255 250 244 / 36%) 68px, rgb(255 255 255 / 30%) 92px),
    rgb(255 255 255 / 20%);
}
.moving-buehne.hat-webgl .moving-schleier { display: none; }

.moving-buehne.ist-pause *, .moving-buehne.ist-pause { animation-play-state: paused; }

@keyframes buehne-ein { from { opacity: 0; } to { opacity: 1; } }
@keyframes kreisen { to { transform: rotate(360deg); } }
@keyframes wasche { 0%, 31% { opacity: 0; } 44%, 52% { opacity: 1; } 64%, 100% { opacity: 0; } }

@keyframes a-arch { 0%, 2% { transform: scaleY(0); } 15%, 27% { transform: scaleY(1); } 36%, 100% { transform: scaleY(0); } }
@keyframes a-b { 0%, 3% { transform: translateY(115%); } 12%, 26% { transform: translateY(0); } 34%, 100% { transform: translateY(-115%); } }

@keyframes b-wort { 0%, 33% { --sp: 0.34em; opacity: 0; } 43% { opacity: 1; } 49%, 55% { --sp: 0em; opacity: 1; } 62%, 100% { --sp: 0em; opacity: 0; } }
@keyframes b-scheibe { 0%, 32% { transform: scale(0); } 42%, 54% { transform: scale(1); } 63%, 100% { transform: scale(0); } }
@keyframes b-ring { 0%, 33% { transform: scale(0.3); opacity: 0; } 38% { opacity: 0.9; } 58% { transform: scale(1.06); opacity: 0; } 100% { transform: scale(1.06); opacity: 0; } }

@keyframes c-slat { 0%, 62% { transform: translateY(104%); } 72%, 86% { transform: translateY(0); } 94%, 100% { transform: translateY(-104%); } }
@keyframes c-b { 0%, 66% { transform: translateY(115%); } 75%, 87% { transform: translateY(0); } 94%, 100% { transform: translateY(-115%); } }
@keyframes c-zeile { 0%, 70% { opacity: 0; } 77%, 87% { opacity: 1; } 93%, 100% { opacity: 0; } }

.moving-schluss {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.6vw, 28px);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

@media (max-width: 680px) {
  .moving-buehne { aspect-ratio: 4 / 5; }
  .wort-a { font-size: 19cqw; bottom: 10%; }
  .wort-b { font-size: 12cqw; }
  .wort-c { font-size: 17cqw; }
  .mo-arch { right: 7%; width: 36%; height: 70%; }
  .mo-bahn { width: 66cqw; }
  .mo-scheibe { width: 40cqw; }
  .mo-ring { width: 76cqw; }
  .mo-zeile { right: auto; left: 7.5%; bottom: 4.5%; font-size: 8px; }
  .mo-slat { width: 10%; }
}

/* Reduzierte Bewegung: ein ruhiges Standbild, der erste Auftritt der Schrift vor dem Bogen */
@media (prefers-reduced-motion: reduce) {
  .moving-buehne { animation: none; }
  .mo-wasche, .akt-b, .akt-c, .mo-bahn i { display: none; }
  .mo-arch { animation: none; transform: scaleY(1); }
  .wort-a .b { animation: none; transform: none; }
  .mo-bahn { animation: none; border-color: rgb(23 23 23 / 8%); }
}
