/* ==========================================================================
   Der Konrad — Scroll-Film-Bühne (Konzept 3 „echt")
   Der Film ersetzt den Hero: canvas-gescrubbte echte Salon-Fahrt,
   darüber das echte Emblem, Tagline, CTAs, Live-Zeiten — ab Sekunde eins.
   ========================================================================== */

.film { position: relative; background: var(--ink); }

/* 188 Frames (7,8s): kurze Scroll-Strecke, damit es nie zäh wird */
.film-driver { height: var(--film-len, 320vh); position: relative; }

.film-stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
}

#filmCanvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}

/* Poster = echter erster Frame; sichtbar bis die ersten Frames dekodiert sind
   und als komplette Fassung im Statik-Modus */
.film-poster {
  position: absolute; inset: 0;
  background-image: url('../film/poster.jpg');   /* Handy: siehe unten (Salonfoto hochkant) */
  background-size: cover; background-position: center;
  transition: opacity .5s ease-out;
}
.film-poster.is-hidden { opacity: 0; }

/* Vignette + Korn verkaufen den „ein Take"-Eindruck, laufen am Ende aus */
.film-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 42%, transparent 55%, rgba(8, 4, 2, .42) 100%);
  opacity: var(--film-vig, 1);
}

/* Weicher Scrim oben, damit Pill/Telefone auf jedem Frame lesbar sind */
.film-stage::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 30%;
  background: linear-gradient(to bottom, rgba(8, 4, 2, .58), transparent);
  pointer-events: none;
}
/* und unten für Fuß + CTAs */
.film-stage::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 34%;
  background: linear-gradient(to top, rgba(8, 4, 2, .55), transparent);
  pointer-events: none;
}

/* --- Overlays: bestehende Hero-Bausteine, jetzt auf der Bühne --- */
.film .hero-top {
  position: absolute; z-index: 5;
  top: calc(clamp(76px, 9vh, 100px) + env(safe-area-inset-top, 0px));
  left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 0 clamp(18px, 4vw, 44px);
}

/* Telefon-Cluster: gleiche Bühnenbehandlung wie die Zeiten-Pill, damit
   Alex/Dorit auch über hellen Frames lesbar bleiben */
