/* ============================================
   FEVER DREAM - Abstract Animated Experience
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff006e;
    --secondary-color: #8338ec;
    --accent-color: #06ffa5;
    --bg-dark: #000000;
}

body {
    font-family: 'Orbitron', sans-serif;
    background: var(--bg-dark);
    color: white;
    overflow: hidden;
    cursor: none;
    position: relative;
}

/* Canvas layers */
#canvas3d,
#particles,
#distortion {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#canvas3d {
    z-index: 1;
    filter: blur(1px);
}

#particles {
    z-index: 2;
    mix-blend-mode: screen;
}

#distortion {
    z-index: 3;
    mix-blend-mode: overlay;
    opacity: 0.3;
}

/* Container */
.container {
    position: relative;
    z-index: 10;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 2000px;
}

/* Name Container - The centerpiece */
.name-container {
    position: relative;
    animation: float 8s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotateX(0deg) rotateY(0deg);
    }
    25% {
        transform: translateY(-30px) rotateX(5deg) rotateY(-5deg);
    }
    50% {
        transform: translateY(0) rotateX(-5deg) rotateY(5deg);
    }
    75% {
        transform: translateY(30px) rotateX(5deg) rotateY(-5deg);
    }
}

/* The Name Itself */
.name {
    font-size: clamp(4rem, 15vw, 12rem);
    font-weight: 900;
    line-height: 0.9;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    transform-style: preserve-3d;
}

.name-part {
    display: block;
    position: relative;
    background: linear-gradient(45deg, 
        var(--primary-color), 
        var(--secondary-color), 
        var(--accent-color),
        var(--primary-color)
    );
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: psychedelicWave 4s ease-in-out infinite;
    text-shadow: 
        0 0 20px rgba(255, 0, 110, 0.5),
        0 0 40px rgba(131, 56, 236, 0.3),
        0 0 60px rgba(6, 255, 165, 0.2);
}

.first-name {
    animation-delay: 0s;
    animation: glitchName 5s infinite, psychedelicWave 4s ease-in-out infinite;
}

.last-name {
    animation-delay: 2s;
    animation: glitchName 5s infinite 1s, psychedelicWave 4s ease-in-out infinite 2s;
}

@keyframes psychedelicWave {
    0%, 100% {
        background-position: 0% 50%;
        filter: hue-rotate(0deg) saturate(1);
    }
    33% {
        background-position: 100% 50%;
        filter: hue-rotate(120deg) saturate(1.5);
    }
    66% {
        background-position: 50% 100%;
        filter: hue-rotate(240deg) saturate(2);
    }
}

@keyframes glitchName {
    0%, 90%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    91% {
        transform: translate(-10px, 5px) scale(0.98) skew(-2deg);
        opacity: 0.8;
    }
    92% {
        transform: translate(10px, -5px) scale(1.02) skew(2deg);
        opacity: 0.9;
    }
    93% {
        transform: translate(-5px, 3px) scale(0.99) skew(-1deg);
        opacity: 1;
    }
}

/* Glitch text layers */
.name-part::before,
.name-part::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    -webkit-background-clip: text;
    background-clip: text;
    opacity: 0;
}

.first-name::before {
    animation: glitch1 7s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.first-name::after {
    animation: glitch2 6s infinite;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

.last-name::before {
    animation: glitch2 5s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.last-name::after {
    animation: glitch1 8s infinite;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

@keyframes glitch1 {
    0%, 96%, 100% {
        opacity: 0;
        transform: translate(0);
    }
    97% {
        opacity: 0.7;
        transform: translate(-15px, -5px);
        filter: hue-rotate(90deg);
    }
    98% {
        opacity: 0.6;
        transform: translate(10px, 5px);
        filter: hue-rotate(180deg);
    }
    99% {
        opacity: 0.8;
        transform: translate(-5px, 0);
        filter: hue-rotate(270deg);
    }
}

@keyframes glitch2 {
    0%, 94%, 100% {
        opacity: 0;
        transform: translate(0);
    }
    95% {
        opacity: 0.6;
        transform: translate(12px, 8px);
        filter: hue-rotate(120deg);
    }
    96% {
        opacity: 0.7;
        transform: translate(-8px, -6px);
        filter: hue-rotate(240deg);
    }
    97% {
        opacity: 0.5;
        transform: translate(6px, -4px);
        filter: hue-rotate(60deg);
    }
}

/* Glitch Shapes - Random floating elements */
.glitch-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    opacity: 0.4;
}

/* Trippy pulsing background */
@keyframes bgPulse {
    0%, 100% {
        filter: hue-rotate(0deg) brightness(1) contrast(1);
    }
    25% {
        filter: hue-rotate(90deg) brightness(1.2) contrast(1.1);
    }
    50% {
        filter: hue-rotate(180deg) brightness(0.9) contrast(1.2);
    }
    75% {
        filter: hue-rotate(270deg) brightness(1.1) contrast(0.9);
    }
}

body {
    animation: bgPulse 10s ease-in-out infinite;
}

/* Scanline effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 999;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(10px);
    }
}

/* Chromatic aberration effect */
body::after {
    content: '';
    position: fixed;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    background: radial-gradient(
        circle at center,
        transparent 50%,
        rgba(255, 0, 110, 0.1) 60%,
        rgba(131, 56, 236, 0.1) 70%,
        rgba(6, 255, 165, 0.1) 80%,
        transparent 90%
    );
    pointer-events: none;
    z-index: 998;
    animation: chromaticAberration 6s ease-in-out infinite;
    mix-blend-mode: screen;
}

@keyframes chromaticAberration {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.05) rotate(180deg);
        opacity: 0.5;
    }
}

/* Responsive */
@media (max-width: 768px) {
    body {
        cursor: auto;
    }
    
    .name {
        font-size: clamp(2.5rem, 12vw, 6rem);
        padding: 1rem;
    }
    
    body::before,
    body::after {
        display: none;
    }
}

/* Hide overflow to prevent scrolling */
html {
    overflow: hidden;
}

/* Kaleidoscope rotation */
@keyframes kaleidoscope {
    0% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(90deg) scale(1.1);
    }
    50% {
        transform: rotate(180deg) scale(1);
    }
    75% {
        transform: rotate(270deg) scale(1.1);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

.name-container {
    animation: float 8s ease-in-out infinite, kaleidoscope 30s linear infinite;
}

/* Breathing effect */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        filter: blur(0px);
    }
    50% {
        transform: scale(1.05);
        filter: blur(2px);
    }
}

.name {
    animation: breathe 5s ease-in-out infinite;
}

/* Text stroke effect for better visibility */
.name-part {
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.1);
    text-stroke: 1px rgba(255, 255, 255, 0.1);
}
