/**
 * E3DC POWER Scroll-Story
 */
.e3pw-story {
    --story-top: calc(var(--pw-header, 0px) + max(24px, (100vh - var(--pw-header, 0px) - var(--stage-h, 520px)) / 2));
    padding: var(--pw-sec) 0 calc(var(--pw-sec) * 0.6);
    isolation: isolate;
}

/* Mesh-Gradient im Türkis-Grün des Heroshots, oben und unten weich ausgeblendet */
.e3pw-story::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    /* große, weich auslaufende Farbflächen + Blur: verschmelzen ohne sichtbare Ränder */
    background:
        radial-gradient(55% 42% at 12% 20%, rgba(22, 104, 78, 0.5) 0%, rgba(22, 104, 78, 0.28) 35%, rgba(22, 104, 78, 0.08) 65%, transparent 100%),
        radial-gradient(50% 38% at 88% 32%, rgba(24, 120, 96, 0.4) 0%, rgba(24, 120, 96, 0.2) 38%, rgba(24, 120, 96, 0.05) 68%, transparent 100%),
        radial-gradient(60% 42% at 68% 64%, rgba(16, 80, 58, 0.45) 0%, rgba(16, 80, 58, 0.22) 40%, rgba(16, 80, 58, 0.06) 70%, transparent 100%),
        radial-gradient(48% 36% at 18% 80%, rgba(44, 110, 52, 0.36) 0%, rgba(44, 110, 52, 0.16) 40%, rgba(44, 110, 52, 0.04) 70%, transparent 100%),
        linear-gradient(180deg, #19290c 0%, #142a1a 30%, #12291c 70%, #19290c 100%);
    filter: blur(40px);
    will-change: transform;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
}

.e3pw-story .e3pw-head {
    max-width: 760px;
}

.e3pw-story__grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(32px, 5vw, 80px);
    align-items: start;
}

/* ── Schritte ─────────────────────────────────────────────────────────── */
.e3pw-story__steps {
    position: relative;
    padding-left: 56px;
    padding-bottom: 6vh;
}

.e3pw-story__rail {
    position: absolute;
    left: 17px;
    top: 0;
    height: 0;
    width: 2px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.e3pw-story__rail span {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--pw-green), var(--pw-yellow));
    box-shadow: 0 0 12px rgba(92, 194, 68, 0.8);
    /* Füllung per scaleY statt height: läuft auf der GPU, ruckelt mobil nicht */
    transform: scaleY(0);
    transform-origin: 50% 0;
    will-change: transform;
}

.e3pw-story__step {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 72vh;
    padding: 24px 0;
    opacity: 0.28;
    transition: opacity 0.6s var(--pw-ease);
}

.e3pw-story__step:first-of-type {
    min-height: 56vh;
    justify-content: flex-start;
    padding-top: 12vh;
}

/* Letzter Schritt kürzer: weniger Leerraum bis zur nächsten Sektion */
.e3pw-story__step:last-of-type {
    min-height: 58vh;
}

.e3pw-story__step.is-active {
    opacity: 1;
}

/* Inhalt eines Schritts: Kreis sitzt immer auf Höhe der Dachzeile */
.e3pw-story__inner {
    position: relative;
    display: flex;
    flex-direction: column;
}

.e3pw-story__num {
    position: absolute;
    left: -56px;
    top: -8px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1b300f;
    border: 2px solid rgba(255, 255, 255, 0.18);
    font-family: var(--pw-f-bold);
    font-size: 13px;
    line-height: 1;
    z-index: 1;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.5s var(--pw-ease);
}

.e3pw-story__step.is-active .e3pw-story__num {
    background: var(--pw-green);
    border-color: var(--pw-green);
    color: #fff;
    box-shadow: 0 0 0 6px rgba(92, 194, 68, 0.18), 0 0 24px rgba(92, 194, 68, 0.7);
}

.e3pw .e3pw-story__kicker {
    font-family: var(--pw-f-bold);
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--pw-green);
    margin-bottom: 12px;
}

.e3pw.e3pw .e3pw-story__title {
    font-family: var(--pw-f-bold);
    font-weight: 700;
    font-size: clamp(28px, 2.4vw, 36px);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: #fff;
    text-wrap: balance;
}

.e3pw .e3pw-story__text {
    margin-top: 16px;
    font-size: 18px;
    line-height: 1.6;
    color: var(--pw-text);
    max-width: 46ch;
}

.e3pw-story__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px !important;
}

.e3pw-story__chips li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 8px 10px;
    /* bewusst eckiger als unsere Buttons, damit sie nicht klickbar wirken */
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-family: var(--pw-f-bold);
    font-size: 13px;
    color: #fff;
}

