/* Leistungsseiten, Upgrade-Varianten (2026-10-10).
   Baut auf ../shared/service-base.css auf; dort liegen alle gemeinsamen Bereiche
   (Einordnung, Leistungsumfang, Beispiel, Arbeiten, Ablauf, Kosten, Fragen, „Was dazu passt.“, Kontakt).
   Hier stehen nur der neue Einstieg, die Schritt-Schalter und das Beispiel mit zwei Karten. */

/* ------------------------------------------------------------------ */
/* Einstieg: Kernaussage, Nutzen und Kontakt zuerst, daneben die Szene  */
/* ------------------------------------------------------------------ */
.sx-hero {
    position: relative;
    display: flex;
    min-height: max(100svh, 700px);
    flex-direction: column;
    overflow: clip;
    background:
        radial-gradient(ellipse 45% 55% at 74% 46%, rgba(34, 230, 189, 0.1), transparent 70%),
        radial-gradient(ellipse 55% 70% at 0% 100%, rgba(9, 49, 70, 0.55), transparent 72%),
        var(--space);
    color: var(--white);
    isolation: isolate;
}

.sx-hero__grid {
    display: grid;
    flex: 1;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: center;
    gap: clamp(1.5rem, 3vw, 3.5rem);
    padding-top: 104px;
    padding-bottom: 1rem;
}

.sx-hero__copy { position: relative; z-index: 1; max-width: 40rem; }

/* H1 aus Fokus-Keyword und Kernaussage */
.sx-title { display: grid; gap: 1.1rem; }

.sx-title__kw {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--accent);
    font-size: clamp(0.95rem, 1.1vw, 1.08rem);
    font-stretch: 100%;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1.3;
}

.sx-title__kw .gx-hex { width: 1.15rem; }

.sx-title__claim {
    font-size: clamp(2.5rem, 4.7vw, 5.15rem);
    font-stretch: 78%;
    font-weight: 560;
    letter-spacing: -0.045em;
    line-height: 0.94;
    text-wrap: balance;
}

.sx-lead {
    max-width: 52ch;
    margin-top: clamp(1.2rem, 2.2vw, 1.75rem);
    color: var(--text-on-dark);
    font-size: clamp(1rem, 1.15vw, 1.12rem);
    line-height: 1.6;
}

.sx-actions { margin-top: clamp(1.5rem, 2.6vw, 2.2rem); }

.sx-trust {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.6rem;
    color: var(--muted-on-dark);
    font-size: 0.86rem;
    line-height: 1.4;
}

.sx-trust img {
    width: 38px;
    height: auto;
    flex: 0 0 auto;
    aspect-ratio: 2 / 1.732;
    background: var(--accent);
    clip-path: var(--hex);
    object-fit: cover;
    object-position: 50% 14%;
}

/* Szene mit Schaltern darunter */
.sx-hero__visual {
    position: relative;
    display: grid;
    height: min(74svh, 700px);
    min-height: 460px;
    grid-template-rows: minmax(0, 1fr) auto;
}

.sx-stage { position: relative; min-height: 0; margin: 0; }
.sx-stage .gx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sx-stage .gx-motion { right: 0; bottom: 0.5rem; }
.sx-stage:not(.is-live) .gx-motion,
.gx-scope__stage .gx-motion { display: none; }
.sx-stage.is-fallback .gx-fallback-mark { display: block; }

/* Etikett am Zeiger: nennt den Teil der Szene, über dem der Zeiger steht (nur mit Maus) */
.sx-hover-tag {
    position: absolute;
    z-index: 4;
    top: 0;
    left: 0;
    padding: 0.35rem 0.7rem 0.35rem 0.6rem;
    background: rgba(14, 26, 23, 0.92);
    color: var(--white);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    clip-path: polygon(0 0, calc(100% - 0.4rem) 0, 100% 0.7rem, 100% 100%, 0 100%);
    transition: opacity 160ms ease;
}
.sx-hover-tag.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
    .sx-hover-tag { transition: none; }
}

