/**
 * Homepage - Bold Cinematic Design
 * Enhanced hero and animations
 */

/* Prevent horizontal scroll on homepage */
html {
    overflow-x: hidden;
    width: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
}

/* ========== CINEMATIC HERO WITH VIDEO ========== */
.home-hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    background: #000;
    overflow: hidden;
    padding: 4rem 2rem;
}

/* Video Background */
.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%) scale(1.1);
    object-fit: cover;
    opacity: 0.45;
    z-index: 0;
    animation: videoZoom 25s ease-in-out infinite alternate;
}

@keyframes videoZoom {
    from { transform: translate(-50%, -50%) scale(1.1); }
    to { transform: translate(-50%, -50%) scale(1.2); }
}

.home-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(0,0,0,0.7) 0%,
        rgba(0,0,0,0.5) 40%,
        rgba(16,185,129,0.1) 100%
    );
}

.home-hero .container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.home-hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.home-hero-content.centered {
    grid-template-columns: 1fr;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.home-hero-text {
    color: #fff;
}

.home-hero-text h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(40px);
    animation: fadeUp 1s ease forwards;
    animation-delay: 0.3s;
}

.home-hero-text h1 span {
    display: block;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.home-hero-text p {
    font-size: 1.25rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.85);
    margin-bottom: 2rem;
    max-width: 500px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s ease forwards;
    animation-delay: 0.5s;
}

.home-hero-content.centered .home-hero-text p {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.home-hero-text .cta-button {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s ease forwards;
    animation-delay: 0.7s;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.home-hero-image {
    opacity: 0;
    transform: translateX(60px);
    animation: slideInRight 1.2s ease forwards;
    animation-delay: 0.5s;
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.home-hero-image img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 1.5rem;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

/* Stats bar under hero */
.home-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.home-stat {
    padding: 2rem 1.5rem;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.2);
    transition: background 0.3s ease;
}

.home-stat:last-child {
    border-right: none;
}

.home-stat:hover {
    background: rgba(255,255,255,0.1);
}

.home-stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.home-stat-label {
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ========== FEATURES SECTION ========== */
.home-features {
    padding: 6rem 2rem;
    background: var(--bg-primary);
}

.home-features h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.home-features > .container > p {
    text-align: center;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 3rem;
}

/* ========== TESTIMONIALS SECTION ========== */
.home-testimonials {
    padding: 6rem 2rem;
    background: var(--bg-light);
}

.home-testimonials h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.home-testimonials > .container > p {
    text-align: center;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* ========== FINAL CTA WITH VIDEO ========== */
.home-cta {
    position: relative;
    padding: 8rem 2rem;
    background: #000;
    text-align: center;
    overflow: hidden;
}

/* CTA Video Background */
.cta-video {
    position: absolute;
    top: 50%;
    left: 75%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0.4;
    z-index: 0;
}

.home-cta::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.85) 0%, rgba(16,185,129,0.15) 100%);
}

.home-cta-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.home-cta h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
}

.home-cta p {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ========== ANIMATIONS ========== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered feature cards */
.features .feature-card.reveal:nth-child(1) { transition-delay: 0.1s; }
.features .feature-card.reveal:nth-child(2) { transition-delay: 0.15s; }
.features .feature-card.reveal:nth-child(3) { transition-delay: 0.2s; }
.features .feature-card.reveal:nth-child(4) { transition-delay: 0.25s; }
.features .feature-card.reveal:nth-child(5) { transition-delay: 0.3s; }
.features .feature-card.reveal:nth-child(6) { transition-delay: 0.35s; }

/* Staggered testimonial cards */
.testimonials-grid .testimonial-card.reveal:nth-child(1) { transition-delay: 0.1s; }
.testimonials-grid .testimonial-card.reveal:nth-child(2) { transition-delay: 0.2s; }
.testimonials-grid .testimonial-card.reveal:nth-child(3) { transition-delay: 0.3s; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .home-hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .home-hero-text p {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }

    .home-hero-image {
        order: -1;
    }

    .home-hero-image img {
        max-width: 400px;
        margin: 0 auto;
    }

    .home-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-stat:nth-child(2) {
        border-right: none;
    }

    .home-stat:nth-child(1),
    .home-stat:nth-child(2) {
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }
}

@media (max-width: 768px) {
    /* Ensure no overflow on mobile */
    .home-hero,
    .home-cta,
    .home-features,
    .home-testimonials,
    .home-stats {
        max-width: 100%;
        overflow-x: hidden;
    }

    .home-hero {
        min-height: 70vh;
        padding: 3rem 1.5rem;
    }

    /* Video background on mobile - keep covering but parent clips overflow */
    .hero-video,
    .cta-video {
        min-width: 100%;
        min-height: 100%;
        width: auto;
        height: auto;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }

    .home-hero-text h1 {
        font-size: 2.25rem;
    }

    .home-hero-text p {
        font-size: 1.0625rem;
    }

    .home-hero-image img {
        max-width: 300px;
    }

    .home-stats {
        grid-template-columns: 1fr;
    }

    .home-stat {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }

    .home-stat:last-child {
        border-bottom: none;
    }

    .home-stat-number {
        font-size: 2rem;
    }

    .home-cta {
        padding: 5rem 1.5rem;
    }

    .home-cta h2 {
        font-size: 1.75rem;
    }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    .hero-video,
    .cta-video {
        display: none;
    }

    .home-hero::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image: url('https://images.unsplash.com/photo-1552664730-d307ca884978?w=1920&q=80');
        background-size: cover;
        background-position: center;
        opacity: 0.25;
    }

    .home-cta::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image: url('https://images.unsplash.com/photo-1521737711867-e3b97375f902?w=1920&q=80');
        background-size: cover;
        background-position: center;
        opacity: 0.2;
    }

    .reveal,
    .home-hero-text h1,
    .home-hero-text p,
    .home-hero-text .cta-button,
    .home-hero-image {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

/* ========== DARK MODE ========== */
[data-theme="dark"] .home-features {
    background: var(--bg-primary);
}

[data-theme="dark"] .home-testimonials {
    background: var(--bg-secondary);
}