.e3pw-story__chips svg {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    color: var(--pw-green);
}

/* Salient setzt body{overflow:hidden} – das verhindert position:sticky.
   clip statt hidden: kein Scroll-Container, horizontaler Überlauf bleibt aus. */
body.e3pw-has-sticky {
    overflow: visible !important;
    overflow-x: clip !important;
}

/* ── Sticky-Bühne ─────────────────────────────────────────────────────── */
.e3pw-story__sticky {
    position: -webkit-sticky;
    position: sticky;
    top: var(--story-top);
    transition: top 0.35s var(--pw-ease);
}

.e3pw-story__stage {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 32px;
    overflow: hidden;
    isolation: isolate;
    background: #0c1707;
    box-shadow:
        0 50px 100px -40px rgba(0, 0, 0, 0.9),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    transform: translateZ(0);
}

.e3pw-story__stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(143, 226, 94, 0.14), inset 0 -120px 120px -60px rgba(8, 16, 5, 0.85);
}

/* Scroll-gekoppelte Linie ohne JavaScript: Füllung startet, wenn der Anfang der
   Linie die 55-%-Marke des Bildschirms erreicht, und ist voll, wenn ihr Ende sie
   passiert. Läuft im Compositor und ist damit auch auf dem iPhone flüssig. */
@supports (animation-timeline: view()) and (view-timeline-name: --a) {
    .e3pw-story--sda .e3pw-story__rail {
        view-timeline-name: --e3pw-rail;
        view-timeline-axis: block;
    }
    .e3pw-story--sda .e3pw-story__rail span {
        animation: e3pwRailFill linear both;
        animation-timeline: --e3pw-rail;
        animation-range: cover 45vh cover calc(100% - 55vh);
    }
}

@keyframes e3pwRailFill {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

/* Eigene Clip-Ebene: iOS Safari ignoriert overflow:hidden + border-radius,
   sobald darin skaliert wird. clip-path mit Rundung greift zuverlässig. */
.e3pw-story__clip {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    -webkit-clip-path: inset(0 round var(--stage-r, 32px));
    clip-path: inset(0 round var(--stage-r, 32px));
}

.e3pw-story__camera {
    position: absolute;
    inset: 0;
    transform-origin: 50% 50%;
    transition: transform 1.4s cubic-bezier(0.65, 0, 0.2, 1), transform-origin 1.4s cubic-bezier(0.65, 0, 0.2, 1);
    will-change: transform;
}

.e3pw-story__svg {
    display: block;
    width: 100%;
    height: 100%;
}

.e3pw-story__img {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.06);
    transition: opacity 0.8s var(--pw-ease), transform 1.4s var(--pw-ease);
}

.e3pw-story__img.is-active {
    opacity: 1;
    transform: none;
}

.e3pw-story__tint {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    mix-blend-mode: soft-light;
    background: radial-gradient(60% 60% at 55% 35%, rgba(255, 214, 90, 0.5), transparent 70%);
    opacity: 0.8;
    transition: background 1s, opacity 1s;
}

.e3pw-story__stage[data-overlay="grid"] .e3pw-story__tint {
    background: radial-gradient(70% 70% at 85% 40%, rgba(110, 190, 255, 0.55), transparent 70%);
}

.e3pw-story__stage[data-overlay="share"] .e3pw-story__tint {
    opacity: 0.35;
}

/* Overlays */
.e3pw-ov {
    opacity: 0;
    transition: opacity 0.8s var(--pw-ease);
}

.e3pw-ov.is-on {
    opacity: 1;
}

.e3pw-ov__base {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 6;
    stroke-linecap: round;
}

.e3pw-ov__flow {
    fill: none;
    stroke-width: 11;
    stroke-linecap: round;
    stroke-dasharray: 22 30;
    animation: e3pwFlow 1.1s linear infinite;
    animation-play-state: paused;
}

.e3pw-ov.is-on .e3pw-ov__flow {
    animation-play-state: running;
}

@keyframes e3pwFlow {
    to { stroke-dashoffset: -52; }
}

@keyframes e3pwRay {
    to { stroke-dashoffset: -200; }
}

.e3pw-ov__flow--sun,
.e3pw-ov__flow--share {
    stroke: #ffe96b;
    filter: drop-shadow(0 0 6px rgba(252, 178, 37, 0.95)) drop-shadow(0 0 16px rgba(252, 178, 37, 0.6));
}

.e3pw-ov__flow--grid {
    stroke: #d7f1ff;
    filter: drop-shadow(0 0 6px rgba(120, 200, 255, 0.95)) drop-shadow(0 0 16px rgba(120, 200, 255, 0.6));
}

