/* ===== HERO SECTION ===== */
.hero {
    position: relative;
    color: var(--white);
    padding: var(--space-16) 0;
    min-height: 100vh; /* Fallback */
    min-height: 100dvh;
    height: 100vh; /* Fallback */
    height: 100dvh;
    display: flex;
    align-items: center;
    overflow: hidden;
    box-sizing: border-box;
}

/* Fixed video background for hero */
.hero::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    z-index: -1;
    will-change: transform;
}

/* Hero video container - fixed positioned */
.hero-video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

/* Hero with video background */
.hero--with-video {
    background: none;
}

.hero-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    will-change: transform;
}

/* Hero video rotation for home page */
.hero--with-video .hero-video-container {
    position: absolute;
    z-index: 0;
}

.hero-video--rotating {
    transition: opacity 1s ease-in-out;
    opacity: 1;
}

.hero-video--hidden {
    opacity: 0;
}

/* Enhanced glass effect for video backgrounds */
.hero--with-video .hero-content {
    position: relative;
    z-index: 3;
}

.hero--with-video .hero-content::before {
    background: rgb(255 255 255 / 15%);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border: 1px solid rgb(255 255 255 / 30%);
    box-shadow: 0 8px 32px rgb(0 0 0 / 15%);
}

/* Text readability without overlay */
.hero--with-video .hero-title,
.hero--with-video .hero-subtitle,
.hero--with-video .hero-description {
    text-shadow: 0 2px 8px rgb(0 0 0 / 70%), 0 1px 3px rgb(0 0 0 / 80%);
}

.hero--with-video .btn {
    box-shadow: 0 4px 12px rgb(0 0 0 / 30%), 0 2px 6px rgb(0 0 0 / 20%);
}


.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

/* Glass block container for hero content */
.hero-content::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: rgb(255 255 255 / 10%);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgb(255 255 255 / 20%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgb(0 0 0 / 10%);
    z-index: -1;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(10px)) {
    .hero-content::before {
        background: rgb(255 255 255 / 25%);
        box-shadow: 0 8px 32px rgb(0 0 0 / 20%);
    }
}

.hero-subtitle {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--secondary);
    margin-bottom: var(--space-4);
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Hero Logo */
.hero-logo {
    height: 120px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgb(0 0 0 / 70%));
    transition: var(--transition);
}

@media (hover: hover) {
    .hero-logo:hover {
        transform: scale(1.05);
    }
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: var(--space-6);
    text-transform: uppercase;
}

.hero-accent {
    color: inherit;
    display: block;
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: var(--space-8);
    opacity: 0.9;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    align-items: center;
    margin-top: var(--space-4);
}

.hero-actions .btn:last-child {
    margin-bottom: 20px;
}

@media (width >= 768px) {
    .hero-actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* Mobile video optimizations */
@media (width <= 768px) {
    .hero-video {
        pointer-events: none;
    }

    .hero-logo {
        height: 40px;
    }

    .hero {
        height: 100vh; /* Fallback */
        height: 100dvh;
        height: -webkit-fill-available;
        box-sizing: border-box;
    }

    .hero-video-container,
    .hero-video {
        position: absolute;
    }

    .section:not(.hero) {
        box-shadow: 0 -5px 10px rgb(0 0 0 / 5%);
    }

    .hero-video--rotating {
        opacity: 0.7;
        will-change: auto;
    }

    .hero--with-video .hero-video-container {
        transition: none;
    }

    .hero-content::before {
        width: 85%;
        height: 90%;
        border-radius: 12px;
        background: rgb(255 255 255 / 15%);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    }

    .hero-content {
        padding: var(--space-8) var(--space-8);
    }

    .hero-subtitle {
        margin-bottom: var(--space-3);
    }

    .hero-title {
        margin-bottom: var(--space-4);
    }

    .hero-description {
        margin-bottom: 20px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: var(--space-4);
        margin-top: var(--space-3);
    }

    .hero-actions .btn {
        width: 100%;
        max-width: 280px;
        font-size: 0.9rem;
        padding: 0.75rem 1.5rem;
    }
}

/* Tablet glass block adjustments */
@media (width >= 769px) and (width <= 1024px) {
    .hero-content::before {
        width: 60%;
        height: 85%;
        border-radius: 14px;
        background: rgb(255 255 255 / 12%);
        -webkit-backdrop-filter: blur(9px);
        backdrop-filter: blur(9px);
    }

    .hero-logo {
        height: 50px;
    }
}

/* Home page specific hero styles */

/* These styles override base hero styles only on home page */

/* They are loaded after hero.css via pages/home.css */

/* Fallback for browsers that don't support video autoplay */
@media (prefers-reduced-motion: reduce) {
    .hero-video {
        display: none;
    }

    .hero--with-video {
        background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    }
}

/* ===== iOS SAFARI FIXES ===== */
@supports (-webkit-touch-callout: none) {
    .hero {
        min-height: -webkit-fill-available;
    }

    .hero-video-container,
    .hero-video {
        position: absolute;
    }

    .hero-video--rotating {
        transform: translate3d(0, 0, 0);
        backface-visibility: hidden;
        perspective: 1000;
    }

    .hero--with-video .hero-video-container {
        transform: translate3d(0, 0, 0);
    }

    .hero-content::before {
        transform: translate3d(-50%, -50%, 0);
        will-change: transform;
    }

    .btn,
    .mobile-toggle {
        -webkit-touch-callout: none;
        user-select: none;
    }

    .form-input,
    .form-textarea {
        font-size: 1rem;
    }
}