/* ============================================================
   Cinematic Hero v2 — scroll-driven, sticky video + 6 Phasen.
   Eigener `.cine-*`-Namespace. Reuse nur .holo-text + .gq-btn.
   Animation: hero-scroll.js (perpetuelle rAF-Loop → Aufsteigen beim
   Scrollen + sanftes Dauer-Schweben). `.cine-js` = JS aktiv (Layer
   starten unsichtbar); ohne JS bleibt alles sichtbar (Fallback).
   ============================================================ */

/* Kein horizontaler Überlauf auf der Index-Seite (schwarzer Rand rechts auf
   Mobile). `clip` statt `hidden`, damit der sticky Hero NICHT bricht
   (overflow:hidden würde einen Scroll-Container erzeugen → sticky tot). */
html, body { overflow-x: clip; max-width: 100%; }

.cine-stage {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 300vh;
  background: #04050A;
  /* WICHTIG: globales `section { padding: 110px 0 }` (index-CSS) überschreiben —
     sonst schiebt das Top-Padding den Sticky-Hero 110px nach unten → schwarzer
     Rand oben, der erst beim Scrollen verschwindet. */
  padding: 0 !important;
  margin: 0;
}

.cine-hero {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: #04050A;
}

/* Header auf der Cinematic-Page IMMER fixed (kein reservierter Flow-Platz →
   kein schwarzer Rand oben) + cleanes Glas statt dunklem Top-Gradient.
   Diese Datei wird NUR auf der Index-Seite geladen → Regel ist seiten-
   scoped, ohne :has()-Abhängigkeit. Sichtbarkeit via .nav-revealed. */
header.gq-header {
  position: fixed !important;
  top: 0; left: 0; right: 0;
  background: rgba(6,6,11,0.55);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ── Video-Hintergrund ── */
.cine-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}
.cine-overlay {
  position: absolute; inset: 0;
  z-index: 1; pointer-events: none;
  /* leichteres Links-Scrim → Video füllt sichtbar den ganzen Screen,
     Text-Lesbarkeit kommt zusätzlich über text-shadow. */
  background:
    linear-gradient(90deg, rgba(4,5,10,0.78) 0%, rgba(4,5,10,0.34) 30%, rgba(4,5,10,0.06) 54%, rgba(4,5,10,0.0) 78%),
    linear-gradient(180deg, rgba(4,5,10,0.40) 0%, transparent 24%, transparent 72%, rgba(4,5,10,0.78) 100%);
}
.cine-grid {
  position: absolute; inset: 0;
  z-index: 1; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(rgba(240,238,230,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240,238,230,0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 85%);
}

.cine-content,
.cine-rail,
.cine-scroll-hint { position: absolute; z-index: 3; }

/* ── Hero-Text (links) ── */
.cine-content {
  left: clamp(24px, 7vw, 110px);
  top: 50%;
  transform: translateY(-50%);
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  will-change: opacity, transform;
}
.cine-tag {
  display: inline-flex; align-items: center; gap: 10px;
  align-self: flex-start;
  padding: 8px 16px 8px 10px;
  border-radius: 100px;
  border: 1px solid rgba(240,238,230,0.12);
  background: rgba(240,238,230,0.04);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(240,238,230,0.78);
  box-shadow: 0 0 22px rgba(139,92,246,0.30), inset 0 0 12px rgba(139,92,246,0.08);
}
.cine-tag-flag { display: inline-flex; flex-shrink: 0; filter: drop-shadow(0 0 6px rgba(218,41,28,0.55)); }
.cine-headline {
  margin: 0;
  font-family: 'Outfit', -apple-system, sans-serif;
  font-weight: 800;
  font-size: clamp(36px, 5.4vw, 78px);
  line-height: 1.05; letter-spacing: -0.035em;
  color: #F0EEE6;
  white-space: nowrap;          /* jede <br>-Zeile bleibt einzeilig (Schräge) */
  text-shadow: 0 2px 24px rgba(4,5,10,0.6);
}
.cine-sub {
  margin: 0; max-width: 52ch;
  font-family: 'Inter', sans-serif;
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.6; color: rgba(240,238,230,0.72);
  text-shadow: 0 1px 16px rgba(4,5,10,0.5);
}
.cine-sub-pill {
  display: inline; padding: 2px 8px; border-radius: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.88em;
  color: #C4B5FD; background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.28); white-space: nowrap;
}
.cine-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; will-change: opacity, transform; }

/* ════════════════════════════════════════════════════════════
   RAIL — eine durchgehende Diagonal-Schiene (5 Bubbles + 4 Tiles).
   Rechts verankert; jedes Element steigt nach unten weiter nach links
   (margin-right via --bx) → folgt der Schräge des Video-Strahls,
   überlappt nie (Flex-Column mit Gap).
   ════════════════════════════════════════════════════════════ */
.cine-rail {
  right: clamp(56px, 24vw, 460px);
  top: 9vh;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}
/* Gruppen-Wrapper sind auf Desktop „durchsichtig" (display:contents) → die 9
   Items fliessen weiter direkt in die Flex-Diagonale, Layout unverändert.
   Auf Mobile werden die Gruppen zu echten zentrierten Flex-Containern (s.u.). */
.cine-group { display: contents; }
.cine-bubble, .cine-tile { margin-right: var(--bx, 0px); will-change: opacity, transform; }

