/* ══════════════════════════════════════════════════════════════
   GS-Telesolution – Seitenwechsel ins Handy (v44)
   1. Der Droide kommt ruhig herein, Hand offen und leer
   2. Das umrissene Handy aus der Radar-Grafik löst sich und legt
      sich über das Handy in seiner Hand
   3. Die ganze Startseite wird in dieses Display gesaugt
   4. Gleichzeitig fliegt Seite 2 von außen herein
   Der Ablauf hängt am Scroll-Fortschritt und läuft vor wie zurück.

   Ab v44: Die Bühne ist so hoch wie ihr Inhalt, mindestens ein Bildschirm.
   Passt die Startseite nicht auf einen Bildschirm (Handy, niedrige
   Fenster), scrollt man erst normal durch sie hindurch; festgehalten wird
   sie, sobald ihr unteres Ende am Bildschirmrand steht. Bis v43 war sie
   auf einen Bildschirm gezwängt – die Überschrift rutschte unter das Logo,
   unten wurde abgeschnitten.
   ══════════════════════════════════════════════════════════════ */

.swap {
  position: relative;
  height: auto;
  padding: 0;
  background: var(--bg-base);
}
/* Scroll-Länge des Übergangs: leerer Raum hinter der Bühne. Als Inhalt und
   nicht als Innenabstand – festgehalten wird nur innerhalb des Inhalts. */
.swap::after { content: ''; display: block; height: 130vh; }   /* ab v64 kürzer: der Ablauf läuft von selbst, die Strecke ist nur noch Auslöser */
.swap-stage {
  position: sticky;
  top: 0;              /* das Skript setzt hier einen negativen Wert, wenn die Bühne höher ist als das Fenster */
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}

/* ── Seite 1 = die bestehende Startseite ─────────────────── */
.swap-a { position: relative; will-change: transform, opacity; }
.swap-a > section {
  min-height: 100vh !important;
  min-height: 100svh !important;
  padding-top: 7rem !important;
  padding-bottom: 2.5rem !important;
}

/* ── Seite 2 ─────────────────────────────────────────────── */
/* Sitzt am unteren Ende der Bühne und ist genau einen Bildschirm hoch –
   das ist der Teil, den man sieht, während die Bühne festgehalten wird. */
.swap-b { position: absolute; left: 0; right: 0; bottom: 0; height: 100vh; height: 100svh; pointer-events: none; }

.swap-glow {
  position: absolute;
  left: 75%; top: 54%;
  width: min(105vh, 100vw); aspect-ratio: 1/1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(156,196,29,0.16), rgba(156,196,29,0) 62%);
  opacity: 0;
}

.swap-head {
  position: absolute;
  left: 5%; top: 50%;
  width: min(28%, 430px);
  transform: translateY(-50%);
  opacity: 0;
  will-change: transform, opacity;
}
.swap-head h2 {
  font-size: clamp(1.7rem, 2.6vw, 2.6rem);
  font-weight: 600; letter-spacing: -0.035em; line-height: 1.06;
  margin: 0.8rem 0 0;
}
.swap-head h2 span { color: var(--accent); }
.swap-head p { margin-top: 1rem; color: var(--text-muted); }

.swap-tiles { position: absolute; inset: 0; }
.swap-tile {
  position: absolute;
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.6rem 1rem; border-radius: 999px; white-space: nowrap;
  background: rgba(24, 24, 27, 0.82);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(6px);
  font-size: clamp(0.82rem, 1.05vw, 1rem); font-weight: 500;
  color: var(--text-primary);
  opacity: 0; will-change: transform, opacity;
  transform: translate(-50%, -50%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.swap-tile::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}

/* ── Droide mit leerer Hand ──────────────────────────────── */
.swap-droid {
  position: absolute;
  left: 75%; bottom: 0;
  height: min(76vh, 660px);
  aspect-ratio: 671 / 1100;
  transform: translate(-50%, 8%);
  opacity: 0;
  will-change: transform, opacity;
}
.swap-droid > img { width: 100%; height: 100%; display: block; }

/* ── Das echte Handy in seiner Hand (blendet beim Landen auf) ── */
.swap-phone {
  position: absolute;
  left: 76.15%; top: 12.73%;     /* exakt die Stelle in seiner Hand */
  width: 22.5%;
  opacity: 0;
  will-change: opacity;
}
.swap-phone img {
  width: 100%; height: auto; display: block;
  filter: drop-shadow(0 12px 26px rgba(0,0,0,0.55));
}
/* Zielpunkt für Seite 1 = Display-Mitte */
.swap-target { position: absolute; left: 48%; top: 45%; width: 1px; height: 1px; }
/* Display leuchtet, wenn Seite 1 drin ist */
.swap-screen {
  position: absolute; left: 48%; top: 45%;
  width: 150%; aspect-ratio: 1/1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(156,196,29,0.75), rgba(156,196,29,0.22) 32%, rgba(156,196,29,0) 62%);
  opacity: 0; mix-blend-mode: screen; pointer-events: none;
}

