/* ═══════════════════════════════════════════════════════════════════
   Tiefenflug — Entwurf für EM-Dienstleistungen
   Die Farben kommen aus den Fotos selbst; deshalb gibt es hier nur
   wenige feste Werte. Orange ist die Hausfarbe von EM.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --orange: #f47a21;
  --tinte: #14181a;
  --papier: #faf9f6;
  --kopf-h: 68px;
  --rand: clamp(18px, 4vw, 52px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  margin: 0;
  background: #0d1512;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: #0d1512;
  color: var(--papier);
  font-family: "Fira Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; }

/* ─── Bühne und Fenster ──────────────────────────────────────────
   Die Bühne ist sechs Bildschirmhöhen hoch. Darin klebt das Fenster
   mit einer Höhe — alles, was sich bewegt, liegt darin. Weniger als
   sechs Höhen, und der Flug wirkt wie ein harter Schnitt. */

.buehne { position: relative; height: 600vh; }

.fenster {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  contain: layout style paint;
  background: #0d1512;
}

/* ─── Das Video ─────────────────────────────────────────────────
   Es wird nie abgespielt — flug.js setzt die Abspielposition aus dem
   Scrollwert. Deshalb liegt es hier einfach bildfüllend und still. */

.flug, .flug-standbild {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
  background: #0d1512;
}
/* Die Leinwand liegt über dem Standbild und blendet auf, sobald genug
   Bilder geladen sind. Vorher sieht man das erste Bild aus dem Markup —
   nie ein schwarzes Loch. */
.flug { opacity: 0; transition: opacity .4s ease; }
.flug.da { opacity: 1; }

.vignette {
  position: absolute; inset: 0; z-index: 9;
  pointer-events: none;
  /* --dunkel kommt aus flug.js und läuft von 1 auf 0,45: Am Anfang muss
     der Keil die weiße Überschrift tragen, am Ende soll der geschnittene
     Gang zu sehen sein — das ist die Pointe und darf nicht im Schatten
     liegen. */
  opacity: var(--dunkel, 1);
  /* Drei Lagen: ein Keil von links, damit der Text steht; eine Vignette
     für die Tiefe; ein Fuß, auf dem die Karten sitzen. */
  background:
    linear-gradient(100deg, rgba(8, 18, 14, .88) 0%, rgba(8, 18, 14, .72) 30%,
                            rgba(8, 18, 14, .34) 58%, rgba(8, 18, 14, .16) 100%),
    radial-gradient(ellipse 80% 70% at 50% 44%,
                    transparent 18%, rgba(8, 18, 14, .62) 100%),
    linear-gradient(to top, rgba(8, 18, 14, .72) 0%, rgba(8, 18, 14, 0) 38%);
}

/* ─── Kopfzeile ─────────────────────────────────────────────────── */

.kopf {
  position: absolute; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--kopf-h);
  padding: 0 var(--rand);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}

.marke {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: #fff;
  font-size: .98rem; letter-spacing: -.01em;
}
.marke svg { color: var(--orange); flex: none; }
.marke b { font-weight: 700; }

.kopf-links { display: flex; gap: clamp(14px, 2.2vw, 30px); }
.kopf-links a {
  text-decoration: none; color: rgba(255, 255, 255, .84);
  font-size: .82rem; letter-spacing: .02em;
  transition: color .18s ease;
}
.kopf-links a:hover { color: var(--orange); }

.kopf-tel {
  text-decoration: none; color: #fff; font-weight: 600;
  font-size: .86rem; letter-spacing: .04em;
  padding: 8px 15px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .34);
  background: rgba(10, 20, 16, .34);
  backdrop-filter: blur(6px);
  transition: background-color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.kopf-tel:hover { background: var(--orange); border-color: var(--orange); color: #14181a; }

@media (max-width: 820px) { .kopf-links { display: none; } }

/* ─── Erste Szene ───────────────────────────────────────────────── */

.szene1 {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px;
  padding: 0 var(--rand) clamp(26px, 4vw, 52px);
  pointer-events: none;
}
.szene1 a { pointer-events: auto; }

.s1-text { position: relative; max-width: 500px; }

/* Schleier hinter dem Text: Die Hecke dahinter ist hell genug, um
   weiße Schrift zu schlucken. */
.s1-text::before {
  content: ""; position: absolute;
  top: -58%; left: -38%; width: 178%; height: 216%;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%,
              rgba(6, 16, 12, .62) 0%, rgba(6, 16, 12, .32) 38%,
              rgba(6, 16, 12, .08) 64%, transparent 78%);
}