/* LLM-Bubble */
.cine-bubble {
  width: 88px; height: 88px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(11,8,32,0.68);
  border: 1px solid rgba(139,92,246,0.42);
  box-shadow:
    0 0 28px rgba(139,92,246,0.48),
    0 0 56px rgba(236,72,153,0.24),
    0 0 80px rgba(91,233,220,0.10),
    inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.cine-bubble img { width: 48px; height: 48px; object-fit: contain; display: block; }

/* Daten-Tile */
.cine-tile {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 18px;
  border-radius: 100px;
  background: rgba(11,8,32,0.72);
  border: 1px solid rgba(139,92,246,0.20);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px; letter-spacing: 0.02em;
  color: rgba(240,238,230,0.85); white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 22px rgba(139,92,246,0.14);
}
.cine-tile b { color: #fff; font-weight: 600; }
/* erstes Tile bekommt etwas Abstand zur letzten Bubble */
.cine-tile:first-of-type { margin-top: 10px; }
.cine-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cine-dot--teal   { background: #5BE9DC; box-shadow: 0 0 10px #5BE9DC; }
.cine-dot--purple { background: #8B5CF6; box-shadow: 0 0 10px #8B5CF6; }
.cine-dot--pink   { background: #FF3D81; box-shadow: 0 0 10px #FF3D81; }
.cine-dot--orange { background: #FFB155; box-shadow: 0 0 10px #FFB155; }
.cine-dot--live { animation: cine-dot-pulse 2s ease-in-out infinite; }
@keyframes cine-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139,92,246,0.6); }
  70%      { box-shadow: 0 0 0 9px rgba(139,92,246,0); }
}

/* ── Scroll-Hinweis ── */
.cine-scroll-hint {
  left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(240,238,230,0.4); pointer-events: none;
}
.cine-scroll-hint .line {
  width: 1px; height: 34px;
  background: linear-gradient(180deg, rgba(240,238,230,0.5), transparent);
  animation: cine-hint 2.2s ease-in-out infinite;
}
@keyframes cine-hint {
  0%, 100% { transform: scaleY(0.5); opacity: 0.4; transform-origin: top; }
  50%      { transform: scaleY(1);   opacity: 1;   transform-origin: top; }
}

/* ── JS aktiv → Layer starten unsichtbar (JS steuert opacity/transform) ──
   Desktop: jedes Item einzeln (JS animiert pro Item). Mobile: die GRUPPE
   steuert die Opacity (s. Mobile-Block) → Items bleiben sichtbar. */
.cine-stage.cine-js .cine-content,
.cine-stage.cine-js .cine-ctas,
.cine-stage.cine-js .cine-bubble,
.cine-stage.cine-js .cine-tile { opacity: 0; }

/* ── Mobile ── */
@media (max-width: 768px) {
  /* Harte Absicherung gegen horizontalen Bleed (schwarzer Rand rechts):
     jeder Top-Level-Block AUSSER der Hero-Stage wird auf Viewport-Breite
     geklemmt + geclippt. Die .cine-stage wird BEWUSST ausgenommen — ein
     overflow auf dem direkten Eltern-Element eines position:sticky-Kindes
     (.cine-hero) kann das Sticky auf iOS/Safari brechen → Hero-Animation
     tot. Die Stage clippt intern ohnehin über .cine-hero{overflow:hidden}. */
  html, body { overflow-x: clip; max-width: 100%; }
  body > *:not(.cine-stage) { max-width: 100vw; overflow-x: clip; }

  .cine-stage { height: 240vh; }   /* kürzere Runway → man scrollt nicht ewig */
  .cine-overlay {
    background: linear-gradient(180deg, rgba(4,5,10,0.55) 0%, rgba(4,5,10,0.30) 34%, rgba(4,5,10,0.80) 100%);
  }
  .cine-content {
    left: 0; right: 0; padding: 0 22px; max-width: none;
    text-align: center; align-items: center;
  }
  .cine-headline { white-space: normal; font-size: clamp(30px, 8vw, 44px); }
  .cine-tag { align-self: center; }
  .cine-ctas { justify-content: center; }

  /* Mobile-Story in GRUPPEN: zuerst alle 5 Bubbles zusammen (Cluster),
     dann verschwinden sie, dann die 4 Cards zusammen (Spalte), dann der
     Hero-Text. hero-scroll.js animiert pro GRUPPE (opacity + Scale-Pop,
     KEIN vertikales Gleiten — das Video steht). */
  .cine-rail { left: 0; right: 0; top: 0; bottom: 0; }

  .cine-group {
    display: flex;
    position: absolute;
    left: 50%; top: 50%;
    width: min(90vw, 440px);
    max-width: 100%;
    margin: 0;
    justify-content: center;
    align-items: center;
    transform: translate(-50%, -50%);  /* JS überschreibt mit Scale-Pop (kein Gleiten) */
  }
  .cine-group--bubbles { flex-wrap: wrap; gap: 18px 22px; }
  .cine-group--tiles   { flex-direction: column; gap: 14px; }
  .cine-group > * { margin: 0 !important; }

  /* Mobile: die Gruppe steuert die Sichtbarkeit, die Items bleiben opak. */
  .cine-stage.cine-js .cine-bubble,
  .cine-stage.cine-js .cine-tile { opacity: 1; }
  .cine-stage.cine-js .cine-group { opacity: 0; }

  .cine-bubble { width: 66px; height: 66px; }
  .cine-bubble img { width: 34px; height: 34px; }
  .cine-tile { font-size: 12.5px; padding: 10px 16px; }
  .cine-tile:first-of-type { margin-top: 0 !important; }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .cine-scroll-hint .line, .cine-dot--live { animation: none; }
}
