/* ============================================================
   VINSTA LED — Cinematic Hero
   ============================================================
   Premium "lights turning on" hero experience.
   GPU-accelerated. Mobile-optimized. Accessible.
   ============================================================ */

/* ─── 1. BASE LAYOUT ─────────────────────────────────────── */

.cinematic-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: calc(-1 * var(--header-height));
    background: var(--bg-primary);
    z-index: 1;
}

/* ─── 2. DEPTH LAYERS ─────────────────────────────────────── */

.hero-depth-layer {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%,
            rgba(15, 18, 30, 0.0) 0%,
            rgba(8, 8, 12, 0.4) 50%,
            rgba(8, 8, 12, 0.95) 100%),
        radial-gradient(circle at 30% 20%,
            rgba(0, 180, 220, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%,
            rgba(100, 80, 255, 0.03) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}

.cinematic-hero.animate .hero-depth-layer {
    opacity: 1;
}

body.light-theme .hero-depth-layer {
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%,
            rgba(248, 249, 251, 0.0) 0%,
            rgba(248, 249, 251, 0.3) 50%,
            rgba(248, 249, 251, 0.9) 100%),
        radial-gradient(circle at 30% 20%,
            rgba(111, 107, 232, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%,
            rgba(37, 99, 235, 0.04) 0%, transparent 50%);
}

/* ─── 3. HERO BACKGROUND IMAGE ────────────────────────────── */

.hero-bg-image {
    position: absolute;
    inset: 0;
    background-image: url('../assets/images/hero-bg.png');
    background-size: cover;
    background-position: center 40%;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 1.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 2.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 0;
}

.cinematic-hero.animate .hero-bg-image {
    opacity: 0.35;
    transform: scale(1);
}

body.light-theme .hero-bg-image {
    opacity: 0;
}

body.light-theme .cinematic-hero.animate .hero-bg-image {
    opacity: 0.15;
}

/* ─── 4. AMBIENT GLOW ─────────────────────────────────────── */

.hero-ambient-glow {
    position: absolute;
    top: 30%;
    left: 50%;
    width: 700px;
    height: 500px;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse at center,
        rgba(0, 200, 255, 0.08) 0%,
        rgba(0, 200, 255, 0.03) 40%,
        transparent 70%);
    filter: blur(60px);
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
    z-index: 2;
    pointer-events: none;
    animation: ambientBreathe 6s ease-in-out infinite paused;
}

.cinematic-hero.animate .hero-ambient-glow {
    opacity: 1;
    animation-play-state: running;
}

@keyframes ambientBreathe {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.08); opacity: 0.7; }
}

body.light-theme .hero-ambient-glow {
    background: radial-gradient(ellipse at center,
        rgba(111, 107, 232, 0.08) 0%,
        rgba(111, 107, 232, 0.03) 40%,
        transparent 70%);
}

/* ─── 5. BLOOM EFFECT (Lights On) ─────────────────────────── */

.hero-bloom {
    position: absolute;
    top: 35%;
    left: 50%;
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%) scale(0.5);
    background: radial-gradient(circle,
        rgba(111, 251, 255, 0.15) 0%,
        rgba(111, 251, 255, 0.05) 40%,
        transparent 70%);
    filter: blur(40px);
    opacity: 0;
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1) 0.5s,
                transform 2s cubic-bezier(0.16, 1, 0.3, 1) 0.5s;
    z-index: 2;
    pointer-events: none;
}

.cinematic-hero.animate .hero-bloom {
    opacity: 1;
    transform: translate(-50%, -50%) scale(3);
}

body.light-theme .hero-bloom {
    background: radial-gradient(circle,
        rgba(111, 107, 232, 0.1) 0%,
        rgba(111, 107, 232, 0.03) 40%,
        transparent 70%);
}

/* ─── 6. PARTICLE CANVAS ──────────────────────────────────── */

.hero-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 2s cubic-bezier(0.16, 1, 0.3, 1) 1s;
}

.cinematic-hero.animate .hero-particles {
    opacity: 1;
}

/* ─── 7. HERO CONTENT ─────────────────────────────────────── */

.cinematic-hero .hero-content {
    position: relative;
    z-index: 10;
    max-width: 780px;
    padding-top: var(--header-height);
}

/* Hero label */
.cinematic-hero .hero-label {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.cinematic-hero.animate .hero-label {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.8s;
}

/* Hero title */
.cinematic-hero .hero-title {
    font-size: clamp(2.8rem, 5.5vw, 4.2rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-3);
}

.hero-line {
    display: block;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.cinematic-hero.animate .hero-line:nth-child(1) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1s;
}

.cinematic-hero.animate .hero-line:nth-child(2) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1.2s;
}

/* Hero description */
.cinematic-hero .hero-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    opacity: 0;
    margin-bottom: var(--space-5);
    max-width: 540px;
    line-height: 1.75;
    transform: translateY(16px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.cinematic-hero.animate .hero-desc {
    opacity: 0.7;
    transform: translateY(0);
    transition-delay: 1.5s;
}

body.light-theme .cinematic-hero .hero-desc {
    color: #3f4858;
}

/* Hero actions */
.cinematic-hero .hero-actions {
    display: flex;
    gap: 1rem;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.cinematic-hero.animate .hero-actions {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1.8s;
}

/* CTA button shimmer effect */
.cinematic-hero .btn-primary {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 0.9rem 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.06em;
}

.cinematic-hero .btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent
    );
    transition: none;
    animation: shimmer 4s ease-in-out infinite 3s;
}

