/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #0a0a0a;
    overflow: hidden;
    height: 100vh;
    cursor: default;
    will-change: transform;
    /* Enhanced backdrop filter for depth */
    backdrop-filter: brightness(1.02) contrast(1.05);
}

/* Advanced gradient background with depth layers */
.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 130%;
    height: 130%;
    background: 
        radial-gradient(ellipse 150% 80% at 20% 30%, rgba(25, 25, 30, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse 120% 90% at 80% 70%, rgba(20, 20, 25, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at center, rgba(30, 30, 30, 0.3) 0%, rgba(15, 15, 15, 0.8) 70%, #0a0a0a 100%);
    animation: enhancedMove 25s ease-in-out infinite;
    z-index: -2;
    will-change: transform;
    filter: blur(0.5px);
}

@keyframes enhancedMove {
    0%, 100% { 
        transform: translate(-15%, -15%) scale(1) rotate(0deg); 
        filter: blur(0.5px) brightness(1);
    }
    33% { 
        transform: translate(-8%, -12%) scale(1.08) rotate(0.5deg); 
        filter: blur(0.3px) brightness(1.02);
    }
    66% { 
        transform: translate(-12%, -8%) scale(1.05) rotate(-0.3deg); 
        filter: blur(0.4px) brightness(0.98);
    }
}

/* Enhanced noise overlay with depth */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.025) 1px, transparent 0),
        radial-gradient(circle at 20px 20px, rgba(100,150,255,0.005) 1px, transparent 0);
    background-size: 45px 45px, 80px 80px;
    animation: enhancedNoiseMove 35s linear infinite;
    z-index: -1;
    opacity: 0.6;
    will-change: transform;
    backdrop-filter: brightness(1.01);
}

@keyframes enhancedNoiseMove {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-22px, -18px) rotate(0.2deg); }
    100% { transform: translate(-45px, -45px) rotate(0deg); }
}

/* Main container with enhanced depth */
.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 2rem;
    position: relative;
    z-index: 10;
    will-change: transform;
    /* Subtle container glow */
    filter: drop-shadow(0 0 50px rgba(255, 255, 255, 0.02));
}

/* Enhanced logo with premium feel */
.logo-container {
    position: relative;
    margin-bottom: 2rem;
    will-change: transform;
    /* Add breathing effect */
    animation: logoBreathing 8s ease-in-out infinite;
}

@keyframes logoBreathing {
    0%, 100% { transform: scale(1) translateZ(0); }
    50% { transform: scale(1.015) translateZ(0); }
}

.logo {
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 900;
    background: linear-gradient(135deg, 
        #ffffff 0%, 
        #f5f5f5 10%,
        #e8e8e8 25%, 
        #ffffff 35%,
        #f0f0f0 50%,
        #ffffff 65%, 
        #e5e5e5 80%,
        #ffffff 90%,
        #f8f8f8 100%);
    background-size: 300% 300%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: premiumTextShimmer 8s ease-in-out infinite;
    letter-spacing: 0.5rem;
    text-align: center;
    filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.12)) 
            drop-shadow(0 0 50px rgba(100, 150, 255, 0.08));
    position: relative;
    will-change: transform, filter;
    transform: translateZ(0);
    /* Enhanced text shadow layers */
    text-shadow: 
        0 0 30px rgba(255, 255, 255, 0.1),
        0 0 60px rgba(100, 150, 255, 0.05),
        0 0 90px rgba(255, 255, 255, 0.03);
}

@keyframes premiumTextShimmer {
    0%, 100% { 
        background-position: 0% 50%; 
        filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.12)) 
                drop-shadow(0 0 50px rgba(100, 150, 255, 0.08));
    }
    25% { 
        background-position: 50% 25%; 
        filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.15)) 
                drop-shadow(0 0 60px rgba(100, 150, 255, 0.1));
    }
    50% { 
        background-position: 100% 50%; 
        filter: drop-shadow(0 0 35px rgba(255, 255, 255, 0.18)) 
                drop-shadow(0 0 70px rgba(100, 150, 255, 0.12));
    }
    75% { 
        background-position: 50% 75%; 
        filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.15)) 
                drop-shadow(0 0 60px rgba(100, 150, 255, 0.1));
    }
}

