/**
 * E3DC POWER Hero
 * Vollflächiges Key-Visual, Claim links unten, Text + Buttons rechts.
 */
.e3pw-hero {
    --r: 1.615;
    --hero-h: max(640px, calc(100svh - var(--hero-hdr, 0px)));
    --hero-gap: clamp(12px, 2.5vh, 32px);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: calc(var(--hero-h) + var(--hero-offset, 0px));
    padding-top: var(--hero-offset, 0px);
    overflow: hidden;
    isolation: isolate;
    --tail: linear-gradient(90deg, #2c5232 0%, #26482d 30%, #20402a 60%, #1c3826 100%);
    background: #182014;
}

/* Unterer Bildrand: exakt in die Farbe des Auslaufs überblenden */
.e3pw-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 42%;
    z-index: 1;
    pointer-events: none;
    background: var(--tail);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 100%);
}

.e3pw-hero-wrap {
    position: relative;
    z-index: 0;
}

/* Auslauf in die nächste Sektion */
.e3pw-hero__tail {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: clamp(260px, 50vh, 600px);
    z-index: -1;
    pointer-events: none;
    background: var(--tail, linear-gradient(90deg, #2c5232 0%, #26482d 30%, #20402a 60%, #1c3826 100%));
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.45) 40%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.45) 40%, transparent 100%);
}

.e3pw-hero__backdrop {
    display: none;
    position: absolute;
    inset: -10%;
    z-index: -3;
    background-size: cover;
    background-position: center 40%;
    filter: blur(70px) saturate(1.25);
    opacity: 0.32;
    transform: scale(1.1);
}

.e3pw-hero__glow {
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(40% 30% at 58% 38%, rgba(255, 214, 90, 0.08), transparent 70%);
    pointer-events: none;
}

.e3pw-hero__sparks {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.2s ease;
}

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

/* Intro erst starten, wenn Schrift + Bild bereit sind (sonst sichtbares Springen) */
html.e3pw-js .e3pw-hero:not(.is-go) .e3pw-hero__img,
html.e3pw-js .e3pw-hero:not(.is-go) .e3pw-hero__tag,
html.e3pw-js .e3pw-hero:not(.is-go) .e3pw-hero__line > span,
html.e3pw-js .e3pw-hero:not(.is-go) .e3pw-hero__side,
html.e3pw-js .e3pw-hero:not(.is-go) .e3pw-hero__scroll {
    animation-play-state: paused;
}

