/*
 * Startseite: Auftakt mit dem 22, Kopfleiste, Video-Bühne (aus Entwurf V2)
 * und die seitlich fahrenden Räume.
 * Wird nur auf index.html nach style.css geladen; nutzt deren Farben und Schriften.
 */

/* ───────── Auftakt: schwarzer Bildschirm, das 22 leuchtet auf, dann öffnet sich die Seite ───────── */
.opener {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--ink);
  pointer-events: none;
  animation: opener-out 0.9s var(--ease) 1.6s forwards;
}
.opener img {
  width: clamp(90px, 11vw, 150px);
  height: auto;
  animation: opener-glow 1.6s ease-out both;
}
@keyframes opener-glow {
  0% {
    opacity: 0;
    filter: blur(14px);
    transform: scale(0.9) rotate(-6deg);
  }
  40% {
    opacity: 1;
    filter: blur(0) drop-shadow(0 0 24px var(--lila));
  }
  52% {
    opacity: 0.35;
  }
  62%,
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 32px var(--lila));
    transform: none;
  }
}
@keyframes opener-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}
/* start.js beendet den Auftakt zusätzlich per Klasse – wirkt auch ohne CSS-Animationen */
.opener.is-removed {
  display: none;
}
.opener.is-gone {
  animation: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.6s ease,
    visibility 0s linear 0.6s;
}
/* Wer über einen Link mitten in die Seite springt (z. B. /#anfrage), sieht den Auftakt nicht */
.opener.skip {
  display: none;
}

/* ───────── Kopfleiste ───────── */
.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px var(--gutter);
  color: var(--paper);
  /* Bleibt auf hellen und dunklen Flächen lesbar */
  mix-blend-mode: difference;
}
.menu-btn,
.bar-cta,
.bar .lang button {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.menu-btn {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.burger,
.burger::before {
  display: block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.4s var(--ease);
}
.burger {
  position: relative;
  transform: translateY(-3px);
}
.burger::before {
  content: '';
  position: absolute;
  top: 6px;
}
.menu-btn[aria-expanded='true'] .burger {
  transform: translateY(0) rotate(45deg);
}
.menu-btn[aria-expanded='true'] .burger::before {
  transform: translateY(-6px) rotate(-90deg);
}
.bar-logo {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  text-decoration: none;
  text-transform: uppercase;
  color: inherit;
}
.bar-logo img {
  height: 26px;
  width: auto;
}
.bar-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 22px;
}
.bar-cta {
  padding: 9px 16px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
}
.bar .lang button {
  padding: 4px 6px;
  border: 0;
  border-radius: 0;
  opacity: 0.45;
}
.bar .lang button[aria-pressed='true'] {
  opacity: 1;
}

/* ───────── Menü ───────── */
.menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 48px;
  padding: 100px var(--gutter) 40px;
  background: var(--ink);
  animation: menu-in 0.7s var(--ease);
}
.menu[hidden] {
  display: none;
}
@keyframes menu-in {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0);
  }
}
.menu ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.menu li a {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 6px 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(40px, 8vw, 104px);
  line-height: 1;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  transition: color 0.3s;
}
.menu li a:hover,
.menu li a:focus-visible {
  color: var(--lila);
}
.menu li .mono {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
}
.menu > p {
  margin: 0;
  color: var(--paper-dim);
}
.menu > p a {
  color: inherit;
}

/* ───────── Bühne: Reel startet im Hochformat und wächst beim Scrollen auf Vollbild ───────── */
.stage {
  /* Höhe = Scrollweg für das Aufziehen des Videos; start.js liest den Fortschritt aus */
  height: 240vh;
  height: 240svh;
  background: var(--ink);
}
.stage-pin {
  --p: 0;
  --start-h: min(72svh, 150vw);
  --start-w: calc(var(--start-h) * 9 / 16);
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.stage-frame {
  position: relative;
  z-index: 1;
  width: calc(var(--start-w) + (100vw - var(--start-w)) * var(--p));
  height: calc(var(--start-h) + (100svh - var(--start-h)) * var(--p));
  border-radius: calc(4px * (1 - var(--p)));
  overflow: hidden;
  background: #1a1418;
}
.stage-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Abdunkeln, damit die Schrift am Ende lesbar ist */
.stage-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13, 10, 12, 0.75), transparent 55%);
  opacity: var(--p);
}
.stage-copy {
  position: absolute;
  z-index: 3;
  left: var(--gutter);
  right: var(--gutter);
  bottom: clamp(64px, 10vh, 120px);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  opacity: clamp(0, (var(--p) - 0.65) * 3, 1);
  transform: translateY(calc((1 - var(--p)) * 40px));
}
.stage-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(38px, 6.4vw, 112px);
  line-height: 0.92;
  letter-spacing: -0.035em;
}
.stage-copy h1 em {
  text-transform: none;
  letter-spacing: -0.01em;
}
.stage-meta,
.stage-hint {
  position: absolute;
  z-index: 3;
  bottom: 22px;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.14em;
}
.stage-meta {
  left: var(--gutter);
  display: flex;
  gap: 24px;
  color: var(--paper-dim);
}
.stage-hint {
  left: 50%;
  translate: -50% 0;
  opacity: calc(1 - var(--p) * 4);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 16px 26px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition:
    background 0.3s,
    color 0.3s;
}
.pill:hover,
.pill:focus-visible {
  background: var(--lila);
  color: var(--paper);
}
.sound {
  position: absolute;
  z-index: 3;
  right: var(--gutter);
  bottom: 16px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 10, 12, 0.4);
  backdrop-filter: blur(8px);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.sound[aria-pressed='true'] {
  border-color: var(--lila);
  color: var(--lila);
}

/* ───────── Räume: angeheftet, die Karten fahren beim Scrollen seitlich ───────── */
/* Klasse .is-pinned und die Höhe von .rooms-scroll setzt start.js */
.rooms.is-pinned .rooms-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 70px;
  overflow: hidden;
}
.rooms.is-pinned .rooms-pin > .wrap {
  width: 100%;
}
.rooms.is-pinned .rooms-head {
  margin-bottom: 4vh;
}
.rooms.is-pinned .rooms-head h2 {
  font-size: clamp(40px, min(7vw, 10vh), 120px);
}
.rooms.is-pinned .rooms-track {
  overflow: visible;
  scroll-snap-type: none;
  will-change: transform;
}
.rooms.is-pinned .room {
  flex-basis: min(520px, 52vh, 80vw);
}
.rooms.is-pinned .room:nth-child(even) {
  margin-top: 5vh;
}

/* ───────── Kleine Bildschirme ───────── */
@media (max-width: 700px) {
  .bar-cta,
  .menu-btn span:not(.burger),
  .stage-meta {
    display: none;
  }
}

/* „Bewegung reduzieren“: Auftakt als ruhiges Einblenden ohne Flackern und Unschärfe.
   Bühne und Räume bleiben, weil sie nur beim eigenen Scrollen mitgehen. */
@media (prefers-reduced-motion: reduce) {
  .opener img {
    animation: opener-fade 1.2s ease-out both;
  }
}
@keyframes opener-fade {
  from {
    opacity: 0;
  }
}
