/* =============================================================================
   ECM – Cinematic Hero (scroll-gesteuerte Bildsequenz)
   Ergänzt assets/styles.css. Muss NACH styles.css eingebunden werden.
   ========================================================================== */

.hero-cinematic {
  --seq-scroll: 4200px;
  --seq-stage-h: 100svh;

  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  margin-inline: 0;
  /* Unter die schwebende Kopfzeile ziehen, damit das Bild randlos beginnt. */
  margin-top: calc(-1 * (var(--header-h, 6rem) + 1rem));
  background: #05070a;
  color: var(--surface);
}

.hero-cinematic__track {
  position: relative;
  height: auto;
}

.hero-cinematic[data-seq-mode='scroll'] .hero-cinematic__track {
  height: calc(var(--seq-scroll) + var(--seq-stage-h));
}

/* Grundzustand = statische Darstellung (auch ohne JavaScript):
   Bild als 16:9-Banner, Texte darunter im normalen Fluss. */
.hero-cinematic__stage {
  position: relative;
  overflow: hidden;
  padding-top: var(--header-h, 6rem);
  background: #05070a;
}

.hero-cinematic__media {
  position: relative;
  aspect-ratio: 16 / 9;
}

/* Scroll-Modus: Bühne wird angeheftet, Bild füllt den Bildschirm. */
.hero-cinematic[data-seq-mode='scroll'] .hero-cinematic__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: var(--seq-stage-h);
  padding-top: 0;
}

.hero-cinematic[data-seq-mode='scroll'] .hero-cinematic__media {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
}

/* --- Bildebene ------------------------------------------------------------ */

.hero-cinematic__canvas,
.hero-cinematic__poster {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.hero-cinematic__poster {
  object-fit: cover;
  opacity: 1;
  transition: opacity 700ms ease;
}

/* Sobald der erste Frame gezeichnet ist, blendet das Poster weg. */
.hero-cinematic[data-seq-loaded='ready'] .hero-cinematic__poster,
.hero-cinematic[data-seq-loaded='complete'] .hero-cinematic__poster {
  opacity: 0;
}

.hero-cinematic__canvas {
  opacity: 0;
  transition: opacity 700ms ease;
}

.hero-cinematic[data-seq-loaded='ready'] .hero-cinematic__canvas,
.hero-cinematic[data-seq-loaded='complete'] .hero-cinematic__canvas {
  opacity: 1;
}

.hero-cinematic__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 7, 10, 0.72) 0%, rgba(5, 7, 10, 0) 26%),
    linear-gradient(0deg, rgba(5, 7, 10, 0.88) 0%, rgba(5, 7, 10, 0) 46%),
    linear-gradient(90deg, rgba(5, 7, 10, 0.7) 0%, rgba(5, 7, 10, 0) 52%);
}

/* --- Textebenen ----------------------------------------------------------- */

.hero-cinematic__caps {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 3.5rem;
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 3.5rem 0 4rem;
}

/* Im Scroll-Modus sitzt die Textspalte nah am linken Rand statt in der
   zentrierten Inhaltsbreite - auf breiten Schirmen sonst zu weit innen. */
.hero-cinematic[data-seq-mode='scroll'] .hero-cinematic__caps {
  position: absolute;
  top: 0;
  bottom: 0;
  left: clamp(1.5rem, 5vw, 5rem);
  right: auto;
  width: min(48rem, 62vw);
  max-width: none;
  margin: 0;
  padding: 0;
  display: block;
}

.hero-cinematic__cap {
  max-width: 46rem;
}

.hero-cinematic[data-seq-mode='scroll'] .hero-cinematic__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(5rem, 12vh, 9rem);
  opacity: 0;
  will-change: opacity, transform;
}

.hero-cinematic__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.1rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-cinematic__eyebrow::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 107, 23, 0.24);
}

.hero-cinematic__cap h1,
.hero-cinematic__cap h2 {
  margin: 0 0 1rem;
  font-size: clamp(2.3rem, 5.4vw, 4.6rem);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.025em;
  text-wrap: balance;
  text-shadow: 0 14px 44px rgba(0, 0, 0, 0.55);
}

.hero-cinematic__cap p {
  margin: 0 0 1.6rem;
  max-width: 34rem;
  color: rgba(245, 241, 233, 0.86);
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  text-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
}

.hero-cinematic__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.hero-cinematic__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1.8rem 0 0;
  max-width: 40rem;
}

.hero-cinematic__facts div {
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(10, 14, 21, 0.5);
  backdrop-filter: blur(10px);
}

.hero-cinematic__facts dt {
  font-size: 1.25rem;
  font-weight: 700;
}