/* ── Key-Visual ───────────────────────────────────────────────────────── */
.e3pw-hero__stage {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Bild füllt den Hero wie "cover", behält aber sein Seitenverhältnis,
   damit FIX/SHARE immer an derselben Stelle im Motiv sitzen. */
.e3pw-hero__visual {
    /* füllt den Hero, wächst aber nicht über 2200px hinaus (Motiv hat 2400px) */
    --w: min(2200px, max(100%, calc((var(--hero-h) + var(--hero-offset, 0px)) * var(--r))));
    position: absolute;
    top: 0;
    left: 50%;
    width: var(--w);
    margin-left: calc(var(--w) / -2);
    aspect-ratio: 2400 / 1486;
    container-type: inline-size;
    will-change: transform, opacity;
}

.e3pw-hero__img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    backface-visibility: hidden;
    animation: e3pwHeroIn 1.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Nur Deckkraft + Transform: läuft komplett auf der GPU, kein Filter-Neurendern */
@keyframes e3pwHeroIn {
    from { opacity: 0; transform: scale(1.06); }
    to { opacity: 1; transform: scale(1); }
}

.e3pw-hero__tags {
    position: absolute;
    right: 1.5%;
    top: 16.5%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: var(--pw-f-display);
    font-size: 6.4cqw;
    line-height: 0.84;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    will-change: transform;
}

.e3pw-hero__tag {
    display: block;
    padding-right: 0.06em;
}

.e3pw-hero__tag--fix {
    color: #8fe25e;
    text-shadow: 0 0 0.06em #5cc244, 0 0 0.3em rgba(92, 194, 68, 0.85), 0 0 0.8em rgba(92, 194, 68, 0.45);
    animation: e3pwTagIn 1s 0.9s var(--pw-ease) both;
}

.e3pw-hero__tag--share {
    /* Innenabstand, damit background-clip:text die Oberkante des S nicht abschneidet */
    padding: 0.12em 0.08em 0.06em 0.04em;
    margin: -0.12em -0.02em -0.06em 0;
    background: linear-gradient(180deg, #fff799 0%, #ffe96b 30%, #fcb225 75%, #f99e34 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 0.12em rgba(252, 178, 37, 0.7)) drop-shadow(0 0 0.4em rgba(249, 158, 52, 0.35));
    animation: e3pwTagIn 1s 1.1s var(--pw-ease) both;
}

@keyframes e3pwTagIn {
    from { opacity: 0; transform: translate3d(0.6em, 0, 0) skewX(-8deg); }
    to { opacity: 1; transform: none; }
}

@keyframes e3pwFlicker {
    0%, 100% { opacity: 1; }
    3% { opacity: 0.35; }
    6% { opacity: 1; }
    9% { opacity: 0.55; }
    12% { opacity: 1; }
}

/* ── Inhalt ───────────────────────────────────────────────────────────── */
.e3pw-hero__content {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    align-items: end;
    gap: clamp(28px, 4vw, 72px);
    padding-top: 40px;
    padding-bottom: clamp(56px, 8vh, 96px);
    will-change: transform, opacity;
}

.e3pw .e3pw-hero__claim {
    margin: 0;
    font-family: var(--pw-f-display);
    font-weight: 400;
    font-size: clamp(52px, 7vw, 124px);
    line-height: 0.9;
    letter-spacing: -0.015em;
    text-transform: uppercase;
    color: #fff;
    transition: filter 0.8s ease;
}

/* Schatten erst nach dem Intro setzen: Filter während der Zeilen-Animation kostet Frames */
.e3pw-hero.is-ready .e3pw-hero__claim {
    filter: drop-shadow(0 8px 30px rgba(5, 12, 2, 0.7));
}

.e3pw-hero__line {
    display: block;
    overflow: hidden;
    padding: 0.04em 0.1em 0.02em 0;
    margin-bottom: -0.02em;
}

.e3pw-hero__line > span {
    display: block;
    transform-origin: 0 0;
    animation: e3pwLineUp 1.1s calc(0.55s + var(--i, 0) * 0.12s) var(--pw-ease) both;
}

/* Ursprung links oben: die Schräglage schiebt keine Buchstabenspitzen ins Sichtfeld */
@keyframes e3pwLineUp {
    from { transform: translate3d(0, 115%, 0) skewY(4deg); }
    to { transform: none; }
}

.e3pw-hero__side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 460px;
    padding-bottom: 0.6em;
    animation: e3pwFadeUp 1s 1.05s var(--pw-ease) both;
}

@keyframes e3pwFadeUp {
    from { opacity: 0; transform: translate3d(0, 24px, 0); }
    to { opacity: 1; transform: none; }
}

.e3pw .e3pw-hero__text {
    font-size: clamp(16px, 1.2vw, 19px);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
    text-shadow: 0 2px 20px rgba(5, 12, 2, 0.8);
}

.e3pw .e3pw-hero__text strong {
    font-family: var(--pw-f-bold);
    color: #fff;
}

.e3pw-hero__btns {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}

/* ── Scroll-Hinweis ───────────────────────────────────────────────────── */
.e3pw-hero__scroll {
    position: absolute;
    left: 50%;
    bottom: 22px;
    z-index: 3;
    width: 26px;
    height: 42px;
    margin-left: -13px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 14px;
    animation: e3pwFadeUp 1s 1.6s var(--pw-ease) both;
}

.e3pw-hero__scroll span {
    position: absolute;
    left: 50%;
    top: 8px;
    width: 4px;
    height: 8px;
    margin-left: -2px;
    border-radius: 2px;
    background: var(--pw-green);
    box-shadow: 0 0 10px var(--pw-green);
    animation: e3pwScrollDot 1.8s var(--pw-ease) infinite;
}

@keyframes e3pwScrollDot {
    0% { transform: translateY(0); opacity: 0; }
    30% { opacity: 1; }
    80%, 100% { transform: translateY(14px); opacity: 0; }
}

/* ── Desktop: Visual im Fluss, Größe nach Bildschirmhöhe ─────────────────
   Das Motiv wird so groß, wie die verfügbare Höhe es sinnvoll zulässt, und
   bleibt komplett sichtbar. Claim und Text überlappen nur den unteren
   Wiesen-Bereich. Reicht die Höhe nicht, wird der Hero einfach höher und
   ist scrollbar, statt Text über die Häuser zu legen. */
@media (min-width: 1101px) {
    .e3pw-hero {
        /* Claim-Schriftgröße richtet sich nach Breite UND Höhe */
        --fs: clamp(52px, min(6.4vw, 11svh), 118px);
        /* Bildhöhe, bei der Bild + Claim + Text genau in den Bildschirm passen:
           das leere Himmel-Stück (obere 12 %) darf hinter den Header, der
           POWER-Schriftzug beginnt aber immer unterhalb der Navigation.
           Claim und Text starten bei 58 % der Bildhöhe und überlagern den
           unteren Teil der Häuser. */
        --fit: calc((100svh - var(--hero-hdr, 0px) - var(--fs) * 2.9 - 72px) / 0.46);
        --w: min(100vw, 2200px, max(1080px, calc(var(--fit) * var(--r))));
        --vh: calc(var(--w) / var(--r));
        justify-content: center;
    }
    .e3pw-hero__stage {
        position: relative;
        inset: auto;
        flex: 0 0 auto;
        height: var(--vh);
        margin-top: calc(max(0px, var(--hero-offset, 0px) - var(--vh) * 0.12 + 16px) - var(--hero-offset, 0px));
        overflow: visible;
    }
    .e3pw-hero__visual {
        --w: inherit;
        width: var(--w);
        margin-left: calc(var(--w) / -2);
        -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%), linear-gradient(180deg, #000 74%, transparent 100%);
        -webkit-mask-composite: source-in;
        mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%), linear-gradient(180deg, #000 74%, transparent 100%);
        mask-composite: intersect;
    }
    .e3pw-hero__content {
        margin-top: calc(var(--vh) * -0.42);
        /* rechter Block (Text + Buttons) schließt unten mit dem Claim ab */
        align-items: end;
        padding-top: 0;
        padding-bottom: clamp(36px, 5.5vh, 72px);
    }
    .e3pw .e3pw-hero__claim {
        font-size: var(--fs);
    }
}

/* ── Tablet ───────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .e3pw-hero__content {
        grid-template-columns: 1fr;
        align-items: start;
    }
    .e3pw-hero__side {
        max-width: 560px;
    }
    .e3pw-hero__scroll {
        display: none;
    }
}

@media (max-width: 1100px) and (min-width: 691px) {
    .e3pw-hero {
        min-height: 0;
    }
    .e3pw-hero__stage {
        position: relative;
        inset: auto;
        /* Visual beginnt unter Logo und Navigation, nicht dahinter */
        margin-top: clamp(8px, 2.5vw, 20px);
    }
    .e3pw-hero__visual {
        --w: 100%;
        position: relative;
        left: 0;
        margin-left: 0;
    }
    .e3pw-hero {
        /* oben im Ton der Bildkante, damit der Abstand unter dem Header nicht als Streifen auffällt */
        background: linear-gradient(180deg, #171e14 0%, #171e14 40%, rgba(23, 30, 20, 0) 75%), var(--tail);
    }
    .e3pw-hero::after {
        display: none;
    }
    .e3pw-hero__img {
        -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
        mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
    }
    .e3pw-hero__content {
        margin-top: -14%;
        padding-bottom: 36px;
    }
    .e3pw .e3pw-hero__claim {
        font-size: clamp(44px, 7.4vw, 72px);
    }
}