/* ── Das umrissene Handy, das aus der Radar-Grafik herüberfliegt ──
   Position, Größe und Drehung setzt das Skript pro Bild. */
.swap-ghost {
  position: absolute;
  left: 0; top: 0; width: 10px; height: 16px;
  opacity: 0;
  will-change: transform, opacity, width, height, left, top;
  filter: drop-shadow(0 0 14px rgba(156,196,29,0.35));
  pointer-events: none;
}
.swap-ghost svg { width: 100%; height: 100%; display: block; overflow: visible; }

/* Scroll-Hinweis */
.swap-hint {
  position: absolute; left: 50%; bottom: 1.4rem; transform: translateX(-50%);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.7rem; letter-spacing: 0.14em; color: var(--text-faint);
  display: flex; align-items: center; gap: 0.5rem; white-space: nowrap;
}
.swap-hint svg { animation: swap-bob 1.8s ease-in-out infinite; }
@keyframes swap-bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(4px)} }

/* ── Handy / schmale Fenster ─────────────────────────────── */
@media (max-width: 860px) {
  .swap::after { height: 220vh; }
  .swap-a > section { padding-top: 6rem !important; }
  .swap-glow { left: 50%; top: 64%; }
  .swap-droid { left: 50%; height: min(36vh, 300px); }
  .swap-head {
    left: 50%; top: 7%; transform: translateX(-50%);
    width: min(90vw, 520px); text-align: center;
  }
  .swap-head h2 { font-size: 1.45rem; margin-top: .5rem; }
  .swap-head p { font-size: .85rem; margin-top: .5rem; }
  .swap-tile { font-size: 0.78rem; padding: 0.42rem 0.75rem; max-width: 92vw; }
}

/* ── Bewegung reduziert ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .swap::after { display: none; }
  .swap-stage { position: static; min-height: 0; }
  .swap-a { position: static; }
  .swap-a > section { min-height: 0 !important; }
  .swap-b { position: static; height: auto; padding-block: 4rem; }
  .swap-head { position: static; transform: none; opacity: 1; width: min(90vw,620px); margin: 0 auto; text-align: center; }
  .swap-tiles { position: static; display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 2rem; }
  .swap-tile { position: static; transform: none; opacity: 1; }
  .swap-droid { position: static; transform: none; opacity: 1; height: 320px; margin: 2rem auto 0; }
  .swap-phone { opacity: 1; }
  .swap-ghost { display: none; }
  .swap-hint { display: none; }
}

/* ── Die Leistungen in der Radar-Grafik (ab v44) ─────────────
   Statt technischer Platzhalter („intent: book_appointment") steht dort,
   was wir anbieten – in reinem Weiß, jede Marke ein Link zu ihrer Seite. */
