/* 1. Scroll Progress Bar */
#scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    /* JS setzt height via scrollY */
    background: linear-gradient(180deg, #480ca8, #598392, rgba(89, 131, 146, 0));
    z-index: 9999;
    pointer-events: none;
    border-radius: 0 0 3px 3px;
    box-shadow: 0 0 12px rgba(89, 131, 146, 0.6);
    transition: height 0.08s linear;
}

/* 2. Premium Mission Cards — Subtle Hover Only */
#mission .glass-card {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.4s ease,
                box-shadow 0.4s ease;
}

#mission .glass-card:hover {
    transform: translateY(-2px);
    border-color: rgba(89, 131, 146, 0.25);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(89, 131, 146, 0.08);
}

/* 3. Value Card 3D Tilt — CSS Basis */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.15s ease, box-shadow 0.3s ease;
    transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    will-change: transform;
}

.tilt-card:hover {
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(72, 12, 168, 0.3);
}

/* 4. Holographic Foil Team Card */
.holo-card {
    position: relative;
    overflow: hidden;
}

.holo-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: conic-gradient(from calc(var(--mx, 0) * 360deg),
            rgba(72, 12, 168, 0.0),
            rgba(89, 131, 146, 0.15),
            rgba(115, 94, 210, 0.2),
            rgba(0, 229, 255, 0.1),
            rgba(72, 12, 168, 0.0));
    mix-blend-mode: color-dodge;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.holo-card:hover::after {
    opacity: 1;
}

/* 5. Hero Reveal — Managed by anime.js */
.hero-word {
    display: inline-block;
    will-change: transform, opacity;
}

/* 6. Deep Reveal — Upgrade des Scroll-Reveal */
.deep-reveal {
    opacity: 0;
    transform: perspective(600px) rotateX(8deg) translateY(40px);
    transition:
        opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.deep-reveal.active {
    opacity: 1;
    transform: perspective(600px) rotateX(0deg) translateY(0);
}

/* 7. Ken Burns Slideshow */
.ks-wrapper .slide img {
    transition: transform 8s ease-in-out, opacity 0.8s ease;
}

.ks-wrapper .slide.active img {
    animation: kenburns 8s ease-in-out forwards;
}

.ks-wrapper .slide {
    transition: opacity 0.8s ease;
}

@keyframes kenburns {
    0% {
        transform: scale(1) translate(0, 0);
    }

    100% {
        transform: scale(1.08) translate(-1%, -1%);
    }
}

/* 8. Aurora CTA Border */
.aurora-wrap {
    position: relative;
    border-radius: var(--radius-xl);
    padding: 2px;
    background: linear-gradient(var(--aurora-angle, 135deg),
            rgba(72, 12, 168, 0.4),
            rgba(89, 131, 146, 0.6),
            rgba(18, 69, 89, 0.3),
            rgba(72, 12, 168, 0.4));
    animation: aurora-shift 8s linear infinite;
}

@keyframes aurora-shift {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(60deg);
    }
}

.aurora-wrap .cta-section {
    border: none !important;
}

/* 9. Depth Light Lines — Scroll-parallaxe Lichtschimmer */
.depth-light {
    position: absolute;
    top: 50%;
    left: -10%;
    width: 120%;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(89, 131, 146, 0.0) 20%,
            rgba(89, 131, 146, 0.4) 50%,
            rgba(89, 131, 146, 0.0) 80%,
            transparent 100%);
    pointer-events: none;
    transform: translateY(var(--dl-y, -50%));
    will-change: transform;
    filter: blur(1px);
}

/* Responsive Constraints */
@media (hover: none) and (pointer: coarse) {
    .tilt-card {
        transform: none !important;
    }
}

@media (max-width: 1024px) {
    .tilt-card {
        transform: none !important;
    }
}

