/* =============================================================
   SCROLL STORY – DR-Automation
   Narrativer Scroll-Bereich zwischen Hero und About-Sektion
   ============================================================= */

/* ── Wrapper ─────────────────────────────────────────────── */
.scroll-story-wrapper {
    background-color: #050814;
    /* KEIN overflow:hidden – sonst clippt es die gepinnten GSAP-Elemente */
    position: relative;
    z-index: 2;
    /* To sit correctly under the hero if necessary, or above */
}

/* GSAP generiert einen "pin-spacer" div um gepinnte Elemente.
   Auf #000 gesetzt damit es zu der dunklen ss-intro (mit gradient) passt */
.scroll-story-wrapper .pin-spacer {
    background-color: #000 !important;
}

/* Nahtloser Übergang aus der Hero-Sektion (#000) in den Wrapper (#050814) */
.scroll-story-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50vh;
    /* Fades strictly in the top half of intro */
    background: linear-gradient(180deg, #000 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* ── Story Intro ─────────────────────────────────────────── */
.ss-intro {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 80px 24px;
    position: relative;
    /* We will place the gradient on a large absolute element to prevent subpixel seam rendering entirely */
}

.ss-intro::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.ss-intro::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 35vh;
    background: linear-gradient(0deg, #000 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.ss-intro-content {
    max-width: 780px;
    position: relative;
    z-index: 1;
}

.ss-eyebrow {
    display: inline-block;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #6366f1;
    margin-bottom: 20px;
    padding: 6px 18px;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 100px;
}

/* ── Scroll Reveal Text Effect ─────────────────────────────── */
.ss-reveal-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
}

.ss-reveal-text {
    font-family: 'Oswald', 'Poppins', sans-serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: -0.01em;
    line-height: 100%;
    margin: 0;
    font-weight: 700;
    text-transform: uppercase;
    width: 100%;
    text-align: center;

    /* Ghost text + reveal fill */
    color: rgba(248, 250, 252, 0.12);
    background: linear-gradient(to right, #f8fafc, #f8fafc) no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    background-size: 0%;
    transition: background-size cubic-bezier(0.1, 0.5, 0.5, 1) 0.5s;

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.3em 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;

    /* Scroll-driven animation */
    animation-name: ssReveal;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
    animation-timeline: view();
    animation-range: entry 100% cover 50%;
}

@keyframes ssReveal {
    to {
        background-size: 100%;
    }
}

/* Hover overlay span */
.ss-reveal-text>span {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background-color: #6366f1;
    color: #050814;
    font-size: inherit;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: inherit;

    clip-path: polygon(0 50%, 100% 50%, 100% 50%, 0 50%);
    transform-origin: center;
    transition: all cubic-bezier(0.1, 0.5, 0.5, 1) 0.4s;

    display: flex;
    align-items: center;
    padding: 0.3em 0;
}

.ss-reveal-text:hover>span {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
}

.ss-intro-problem {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: rgba(248, 250, 252, 0.65);
    line-height: 1.8;
    margin-bottom: 40px;
}

.ss-intro-problem strong {
    color: #f8fafc;
}

.ss-intro-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #6366f1;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(99, 102, 241, 0.4);
    padding-bottom: 4px;
    transition: gap 0.3s, color 0.3s;
}

.ss-intro-cta:hover {
    gap: 16px;
    color: #818cf8;
}

/* ── Story Sections (gepinnt) ────────────────────────────── */
.ss-story {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 80px 6vw;
    background-color: #000;
    /* KEIN overflow:hidden – würde das GSAP-Pin abschneiden */
}

/* Übergang entfernt, da Services jetzt ebenfalls schwarz sind */

.ss-story::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(99, 102, 241, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

/* Bild-Container (gepinnt im Hintergrund) */
.ss-pin-container {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.ss-image {
    width: 52vw;
    max-width: 760px;
    height: 72vh;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
    /* Startzustand – wird per GSAP animiert */
    transform: scale(0.94);
    opacity: 0.25;
}

/* Dunkles Overlay über dem Bild damit der Text lesbar bleibt */
.ss-pin-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 80% at 50% 50%, rgba(10, 15, 30, 0.35) 0%, rgba(10, 15, 30, 0.6) 100%);
    border-radius: 16px;
    pointer-events: none;
    z-index: 1;
}

/* Text-Container */
.ss-text-container {
    max-width: 420px;
    position: relative;
    z-index: 10;
    /* Startzustand – wird per GSAP animiert */
    opacity: 0.05;
    transform: translateY(30px);
}

.ss-text-container.ss-right {
    margin-left: auto;
}

.ss-text-container.ss-left {
    margin-right: auto;
}

/* Label über dem Titel */
.ss-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #6366f1;
    margin-bottom: 16px;
}

.ss-label i {
    font-size: 0.85rem;
}

/* Überschrift */
.ss-title {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.2;
    margin: 0 0 20px;
    letter-spacing: -0.02em;
}

/* Fließtext */
.ss-text {
    font-size: 1rem;
    line-height: 1.75;
    color: rgba(248, 250, 252, 0.65);
    margin-bottom: 24px;
}

.ss-text strong {
    color: #f8fafc;
}

/* Checkliste */
.ss-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ss-checklist li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.95rem;
    color: rgba(248, 250, 252, 0.75);
    line-height: 1.5;
}

.ss-checklist li i {
    color: #6366f1;
    margin-top: 3px;
    flex-shrink: 0;
}

/* Erste Story: etwas sichtbarer beim Start */
#ss-story-1 .ss-image {
    opacity: 0.25;
    transform: scale(0.94);
}

/* ── Text-Overlay über Bild (auf kleinen Screens) ─────────── */
/* Auf Desktop: Bild und Text nebeneinander (Bild gepinnt).
   Auf Tablet/Mobile: Bild als Hintergrund, Text davor zentriert */

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .ss-story {
        flex-direction: column;
        padding: 80px 24px;
    }

    .ss-text-container {
        margin: 0 auto !important;
        text-align: center;
        max-width: 600px;
        /* Auf Tablet direkt sichtbar, kein GSAP-Pin */
        opacity: 1 !important;
        transform: none !important;
    }

    .ss-checklist {
        align-items: center;
    }

    .ss-pin-container {
        position: relative;
        width: 100%;
        height: 280px;
        margin-bottom: 40px;
    }

    .ss-image {
        width: 90%;
        height: 100%;
        opacity: 1 !important;
        transform: none !important;
        border-radius: 12px;
    }
}

@media (max-width: 640px) {
    .ss-reveal-text {
        font-size: clamp(1.6rem, 5vw, 2rem);
    }

    .ss-title {
        font-size: 1.6rem;
    }

    .ss-pin-container {
        height: 220px;
    }
}