/* Enhanced underline with multiple layers */
.logo-underline {
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 10%,
        rgba(255, 255, 255, 0.9) 25%, 
        rgba(100, 150, 255, 0.8) 40%,
        rgba(255, 255, 255, 1) 50%,
        rgba(100, 150, 255, 0.8) 60%,
        rgba(255, 255, 255, 0.9) 75%, 
        rgba(255, 255, 255, 0.2) 90%,
        transparent 100%);
    margin-top: 1rem;
    animation: enhancedUnderlineGlow 6s ease-in-out infinite;
    will-change: transform, box-shadow;
    position: relative;
    border-radius: 2px;
}

.logo-underline::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(100, 150, 255, 0.1) 25%, 
        rgba(100, 150, 255, 0.2) 50%,
        rgba(100, 150, 255, 0.1) 75%, 
        transparent 100%);
    border-radius: 3px;
    filter: blur(2px);
    animation: enhancedUnderlineGlow 6s ease-in-out infinite reverse;
}

@keyframes enhancedUnderlineGlow {
    0%, 100% { 
        box-shadow: 
            0 0 5px rgba(100, 150, 255, 0.3),
            0 0 10px rgba(255, 255, 255, 0.2),
            0 0 20px rgba(100, 150, 255, 0.1);
        transform: scaleX(0.85) scaleY(0.9);
    }
    33% { 
        box-shadow: 
            0 0 8px rgba(100, 150, 255, 0.5),
            0 0 15px rgba(255, 255, 255, 0.3),
            0 0 30px rgba(100, 150, 255, 0.15);
        transform: scaleX(1) scaleY(1.1);
    }
    66% { 
        box-shadow: 
            0 0 12px rgba(100, 150, 255, 0.7),
            0 0 25px rgba(255, 255, 255, 0.4),
            0 0 50px rgba(100, 150, 255, 0.2);
        transform: scaleX(1.05) scaleY(1.2);
    }
}

/* Enhanced particles with layered depth */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    will-change: transform;
    perspective: 1000px;
}

.particle {
    position: absolute;
    border-radius: 50%;
    animation: enhancedParticleFloat 18s linear infinite;
    will-change: transform, opacity;
    /* Enhanced glow effect */
    filter: blur(0.5px);
    box-shadow: 0 0 6px currentColor;
}

/* Multi-layered particle system */
.particle:nth-child(1), .particle:nth-child(5) {
    left: 15%;
    animation-delay: 0s;
    animation-duration: 22s;
    background: rgba(100, 150, 255, 0.4);
    width: 4px;
    height: 4px;
    box-shadow: 
        0 0 8px rgba(100, 150, 255, 0.6),
        0 0 16px rgba(100, 150, 255, 0.3);
}

.particle:nth-child(2), .particle:nth-child(6) {
    left: 35%;
    animation-delay: 3s;
    animation-duration: 28s;
    background: rgba(255, 255, 255, 0.3);
    width: 2px;
    height: 2px;
    box-shadow: 
        0 0 6px rgba(255, 255, 255, 0.4),
        0 0 12px rgba(255, 255, 255, 0.2);
}

.particle:nth-child(3), .particle:nth-child(7) {
    left: 55%;
    animation-delay: 6s;
    animation-duration: 20s;
    background: rgba(100, 150, 255, 0.5);
    width: 3px;
    height: 3px;
    box-shadow: 
        0 0 7px rgba(100, 150, 255, 0.7),
        0 0 14px rgba(100, 150, 255, 0.4);
}

.particle:nth-child(4), .particle:nth-child(8) {
    left: 75%;
    animation-delay: 9s;
    animation-duration: 24s;
    background: rgba(255, 255, 255, 0.25);
    width: 2.5px;
    height: 2.5px;
    box-shadow: 
        0 0 5px rgba(255, 255, 255, 0.3),
        0 0 10px rgba(255, 255, 255, 0.15);
}

