/* ---------- 3D-Prozessobjekt ----------
   Greift nur, wenn <html> die Klasse "want-3d" trägt. Ohne WebGL, bei
   reduzierter Bewegung oder bei einem Ladefehler bleibt die Seite wie bisher. */

.process-3d {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 30;              /* unter Header (40), Hintergrund-Schalter (45) und Chat (1000) */
  pointer-events: none;
  display: none;
  opacity: 0;
  transition: opacity .9s ease;
}
.want-3d .process-3d { display: block; }
.process-3d.is-ready { opacity: 1; }

.service-stage,
.service-outro { display: none; }

/* Hero: Das Objekt nimmt den Platz der vier Schritt-Karten ein.
   Die Schritte stehen weiterhin im Abschnitt "Zusammenarbeit". */
.want-3d .hero-visual { opacity: 1; animation: none; }
.want-3d .hero-visual > * { display: none; }

.want-3d .service-outro {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.5;
}
.want-3d .service-outro strong { display: block; color: #f4f8fc; font-size: clamp(23px, 2vw, 30px); line-height: 1.2; margin-bottom: 10px; }
.want-3d .service-outro .text-link { display: inline-block; margin-top: 18px; }

@media (min-width: 1081px) {
  .want-3d .services {
    display: grid;
    grid-template-columns: minmax(0, 540px) minmax(0, 1fr);
    column-gap: clamp(32px, 5vw, 80px);
    align-items: start;
  }
  .want-3d .services .section-heading { grid-column: 1; grid-row: 1; margin-bottom: 14vh; }
  .want-3d .service-grid { grid-column: 1; grid-row: 2; grid-template-columns: minmax(0, 1fr); gap: 44vh; }
  .want-3d .service-outro { grid-column: 1; grid-row: 3; margin-top: 44vh; padding-bottom: 38vh; }
  .want-3d .service-stage {
    display: block;
    grid-column: 2;
    grid-row: 1 / span 3;
    position: sticky;
    top: 0;
    height: 100vh;
  }
  .want-3d .service-card { filter: opacity(.38); transition: filter .5s ease, box-shadow .5s ease; }
  .want-3d .service-card.is-active { filter: none; box-shadow: 0 24px 70px rgba(0, 161, 163, .18); }
}

@media (max-width: 1080px) {
  .want-3d .hero-visual {
    min-height: 0;
    height: min(44vh, 380px);
    aspect-ratio: auto;
    margin: 0 auto 28px;
  }
  .want-3d .service-stage {
    display: block;
    position: sticky;
    top: 76px;
    z-index: 5;
    height: 36vh;
    margin: 0 -20px 22px;
    background: rgba(4, 11, 24, .9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(185, 220, 240, .14);
    border-bottom: 1px solid rgba(185, 220, 240, .14);
  }
  .want-3d .services .section-heading { margin-bottom: 24px; }
  .want-3d .service-outro { margin-top: 32px; }
}
@media (max-width: 600px) {
  .want-3d .service-stage { top: 64px; }
}

/* Auf Handys bleibt die Animation im eigenen Platz im Seitenfluss.
   Kein festes Canvas und keine klebende Bühne über den Leistungstexten.
   Die zweite Abfrage erfasst Handys im Querformat, keine Desktopfenster. */
@media (max-width: 600px), (max-width: 960px) and (max-height: 500px) and (pointer: coarse) {
  .want-3d .hero-visual {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    width: min(100%, 380px);
    height: clamp(230px, 68vw, 320px);
    min-height: 0;
    margin: 0 auto;
    border-radius: 20px;
  }
  .want-3d .hero-visual > .process-3d {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
  }
  .want-3d .service-stage { display: none; }

  /* Der animierte Chat-Zugang sitzt ebenfalls außerhalb der Lesefläche. */
  .sy-chat { top: 8px; right: 74px; bottom: auto; }
  .sy-chat-fab {
    width: 44px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: none;
    box-shadow: none;
  }
  .sy-chat-fab:hover { transform: none; }
  .sy-chat-fab svg.sy-mascot { width: 44px; height: 48px; }
  .sy-chat-fab.open { visibility: hidden; }
  .sy-chat-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    top: max(8px, env(safe-area-inset-top));
    bottom: max(8px, env(safe-area-inset-bottom));
    width: auto;
    height: auto;
    max-height: calc(100dvh - 16px);
  }
  .sy-chat-greeting:not(.sy-greeting-inline) { display: none; }
  .site-header .header-actions > [data-booking-trigger] { display: none; }
  .hero-actions > .background-toggle {
    position: static;
    inset: auto;
    align-self: flex-start;
    min-height: 44px;
    max-width: 100%;
    margin: 0;
    padding: 10px 14px;
    font-size: 12px;
    white-space: normal;
  }
}
@media (max-width: 960px) and (max-height: 500px) and (pointer: coarse) {
  .sy-chat { top: 14px; right: 94px; }
}