/* ── Mobil ────────────────────────────────────────────────────────────── */
@media (max-width: 690px) {
    .e3pw-hero {
        min-height: 0;
    }
    .e3pw-hero__stage {
        position: relative;
        inset: auto;
        /* Visual beginnt unter Logo und Navigation, nicht dahinter */
        margin-top: clamp(8px, 2.5vw, 20px);
    }
    .e3pw-hero__visual {
        --w: 136%;
        position: relative;
        left: 50%;
        /* 10px nach links versetzt, FIX/SHARE wandern im Bild mit */
        margin-left: calc(-68% - 10px);
    }
    .e3pw-hero {
        /* oben im Ton der Bildkante, damit der Abstand unter dem Header nicht als Streifen auffällt */
        background: linear-gradient(180deg, #171e14 0%, #171e14 40%, rgba(23, 30, 20, 0) 75%), var(--tail);
    }
    .e3pw-hero::after {
        display: none;
    }
    .e3pw-hero__img {
        -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
        mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
    }
    .e3pw-hero__content {
        /* Claim überlagert nur noch den unteren Bildrand */
        margin-top: -19%;
        gap: 22px;
        padding-top: 0;
        padding-bottom: 20px;
    }
    .e3pw .e3pw-hero__claim {
        font-size: clamp(34px, 10.5vw, 48px);
    }
    .e3pw-hero__btns .e3pw-btn {
        flex: 1 1 100%;
    }
}