@keyframes enhancedParticleFloat {
    0%, 100% { 
        transform: translateY(0) rotateZ(0deg) scale(1);
        opacity: 0.4;
    }
    25% { 
        transform: translateY(-15px) rotateZ(90deg) scale(1.1);
        opacity: 0.6;
    }
    50% { 
        transform: translateY(-25px) rotateZ(180deg) scale(0.9);
        opacity: 0.8;
    }
    75% { 
        transform: translateY(-10px) rotateZ(270deg) scale(1.05);
        opacity: 0.5;
    }
}

/* Enhanced parallax layers with depth */
.parallax-layer-1 {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background: 
        radial-gradient(circle at 70% 30%, rgba(100, 150, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.02) 0%, transparent 40%);
    z-index: -5;
    will-change: transform;
    filter: blur(1px);
    animation: layerFloat1 30s ease-in-out infinite;
}

@keyframes layerFloat1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    33% { transform: translate(2%, 1%) rotate(0.3deg) scale(1.02); }
    66% { transform: translate(-1%, 2%) rotate(-0.2deg) scale(0.98); }
}

.parallax-layer-2 {
    position: fixed;
    top: -15%;
    left: -15%;
    width: 130%;
    height: 130%;
    background: 
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.015) 0%, transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(100, 150, 255, 0.02) 0%, transparent 50%);
    z-index: -6;
    will-change: transform;
    filter: blur(2px);
    animation: layerFloat2 40s ease-in-out infinite reverse;
}

@keyframes layerFloat2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    50% { transform: translate(-1%, -1%) rotate(-0.1deg) scale(1.01); }
}

/* Enhanced geometric elements with continuous movement */
.parallax-geometry {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    will-change: transform;
    perspective: 1000px;
    /* Ensure continuous animation */
    animation-play-state: running;
}

/* Special effect state for enhanced interactivity - FIXED: No position shifting */
.parallax-geometry.special-effect-active .geo-element {
    /* Remove animation-duration override to prevent position jumps */
    filter: brightness(1.2) saturate(1.3);
    box-shadow: 
        0 0 30px rgba(100, 150, 255, 0.15),
        inset 0 0 15px rgba(255, 255, 255, 0.1);
    /* Add smooth transition for glow properties only */
    transition: filter 0.4s ease, box-shadow 0.4s ease;
}

.geo-element {
    position: absolute;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(100, 150, 255, 0.08);
    backdrop-filter: blur(1px);
    will-change: transform, opacity;
    border-radius: 2px;
    /* Ensure animations continue smoothly */
    animation-play-state: running !important;
    animation-fill-mode: both;
    /* Remove transition for transform to prevent conflicts */
    transition: filter 0.3s ease, box-shadow 0.3s ease;
}

.geo-element:nth-child(1) {
    width: 120px;
    height: 120px;
    top: 15%;
    left: 10%;
    animation: 
        geoFloat1 25s ease-in-out infinite,
        geoRotate1 20s linear infinite,
        geoOrbit1 45s ease-in-out infinite;
    animation-play-state: running, running, running;
    box-shadow: 
        0 0 20px rgba(100, 150, 255, 0.05),
        inset 0 0 10px rgba(255, 255, 255, 0.02);
}

.geo-element:nth-child(2) {
    width: 80px;
    height: 80px;
    top: 60%;
    right: 15%;
    animation: 
        geoFloat2 30s ease-in-out infinite,
        geoRotate2 25s linear infinite reverse,
        geoOrbit2 50s ease-in-out infinite reverse;
    animation-play-state: running, running, running;
    border-radius: 50%;
    box-shadow: 
        0 0 15px rgba(255, 255, 255, 0.04),
        inset 0 0 8px rgba(100, 150, 255, 0.03);
}

