/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --neon-pink: #ff006e;
    --neon-purple: #8338ec;
    --neon-cyan: #3a86ff;
    --neon-green: #06ffa5;
    --neon-magenta: #ff00ff;
    --neon-yellow: #ffee00;
    --neon-orange: #ff5e00;
    --glow-intensity: 0 0 20px;
    --deep-purple: #0a0015;
}

body, html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    cursor: none;
    position: relative;
}

/* Main Container */
.container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, rgba(131, 56, 236, 0.1) 0%, transparent 70%);
}

/* Three.js Canvas */
#three-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Trail Canvas */
#trail-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* Aurora Background Effect */
.aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.4;
    background: 
        radial-gradient(ellipse at top left, rgba(255, 0, 110, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(131, 56, 236, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at center, rgba(58, 134, 255, 0.3) 0%, transparent 70%);
    animation: aurora 20s ease-in-out infinite;
    filter: blur(80px);
    z-index: 0;
}

@keyframes aurora {
    0%, 100% { transform: rotate(0deg) scale(1); filter: hue-rotate(0deg) blur(80px); }
    25% { transform: rotate(90deg) scale(1.2); filter: hue-rotate(90deg) blur(100px); }
    50% { transform: rotate(180deg) scale(1.1); filter: hue-rotate(180deg) blur(90px); }
    75% { transform: rotate(270deg) scale(0.9); filter: hue-rotate(270deg) blur(85px); }
}

/* Morphing Blobs */
.blob-container {
    position: absolute;
    width: 100%;
    height: 100%;
    filter: blur(50px);
    opacity: 0.8;
    z-index: 1;
}

.blob {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: screen;
}

.blob-1 {
    width: 40vw;
    height: 40vw;
    max-width: 500px;
    max-height: 500px;
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
    top: -20%;
    left: -20%;
    animation: blob-float-1 20s infinite ease-in-out;
}

.blob-2 {
    width: 35vw;
    height: 35vw;
    max-width: 450px;
    max-height: 450px;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
    bottom: -20%;
    right: -20%;
    animation: blob-float-2 25s infinite ease-in-out;
}

.blob-3 {
    width: 30vw;
    height: 30vw;
    max-width: 400px;
    max-height: 400px;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-orange));
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: blob-float-3 30s infinite ease-in-out;
}

@keyframes blob-float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(100px, -100px) scale(1.2); }
    66% { transform: translate(-50px, 50px) scale(0.8); }
}

@keyframes blob-float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-80px, 80px) scale(1.1); }
    66% { transform: translate(50px, -50px) scale(0.9); }
}

@keyframes blob-float-3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

/* Main Text Styling */
.main-text {
    position: relative;
    z-index: 10;
    font-size: clamp(3rem, 12vw, 10rem);
    font-weight: bold;
    letter-spacing: 0.1em;
    user-select: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.main-text span {
    position: relative;
    display: inline-block;
    color: #fff;
    text-shadow: 
        0 0 20px var(--neon-pink),
        0 0 40px var(--neon-pink),
        0 0 60px var(--neon-purple);
    animation: text-glow 2s ease-in-out infinite alternate;
    transition: all 0.3s ease;
}

.main-text .x {
    margin: 0 0.1em;
    color: var(--neon-cyan);
    text-shadow: 
        0 0 20px var(--neon-cyan),
        0 0 40px var(--neon-cyan),
        0 0 60px var(--neon-green);
    animation: x-pulse 1.5s ease-in-out infinite;
}

@keyframes text-glow {
    0% { 
        filter: brightness(1);
        transform: translateY(0);
    }
    100% { 
        filter: brightness(1.2);
        transform: translateY(-5px);
    }
}

@keyframes x-pulse {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
    }
    50% { 
        transform: scale(1.1) rotate(180deg);
    }
}

/* Glitch Effect on Hover */
.main-text:hover span {
    animation: glitch 0.3s infinite;
}

@keyframes glitch {
    0%, 100% {
        text-shadow: 
            0 0 20px var(--neon-pink),
            0 0 40px var(--neon-pink);
        transform: translate(0);
    }
    20% {
        text-shadow: 
            2px 2px 0 var(--neon-cyan),
            -2px -2px 0 var(--neon-pink),
            0 0 30px var(--neon-pink);
        transform: translate(2px, -2px);
    }
    40% {
        text-shadow: 
            -2px 2px 0 var(--neon-green),
            2px -2px 0 var(--neon-purple),
            0 0 30px var(--neon-purple);
        transform: translate(-2px, 2px);
    }
}

/* Rainbow Shift Animation */
@keyframes rainbow-shift {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* ASCII Rain */
.ascii-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.ascii-drop {
    position: absolute;
    top: -20px;
    animation: fall linear;
    font-size: 16px;
    opacity: 0.7;
    text-shadow: 0 0 10px currentColor;
}

@keyframes fall {
    to {
        transform: translateY(calc(100vh + 20px));
    }
}

/* Floating Hearts */
.hearts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 6;
}

.floating-heart {
    position: absolute;
    animation: float-heart linear infinite;
    opacity: 0.8;
    transition: all 0.3s ease;
    pointer-events: none;
}

@keyframes float-heart {
    0% {
        transform: translateX(0) translateY(0) rotate(0deg);
    }
    25% {
        transform: translateX(20px) translateY(-30px) rotate(15deg);
    }
    50% {
        transform: translateX(-20px) translateY(20px) rotate(-15deg);
    }
    75% {
        transform: translateX(30px) translateY(-10px) rotate(10deg);
    }
    100% {
        transform: translateX(0) translateY(0) rotate(0deg);
    }
}

/* Cursor Glow */
.cursor-glow {
    position: fixed;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 20;
    mix-blend-mode: screen;
    filter: blur(5px);
}

/* Ripple Effect */
.ripple-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 7;
}

.ripple {
    position: absolute;
    border: 2px solid var(--neon-cyan);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple-expand 1s ease-out;
    opacity: 0;
}

@keyframes ripple-expand {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* Constellation */
.constellation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

.constellation-star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
    box-shadow: 0 0 10px white;
    transition: all 0.1s ease;
}

/* Explosion Particles */
.explosion-particle {
    position: fixed;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
    animation: explode 1.5s ease-out forwards;
}

@keyframes explode {
    0% {
        transform: translate(-50%, -50%) translate(0, 0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) translate(var(--vx), var(--vy));
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-text {
        font-size: clamp(2.5rem, 15vw, 6rem);
    }
    
    .blob-1, .blob-2, .blob-3 {
        width: 50vw;
        height: 50vw;
    }
    
    .cursor-glow {
        display: none;
    }
}

@media (max-width: 480px) {
    .main-text {
        font-size: clamp(2rem, 18vw, 4rem);
        letter-spacing: 0.05em;
    }
    
    .main-text .x {
        margin: 0 0.05em;
    }
}

/* Performance Optimizations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
    
    .aurora-bg,
    .blob-container {
        display: none;
    }
}