.e3pw-ov__halo {
    transform-box: fill-box;
    transform-origin: center;
    animation: e3pwHalo 3s ease-in-out infinite;
}

@keyframes e3pwHalo {
    0%, 100% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.12); opacity: 1; }
}

@keyframes e3pwSpin {
    to { rotate: 360deg; }
}

.e3pw-ov__outline {
    fill: none;
    stroke: #fff799;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 16 84;
    opacity: 0.7;
    filter: drop-shadow(0 0 5px rgba(255, 233, 107, 0.8));
    animation: e3pwComet 4.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes e3pwComet {
    from { stroke-dashoffset: 116; }
    to { stroke-dashoffset: 0; }
}

/* Sonne links oben, Lichtkegel aufs Dach */
.e3pw-ov__sun {
    filter: drop-shadow(0 0 18px rgba(255, 233, 107, 0.9));
}

.e3pw-ov__beam {
    mix-blend-mode: screen;
    animation: e3pwBeam 4s ease-in-out infinite;
}

@keyframes e3pwBeam {
    0%, 100% { opacity: 0.75; }
    50% { opacity: 1; }
}

.e3pw-ov__ray {
    fill: none;
    stroke: #fff7c2;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 60 140;
    opacity: 0.6;
    filter: drop-shadow(0 0 6px rgba(255, 233, 107, 0.9));
    animation: e3pwRay 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    animation-play-state: paused;
}

.e3pw-ov__ray--2 { animation-delay: -0.6s; }
.e3pw-ov__ray--3 { animation-delay: -1.2s; }

.e3pw-ov.is-on .e3pw-ov__ray {
    animation-play-state: running;
}

.e3pw-ov__node {
    stroke-width: 4;
}

.e3pw-ov__node--sun,
.e3pw-ov__node--share {
    fill: #fff799;
    stroke: #fcb225;
    filter: drop-shadow(0 0 10px rgba(252, 178, 37, 1));
}

.e3pw-ov__node--grid {
    fill: #eaf8ff;
    stroke: #6cc4ff;
    filter: drop-shadow(0 0 10px rgba(108, 196, 255, 1));
}

.e3pw-ov__node--pulse {
    transform-box: fill-box;
    transform-origin: center;
    animation: e3pwNode 1.6s ease-in-out infinite;
}

@keyframes e3pwNode {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.5); }
}

.e3pw-ov__pylon path {
    fill: none;
    stroke: rgba(225, 244, 255, 0.9);
    stroke-width: 7;
    stroke-linejoin: round;
    stroke-linecap: round;
    filter: drop-shadow(0 0 8px rgba(120, 200, 255, 0.8));
}

.e3pw-ov__pylon circle {
    fill: #d7f1ff;
}

.e3pw-ov__ai-bg {
    fill: rgba(10, 20, 6, 0.85);
    stroke: #6cc4ff;
    stroke-width: 3;
}

.e3pw-ov__ai-ring {
    fill: none;
    stroke: #d7f1ff;
    stroke-width: 3;
    stroke-dasharray: 20 16;
    transform-box: fill-box;
    transform-origin: center;
    animation: e3pwSpin 6s linear infinite;
}

.e3pw-ov__ai text {
    font-family: var(--pw-f-display);
    font-size: 36px;
    fill: #fff;
}

.e3pw-ov__coin circle {
    fill: var(--pw-yellow);
    stroke: #fff799;
    stroke-width: 3;
    filter: drop-shadow(0 0 10px rgba(252, 178, 37, 1));
}

.e3pw-ov__coin text {
    font-family: var(--pw-f-bold);
    font-size: 28px;
    fill: #142108;
}

/* Navigation oben */
.e3pw-story__nav {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 5;
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(10, 20, 6, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.e3pw .e3pw-story__nav button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: auto;
    padding: 6px 14px 6px 6px;
    border: 0;
    border-radius: 999px !important;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--pw-f-bold);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.4s, color 0.4s;
}

.e3pw .e3pw-story__nav i {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    font-style: normal;
    font-size: 11px;
}

.e3pw .e3pw-story__nav button.is-active {
    background: rgba(92, 194, 68, 0.22);
    color: #fff;
}

.e3pw .e3pw-story__nav button.is-active i {
    background: var(--pw-green);
    color: #fff;
}

/* HUD */
.e3pw-story__huds {
    position: absolute;
    left: 18px;
    bottom: 18px;
    z-index: 5;
}