.geo-element:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 25%;
    right: 25%;
    animation: 
        geoFloat3 20s ease-in-out infinite,
        geoRotate3 15s linear infinite,
        geoOrbit3 35s ease-in-out infinite;
    animation-play-state: running, running, running;
    /* Remove initial transform - will be handled in keyframes */
    box-shadow: 
        0 0 12px rgba(100, 150, 255, 0.06),
        inset 0 0 6px rgba(255, 255, 255, 0.025);
}

.geo-element:nth-child(4) {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 20%;
    animation: 
        geoFloat4 35s ease-in-out infinite,
        geoRotate4 30s linear infinite reverse,
        geoOrbit4 40s ease-in-out infinite reverse;
    animation-play-state: running, running, running;
    border-radius: 20px;
    box-shadow: 
        0 0 18px rgba(255, 255, 255, 0.03),
        inset 0 0 9px rgba(100, 150, 255, 0.04);
}

/* Enhanced continuous floating animations - OPTIMIZED */
@keyframes geoFloat1 {
    0%, 100% { 
        transform: translate(0, 0) scale(1);
    }
    25% { 
        transform: translate(15px, -8px) scale(1.03);
    }
    50% { 
        transform: translate(8px, 12px) scale(0.98);
    }
    75% { 
        transform: translate(-10px, -5px) scale(1.01);
    }
}

@keyframes geoFloat2 {
    0%, 100% { 
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    20% { 
        transform: translate(-18px, -12px) scale(1.08);
        opacity: 0.9;
    }
    40% { 
        transform: translate(-25px, 5px) scale(0.95);
        opacity: 0.95;
    }
    60% { 
        transform: translate(-8px, 18px) scale(1.05);
        opacity: 0.85;
    }
    80% { 
        transform: translate(5px, -3px) scale(0.99);
        opacity: 0.9;
    }
}

@keyframes geoFloat3 {
    /* FIXED: Maintain 45deg rotation throughout animation */
    0%, 100% { 
        transform: translate(0, 0) scale(1) rotate(45deg);
    }
    33% { 
        transform: translate(12px, 18px) scale(0.92) rotate(45deg);
    }
    66% { 
        transform: translate(-8px, 25px) scale(1.04) rotate(45deg);
    }
}

@keyframes geoFloat4 {
    0%, 100% { 
        transform: translate(0, 0) scale(1);
    }
    20% { 
        transform: translate(-12px, -8px) scale(1.02);
    }
    40% { 
        transform: translate(5px, -15px) scale(0.96);
    }
    60% { 
        transform: translate(18px, -3px) scale(1.04);
    }
    80% { 
        transform: translate(8px, 10px) scale(0.98);
    }
}

/* Optimized rotation animations - PERFORMANCE ENHANCED */
@keyframes geoRotate1 {
    from { 
        transform: rotate(0deg);
    }
    to { 
        transform: rotate(360deg);
    }
}

@keyframes geoRotate2 {
    from { 
        transform: rotate(0deg);
    }
    to { 
        transform: rotate(-360deg);
    }
}

@keyframes geoRotate3 {
    /* FIXED: Combine rotation with base 45deg */
    from { 
        transform: rotate(45deg);
    }
    to { 
        transform: rotate(405deg); /* 45 + 360 */
    }
}

@keyframes geoRotate4 {
    from { 
        transform: rotate(0deg);
    }
    to { 
        transform: rotate(-360deg);
    }
}

/* Simplified orbit animations - PERFORMANCE OPTIMIZED */
@keyframes geoOrbit1 {
    0%, 100% { 
        transform: translateX(0) translateY(0);
    }
    25% { 
        transform: translateX(8px) translateY(-4px);
    }
    50% { 
        transform: translateX(0) translateY(-8px);
    }
    75% { 
        transform: translateX(-8px) translateY(-4px);
    }
}

@keyframes geoOrbit2 {
    0%, 100% { 
        transform: translateX(0) translateY(0);
    }
    25% { 
        transform: translateX(-6px) translateY(3px);
    }
    50% { 
        transform: translateX(0) translateY(6px);
    }
    75% { 
        transform: translateX(6px) translateY(3px);
    }
}

@keyframes geoOrbit3 {
    0%, 100% { 
        transform: translateX(0) translateY(0);
    }
    25% { 
        transform: translateX(5px) translateY(-2px);
    }
    50% { 
        transform: translateX(0) translateY(-5px);
    }
    75% { 
        transform: translateX(-5px) translateY(-2px);
    }
}

@keyframes geoOrbit4 {
    0%, 100% { 
        transform: translateX(0) translateY(0);
    }
    25% { 
        transform: translateX(-4px) translateY(2px);
    }
    50% { 
        transform: translateX(0) translateY(4px);
    }
    75% { 
        transform: translateX(4px) translateY(2px);
    }
}

/* Enhanced grid overlay */
.parallax-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(100, 150, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 150, 255, 0.02) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.008) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.008) 1px, transparent 1px);
    background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
    z-index: -4;
    will-change: transform;
    animation: gridPulse 45s ease-in-out infinite;
    filter: blur(0.5px);
}