@media (max-width: 480px) {
    .aurora-wrap {
        animation: none;
        background: linear-gradient(135deg,
                rgba(72, 12, 168, 0.4),
                rgba(89, 131, 146, 0.6));
    }

    .holo-card::after {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    #bio-particles,
    .aurora-wrap {
        display: none !important;
    }

    .hero-word,
    .deep-reveal {
        transition: none !important;
        clip-path: none !important;
    }
}

/* ========================================================================= */
/* WAVE 2: DEEP SIGNAL UPGRADES                                              */
/* ========================================================================= */

/* 1. Section Titles — Animated Underline Gradient */
.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #480ca8, #598392, transparent);
    box-shadow: 0 0 12px rgba(89, 131, 146, 0.6);
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.section-title.title-revealed::after {
    width: 60%;
}

/* 2. Section Dividers — Morphing Wave */
.wave-divider {
    position: relative;
    overflow: hidden;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.wave-divider::before {
    display: none !important;
}

.divider-wave {
    position: absolute;
    width: 100%;
    height: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.divider-wave path {
    stroke-dasharray: 1200;
    stroke-dashoffset: 0;
    animation: waveScroll 8s linear infinite;
}

@keyframes waveScroll {
    to {
        stroke-dashoffset: -1200;
    }
}

/* 3. Mission Grid — Split Layout + Stats Bar */
.mission-split {
    display: grid !important;
    grid-template-columns: 1fr 1px 1fr;
    gap: var(--spacing-lg);
    align-items: stretch;
}

@media (max-width: 768px) {
    .mission-split {
        grid-template-columns: 1fr;
    }
}

.mission-separator {
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.mission-separator::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -2px;
    width: 5px;
    height: 20px;
    background: var(--primary-light);
    box-shadow: 0 0 10px var(--primary-light), 0 0 20px var(--accent-color);
    border-radius: 5px;
    animation: traveling-glow 3s linear infinite;
}

@keyframes traveling-glow {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(300px);
        opacity: 0;
    }
}

.mission-stats-bar {
    display: flex;
    justify-content: space-around;
    margin-top: var(--spacing-xl);
    padding: var(--spacing-md);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount));
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

.mstat {
    text-align: center;
}

.mstat span {
    font-size: var(--font-size-h3);
    font-weight: 800;
    color: var(--primary-light);
    text-shadow: 0 0 10px rgba(72, 12, 168, 0.3);
}

.mstat p {
    font-size: var(--font-size-small);
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .mission-stats-bar {
        flex-direction: column;
        gap: var(--spacing-md);
    }
}

/* 4. Value Cards — Icon Upgrade + Neon Ring */
.value-card {
    position: relative;
    overflow: hidden;
}

.value-icon-wrapper {
    position: relative;
    display: inline-block;
    padding: 15px;
}

.value-icon-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid transparent;
    background: conic-gradient(from 0deg, transparent, rgba(72, 12, 168, 0.8), transparent) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: rotate-ring 4s linear infinite;
}

@keyframes rotate-ring {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.value-card:hover .material-icons {
    filter: drop-shadow(0 0 8px rgba(72, 12, 168, 0.6));
}

.value-card::before {
    content: '';
    position: absolute;
    top: calc(var(--my, 0.5) * 100%);
    left: calc(var(--mx, 0.5) * 100%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(72, 12, 168, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    mix-blend-mode: screen;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.value-card:hover::before {
    opacity: 1;
}

/* 5. Team Card — Full Redesign */
.team-card-v2 {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--spacing-xl);
    text-align: center;
}

.team-card-v2 .profile-img {
    clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
    width: 160px;
    height: 160px;
    object-fit: cover;
    transition: clip-path 0.4s ease;
    margin: 0 auto var(--spacing-md);
    display: block;
}

.team-card-v2 .profile-img:hover {
    clip-path: polygon(50% 5%, 95% 27%, 95% 73%, 50% 95%, 5% 73%, 5% 27%);
}

.team-tags {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: var(--spacing-md) 0;
    flex-wrap: wrap;
}

.team-tag {
    background: rgba(72, 12, 168, 0.15);
    border: 1px solid rgba(72, 12, 168, 0.3);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-light);
}

/* Team Social Links */
.team-social-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: var(--spacing-lg);
    flex-wrap: wrap;
}

.team-social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.team-social-btn:hover {
    background: rgba(72, 12, 168, 0.15);
    border-color: rgba(72, 12, 168, 0.4);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(72, 12, 168, 0.2);
}

/* 6. Slideshow Dots + Caption */
.slide-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.slide-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.slide-dot.active {
    width: 24px;
    background: var(--text-light);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.slide-caption {
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 100%;
    padding: 40px 20px 20px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    font-weight: bold;
    font-size: var(--font-size-h4);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s ease;
    z-index: 5;
}

.slide.active .slide-caption {
    transform: translateY(0);
    opacity: 1;
}

/* 7. Arbeitsweise Section */
.workflow-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.workflow-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50px;
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.workflow-timeline::after {
    content: '';
    position: absolute;
    top: 0;
    left: 48px;
    width: 5px;
    height: 30px;
    background: var(--primary-light);
    box-shadow: 0 0 10px var(--primary-light), 0 0 20px var(--accent-color);
    border-radius: 5px;
    animation: traveling-glow-timeline 4s linear infinite;
}

@keyframes traveling-glow-timeline {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(800px);
        opacity: 0;
    }
}

.wf-step {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    position: relative;
    z-index: 1;
}

.wf-num {
    width: 100px;
    font-size: 32px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.1);
    -webkit-text-stroke: 1px var(--primary-light);
    text-align: right;
    flex-shrink: 0;
}

.wf-body {
    flex: 1;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--glass-shadow);
}

.wf-body h3 {
    color: var(--primary-light);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-h4);
}