.e3pw-story__hud {
    position: absolute;
    left: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px 12px 12px;
    border-radius: 20px;
    white-space: nowrap;
    background: rgba(10, 20, 6, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    backdrop-filter: blur(16px) saturate(1.3);
    opacity: 0;
    transform: translate3d(0, 16px, 0);
    transition: opacity 0.5s var(--pw-ease), transform 0.6s var(--pw-ease);
}

.e3pw-story__hud.is-active {
    opacity: 1;
    transform: none;
    transition-delay: 0.35s;
}

.e3pw-story__hud-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    color: #142108;
    background: var(--pw-grad);
}

.e3pw-story__hud-icon--grid {
    background: linear-gradient(135deg, #eaf8ff, #6cc4ff);
}

.e3pw-story__hud-icon--share {
    color: #fff;
    background: var(--pw-green);
}

.e3pw-story__hud-icon svg {
    width: 24px;
    height: 24px;
}

.e3pw-story__hud small {
    display: block;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.e3pw-story__hud strong {
    display: block;
    font-family: var(--pw-f-display);
    font-weight: 400;
    font-size: 26px;
    line-height: 1.1;
    color: #fff;
}

.e3pw-story__count {
    position: absolute;
    right: 22px;
    bottom: 16px;
    z-index: 5;
    font-family: var(--pw-f-display);
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
}

.e3pw-story__count b {
    font-weight: 400;
    font-size: 44px;
    color: #fff;
}

/* Luft zwischen 01, Schrägstrich und 03 (kursive Ziffern ragen sonst ineinander) */
.e3pw-story__count span {
    margin-left: 0.5em;
    letter-spacing: 0.03em;
}

.e3pw-story__count i {
    font-style: inherit;
    margin-right: 0.28em;
}

/* ── Tablet / Mobil ───────────────────────────────────────────────────── */
@media (max-width: 999px) {
    .e3pw-story {
        --story-top: var(--pw-header, 0px);
    }
    .e3pw-story__grid {
        display: flex;
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 0;
    }
    /* Band hinter dem mitlaufenden Bild: volle Bildschirmbreite (keine
       sichtbaren Kanten), leicht getönt + Blur, unten weich ausgeblendet */
    .e3pw-story__sticky {
        z-index: 3;
        margin: 0 calc(50% - 50vw);
        padding: 10px calc(50vw - 50%) 44px;
        /* deckend hinter dem Bild, darunter weich ausgeblendet: Text verschwindet
           sauber, ohne Blur (Blur beim Scrollen kostet auf dem iPhone Leistung) */
        background: linear-gradient(180deg, rgba(18, 40, 27, 0) 0, #12281b 10px, #12281b calc(100% - 64px), rgba(18, 40, 27, 0.85) calc(100% - 40px), rgba(18, 40, 27, 0) 100%);
    }
    .e3pw-story__stage {
        --stage-r: 22px;
        border-radius: 22px;
    }
    .e3pw-story__steps {
        padding-left: 44px;
        padding-bottom: 2vh;
    }
    .e3pw-story__rail {
        left: 13px;
    }
    .e3pw-story__num {
        left: -44px;
        width: 28px;
        height: 28px;
        font-size: 11px;
        top: -4px;
    }
    .e3pw-story__step,
    .e3pw-story__step:first-of-type,
    .e3pw-story__step:last-of-type {
        min-height: 52vh;
        justify-content: center;
        padding-top: 24px;
    }
}

@media (max-width: 690px) {
    .e3pw-story__nav {
        top: 10px;
        right: 10px;
    }
    .e3pw-story__nav {
        gap: 2px;
        padding: 3px;
    }
    .e3pw .e3pw-story__nav button {
        gap: 6px;
        padding: 3px;
        font-size: 11px;
    }
    .e3pw .e3pw-story__nav i {
        width: 18px;
        height: 18px;
        font-size: 9px;
    }
    .e3pw .e3pw-story__nav button span {
        display: none;
    }
    .e3pw .e3pw-story__nav button.is-active span {
        display: inline;
        padding-right: 7px;
    }
    .e3pw-story__huds {
        left: 10px;
        bottom: 10px;
    }
    .e3pw-story__hud {
        gap: 10px;
        padding: 8px 14px 8px 8px;
        border-radius: 14px;
    }
    .e3pw-story__hud-icon {
        width: 32px;
        height: 32px;
        border-radius: 10px;
    }
    .e3pw-story__hud-icon svg {
        width: 18px;
        height: 18px;
    }
    .e3pw-story__hud small {
        font-size: 10px;
    }
    .e3pw-story__hud strong {
        font-size: 18px;
    }
    .e3pw-story__count {
        display: none;
    }
    .e3pw .e3pw-story__text {
        font-size: 16px;
    }
    /* Headline deutlich größer als der Fließtext */
    .e3pw.e3pw .e3pw-story__title {
        font-size: 30px;
        line-height: 1.18;
    }
}