.sx-steps { position: relative; z-index: 2; }

.sx-steps__kicker {
    margin-bottom: 0.65rem;
    color: var(--muted-on-dark);
    font-size: 0.82rem;
    font-weight: 600;
}

.sx-steps__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 clamp(0.75rem, 1.6vw, 1.5rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.sx-steps__list li {
    padding-top: 0.75rem;
    border-top: 2px solid var(--line-on-dark);
    color: var(--text-on-dark);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
}

.sx-steps.is-live .sx-steps__list li { padding-top: 0; border-top: 0; }

.sx-steps__list button {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 52px;
    align-items: flex-start;
    padding: 0.85rem 0 0.4rem;
    border: 0;
    background: none;
    color: var(--muted-on-dark);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    text-align: left;
    transition: color 200ms ease;
}

.sx-steps__list button:hover,
.sx-steps__list button[aria-pressed="true"] { color: var(--white); }

.sx-steps__bar {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 2px;
    background: var(--line-on-dark);
}

.sx-steps__bar i {
    position: absolute;
    inset: 0;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
}

.sx-steps__list button[aria-pressed="true"] .sx-steps__bar i { transform: scaleX(var(--p, 1)); }

.sx-chapters { margin-top: 0.5rem; }

/* ------------------------------------------------------------------ */
/* Leistungsumfang: Zeichen „Teil i von 3“                               */
/* ------------------------------------------------------------------ */
.sx-legend { width: 74px; height: auto; overflow: visible; }
.sx-legend polygon { fill: none; stroke: rgba(195, 206, 201, 0.45); stroke-linejoin: round; stroke-width: 2.5; }
.sx-legend .is-on { fill: var(--accent); stroke: var(--accent); }
.sx-page .gx-tag { max-width: 15rem; white-space: normal; line-height: 1.3; }

.sx-intro-more { margin-top: 1.1rem; }

/* Lange Leistungsnamen („Abschlussoptimierung“) brechen in schmalen Kacheln sauber um */
.sx-page .gx-related__list strong { hyphens: auto; overflow-wrap: anywhere; }
.sx-page :is(.gx-frame, .gx-intro, .gx-faq, .gx-process__grid) > * { min-width: 0; }
/* Lange deutsche Komposita: trennen statt überlaufen. Listenpunkte in Grids dürfen schrumpfen. */
.sx-page main :is(li, p, summary, h2, h3) { hyphens: auto; overflow-wrap: break-word; }
.sx-page :is(.gx-checks, .gx-steps) > li { min-width: 0; }
.sx-page .sx-steps__list button { hyphens: manual; overflow-wrap: normal; }

/* ------------------------------------------------------------------ */
/* Beispiel: zwei Karten tauschen räumlich die Plätze                   */
/* ------------------------------------------------------------------ */
.sx-flip__scene { position: relative; perspective: 1400px; perspective-origin: 50% 30%; }

.sx-flip__space {
    position: relative;
    display: grid;
    min-height: clamp(300px, 30vw, 380px);
    place-items: center;
    padding-block: clamp(1rem, 3vw, 2rem);
    transform-style: preserve-3d;
}

.sx-flip__card {
    --c: 28px;
    grid-area: 1 / 1;
    width: min(100%, 34rem);
    padding: clamp(1.4rem, 3vw, 2.2rem);
    clip-path: polygon(0 0, calc(100% - var(--c) * 0.577) 0, 100% var(--c), 100% 100%, 0 100%);
    transition: transform 900ms cubic-bezier(0.34, 1.32, 0.42, 1), opacity 500ms ease, filter 500ms ease;
}

.sx-flip__card--before { background: #1d2b27; color: var(--text-on-dark); }
.sx-flip__card--after { background: var(--white); color: var(--ink); }

.sx-flip__label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.sx-flip__label .gx-hex { width: 1.15rem; }

.sx-flip__mark {
    display: grid;
    width: 1.35rem;
    aspect-ratio: 2 / 1.732;
    place-items: center;
    background: #3a4a45;
    color: var(--white);
    clip-path: var(--hex);
    font-size: 0.72rem;
}

.sx-flip__text { font-size: clamp(1.05rem, 1.4vw, 1.22rem); line-height: 1.55; }
.sx-flip__card--after .sx-flip__text { color: var(--ink); }

.gx-example[data-state="after"] .sx-flip__card--after { z-index: 2; transform: translate3d(4%, 0, 60px); }
.gx-example[data-state="after"] .sx-flip__card--before { z-index: 1; filter: saturate(0.6); opacity: 0.55; transform: translate3d(-18%, -10%, -140px) rotateY(16deg) rotateZ(-2deg); }
.gx-example[data-state="before"] .sx-flip__card--before { z-index: 2; transform: translate3d(-4%, 0, 60px); }
.gx-example[data-state="before"] .sx-flip__card--after { z-index: 1; opacity: 0.45; transform: translate3d(18%, 10%, -140px) rotateY(-16deg) rotateZ(2deg); }

.sx-example__note { max-width: 70ch; }

/* Ohne JavaScript: beide Karten nebeneinander */
.gx-page:not(.service-enhanced) .sx-flip__space { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.gx-page:not(.service-enhanced) .sx-flip__card { grid-area: auto; opacity: 1; filter: none; transform: none; }
.gx-page:not(.service-enhanced) .sx-example .gx-switch { display: none; }

/* ------------------------------------------------------------------ */
/* Übersicht aller Varianten                                             */
/* ------------------------------------------------------------------ */
.sx-index { padding-block: 4rem 6rem; }
.sx-index .gx-body { margin-bottom: 3rem; }
.sx-index__group { margin-top: 2.5rem; }
.sx-index__group h2 { padding-bottom: 0.6rem; border-bottom: 2px solid var(--ink); font-size: 1.3rem; font-weight: 650; }
.sx-index__group ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.6rem; margin-top: 1rem; }
.sx-index__group a { display: grid; gap: 0.2rem; padding: 0.9rem 1rem; background: var(--mist); transition: background-color 180ms ease; }
.sx-index__group a:hover { background: var(--mist-strong); }
.sx-index__group span { color: var(--muted); font-size: 0.82rem; }

/* ------------------------------------------------------------------ */
/* Responsiv                                                             */
/* ------------------------------------------------------------------ */
@media (max-width: 1100px) {
    .sx-hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 900px) {
    .sx-hero { min-height: 0; }
    .sx-hero__grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-top: 100px; }
    .sx-hero__visual { height: auto; min-height: 0; grid-template-rows: auto auto; }
    .sx-stage { height: clamp(300px, 86vw, 520px); margin-inline: calc(var(--page-gutter) * -1); }
    .sx-steps { margin-top: 0.25rem; }
}

@media (max-width: 760px) {
    .sx-title { gap: 0.8rem; }
    .sx-title__claim { font-size: clamp(2.25rem, 10vw, 3.3rem); }
    .sx-lead { font-size: 1rem; }
    .sx-actions .button { width: 100%; }
    .sx-trust { margin-top: 1.2rem; }
    .sx-steps__list button { font-size: 0.82rem; }
    .sx-hero__grid { gap: 0.5rem; }
    .sx-stage { margin-top: -1.5rem; }
    .gx-example[data-state] .sx-flip__card--before,
    .gx-example[data-state] .sx-flip__card--after { width: 88%; }
}

@media (max-height: 760px) and (min-width: 901px) {
    .sx-hero__grid { padding-top: 92px; }
    .sx-title__claim { font-size: clamp(2.4rem, 4.2vw, 4.4rem); }
    .sx-trust { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .sx-flip__card { transition: none; }
}