@media (max-width: 768px) {
    .workflow-timeline::before {
        left: 20px;
    }

    .workflow-timeline::after {
        left: 18px;
    }

    .wf-num {
        font-size: 24px;
        width: 40px;
        text-align: center;
        -webkit-text-stroke: 0.5px var(--primary-light);
    }
}

/* ================================================================
   PERFORMANCE FIXES
   ================================================================ 
   
       <div class="section-divider-line"></div>

    <section class="section" id="referenzen">
        <div class="container">
            <h2 class="section-title">Ausgewählte Referenzen</h2>
            <p class="section-subtitle">Einblicke in aktuelle Projekte und erfolgreiche Kooperationen.</p>

            <div class="glass-card" style="padding: var(--spacing-sm); max-width: 900px; margin: 0 auto;">
                <div class="slideshow-wrapper ks-wrapper">
                    <div class="slide active">
                        <img src="img/ref-1.jpg" alt="Referenz Projekt 1"
                            onerror="this.onerror=null; this.src='https://placehold.co/800x450/124559/FFF?text=Projekt+Alpha';">
                    </div>
                    <div class="slide">
                        <img src="img/ref-2.jpg" alt="Referenz Projekt 2"
                            onerror="this.onerror=null; this.src='https://placehold.co/800x450/480ca8/FFF?text=Projekt+Beta';">
                    </div>
                    <div class="slide">
                        <img src="img/ref-3.jpg" alt="Referenz Projekt 3"
                            onerror="this.onerror=null; this.src='https://placehold.co/800x450/598392/FFF?text=Projekt+Gamma';">
                    </div>
                    <div class="slide">
                        <img src="img/ref-4.jpg" alt="Referenz Projekt 4"
                            onerror="this.onerror=null; this.src='https://placehold.co/800x450/01161E/FFF?text=Projekt+Delta';">
                    </div>
                </div>
            </div>
        </div>
    </section>
   */

/* Partikel Canvas (bio-particles) */
#bio-particles {
    will-change: transform;
    transform: translateZ(0);
}

/* backdrop-filter auf Mobile reduzieren */
@media (max-width: 768px) {

    .glass-card,
    .wf-body,
    .cta-section {
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
    }
}

/* Partikel-Container auf Mobile verstecken */
@media (max-width: 768px) {
    #bio-particles {
        display: none !important;
    }
}

.mission-grid-premium {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Nebeneinander auf Desktop */
    gap: 40px;
    margin-top: var(--spacing-xl);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    perspective: 1000px;
    /* Notwendig für den 3D-Effekt */
}

.mission-item {
    padding: 50px;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: transform 0.1s ease, box-shadow 0.3s ease;
}

/* Header-Bereich mit Icon und Titel nebeneinander */
.mission-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mission-icon {
    font-size: 35px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mission-item h3 {
    font-size: var(--font-size-h3);
    margin: 0;
}

.mission-content p {
    font-size: var(--font-size-body);
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

/* ==============================================================
   INDIVIDUELLE FARB-AKZENTE (Violett für Mission, Cyan für Vision)
   ============================================================== */

/* Akzent 1: Violett */
.mission-item.accent-violet .mission-icon {
    color: var(--primary-vibrant);
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.15);
}

.mission-item.accent-violet:hover {
    border-color: rgba(124, 58, 237, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 15px rgba(124, 58, 237, 0.1);
}

.mission-item.accent-violet .ambient-glow {
    background: radial-gradient(circle at -20% -20%, rgba(124, 58, 237, 0.1) 0%, rgba(1, 22, 30, 0) 70%);
}

/* Akzent 2: Cyan */
.mission-item.accent-cyan .mission-icon {
    color: var(--vibrant-cyan);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.15);
}

.mission-item.accent-cyan:hover {
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 15px rgba(6, 182, 212, 0.1);
}

.mission-item.accent-cyan .ambient-glow {
    background: radial-gradient(circle at -20% -20%, rgba(6, 182, 212, 0.1) 0%, rgba(1, 22, 30, 0) 70%);
}

/* Subtiler Glow-Effekt im Hintergrund */
.ambient-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.mission-item:hover .ambient-glow {
    opacity: 1;
}

/* ==============================================================
   RESPONSIVE ANPASSUNGEN (TABLET & MOBILE)
   ============================================================== */

@media (max-width: 1024px) {
    .mission-grid-premium {
        grid-template-columns: 1fr;
        /* Stapeln auf kleineren Bildschirmen */
        gap: var(--spacing-lg);
        padding: 0 var(--spacing-md);
    }

    .mission-item {
        padding: 40px;
    }
}

@media (max-width: 768px) {
    .mission-header {
        flex-direction: column;
        /* Icon über Titel auf Handy */
        align-items: flex-start;
        gap: 15px;
    }

    .mission-item h3 {
        font-size: 1.5rem;
    }
}