/* ==========================================================================
   Systempfad IT — Hero-Stylesheet
   Nur auf der Startseite geladen.
   Enthält: Video-Hintergrund, 3D Device-Mockups, Hero-Overlay, Transition
   ========================================================================== */

/* === HERO CONTAINER === */
.hero-section {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background-color: #131313;
}

/* === VIDEO HINTERGRUND === */
.hero-video-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.hero-video-layer video,
.hero-video-layer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* === HERO GRADIENT OVERLAY (Lesbarkeit) === */
.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(
        180deg,
        rgba(19, 19, 19, 0.7) 0%,
        rgba(19, 19, 19, 0.4) 40%,
        rgba(19, 19, 19, 0.6) 70%,
        rgba(19, 19, 19, 0.95) 100%
    );
}

/* === 3D DEVICE MOCKUP CONTAINER === */
.hero-devices {
    position: absolute;
    inset: 0;
    z-index: 3;
    perspective: 1200px;
    perspective-origin: 50% 50%;
    pointer-events: none;
}

/* Gemeinsame Device-Basis */
.device-frame {
    position: absolute;
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(0, 212, 255, 0.08);
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    backface-visibility: hidden;
    will-change: transform;
}

/* Laptop-Mockup */
.device-laptop {
    width: 520px;
    height: 340px;
    right: 5%;
    top: 18%;
    transform: rotateY(-12deg) rotateX(4deg) translateZ(0);
    border: 3px solid #2a2a2a;
    border-radius: 12px 12px 0 0;
}

.device-laptop::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: -20px;
    right: -20px;
    height: 16px;
    background: linear-gradient(180deg, #2a2a2a, #1a1a1a);
    border-radius: 0 0 8px 8px;
    transform: rotateX(-20deg);
    transform-origin: top;
}

/* Phone-Mockup */
.device-phone {
    width: 180px;
    height: 380px;
    right: 3%;
    bottom: 10%;
    transform: rotateY(-8deg) rotateX(2deg) translateZ(40px);
    border: 4px solid #2a2a2a;
    border-radius: 24px;
}

.device-phone::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 6px;
    background: #1a1a1a;
    border-radius: 3px;
    z-index: 5;
}

/* Tablet-Mockup */
.device-tablet {
    width: 300px;
    height: 420px;
    left: 3%;
    top: 25%;
    transform: rotateY(10deg) rotateX(3deg) translateZ(20px);
    border: 4px solid #2a2a2a;
    border-radius: 16px;
}

/* Device Screen (gemeinsam) */
.device-screen {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Screen Glanz-Effekt */
.device-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.08) 0%,
        transparent 50%,
        rgba(0, 212, 255, 0.03) 100%
    );
    z-index: 4;
    pointer-events: none;
}

/* === HERO TEXT LAYER === */
.hero-content {
    position: relative;
    z-index: 5;
}

/* === LAYER STACKING REFERENZ ===
   z-index: 1  — Video/Bild-Hintergrund
   z-index: 2  — Gradient Overlay
   z-index: 3  — 3D Device Mockups
   z-index: 5  — Hero Text/Content
   z-index: 50 — Navigation (in nav.php)
   ========================================= */

/* === DARK-TO-LIGHT UEBERGANG === */
.hero-transition {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    z-index: 6;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 40%,
        rgba(255, 255, 255, 0.8) 70%,
        #ffffff 100%
    );
    pointer-events: none;
}

/* Variante: Transition nach Alt-Sektion */
.hero-transition-alt {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    z-index: 6;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(248, 250, 252, 0.3) 40%,
        rgba(248, 250, 252, 0.8) 70%,
        #f8fafc 100%
    );
    pointer-events: none;
}

/* === FLOATING ANIMATION (fuer Devices) === */
@keyframes deviceFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

.device-float {
    animation: deviceFloat 6s ease-in-out infinite;
}

.device-float-delay {
    animation: deviceFloat 7s ease-in-out infinite 1.5s;
}

.device-float-slow {
    animation: deviceFloat 8s ease-in-out infinite 0.8s;
}

/* === MOBILE: Vereinfachtes Layout (kein 3D) === */
@media (max-width: 1024px) {
    .hero-devices {
        perspective: none;
    }

    .device-laptop {
        width: 360px;
        height: 230px;
        right: 50%;
        top: auto;
        bottom: 25%;
        transform: translateX(50%) rotateY(0) rotateX(0);
    }

    .device-phone,
    .device-tablet {
        display: none;
    }

    .device-laptop::after {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-section {
        min-height: 100vh;
        overflow: visible;
    }

    .hero-devices {
        display: none;
    }

    .hero-transition {
        height: 120px;
    }
}

/* === CSS-FALLBACK: Hero-Text sichtbar auch ohne GSAP === */
/* Elemente starten bei opacity:0 im HTML (fuer GSAP).
   Falls GSAP nicht laedt, macht diese Animation sie nach 3s sichtbar.
   GSAP ueberschreibt inline-styles und gewinnt immer. */
@keyframes heroFallbackReveal {
    0%   { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}

[data-gsap-label],
[data-gsap-subline],
[data-gsap-cta] {
    animation: heroFallbackReveal 0.6s ease-out 3s both;
}

.hero-headline-line {
    animation: heroFallbackReveal 0.6s ease-out 3.2s both;
}

/* === PREFERS-REDUCED-MOTION === */
@media (prefers-reduced-motion: reduce) {
    .device-float,
    .device-float-delay,
    .device-float-slow {
        animation: none;
    }

    .device-frame {
        transition: none;
    }

    [data-gsap-label],
    [data-gsap-subline],
    [data-gsap-cta],
    .hero-headline-line {
        animation: none;
        opacity: 1 !important;
        transform: none !important;
    }
}
