/* =========================================================
   GLOBALE REPARATUR & SCROLL-FREIGABE
   ========================================================= */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Manrope', sans-serif;
    color: #2b303a;
    -webkit-font-smoothing: antialiased;
    /* REPARATUR: Verhindert, dass der Hero unter die fixed Navigation rutscht */
    padding-top: 88px; 
}

/* Flüssige Hardware-Beschleunigung für die Scroll-Effekte */
[data-aos] {
    will-change: transform, opacity;
    transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.fw-extrabold { 
    font-weight: 800; 
}

/* =========================================================
   1. HERO-BEREICH STYLING (MODERN)
   ========================================================= */
.hero-section {
    background-color: #0f172a; /* Dunkler, edler Hintergrund */
    background-image: radial-gradient(at 0% 0%, rgba(30, 41, 59, 1) 0, transparent 50%), 
                      radial-gradient(at 50% 0%, rgba(99, 102, 241, 0.15) 0, transparent 50%);
}

.hero-bg-glow {
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

/* Farbverlauf für Text */
.text-gradient {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-primary-gradient {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

/* Buttons */
.btn-primary-custom {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    color: white;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
    color: white;
}

.btn-outline-light-custom {
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 12px;
    transition: all 0.2s ease;
}
.btn-outline-light-custom:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

/* Glassmorphismus Vorschau-Box im Hero */
.bg-blur {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.feature-icon-sm {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================================
   2. FEATURE-CARDS STYLING
   ========================================================= */
.shadow-hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.transition-all {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shadow-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

.bg-primary-soft { background-color: rgba(99, 102, 241, 0.1); }
.bg-success-soft { background-color: rgba(34, 197, 94, 0.1); }
.bg-warning-soft { background-color: rgba(234, 179, 8, 0.1); }

/* Maximale Breite für zentrierte Texte */
.max-w-2xl { max-width: 42rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* =========================================================
   HERO (BILD-VARIANTE)
   ========================================================= */
.hero-image {
    position: relative;
    width: 100%;
    height: min(560px, 65vh);
    min-height: 420px;
    overflow: hidden;
}

.hero-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: heroZoom 12s ease-out forwards;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    color: #ffffff;
    background: linear-gradient(90deg, rgba(13, 25, 42, 0.78) 0%, rgba(13, 25, 42, 0.50) 45%, rgba(13, 25, 42, 0.12) 100%);
}

.hero-content {
    max-width: 900px;
    padding: 2rem 0;
}

.hero-content h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.04em;
    text-shadow: 0 3px 20px rgba(0, 0, 0, 0.45);
}

.hero-content p {
    max-width: 700px;
    margin: 1.5rem 0 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(1.05rem, 2vw, 1.4rem);
    line-height: 1.65;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

@keyframes heroZoom {
    from { transform: scale(1.08); }
    to { transform: scale(1); }
}

@media (max-width: 767.98px) {
    .hero-image {
        height: 480px;
        min-height: 480px;
    }
    .hero-overlay {
        background: linear-gradient(180deg, rgba(13, 25, 42, 0.25) 0%, rgba(13, 25, 42, 0.72) 100%);
    }
    .hero-content { padding: 2rem 1rem; }
    .hero-content h1 { font-size: clamp(2.5rem, 12vw, 4rem); }
    .hero-content p { font-size: 1.05rem; }
}

/* =========================================================
   CONTENT (ALLGEMEIN)
   ========================================================= */
.content-section {
    padding: 6rem 0;
}

.section-eyebrow {
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    color: #0d6efd;
}

.section-title {
    margin-bottom: 1.5rem;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: #0d192a;
}

.section-lead {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #667085;
}

@media (max-width: 767.98px) {
    .content-section { padding: 4rem 0; }
    .section-title { font-size: 2rem; }
    .section-lead { font-size: 1.1rem; }
}

/* =========================================================
   DYNAMISCHER INHALT & ON-SCROLL EFFECT CARDS
   ========================================================= */
.dynamic-content-section {
    padding-top: 2rem;
    padding-bottom: 5rem; 
}

.dynamic-scroll-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    border-left: 4px solid transparent !important;
}

.dynamic-scroll-card:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 20px 40px -15px rgba(99, 102, 241, 0.12) !important;
    border-left-color: #6366f1 !important;
}

.feature-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, color 0.3s;
}

.dynamic-scroll-card:hover .feature-icon {
    background-color: #6366f1;
    color: white !important;
}

.entry-content p { 
    margin: 0; 
}

/* =========================================================
   FOOTER (BEREINIGT & REPARIERT)
   ========================================================= */
.site-footer {
    position: relative;
    width: 100%;
    /* REPARATUR: Massiv vergrösserter Abstand nach oben zum Content */
    margin-top: 12rem !important; 

    background-color: #0d192a;
    color: rgba(255, 255, 255, 0.75);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer .container {
    position: relative;
}

.footer-title {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
}

/* Styling für Bilder, die aus der DB kommen */
.modern-image-wrapper img {
    max-width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Subtiler Zoom-Effekt beim Überfahren des Bildes mit der Maus */
.modern-image-wrapper:hover img {
    transform: scale(1.04);
}

/* Styling für dynamische Überschriften aus der DB */
.custom-section-header h2, .custom-section-header h3 {
    font-weight: 800;
    color: #0d192a;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

/* Schicker blauer Unterstrich unter dynamischen Überschriften */
.custom-section-header h2::after, .custom-section-header h3::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 25%;
    width: 50%;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    border-radius: 2px;
}

/* =========================================================
   NATIVE CSS SCROLL-DRIVEN ANIMATIONS (KEIN JS NÖTIG!)
   ========================================================= */

/* Wenn der Browser moderne Scroll-Animationen unterstützt (Chrome, Edge, Safari, Opera) */
@supports (animation-timeline: view()) {
    
    .dynamic-scroll-card {
        /* Verknüpft die Animation direkt mit dem Scrollen des Fensters */
        animation-timeline: view();
        /* Bestimmt, dass die Animation startet, sobald die Karte unten auftaucht, 
           und endet, wenn sie im oberen Drittel angekommen ist */
        animation-range: entry 5% cover 35%;
        animation-fill-mode: both;
        will-change: transform, opacity;
    }

    /* Karte von links einfliegen lassen */
    .card-fly-in-left {
        animation-name: cssFlyInLeft;
    }

    /* Karte von rechts einfliegen lassen */
    .card-fly-in-right {
        animation-name: cssFlyInRight;
    }

    /* Bilder und Überschriften sanft hochskalieren */
    .css-zoom-in, .custom-section-header {
        animation-name: cssZoomIn;
        animation-timeline: view();
        animation-range: entry 0% cover 25%;
        animation-fill-mode: both;
    }
}

/* =========================================================
   VERSTÄRKTE ON-SCROLL EFFEKTE (AUSGEPRÄGTER)
   ========================================================= */

@keyframes cssFlyInLeft {
    from {
        opacity: 0;
        /* Startet weiter links (-120px), tiefer (40px) und leicht nach links gekippt (-5 Grad) */
        transform: translateX(-120px) translateY(40px) rotate(-5deg) scale(0.9);
        filter: blur(4px); /* Subtiler Unschärfe-Effekt beim Start für mehr Tiefe */
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(0) rotate(0deg) scale(1);
        filter: blur(0);
    }
}

@keyframes cssFlyInRight {
    from {
        opacity: 0;
        /* Startet weiter rechts (120px), tiefer (40px) und leicht nach rechts gekippt (5 Grad) */
        transform: translateX(120px) translateY(40px) rotate(5deg) scale(0.9);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(0) rotate(0deg) scale(1);
        filter: blur(0);
    }
}

@keyframes cssZoomIn {
    from {
        opacity: 0;
        /* Bilder und Überschriften kommen deutlich tiefer aus dem Hintergrund hoch */
        transform: translateY(80px) scale(0.85);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* Fallback für uralte Browser oder Firefox ohne aktivierte CSS-Timelines:
   Die Karten sind sofort normal sichtbar, ohne die Seite zu zerstören */
@supports not (animation-timeline: view()) {
    .dynamic-scroll-card, .css-zoom-in, .custom-section-header {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* =========================================================
   PUNKT 1: ZWEISPALTIGES GRID-LAYOUT (ALTERNIEREND)
   ========================================================= */
.dynamic-scroll-card .card-body {
    width: 100%;
}

@media (min-width: 768px) {
    /* Macht die Icon-Spalte im Grid breiter und zentriert sie optisch */
    .grid-visual-side {
        width: 15%;
        display: flex;
        justify-content: center;
    }
    .grid-text-side {
        width: 85%;
    }
}

/* Vergrössert das Icon für die Grid-Ansicht */
.dynamic-scroll-card .feature-icon {
    width: 64px;
    height: 64px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Stellt sicher, dass die Bootstrap-Spalten die Karten auf gleiche Höhe strecken */
.col-md-6.d-flex {
    display: flex !important;
}

/* Optimierung der Grid-Cards */
.dynamic-scroll-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* =========================================================
   PUNKT 2: MIKRO-ANIMATIONEN FÜR DEN MOUSE-OVER EFFEKT
   ========================================================= */

/* Basis-Zustand der Karte für flüssige Übergänge */
.dynamic-scroll-card {
    position: relative;
    overflow: hidden;
    transition: 
        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), 
        box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1), 
        border-color 0.5s ease;
    border-left: 4px solid transparent !important;
}

/* 1. Mikro-Bewegung der gesamten Karte (3D-Lift und weicher Tiefenschatten) */
.dynamic-scroll-card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: 0 25px 50px -12px rgba(99, 102, 241, 0.16) !important;
    border-left-color: #6366f1 !important; /* Der Lichtstreifen fährt aus */
}

/* Basis-Zustand des Icons */
.dynamic-scroll-card .feature-icon {
    transition: 
        transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), 
        background-color 0.4s ease, 
        color 0.4s ease,
        box-shadow 0.4s ease;
}

/* 2. Mikro-Animation des Icons beim Hovern:
   Es färbt sich komplett um, ploppt leicht auf (Skalierung) und rotiert um 8 Grad */
.dynamic-scroll-card:hover .feature-icon {
    background-color: #6366f1 !important;
    color: #ffffff !important;
    transform: scale(1.12) rotate(8deg);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

/* 3. Subtile Animation für das Icon-Innere (Der Pfeil/das Symbol selbst pulsiert minimal) */
.dynamic-scroll-card:hover .feature-icon i {
    animation: iconPulse 1s ease-in-out infinite alternate;
}

@keyframes iconPulse {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.15);
    }
}

/* Bonus: Text-Farbe wird beim Hovern Nuancen dunkler für besseren Kontrast */
.dynamic-scroll-card:hover .entry-content {
    color: #0f172a !important;
    transition: color 0.3s ease;
}

/* =========================================================
   PUNKT 3: FEINTUNING DER GESCHWINDIGKEIT & DES TIMINGS
   ========================================================= */

@supports (animation-timeline: view()) {
    
    .dynamic-scroll-card {
        animation-timeline: view();
        /* STARTZEITPUNKT: Beginnt bereits, wenn die Karte zu 2% im sichtbaren Bereich (entry) unten auftaucht.
           ENDZEITPUNKT: Die volle Sichtbarkeit (100%) ist erreicht, wenn die Karte 28% des Bildschirms hochgewandert ist.
           Dadurch wirkt der Effekt extrem reaktiv und natürlich. */
        animation-range: entry 2% cover 28%;
        animation-fill-mode: both;
        
        /* GESCHWINDIGKEITS-KURVE: Eine hochentwickelte mathematische Kurve (Cubic-Bezier).
           Sie bewirkt, dass der Hineinflug rasant startet, sich dann aber zum Ende hin 
           wunderschön verlangsamt und sanft "einfedert". */
        animation-timing-function: cubic-bezier(0.1, 0.9, 0.2, 1) !important;
        will-change: transform, opacity;
    }

    /* ---------------------------------------------------------
       STAGGER-EFFEKT (Zeitversatz für das Nebeneinander-Grid)
       --------------------------------------------------------- */
    
    /* Jede linke Spalte im Grid (1. Karte in der Reihe) */
    .row > div:nth-child(2n+1) .dynamic-scroll-card {
        animation-name: cssFlyInLeft;
    }

    /* Jede rechte Spalte im Grid (2. Karte in der Reihe) */
    .row > div:nth-child(2n) .dynamic-scroll-card {
        animation-name: cssFlyInRight;
        /* Verzögert den Startzeitpunkt der rechten Karte minimal im Vergleich zur linken,
           sodass ein wunderschöner, asynchroner Wellen-Effekt beim Scrollen entsteht */
        animation-range: entry 8% cover 32%;
    }

    /* Bilder und Überschriften (Sanftes, schnelles Hochgleiten) */
    .css-zoom-in, .custom-section-header {
        animation-name: cssZoomIn;
        animation-timeline: view();
        animation-range: entry 0% cover 20%;
        animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
        animation-fill-mode: both;
    }
}