.hero-cinematic__facts dd {
  margin: 0.2rem 0 0;
  color: rgba(245, 241, 233, 0.78);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* --- Bedienhinweise & Fortschritt ----------------------------------------- */

.hero-cinematic__hint,
.hero-cinematic__rail,
.hero-cinematic__loader {
  display: none;
}

.hero-cinematic[data-seq-mode='scroll'] .hero-cinematic__hint,
.hero-cinematic[data-seq-mode='scroll'] .hero-cinematic__rail,
.hero-cinematic[data-seq-mode='scroll'] .hero-cinematic__loader {
  display: block;
}

.hero-cinematic__hint {
  position: absolute;
  right: clamp(1.5rem, 5vw, 5rem);
  bottom: clamp(5rem, 12vh, 9rem);
  z-index: 3;
  color: rgba(245, 241, 233, 0.66);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: opacity 500ms ease;
}

.hero-cinematic__hint::after {
  content: '';
  display: block;
  width: 1px;
  height: 3.2rem;
  margin: 0.8rem auto 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), transparent);
  animation: ecm-seq-hint 2.2s ease-in-out infinite;
}

.hero-cinematic.is-engaged .hero-cinematic__hint {
  opacity: 0;
}

@keyframes ecm-seq-hint {
  0%,
  100% { transform: scaleY(0.35); transform-origin: top; opacity: 0.35; }
  50%  { transform: scaleY(1);    transform-origin: top; opacity: 1; }
}

/* Bei "Bewegung reduzieren": nichts, was von allein läuft. Das Durchblättern
   der Sequenz bleibt, es folgt ausschliesslich dem eigenen Scrollen. */
.hero-cinematic[data-seq-motion='reduced'] .hero-cinematic__hint::after {
  animation: none;
  transform: scaleY(1);
  transform-origin: top;
  opacity: 0.7;
}

.hero-cinematic__rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.hero-cinematic__bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--accent-soft));
  transform: scaleX(0);
  transform-origin: left center;
}

.hero-cinematic__loader {
  position: absolute;
  right: clamp(1.5rem, 5vw, 5rem);
  top: calc(var(--header-h, 6rem) + 2.5rem);
  z-index: 3;
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(10, 14, 21, 0.6);
  backdrop-filter: blur(10px);
  color: rgba(245, 241, 233, 0.72);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: opacity 500ms ease;
}

.hero-cinematic[data-seq-loaded='complete'] .hero-cinematic__loader,
.hero-cinematic[data-seq-failed] .hero-cinematic__loader {
  opacity: 0;
  pointer-events: none;
}

/* --- Mobil ---------------------------------------------------------------- */

@media (max-width: 760px) {
  .hero-cinematic__cap {
    max-width: none;
  }

  .hero-cinematic[data-seq-mode='scroll'] .hero-cinematic__cap {
    bottom: 4.5rem;
    padding-right: 0.5rem;
  }

  .hero-cinematic__facts {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .hero-cinematic__facts div {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    padding: 0.6rem 0.85rem;
  }

  .hero-cinematic__facts dt {
    font-size: 1rem;
  }

  .hero-cinematic__hint {
    display: none !important;
  }

  .hero-cinematic__scrim {
    background:
      linear-gradient(180deg, rgba(5, 7, 10, 0.7) 0%, rgba(5, 7, 10, 0) 24%),
      linear-gradient(0deg, rgba(5, 7, 10, 0.92) 0%, rgba(5, 7, 10, 0) 58%);
  }
}

/* --- Anschluss-Sektion (Film) --------------------------------------------- */

.filmstrip {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 6rem auto 0;
}

.filmstrip__frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #090d14;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

.filmstrip__frame img,
.filmstrip__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

/* Läuft als stumme Schleife: keine Zeigereingaben, damit YouTube weder
   Titelleiste noch Kanalnamen einblendet. Die Vergrösserung schneidet den
   Rand weg, an dem sonst Reste der Player-Oberfläche stehen könnten. */
.filmstrip__frame.is-playing iframe {
  pointer-events: none;
  transform: scale(1.22);
  transform-origin: center;
}

.filmstrip__play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  gap: 0.8rem;
  width: 100%;
  border: 0;
  background: linear-gradient(0deg, rgba(5, 7, 10, 0.72), rgba(5, 7, 10, 0.12));
  color: var(--surface);
  font: inherit;
  cursor: pointer;
}

.filmstrip__play span {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 107, 23, 0.9);
  font-size: 1.3rem;
  transition: transform 250ms ease;
}

.filmstrip__play:hover span,
.filmstrip__play:focus-visible span {
  transform: scale(1.08);
}

.filmstrip__play small {
  max-width: 26rem;
  color: rgba(245, 241, 233, 0.8);
  font-size: 0.85rem;
  text-align: center;
}