@keyframes shimmer {
    0% { left: -100%; }
    30% { left: 150%; }
    100% { left: 150%; }
}

.cinematic-hero .btn-primary:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow:
        0 0 32px rgba(111, 251, 255, 0.2),
        0 8px 24px rgba(0, 0, 0, 0.25);
}

.cinematic-hero .btn-secondary {
    border-radius: var(--radius-lg);
    padding: 0.9rem 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.06em;
}

/* ─── 8. SCROLL INDICATOR ─────────────────────────────────── */

.cinematic-hero .scroll-indicator {
    position: absolute;
    bottom: var(--space-6);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.cinematic-hero.animate .scroll-indicator {
    opacity: 1;
    transition-delay: 2.2s;
}

/* ─── 9. SCROLL PARALLAX ──────────────────────────────────── */

.cinematic-hero .hero-content,
.cinematic-hero .hero-bloom,
.cinematic-hero .hero-ambient-glow,
.cinematic-hero .scroll-indicator {
    will-change: transform, opacity;
}

/* Applied via JS on scroll */
.cinematic-hero.scrolling .scroll-indicator {
    opacity: 0 !important;
    transition-delay: 0s;
}

/* ─── 10. GRADIENT SHIFT ANIMATION ────────────────────────── */

.hero-gradient-shift {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.4;
    background: linear-gradient(
        135deg,
        rgba(0, 180, 255, 0.03) 0%,
        rgba(100, 60, 255, 0.02) 50%,
        rgba(0, 200, 180, 0.03) 100%
    );
    background-size: 200% 200%;
    animation: gradientShift 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body.light-theme .hero-gradient-shift {
    background: linear-gradient(
        135deg,
        rgba(111, 107, 232, 0.04) 0%,
        rgba(37, 99, 235, 0.03) 50%,
        rgba(111, 107, 232, 0.04) 100%
    );
    background-size: 200% 200%;
}

/* ─── 11. BOTTOM FADE (seamless section transition) ───────── */

.cinematic-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    background: linear-gradient(to bottom, transparent, var(--bg-primary));
    z-index: 5;
    pointer-events: none;
}

/* ─── 12. LIGHT THEME OVERRIDES ───────────────────────────── */

body.light-theme .cinematic-hero {
    background: var(--bg-primary);
}

body.light-theme .cinematic-hero .hero-title {
    color: #111827;
    text-shadow: 0 10px 32px rgba(255, 255, 255, 0.64);
}

body.light-theme .cinematic-hero .hero-label {
    color: #5551cf;
    border-color: rgba(111, 107, 232, 0.22);
    background: rgba(255, 255, 255, 0.58);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

body.light-theme .cinematic-hero .btn-primary {
    background: linear-gradient(135deg, #7470ee 0%, #5d5ad8 100%);
    color: #ffffff;
    border: none;
    box-shadow:
        0 10px 24px rgba(93, 90, 216, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

body.light-theme .cinematic-hero .btn-primary:hover {
    filter: brightness(1.03);
    box-shadow:
        0 14px 32px rgba(93, 90, 216, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

body.light-theme .cinematic-hero .btn-primary::after {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
}

body.light-theme .cinematic-hero .btn-secondary {
    background: rgba(255, 255, 255, 0.58);
    border-color: rgba(17, 24, 39, 0.08);
    color: var(--text-primary);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.055);
    backdrop-filter: blur(12px);
}

body.light-theme .cinematic-hero .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(111, 107, 232, 0.18);
    color: #5551cf;
}

/* ─── 13. MOBILE OPTIMIZATION ─────────────────────────────── */

@media (max-width: 768px) {
    .cinematic-hero {
        min-height: 100vh;
        min-height: 100dvh;
    }

    .cinematic-hero .hero-content {
        padding: 0 var(--space-2);
        padding-top: calc(var(--header-height) + var(--space-4));
    }

    .cinematic-hero .hero-title {
        font-size: clamp(2.2rem, 8vw, 3rem);
        letter-spacing: -0.02em;
    }

    .cinematic-hero .hero-desc {
        font-size: 0.95rem;
        margin-bottom: var(--space-4);
    }

    .cinematic-hero .hero-label {
        font-size: 0.65rem;
        padding: 5px 12px;
        margin-bottom: var(--space-3);
    }

    .hero-ambient-glow {
        width: 400px;
        height: 300px;
        filter: blur(40px);
    }

    .hero-bloom {
        width: 150px;
        height: 150px;
    }

    .cinematic-hero .hero-actions .btn {
        padding: 0.85rem 1.5rem;
        border-radius: var(--radius-md);
    }

    .cinematic-hero .scroll-indicator {
        bottom: var(--space-4);
    }

    .cinematic-hero::after {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .cinematic-hero .hero-title {
        font-size: clamp(1.8rem, 8vw, 2.4rem);
    }

    .cinematic-hero .hero-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .cinematic-hero .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ─── 14. REDUCED MOTION ──────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .hero-depth-layer,
    .hero-bg-image,
    .hero-ambient-glow,
    .hero-bloom,
    .hero-particles,
    .hero-gradient-shift,
    .cinematic-hero .hero-label,
    .hero-line,
    .cinematic-hero .hero-desc,
    .cinematic-hero .hero-actions,
    .cinematic-hero .scroll-indicator {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
    }

    .cinematic-hero.animate .hero-bg-image {
        opacity: 0.35;
    }

    .cinematic-hero.animate .hero-desc {
        opacity: 0.7;
    }
}
