/* Futuristic Interactive Hero - Modern Hero CSS */
:root {
    --hero-bg-start: #050810;
    --hero-bg-end: #0a1625;
    --neon-blue: #00c2ff;
}

.modern-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 700px;
    background: linear-gradient(135deg, var(--hero-bg-start) 0%, var(--hero-bg-end) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    opacity: 0;
    animation: pageFadeIn 1.5s ease-out forwards;
    content-visibility: auto;
    contain-intrinsic-size: 100vh;
}

@keyframes pageFadeIn {
    to {
        opacity: 1;
    }
}

/* === Background Particles === */
.hero-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 194, 255, 0.4) 0%, transparent 80%);
    opacity: 0;
    animation: floatGlow 10s infinite ease-in-out;
}

.p1 {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 15%;
    animation-duration: 8s;
    animation-delay: 0s;
}

.p2 {
    width: 60px;
    height: 60px;
    top: 70%;
    left: 80%;
    animation-duration: 12s;
    animation-delay: 2s;
}

.p3 {
    width: 150px;
    height: 150px;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 15s;
    animation-delay: 1s;
    opacity: 0.15;
}

.p4 {
    width: 40px;
    height: 40px;
    top: 85%;
    left: 20%;
    animation-duration: 9s;
    animation-delay: 4s;
}

.p5 {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 60%;
    animation-duration: 14s;
    animation-delay: 3s;
}

@keyframes floatGlow {

    0%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0.2;
    }

    50% {
        transform: translateY(-30px) scale(1.1);
        opacity: 0.4;
    }
}

/* === Main Content Area === */
.hero-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: row;
    /* Desktop: Side by Side */
    align-items: center;
    justify-content: space-between;
    /* Spread Text and Animation */
    perspective: 1200px;
    width: 100%;
    max-width: 1400px;
    padding: 0 5%;
}

/* === Text Content Styles === */
.hero-text-content {
    width: 45%;
    text-align: left;
    z-index: 2;
    color: #fff;
}

.hero-text-content h1,
.hero-text-content p,
.hero-text-content .hero-buttons {
    position: relative;
    z-index: 2;
}

/* === 3D Flip Wrapper === */
.flip-3d-wrapper {
    position: relative;
    width: 320px;
    /* Reduced Size */
    height: 320px;
    transform-style: preserve-3d;
    animation: floatContainer 6s ease-in-out infinite;
}

@keyframes floatContainer {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

/* === The Cube (Flipper) === */
.flipper-cube {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
    animation: rotateCube 12s infinite linear;
    /* Continuous Spinning */
    will-change: transform;
}

/* Cube Faces */
.cube-face {
    position: absolute;
    width: 320px;
    height: 320px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--neon-blue);
    box-shadow: 0 0 25px rgba(0, 194, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: visible;
    /* Visible for continuous spin */
    border-radius: 12px;
    overflow: hidden;
}

.cube-face img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Full image visible */
    display: block;
}

/* 
   Cube Transforms (Desktop 320px -> r=160px)
   90 deg rotation
*/
.face-1 {
    transform: rotateY(0deg) translateZ(160px);
}

.face-2 {
    transform: rotateY(90deg) translateZ(160px);
}

.face-3 {
    transform: rotateY(180deg) translateZ(160px);
}

.face-4 {
    transform: rotateY(270deg) translateZ(160px);
}

/* Animation Keyframes (Continuous Spin) */
@keyframes rotateCube {
    0% {
        transform: rotateY(0deg);
    }

    100% {
        transform: rotateY(-360deg);
    }
}


/* Glow Border Decoration */
.hero-glow-border {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    height: 350px;
    border: 1px solid rgba(0, 194, 255, 0.1);
    border-radius: 20px;
    pointer-events: none;
    box-shadow: 0 0 40px rgba(0, 194, 255, 0.05);
    z-index: 1;
}

.cube-face {
    will-change: transform;
}

/* === Responsive === */

/* Tablet & Smaller Laptops */
@media (max-width: 1024px) {
    .modern-hero {
        padding: 0;
    }

    .hero-content {
        gap: 2rem;
        justify-content: center;
    }

    /* Reduce size slightly */
    .flip-3d-wrapper {
        width: 300px;
        height: 300px;
    }

    .cube-face {
        width: 300px;
        height: 300px;
    }

    .hero-glow-border {
        width: 320px;
        height: 320px;
    }

    /* r = 150px */
    .face-1 {
        transform: rotateY(0deg) translateZ(150px);
    }

    .face-2 {
        transform: rotateY(90deg) translateZ(150px);
    }

    .face-3 {
        transform: rotateY(180deg) translateZ(150px);
    }

    .face-4 {
        transform: rotateY(270deg) translateZ(150px);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .modern-hero {
        height: auto;
        min-height: 100vh;
        padding-top: 6rem;
        padding-bottom: 2rem;
    }

    .hero-content {
        flex-direction: column;
        gap: 3rem;
        padding: 0 1.5rem;
    }

    .hero-text-content {
        width: 100%;
        text-align: center;
        margin-bottom: 0;
    }

    .hero-buttons {
        justify-content: center;
    }

    .flip-3d-wrapper {
        width: 200px;
        /* Reduced for full visibility on small phones */
        height: 200px;
        margin: 2rem auto;
    }

    .cube-face {
        width: 200px;
        height: 200px;
        border-width: 1.5px;
        /* Thinner border for cleaner look on small screens */
    }

    .hero-glow-border {
        display: none;
    }

    .p3,
    .p4,
    .p5 {
        display: none;
    }

    /* r = 100px (Exactly half of 200px) */
    .face-1 {
        transform: rotateY(0deg) translateZ(100px);
    }

    .face-2 {
        transform: rotateY(90deg) translateZ(100px);
    }

    .face-3 {
        transform: rotateY(180deg) translateZ(100px);
    }

    .face-4 {
        transform: rotateY(270deg) translateZ(100px);
    }
}