/* DI Platzer - Enhanced Styles with 3D & Scroll Video */

html { scroll-behavior: smooth; }

body {
    background: #050505;
    color: #fff;
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

::selection { background: #3b82f6; color: white; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #050505; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

/* Loader */
#loader {
    transition: opacity 0.6s ease;
}

/* Dot Nav */
.dot-nav {
    opacity: 0;
    animation: fadeInNav 0.8s ease forwards 2s;
}
@keyframes fadeInNav { to { opacity: 1; } }

.dot-nav .dot {
    transition: all 0.3s ease;
    position: relative;
}
.dot-nav .dot.active {
    background: #3b82f6;
    transform: scale(1.4);
    box-shadow: 0 0 10px rgba(59,130,246,0.5);
}
.dot-nav .dot::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}
.dot-nav .dot.active::before {
    border-color: rgba(59,130,246,0.3);
}

/* Hero Video & Canvas */
#hero-video, #about-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}

#hero-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    mix-blend-mode: screen;
    opacity: 0.5;
    pointer-events: none;
}

/* Hero video scale wrapper */
.hero-video-scale {
    transition: transform 0.1s linear;
    will-change: transform;
}

/* ===== 3D PERSPECTIVE & TILT ===== */
.perspective-container {
    perspective: 1200px;
    transform-style: preserve-3d;
}

[data-tilt] {
    transform-style: preserve-3d;
    transform: perspective(1000px);
    transition: transform 0.1s ease-out;
}

[data-tilt] .tilt-inner {
    transform: translateZ(30px);
}

.service-card[data-tilt]:hover,
.ref-card[data-tilt]:hover {
    transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(10px);
}

/* ===== SCROLL VIDEO SECTION ===== */
#ueber-uns {
    position: relative;
}

/* Frames are controlled by inline styles + GSAP. 
   This CSS rule is a safety net only. */
.video-text-frame {
    will-change: opacity, transform;
    transition: none;
}

/* CRITICAL FALLBACK: Hide all scroll-video frames except frame 0.
   These rules match the inline <style> in index.html head.
   GSAP inline styles will override these once initialized. */
html body #ueber-uns .video-text-frame {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
html body #ueber-uns .video-text-frame[data-frame="0"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.video-text-frame > div {
    will-change: transform;
}

/* Progress bar glow */
#video-progress {
    box-shadow: 0 0 8px rgba(59,130,246,0.5);
    transition: width 0.1s linear;
}

/* ===== CARDS ===== */
.service-card, .ref-card {
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.service-card:hover, .ref-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* Card icon glow on hover */
.service-card:hover .w-14 {
    box-shadow: 0 0 20px rgba(59,130,246,0.3);
}

/* ===== PARALLAX ELEMENTS ===== */
.parallax-slow {
    will-change: transform;
}
.parallax-fast {
    will-change: transform;
}

/* ===== MAP ===== */
.leaflet-container {
    background: #1a1a1a;
    filter: brightness(0.7) contrast(1.1);
}

/* Form focus */
input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}

/* Back to top */
#back-to-top {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
#back-to-top:hover {
    transform: translateY(-2px);
}

/* ===== SCROLL HINT ANIMATION ===== */
.about-scroll-hint {
    animation: bounceHint 2s ease-in-out infinite;
}
@keyframes bounceHint {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.4; }
    50% { transform: translateX(-50%) translateY(6px); opacity: 0.7; }
}

/* Hero scroll indicator - controlled by GSAP */
.hero-scroll-indicator {
    will-change: opacity, transform;
}

/* ===== TEXT REVEAL ===== */
.reveal-text {
    overflow: hidden;
}
.reveal-text > span {
    display: inline-block;
    transform: translateY(100%);
}

/* ===== GLOW EFFECTS ===== */
.glow-accent {
    box-shadow: 0 0 20px rgba(59,130,246,0.15);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .dot-nav { display: none !important; }
    #hero-canvas { opacity: 0.25; }
    
    #ueber-uns {
        height: 400vh !important;
    }
    
    .video-text-frame h2 {
        font-size: 2.5rem !important;
    }
    
    .video-text-frame h3 {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 480px) {
    #ueber-uns {
        height: 350vh !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .hero-video-scale {
        transform: none !important;
    }
}