.hero-svg-visual { container-type: inline-size; }
.hero-produkte { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.hero-produkte li { position: absolute; left: var(--x); top: var(--y); animation: drift-tag var(--t, 7s) ease-in-out infinite; }
.hero-produkte li:nth-child(even) { animation-direction: reverse; }
.hero-produkte li:hover, .hero-produkte li:focus-within { animation-play-state: paused; }   /* stillhalten, wenn jemand zielt */
.hero-produkte a {
  pointer-events: auto;
  display: inline-flex; flex-direction: column; align-items: flex-start;
  padding: 0.42em 0.8em 0.46em; border-radius: 0.5em;
  background: rgba(20, 20, 22, 0.9);
  border: 1px solid #2E2E33;
  color: #FFFFFF;
  font-family: 'Geist', sans-serif; font-weight: 500; line-height: 1.22;
  font-size: 13px;
  font-size: clamp(12px, 2.7cqw, 15px);
  letter-spacing: -0.005em;
  text-decoration: none; white-space: nowrap;
  transition: border-color 0.18s, background 0.18s;
}
.hero-produkte a:hover, .hero-produkte a:focus-visible { border-color: var(--accent); background: rgba(31, 31, 35, 0.96); }
.hero-produkte a span { font-weight: 400; }
/* Dasselbe am Handy, wo die Grafik fehlt */
.hero-chips-mobile a.hero-chip { color: #FFFFFF; text-decoration: none; font-family: 'Geist', sans-serif; font-weight: 500; }

/* ── Die Wellen neben dem Handy (ab v46) ─────────────────────
   Jeder Balken wird um seine EIGENE Mitte gestaucht. Ohne diese Zeile nimmt
   der Browser die Mitte der ganzen Grafik – dann rutschen die Balken beim
   Kleinerwerden nach unten, bis in die Schildchen darunter. */
.hero-bar { transform-box: fill-box; transform-origin: center; }

/* ── Herstellerlogos in den Kacheln (ab v47) ─────────────────
   Die Höhen sind nach Augenmaß abgestimmt, nicht gleich: Ein fettes Logo
   wirkt bei gleicher Höhe größer als ein feines. */
.hersteller-logo { display: block; width: auto; margin-top: 0.9rem; }
.hersteller-yeastar { height: 32px; }
.hersteller-dreicx  { height: 26px; }
.hersteller-mitel   { height: 30px; }

/* ── Eigene Zeichen: SIP-Trunk, IP Mobile (ab v47) ───────────
   Blaues Bildzeichen, Name in Weiß – wie die Herstellerlogos daneben. */
.eigenmarke { display: flex; width: fit-content; align-items: center; gap: 0.6rem; margin-top: 0.9rem; height: 32px;
  color: #FFFFFF; font-family: 'Geist', sans-serif; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1; white-space: nowrap; }
.eigenmarke svg { height: 32px; width: auto; flex: none; color: #0A99DA; }

/* ── Radar-Grafik: Logos in den Schildchen (ab v47) ──────────
   Die Höhen hängen an der Schriftgröße des Schildchens (em) – so werden
   Logos und Schrift mit der Grafik gemeinsam kleiner. */
.hero-produkte a { flex-direction: row; align-items: center; gap: 0.45em; padding: 0.5em 0.75em; font-weight: 600; letter-spacing: -0.02em; }
.hero-produkte .hp-logo { display: block; width: auto; }
.hero-produkte .hp-yeastar  { height: 1.5em; }
.hero-produkte .hp-dreicx   { height: 1.25em; }
.hero-produkte .hp-mitel    { height: 1.4em; }
.hero-produkte .hp-justtalk { height: 2em; }
.hero-produkte .hp-eigen svg { height: 1.35em; width: auto; flex: none; color: #0A99DA; }
/* … und in den Kacheln am Handy */
.hero-chips-mobile a.hero-chip-logo { justify-content: flex-start; gap: 0.5rem; min-height: 44px; font-size: 0.9rem; font-weight: 600; letter-spacing: -0.01em; }
.hero-chip-logo .hp-logo { display: block; width: auto; }
.hero-chip-logo .hp-yeastar  { height: 22px; }
.hero-chip-logo .hp-dreicx   { height: 18px; }
.hero-chip-logo .hp-mitel    { height: 20px; }
.hero-chip-logo .hp-justtalk { height: 26px; }
.hero-chip-logo.hp-eigen svg { height: 20px; width: auto; flex: none; color: #0A99DA; }

/* ── Seitenwechsel: Logos in den hereinfliegenden Leistungen (ab v47) ── */
.swap-tile.st-logo { gap: 0.5em; padding: 0.6rem 1.05rem; font-weight: 600; color: #FFFFFF; letter-spacing: -0.01em; }
.swap-tile.st-logo::before { display: none; }
.swap-tile .st-bild { display: block; width: auto; }
.swap-tile .st-yeastar  { height: 1.7em; }
.swap-tile .st-dreicx   { height: 1.4em; }
.swap-tile .st-mitel    { height: 1.6em; }
.swap-tile .st-justtalk { height: 2em; }
.swap-tile svg { height: 1.5em; width: auto; flex: none; color: #0A99DA; }
@media (max-width: 860px) {
  .swap-tile.st-logo { padding: 0.38rem 0.7rem; gap: 0.4em; }
  .swap-tile .st-justtalk { height: 1.85em; }
}

/* ── Seitenwechsel, Seite 2: das Firmenlogo statt der Überschrift (ab v47) ── */
.swap-head h2.swap-logo { margin: 1rem 0 0; line-height: 0; font-size: 0; }
.swap-logo img { display: block; width: 100%; max-width: 420px; height: auto; }
.swap-head h2.swap-logo + p { margin-top: 1.25rem; }
@media (max-width: 860px) {
  .swap-head h2.swap-logo { margin-top: 0.6rem; }
  .swap-logo img { width: min(72vw, 300px); margin-inline: auto; }
  .swap-head h2.swap-logo + p { margin-top: 0.8rem; }
}

/* ── Bilder in den Kacheln „Telefonie & KI" (ab v48) ──────────────── */
.bento .card { position: relative; }
.kachel-bild { position: relative; min-width: 0; }
.kachel-bild img { display: block; width: 100%; height: auto; }

/* breite Kacheln: Text links, Bild rechts */
.bento .kachel-quer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 46%); gap: 1.5rem; align-items: center; }
.kb-yeastar img { width: min(100%, 236px); margin-inline: auto; filter: drop-shadow(0 10px 28px rgba(0,0,0,0.45)); }
.kb-yeastar.kb-rad img { width: min(100%, 250px); }
.bento .kachel-quer.kq-mitel { grid-template-columns: minmax(0, 1fr) minmax(0, 52%); gap: 1.25rem; }
.kb-mitel { margin-right: -0.75rem; }
.kb-mitel img { filter: drop-shadow(0 10px 22px rgba(0,0,0,0.5)); }
/* die SIM-Karte aus dem Folder füllt die rechte Hälfte bis an den Rand */
.kb-sim { align-self: stretch; margin: -1.75rem -1.75rem -1.75rem 0; min-height: 210px; border-radius: 0 11px 11px 0; overflow: hidden; }
.kb-sim img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 34%); mask-image: linear-gradient(90deg, transparent 0, #000 34%); }

/* schmale Kacheln: Bild oben, bis an den Rand (die Kachel selbst schneidet nichts ab – sonst würde die Spalte schmäler als ihr Inhalt) */
.kachel-hoch .kachel-bild { margin: -1.75rem -1.75rem 1.4rem; aspect-ratio: 16 / 9; background: #121214; border-bottom: 1px solid var(--border-subtle); border-radius: 11px 11px 0 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden; }
.kb-dreicx img { width: auto; height: 84%; }
.kb-foto img { width: 100%; height: 100%; object-fit: cover; }

/* Just Talk + Chat: der Droide */
.bento .hero-card > :not(svg):not(.kachel-droide) { position: relative; z-index: 1; }
.kachel-droide { position: absolute; right: 1.25rem; bottom: 0; height: min(58%, 420px); width: auto; pointer-events: none;
  filter: drop-shadow(0 14px 30px rgba(0,0,0,0.5)); }

/* schmale Fenster: vier Spalten werden eng – das Bild wandert nach oben */
@media (max-width: 1140px) {
  .bento .kachel-quer, .bento .kachel-quer.kq-mitel { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .kachel-quer .kachel-bild { order: -1; flex: none; margin: -1.75rem -1.75rem 1.4rem; height: 190px; background: #121214; border-bottom: 1px solid var(--border-subtle); border-radius: 11px 11px 0 0;
    display: flex; align-items: center; justify-content: center; overflow: hidden; }
  .kb-yeastar img, .kb-yeastar.kb-rad img { width: auto; height: 88%; }
  .kb-mitel img { width: auto; max-width: 92%; height: auto; max-height: 86%; }
  .kb-sim { min-height: 0; }
  .kb-sim img { object-position: 82% 50%; -webkit-mask-image: none; mask-image: none; }
  .kachel-droide { height: min(48%, 340px); right: 0.75rem; }
}
/* 901–1023 px: vier gleich breite Spalten – seit v47 drückte das Zeichen „SIP-Trunk" die Nachbarspalte (3CX) zusammen */
@media (min-width: 901px) and (max-width: 1023px) {
  .bento { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bento .eigenmarke { font-size: 1.05rem; gap: 0.4rem; }
  .bento .eigenmarke svg { height: 22px; }
}
@media (max-width: 900px) {
  .kachel-quer .kachel-bild { height: 210px; }
  .kachel-hoch .kachel-bild { aspect-ratio: auto; height: clamp(170px, 50vw, 240px); }
  .kb-foto img { object-position: 50% 60%; }
  .kachel-droide { position: static; display: block; height: 250px; margin: 1.5rem auto -1.75rem; }
}

/* ── Begrüßungsvideo auf Seite 2 (ab v63, Untertitel ab v64, beide Sätze ab v67) ──────────
   Läuft einmal stumm, sobald die Bühne zu sehen ist, und bleibt dann auf dem letzten Bild stehen.
   Unter den Namen stehen beide Sätze; der gerade gesprochene ist hell, der andere tritt zurück. Ein Klick auf die Köpfe spielt es noch einmal ab.
   Mit Ton nur auf Knopfdruck (Knopf „Mit Ton" neben den Namen). Am Handy, in schmalen (bis 1000 px) und in niedrigen Fenstern (bis 715 px, bei schmalen bis 745 px) ausgeblendet. */
.swap-video { margin-top: 1.35rem; pointer-events: none; }
.swap-video.sv-aktiv { pointer-events: auto; }
.sv-rahmen { position: relative; width: min(92%, calc((100vh - 624px) * 1.771)); }
.sv-film { display: block; width: 100%; height: auto; aspect-ratio: 960 / 542; background: transparent; cursor: pointer; }
.swap-video[data-form="medaillons"] .sv-film {
  -webkit-mask-image: radial-gradient(ellipse 21.9% 43.3% at 23.3% 50.1%, #000 97.5%, transparent 100%), radial-gradient(ellipse 22.2% 43.3% at 76.6% 50.1%, #000 97.5%, transparent 100%);
          mask-image: radial-gradient(ellipse 21.9% 43.3% at 23.3% 50.1%, #000 97.5%, transparent 100%), radial-gradient(ellipse 22.2% 43.3% at 76.6% 50.1%, #000 97.5%, transparent 100%);
}
.sv-ki { position: absolute; left: 50%; top: 93%; transform: translateX(-50%); white-space: nowrap;   /* unten zwischen den beiden Köpfen */
  font-family: 'Geist Mono', ui-monospace, monospace; font-size: 0.62rem; letter-spacing: 0.06em; color: var(--text-faint); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 0.16rem 0.4rem; background: rgba(18, 18, 20, 0.7); }
.sv-zeile { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.05rem; max-width: 22.5vw; min-height: 1.7rem; }
.swap-head p.sv-untertitel { margin: 0.2rem 0 0; max-width: 22.5vw; font-size: 0.9rem; line-height: 1.45; color: var(--text-primary); }
.sv-satz { display: block; transition: opacity .25s ease; }
.sv-s2 { margin-top: 0.15rem; }
.sv-untertitel[data-spricht="gerald"] .sv-s2, .sv-untertitel[data-spricht="natascha"] .sv-s1 { opacity: 0.38; }
.sv-wer { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.sv-ton { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; padding: 0.28rem 0.6rem; border: 1px solid var(--border-subtle); border-radius: 999px; background: rgba(255,255,255,0.04); color: var(--text-primary); font: inherit; font-size: 0.72rem; font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer; transition: border-color .2s ease, color .2s ease; }
.sv-ton:hover, .sv-ton[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
@media (max-width: 1279px) { .sv-rahmen { width: min(92%, calc((100vh - 656px) * 1.771)); } }   /* dort bricht der Text öfter um */
@media (max-width: 1100px) { .sv-rahmen { max-width: 80%; } }   /* schmale Fenster: Abstand zu den Kacheln halten */
@media (max-height: 715px) { .swap-video { display: none; } }
@media (max-width: 1279px) and (max-height: 745px) { .swap-video { display: none; } }
@media (max-width: 1000px) { .swap-video { display: none; } }
@media (prefers-reduced-motion: reduce) { .swap-video { display: block; pointer-events: auto; max-width: 420px; margin-inline: auto; } .sv-rahmen { margin-inline: auto; } .swap-head p.sv-untertitel, .sv-zeile { max-width: none; } }