.dach {
  position: relative; margin: 0 0 14px;
  font-size: .68rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--orange);
}

.szene1 h1 {
  position: relative; margin: 0;
  font-family: "Archivo", "Fira Sans", sans-serif;
  font-weight: 800;
  font-size: clamp(2.4rem, 5.6vw, 4.6rem);
  line-height: .94; letter-spacing: -.045em;
  color: #fff;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .55);
}
.szene1 h1 em { font-style: normal; color: var(--orange); }

.lede {
  position: relative; margin: 18px 0 0; max-width: 34ch;
  font-size: clamp(.95rem, 1.2vw, 1.08rem);
  line-height: 1.6; color: rgba(255, 255, 255, .84);
  text-shadow: 0 1px 14px rgba(0, 0, 0, .6);
}

.s1-takt { position: relative; display: flex; gap: 6px; margin-top: 26px; }
.s1-takt i { width: 14px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .34); }
.s1-takt i:first-child { width: 28px; background: var(--orange); }

/* ─── Die drei Karten rechts ────────────────────────────────────── */

.s1-karten { display: flex; gap: 10px; align-items: flex-end; }

.kk {
  position: relative; flex: none;
  width: clamp(96px, 10.5vw, 148px);
  height: clamp(116px, 12.5vw, 176px);
  border-radius: 16px; overflow: hidden;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(10, 20, 16, .5);
  box-shadow: 0 10px 34px rgba(2, 14, 10, .55);
  transition: transform .3s cubic-bezier(.16, 1, .3, 1), box-shadow .3s ease;
}
.kk:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 44px rgba(2, 14, 10, .62);
}
.kk img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kk::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6, 18, 14, .82) 0%,
              rgba(6, 18, 14, .06) 46%, transparent 72%);
}

.kk-leiste {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 11px 12px; display: flex; flex-direction: column; gap: 1px;
}
.kk-leiste b { font-size: .86rem; font-weight: 600; color: #fff; }
.kk-leiste i {
  font-style: normal; font-size: .64rem; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255, 255, 255, .62);
}

.kk-zahl {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
}
.kk-zahl b {
  font-family: "Archivo", sans-serif; font-weight: 800;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem); line-height: 1;
  letter-spacing: -.04em; color: var(--orange);
}
.kk-zahl i {
  font-style: normal; font-size: .62rem; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(255, 255, 255, .72);
}

@media (max-width: 700px) {
  .szene1 {
    flex-direction: column; align-items: flex-start; justify-content: flex-end;
    padding-bottom: clamp(62px, 11vh, 86px);   /* Platz für den Hinweis darunter */
  }
  .s1-karten { gap: 8px; align-self: stretch; }
  .kk { flex: 1 1 0; width: auto; height: 92px; }
  .szene1 h1 { font-size: clamp(2.1rem, 11vw, 2.9rem); }
  .lede { font-size: .92rem; max-width: none; }
  /* Der Hinweis stand sonst mitten auf der Zahlenkachel. */
  .hinweis { bottom: 12px; }
  .hinweis span { display: none; }
  .bk { width: clamp(126px, 38vw, 160px); height: clamp(178px, 52vw, 230px); }
}

/* ─── Scrollhinweis ─────────────────────────────────────────────── */

.hinweis {
  position: absolute; bottom: 20px; left: 50%; z-index: 11;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  pointer-events: none;
}
.hinweis span {
  font-size: .58rem; letter-spacing: .26em; text-transform: uppercase;
  color: rgba(255, 255, 255, .64);
}
.hinweis i {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .34);
  display: grid; place-items: center; color: #fff;
}
@media (prefers-reduced-motion: no-preference) {
  .hinweis i { animation: tippen 2.4s ease-in-out 1.6s infinite; }
}
@keyframes tippen {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ─── Zweite Szene ──────────────────────────────────────────────── */

.szene2 {
  position: absolute; inset: 0; z-index: 20;
  opacity: 0; pointer-events: none;
}
/* Die zweite Szene hat keinen eigenen Bildgrund mehr — darunter liegt
   weiterhin das Video, das am Ende ohnehin den freien Weg zeigt. Dieser
   Schleier dunkelt nur noch so weit ab, dass Überschrift und Karten
   darauf stehen können. */
.s2-schleier {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(8, 18, 14, .74) 0%, rgba(8, 18, 14, .22) 40%,
                    rgba(8, 18, 14, .46) 100%);
}

