/* Vollbild-Intro (Film beim Öffnen der Seite). Ohne JavaScript oder bei Fehlern sperrt sich die Seite nie:
   - Das Intro blendet sich per CSS nach 40 s von selbst aus (länger als der 30-s-Film).
   - Bei "weniger Bewegung" wird es gar nicht angezeigt. */

html.intro-open {
  overflow: hidden;
  animation: intro-unlock 0s linear 40s forwards;
}

.intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: #ddf3e3; /* passt zum Hintergrund des Films */
  opacity: 1;
  transition: opacity .5s ease;
  animation: intro-failsafe 0s linear 40s forwards;
}

.intro.is-closing {
  opacity: 0;
  pointer-events: none;
}

.intro[hidden] {
  display: none;
}

.intro-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ddf3e3;
}

.intro-controls {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 clamp(16px, 3vw, 32px);
  pointer-events: none;
}

.intro-controls--top {
  top: clamp(16px, 3vw, 28px);
  justify-content: flex-end;
}

.intro-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgb(1 45 50 / .35);
  border-radius: 99px;
  background: rgb(250 251 248 / .85);
  color: #012d32;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.intro-btn:hover {
  background: #fafbf8;
}

.intro-btn:focus-visible {
  outline: 3px solid #012d32;
  outline-offset: 3px;
}

.intro-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes intro-failsafe {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@keyframes intro-unlock {
  to {
    overflow: auto;
  }
}

/* Nur PC und Tablet im Querformat: Auf allen anderen Geräten (Handy, Tablet hochkant) gibt es kein Intro.
   Dieselbe Bedingung prüft intro.js, damit der Film dort auch nicht geladen wird. */
@media not all and (min-width: 768px) and (min-height: 500px) and (orientation: landscape) {
  .intro {
    display: none;
  }

  html.intro-open {
    overflow: auto;
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro {
    display: none;
  }

  html.intro-open {
    overflow: auto;
    animation: none;
  }
}