.film .hero-phones {
  background: rgba(14, 9, 5, .45);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 10px 16px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.film .hero-phones a { white-space: nowrap; text-shadow: none; }
.film .hero-phones a span { color: var(--copper-bright); }

.film .hero-center {
  position: absolute; z-index: 4;
  inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  pointer-events: none;
}
.film .hero-center > * { pointer-events: auto; }

/* Konstanter, weicher Lichthof hinter Emblem + Text: haelt beides auf jedem
   Frame lesbar, ohne das Bild flachzudruecken */
.film .hero-center::before {
  content: ""; position: absolute; z-index: -1;
  left: 50%; top: 50%; width: min(720px, 96vw); height: min(620px, 86vh);
  transform: translate(-50%, -50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(8, 4, 2, .52), rgba(8, 4, 2, .28) 55%, transparent 78%);
  pointer-events: none;
}

/* Emblem ohne jede Schattierung (Vorgabe), konstante Groesse waehrend des
   ganzen Films — es steht wie ein Wappen ueber der Fahrt */
.film .hero-emblem {
  width: min(540px, 74vw, 59vh); height: auto;
}
/* Kompakt-Modus (film.js layoutHero): Emblem gross, Tagline + Knoepfe eng darunter */
.film .hero-center.is-compact .hero-emblem { max-width: none; }
.film .hero-center.is-compact .hero-tagline { margin-top: 10px; font-size: clamp(18px, 2vw, 30px); }
.film .hero-center.is-compact .hero-tagline::before,
.film .hero-center.is-compact .hero-tagline::after { width: clamp(28px, 4vw, 72px); }
.film .hero-center.is-compact .hero-ctas { margin-top: 12px; gap: 12px; }
.film .hero-center.is-compact .hero-ctas .btn-primary { padding: 9px 9px 9px 20px; font-size: 14px; }
.film .hero-center.is-compact .hero-ctas .btn-ghost { padding: 9px 20px; font-size: 14px; }

.film .hero-foot {
  position: absolute; z-index: 5;
  left: 0; right: 0;
  bottom: calc(46px + env(safe-area-inset-bottom, 0px));
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 clamp(18px, 4vw, 44px);
}

/* --- Überspringen: immer erreichbar, verschwindet am Filmende --- */
.film-skip {
  position: absolute; z-index: 6;
  right: clamp(18px, 4vw, 44px);
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  font: 500 13px/1 var(--font-sans, 'Outfit', sans-serif);
  letter-spacing: .06em;
  color: var(--paper, #f6efe6);
  background: rgba(14, 9, 5, .46);
  border: 1px solid rgba(223, 164, 119, .35);
  border-radius: 99px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: var(--film-skip, 1);
  transition: border-color .25s ease-out, background .25s ease-out;
}
.film-skip:hover { border-color: var(--copper-bright, #dfa477); background: rgba(14, 9, 5, .66); }
.film-skip:focus-visible { outline: 2px solid var(--copper-bright, #dfa477); outline-offset: 2px; }
.film-skip svg { width: 14px; height: 14px; }
.film-skip[data-gone] { pointer-events: none; }

/* --- KI-Kennzeichnung (EU AI Act, Transparenzpflicht): klein, aber klar --- */
.film-ai-note {
  position: absolute; z-index: 6;
  left: clamp(18px, 4vw, 44px);
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  font: 400 11px/1.4 var(--font-sans, 'Outfit', sans-serif);
  letter-spacing: .05em;
  color: rgba(243, 234, 217, .72);
  background: rgba(14, 9, 5, .4);
  border-radius: 8px;
  padding: 5px 10px;
  pointer-events: none;
}

/* --- Fortschritt: Kupfer-Haarlinie, auf der eine kleine Schere entlangfährt --- */
.film-progress {
  position: absolute; z-index: 6;
  left: clamp(18px, 4vw, 44px); right: clamp(18px, 4vw, 44px);
  bottom: calc(26px + env(safe-area-inset-bottom, 0px));
  height: 14px;
  pointer-events: none;
  opacity: var(--film-skip, 1);
}
.film-progress .line {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; background: rgba(223, 164, 119, .28);
}
.film-progress .fill {
  position: absolute; left: 0; top: 50%;
  height: 1px; width: 100%;
  background: var(--copper-bright, #dfa477);
  transform: scaleX(var(--film-p, 0));
  transform-origin: left center;
}
.film-progress .shears {
  position: absolute; top: 50%;
  left: calc(var(--film-p, 0) * 100%);
  transform: translate(-50%, -50%) rotate(90deg);
  color: var(--copper-bright, #dfa477);
  width: 13px; height: 13px;
}

/* ---------- Statik (?static=1, Reduced Motion, kein Canvas) ---------- */
.is-static .film-driver { height: auto; }
.is-static .film-stage { position: relative; height: 100vh; height: 100svh; }
.is-static #filmCanvas,
.is-static .film-skip,
.is-static .film-progress { display: none; }
.is-static .film-poster {
  opacity: 1 !important;
  background-image: url('../film/poster-static.jpg') !important;
}
.is-static .film { --film-ui: 1; --film-logo-s: 1; }

/* ---------- Klein ---------- */
@media (max-width: 640px) {
  /* Kürzere Scroll-Strecke: der Film übergibt straffer an den Inhalt */
  .film-driver { --film-len: 300vh; }

  .film .hero-foot {
    flex-direction: column; gap: 6px; align-items: flex-start;
    opacity: var(--film-skip, 1);
  }
  .film-skip {
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    padding: 8px 13px; font-size: 12px;
  }

  .film .hero-emblem { width: min(340px, 68vw); }

  /* Kopfleiste: Pill und Nummern untereinander, Nummern NIE umbrechen */
  .film .hero-top { flex-direction: column; gap: 10px; align-items: flex-start; }
  .film .hero-phones {
    flex-direction: column; gap: 5px; align-items: flex-start;
    padding: 8px 14px;
  }
  /* Drei Kopfzeilen brauchen Platz: Emblem rückt darunter */
  .film .hero-center { padding-top: 150px; }
  .film-ai-note {
    max-width: 48vw;
    font-size: 10px;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
  .film .hero-phones a { font-size: 13px; gap: 7px; }
  .film .hero-phones a span { font-size: 10px; }

  /* Pill: Zeile 1 Status + Pfeil, Zeile 2 die Öffnungs-Info in einem Stück */
  .film .live { flex-wrap: wrap; row-gap: 2px; padding: 8px 14px; }
  .film .live .txt { white-space: nowrap; }
  .film .live .chev { margin-left: 2px; }
  .film .live .sub {
    order: 5; flex-basis: 100%;
    white-space: nowrap; font-size: 12px; padding-left: 18px;
  }

  /* Tagline: ein ruhiges einzeiliges Lockup statt zerrissener Hälften */
  .film .hero-tagline {
    font-size: 12.5px; letter-spacing: .2em; text-indent: .2em;
    gap: 9px; white-space: nowrap;
  }
  .film .hero-tagline::before, .film .hero-tagline::after { width: 14px; }
}

/* ---------- Handy (Hochkant): kein Film, ein stehendes Salonbild ----------
   Die 720p-Fahrt hat auf einem Hochkant-Display nur als schmales Band Platz.
   Statt Letterbox steht hier das echte Salonfoto (Hochkant-Ausschnitt, gleiche
   warme Abstimmung wie der Film) und das Emblem darauf: ein ruhiges Plakat,
   Anruf und Preise im Daumenbereich. Kein Frame-Download, keine KI-Kennzeichnung
   noetig (echtes Foto). film.js steigt auf diesen Breiten vor dem Manifest aus. */
@media (max-width: 640px) {
  .film-driver { height: auto; }
  .film-stage {
    position: relative;
    height: 100vh; height: 100svh;
    min-height: 600px;
  }
  #filmCanvas, .film-skip, .film-progress, .film-ai-note { display: none; }

  .film .film-poster {
    opacity: 1 !important;
    background-image: url('../img/hero-phone-1200.jpg') !important;
    background-image: image-set(
      url('../img/hero-phone-800.webp') 1x,
      url('../img/hero-phone-1200.webp') 2x
    ) !important;
    background-position: 50% 44%;
  }
  .film-vignette {
    opacity: 1;
    background: radial-gradient(110% 80% at 50% 40%, transparent 50%, rgba(8, 4, 2, .5) 100%);
  }
  .film-stage::before { height: 26%; }
  .film-stage::after  { height: 46%; background: linear-gradient(to top, rgba(8, 4, 2, .72), rgba(8, 4, 2, .28) 55%, transparent); }

  /* Kopf: nur die Zeiten-Pill, eine Zeile. Die drei Nummern liegen einen Tipp
     entfernt hinter "Termin vereinbaren" (Anruf-Auswahl) und unter "Besuch". */
  .film .hero-top {
    top: calc(64px + env(safe-area-inset-top, 0px));
    flex-direction: row; justify-content: flex-start;
  }
  .film .hero-phones { display: none; }
  .film .live { padding: 9px 15px; gap: 9px; }
  .film .live .txt { font-size: 13.5px; }
  .film .live .sub {
    order: 0; flex-basis: auto; padding-left: 0;
    font-size: 12.5px;
  }
  .film .live .sub:not([hidden])::before {
    content: ""; display: inline-block; width: 3px; height: 3px; border-radius: 50%;
    background: var(--cream-faint, #93876f); margin: 0 8px 3px 0;
  }
  .film .live .chev { order: 9; }

  /* Emblem + Tagline sitzen auf der Stuhllehne (oberes Drittel), die Knoepfe
     unten im Daumenbereich. */
  .film .hero-center {
    justify-content: center;
    padding: 0 var(--pad) 30svh;
  }
  .film .hero-center::before {
    top: 40%; width: 100vw; height: 62svh;
    background: radial-gradient(50% 50% at 50% 50%, rgba(8, 4, 2, .46), rgba(8, 4, 2, .22) 55%, transparent 78%);
  }
  .film .hero-emblem { width: min(300px, 70vw); }
  .film .hero-tagline { margin-top: 20px; }

  .film .hero-ctas {
    position: absolute; left: var(--pad); right: var(--pad);
    bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    margin: 0; flex-direction: column; gap: 10px;
  }
  .film .hero-ctas .btn-primary,
  .film .hero-ctas .btn-ghost {
    width: min(100%, 340px); justify-content: center;
    padding-top: 15px; padding-bottom: 15px; font-size: 15.5px;
  }
  .film .hero-ctas .btn-primary { padding-left: 46px; }  /* Text optisch mittig trotz Icon rechts */
  .film .hero-ctas .btn-primary .ic { margin-left: -6px; }

  .film .hero-foot {
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    flex-direction: column; align-items: center; gap: 3px;
    text-align: center; font-size: 12.5px; opacity: 1;
  }
}

/* Handy quer (niedrig): Film laeuft, Kopfleiste bleibt nur die Pill */
@media (max-width: 900px) and (max-height: 480px) and (orientation: landscape) {
  .film .hero-phones { display: none; }
  .film .hero-emblem { width: min(240px, 34vh); }
  .film .hero-tagline { margin-top: 10px; }
  .film .hero-ctas { margin-top: 14px; }
}

/* Telefon-Kasten oben rechts: zwei Spalten, Namen und Nummern jeweils buendig */
.film .hero-phones { align-items: stretch; }
.film .hero-phones a {
  display: grid; grid-template-columns: 3.7em auto; column-gap: 10px;
  align-items: baseline; justify-items: start;
}
.film .hero-phones a span { text-align: left; }