.s2-kopf {
  position: absolute; top: clamp(70px, 11vh, 120px); left: 0; right: 0;
  z-index: 400; text-align: center; padding: 0 var(--rand);
  opacity: 0; pointer-events: none;
}
.s2-kopf a { pointer-events: auto; }

.s2-schirm {
  position: absolute; top: -70%; left: 50%; transform: translateX(-50%);
  width: min(900px, 94vw); height: 270%;
  pointer-events: none;
  background: radial-gradient(ellipse 50% 50% at 50% 50%,
              rgba(8, 20, 15, .78) 0%, rgba(8, 20, 15, .46) 44%, transparent 74%);
}

.s2-kopf h2 {
  position: relative; margin: 0;
  font-family: "Archivo", "Fira Sans", sans-serif; font-weight: 800;
  font-size: clamp(1.8rem, 4.2vw, 3.4rem);
  line-height: 1.04; letter-spacing: -.04em; color: #fff;
  text-shadow: 0 2px 26px rgba(0, 0, 0, .55);
}
.s2-kopf p {
  position: relative; margin: 14px auto 0; max-width: 46ch;
  font-size: clamp(.92rem, 1.1vw, 1.04rem); line-height: 1.6;
  color: rgba(255, 255, 255, .9);
  text-shadow: 0 1px 12px rgba(0, 0, 0, .6);
}

.knopf {
  position: relative; display: inline-flex; align-items: center; gap: 9px;
  margin-top: 22px; padding: 13px 24px;
  background: var(--orange); color: #14181a;
  font-weight: 700; font-size: .94rem; text-decoration: none;
  border-radius: 4px;
  transition: transform .22s cubic-bezier(.16, 1, .3, 1), box-shadow .22s ease;
  box-shadow: 0 10px 28px rgba(244, 122, 33, .3);
}
.knopf:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(244, 122, 33, .42); }

/* ─── Der Bogen mit den fünf Bereichen ──────────────────────────── */

.bogen {
  position: absolute; inset: 0;
  pointer-events: none;
  perspective: 1250px;
  perspective-origin: 50% 44%;
}

.bk {
  position: absolute; top: 60%; left: 50%;
  width: clamp(142px, 13vw, 182px);
  height: clamp(200px, 19vw, 262px);
  padding: clamp(14px, 1.4vw, 19px);
  border-radius: 20px;
  display: flex; flex-direction: column;
  text-decoration: none; color: var(--tinte);
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, .6);
  backface-visibility: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .9) inset,
    0 26px 44px -12px rgba(16, 38, 26, .42),
    0 8px 16px -6px rgba(16, 38, 26, .28);
}

.bk-nr {
  font-size: .56rem; font-weight: 600; letter-spacing: .22em;
  color: rgba(20, 24, 26, .45);
}
.bk-titel {
  font-family: "Archivo", sans-serif; font-weight: 800;
  font-size: clamp(1rem, 1.5vw, 1.3rem); line-height: 1.1;
  letter-spacing: -.02em;
  margin-top: auto; margin-bottom: 8px;
}
.bk-text { font-size: .74rem; line-height: 1.5; color: rgba(20, 24, 26, .82); }

.bk-pfeil {
  position: absolute; top: 13px; right: 13px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 1px 3px rgba(16, 38, 26, .18);
  display: grid; place-items: center;
  color: rgba(20, 24, 26, .62);
  transition: background-color .2s ease, color .2s ease;
}
.bk:hover .bk-pfeil { background: var(--orange); color: #fff; }

/* ─── Fußbereich ────────────────────────────────────────────────── */

.fuss {
  position: relative; z-index: 2;
  background: #0d1512;
  padding: clamp(30px, 5vw, 54px) var(--rand);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.fuss p {
  margin: 0 0 16px;
  font-size: .82rem; color: rgba(255, 255, 255, .56);
}
.fuss a { color: var(--orange); }

/* ─── Wer keine Bewegung will ───────────────────────────────────── */

body.ruhig .buehne { height: auto; }
body.ruhig .fenster { position: relative; height: auto; min-height: 100svh; }
body.ruhig .szene2 { position: relative; inset: auto; min-height: 100svh; }
body.ruhig .hinweis { display: none; }

.bogen-liste {
  position: relative; inset: auto;
  perspective: none;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px;
  padding: clamp(180px, 24vh, 260px) var(--rand) clamp(40px, 6vw, 70px);
}

@media (prefers-reduced-motion: reduce) {
  .kk, .knopf, .bk-pfeil { transition: none; }
}
