/**
 * Video Background System
 * Translucent video layers for cards and headers
 * A Paul Phillips Manifestation
 */

/* Video Container Base Styles */
.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.video-background video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0.3;
    mix-blend-mode: screen;
    filter: blur(2px) brightness(0.7);
}

/* Hero Section Video Background */
.hero {
    position: relative;
}

.hero .video-background video {
    opacity: 0.25;
    filter: blur(3px) brightness(0.6) saturate(1.2);
}

/* Signal Cards Video Backgrounds */
.signal-card {
    position: relative;
    overflow: hidden;
}

.signal-card .video-background video {
    opacity: 0.2;
    mix-blend-mode: lighten;
    filter: blur(4px) brightness(0.5) contrast(1.1);
}

/* Capability Cards */
.capability-card {
    position: relative;
    overflow: hidden;
}

.capability-card .video-background video {
    opacity: 0.15;
    filter: blur(5px) brightness(0.4);
    mix-blend-mode: overlay;
}

/* Platform Cards */
.platform-card {
    position: relative;
    overflow: hidden;
}

.platform-card .video-background video {
    opacity: 0.18;
    filter: blur(3px) brightness(0.5) saturate(1.3);
    mix-blend-mode: screen;
}

/* Section Headers */
.section-heading {
    position: relative;
}

.section-heading .video-background video {
    opacity: 0.12;
    filter: blur(6px) brightness(0.3);
}

/* Research Lab Aside */
.research-lab {
    position: relative;
    overflow: hidden;
}

.research-lab .video-background video {
    opacity: 0.2;
    filter: blur(4px) brightness(0.6) hue-rotate(15deg);
    mix-blend-mode: lighten;
}

/* Contact Section */
#contact {
    position: relative;
}

#contact .video-background video {
    opacity: 0.22;
    filter: blur(3px) brightness(0.5) contrast(1.2);
}

/* Video Loading State */
.video-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05) 0%, rgba(255, 0, 110, 0.05) 100%);
    opacity: 1;
    transition: opacity 0.5s ease;
}

.video-background.loaded::before {
    opacity: 0;
}

/* Responsive: Disable videos on mobile for performance */
@media (max-width: 768px) {
    .video-background video {
        display: none;
    }

    .video-background::before {
        opacity: 1;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .video-background video {
        display: none;
    }

    .video-background::before {
        opacity: 1;
    }
}

/* Video Overlay Gradients for Better Text Readability */
.hero .video-background::after,
.signal-card .video-background::after,
.capability-card .video-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.3) 100%
    );
    pointer-events: none;
}

/* Specific video background variants */
.video-bg-cyan {
    filter: blur(4px) brightness(0.6) saturate(1.4) hue-rotate(-10deg);
}

.video-bg-magenta {
    filter: blur(4px) brightness(0.5) saturate(1.3) hue-rotate(10deg);
}

.video-bg-tech {
    filter: blur(3px) brightness(0.4) contrast(1.3) saturate(0.8);
    mix-blend-mode: overlay;
}

.video-bg-abstract {
    filter: blur(5px) brightness(0.5) contrast(1.2);
    mix-blend-mode: screen;
}

/* Animation for video fade-in */
@keyframes videoFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: var(--video-opacity, 0.3);
    }
}

.video-background video.loaded {
    animation: videoFadeIn 1.5s ease-in-out forwards;
}

/* Performance optimization: will-change */
.video-background video {
    will-change: opacity, filter;
}

/* GPU acceleration */
.video-background {
    transform: translateZ(0);
    backface-visibility: hidden;
}