@keyframes gridPulse {
    0%, 100% { 
        opacity: 0.3; 
        transform: scale(1) rotate(0deg);
    }
    50% { 
        opacity: 0.5; 
        transform: scale(1.01) rotate(0.1deg);
    }
}

/* Responsive enhancements */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .logo {
        font-size: clamp(3rem, 15vw, 6rem);
        letter-spacing: 0.3rem;
    }
    
    .particles-container {
        display: none; /* Performance optimization for mobile */
    }
    
    .parallax-geometry,
    .parallax-layer-1,
    .parallax-layer-2 {
        display: none; /* Reduce mobile complexity */
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: clamp(2.5rem, 18vw, 5rem);
        letter-spacing: 0.2rem;
    }
    
    .terminal-container {
        min-width: 300px;
        margin: 0 1rem;
    }
}

/* Enhanced hover states for devices that support it */
@media (hover: hover) {
    .logo:hover {
        animation-play-state: paused;
        transform: translateY(-3px) scale(1.03) translateZ(0);
        filter: drop-shadow(0 0 35px rgba(255, 255, 255, 0.2)) 
                drop-shadow(0 0 70px rgba(100, 150, 255, 0.15));
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .container:hover .geo-element {
        animation-play-state: paused;
        opacity: 0.8;
        transition: opacity 0.3s ease;
    }
}

/* Accessibility and performance */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Hardware acceleration for key elements */
.logo,
.particle,
.geo-element,
.parallax-layer-1,
.parallax-layer-2,
.parallax-grid {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Enhanced focus states for accessibility */
.container *:focus-visible {
    outline: 2px solid rgba(100, 150, 255, 0.6);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Terminal-style contact section */
.contact-section {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    animation: fadeIn 2s ease-out 1s both;
    width: auto;
    max-width: 90vw;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.terminal-container {
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid rgba(100, 150, 255, 0.6);
    border-radius: 4px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(100, 150, 255, 0.3);
    font-family: 'Courier New', monospace;
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0;
    visibility: hidden;
    animation: fadeIn 2s ease-out 3s both;
}

.terminal-header {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(100, 150, 255, 0.3);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-align: left;
}

.terminal-title {
    font-weight: normal;
    letter-spacing: 0.5px;
}

.terminal-content {
    padding: 20px;
    color: #ffffff;
}

.terminal-prompt {
    color: #ffffff;
    margin-right: 8px;
}

.typewriter-text {
    color: #ffffff;
    margin-left: 4px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.cursor {
    color: #64a8ff;
    animation: cursorBlink 1s infinite;
    font-weight: bold;
    margin-left: 2px;
    text-shadow: 0 0 8px rgba(100, 168, 255, 0.7);
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Hover effect for terminal */
.terminal-container:hover {
    border-color: rgba(100, 150, 255, 0.6);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(100, 150, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.terminal-container:hover .terminal-prompt {
    text-shadow: 0 0 12px rgba(39, 202, 63, 0.8);
}

.terminal-container:hover .cursor {
    text-shadow: 0 0 12px rgba(100, 168, 255, 1);
} 