/* Nexus Core Hero Animation - The "Best Thing Ever" */
:root {
    --nexus-cyan: #2b50bc;
    --nexus-purple: #6366f1;
    --nexus-pink: #a78bfa;
    --void-black: #040b18;
}

/* Container */
.nexus-hero-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 300px;
    height: 300px;
    perspective: 1000px;
    /* 3D Depth */
    margin: 40px auto;
    pointer-events: none;
    /* Let clicks pass through if needed */
}

/* The Rotating Gyroscope Assembly */
.nexus-gyroscope {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: float-hover 6s ease-in-out infinite;
}

/* Floating Animation */
@keyframes float-hover {

    0%,
    100% {
        transform: translateY(0) rotateX(10deg);
    }

    50% {
        transform: translateY(-20px) rotateX(-10deg);
    }
}

/* Common Ring Styles */
.gyro-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid transparent;
    transform-style: preserve-3d;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(34, 211, 238, 0.08)
}

/* Outer Ring */
.ring-outer {
    width: 280px;
    height: 280px;
    border-top: 2px solid var(--nexus-cyan);
    border-bottom: 2px solid var(--nexus-cyan);
    animation: spin-x 12s linear infinite;
}

.ring-outer::before {
    /* Glow segments */
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    width: 20px;
    height: 4px;
    background: var(--nexus-cyan);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(34, 211, 238, 0.08)
    transform: translateX(-50%);
}

/* Middle Ring */
.ring-middle {
    width: 220px;
    height: 220px;
    border-left: 2px solid var(--nexus-purple);
    border-right: 2px solid var(--nexus-purple);
    animation: spin-y 8s linear infinite reverse;
}

.ring-middle::after {
    /* Glow segments */
    content: '';
    position: absolute;
    top: 50%;
    right: -2px;
    width: 4px;
    height: 30px;
    background: var(--nexus-purple);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(34, 211, 238, 0.08)
    transform: translateY(-50%);
}

/* Inner Ring */
.ring-inner {
    width: 160px;
    height: 160px;
    border: 1px dashed var(--nexus-pink);
    animation: spin-3d 6s linear infinite;
}

/* The Core (Energy Sphere) - Now a backing glow for text */
.nexus-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: transparent;
    /* radial-gradient(circle at 30% 30%, #fff, var(--nexus-cyan), #000) */
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(34, 211, 238, 0.08)
    /* Ambient glow behind text */
    animation: pulse-core 3s ease-in-out infinite alternate;
}

/* THE GZ TEXT - Holographic & Volumetric */
.nexus-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', 'Chakra Petch', sans-serif;
    font-size: 140px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.95);
    text-shadow:
        0 0 10px rgba(43, 80, 188, 0.8),
        0 0 20px rgba(43, 80, 188, 0.5),
        0 0 40px rgba(124, 138, 255, 0.5),
        2px 2px 0px rgba(0, 0, 0, 0.5);
    /* Depth */
    letter-spacing: -5px;
    z-index: 20;
    pointer-events: none;
    /* 3D Tilt Effect */
    transform-style: preserve-3d;
    animation: float-text 6s ease-in-out infinite;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Gradient Overlay for Text */
.nexus-text::after {
    content: 'GZ';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    z-index: 21;
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes float-text {

    0%,
    100% {
        transform: translate(-50%, -50%) translateZ(40px) rotateX(10deg);
    }

    50% {
        transform: translate(-50%, -50%) translateZ(40px) rotateX(-10deg);
    }
}

/* Data Stream Particles */
.data-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
}

/* Generate positions for particles (manually or via loop in EJS later?) 
   For CSS only, we can use :nth-child delays */
.data-particle:nth-child(1) {
    animation: orbit-particle 4s infinite linear;
}

.data-particle:nth-child(2) {
    animation: orbit-particle 5s infinite linear 1s;
}

.data-particle:nth-child(3) {
    animation: orbit-particle 6s infinite linear 0.5s;
}


/* Animations */
@keyframes spin-x {
    0% {
        transform: translate(-50%, -50%) rotateX(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotateX(360deg);
    }
}

@keyframes spin-y {
    0% {
        transform: translate(-50%, -50%) rotateY(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotateY(360deg);
    }
}

@keyframes spin-3d {
    0% {
        transform: translate(-50%, -50%) rotate3d(1, 1, 1, 0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate3d(1, 1, 1, 360deg);
    }
}

@keyframes pulse-core {
    0% {
        transform: translate(-50%, -50%) scale(0.9);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(34, 211, 238, 0.08)
    }

    100% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(34, 211, 238, 0.08)
    }
}

@keyframes orbit-particle {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) translateX(100px) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg) translateX(100px) rotate(-360deg);
        opacity: 0;
    }
}

/* --- RESPONSIVE POLISH --- */
@media (max-width: 768px) {
    .nexus-hero-container {
        width: 240px;
        height: 240px;
    }

    .ring-outer {
        width: 220px;
        height: 220px;
    }

    .ring-middle {
        width: 170px;
        height: 170px;
    }

    .ring-inner {
        width: 120px;
        height: 120px;
    }

    .nexus-text {
        font-size: 100px;
        letter-spacing: -2px;
    }
}

@media (max-width: 480px) {
    .nexus-hero-container {
        width: 180px;
        height: 180px;
        margin: 20px auto;
    }

    .ring-outer {
        width: 160px;
        height: 160px;
    }

    .ring-middle {
        width: 120px;
        height: 120px;
    }

    .ring-inner {
        width: 80px;
        height: 80px;
    }

    .nexus-text {
        font-size: 80px;
        letter-spacing: -1px;
    }
}
/* Extra Small Devices Optimization (under 375px) */
@media (max-width: 375px) {
    .nexus-hero-container {
        width: 150px !important;
        height: 150px !important;
        margin: 15px auto !important;
    }
    .ring-outer {
        width: 140px !important;
        height: 140px !important;
    }
    .ring-middle {
        width: 100px !important;
        height: 100px !important;
    }
    .ring-inner {
        width: 70px !important;
        height: 70px !important;
    }
    .nexus-text {
        font-size: 60px !important;
    }
}
