:root {
    --bg-color: #0f172a;
    --card-bg: rgba(15, 23, 42, 0.8);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --neon-glow: 0 0 10px var(--accent-color), 0 0 20px var(--accent-color), 0 0 30px var(--accent-color);
    --scanline-color: rgba(255, 0, 255, 0.1);
}

[data-theme="light"] {
    --bg-color: #f8fafc;
    --card-bg: rgba(248, 250, 252, 0.9);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: rgba(15, 23, 42, 0.1);
    --shadow-color: rgba(15, 23, 42, 0.1);
}

[data-color="purple"] {
    --accent-color: #a78bfa;
}

[data-color="pink"] {
    --accent-color: #f472b6;
}

[data-color="green"] {
    --accent-color: #22c55e;
}

[data-color="orange"] {
    --accent-color: #f97316;
}

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

body {
    font-family: 'Fredoka', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    transition: all 0.3s ease;
    position: relative;
}

/* CRT Monitor Effects */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.8) 100%);
    pointer-events: none;
    z-index: 9998;
    mix-blend-mode: multiply;
}

/* Scanline Effects */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0) 50%,
        rgba(255,255,255,0.05) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9997;
    animation: scanline 8s linear infinite;
}

/* VHS Tape Noise */
.vhs-noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/><feColorMatrix type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.5 0"/></filter></svg>#noise');
    opacity: 0.1;
    pointer-events: none;
    z-index: -1;
    animation: noise 0.1s linear infinite;
}

/* Enhanced Particle System */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    animation: drift 15s linear infinite;
    box-shadow: 0 0 5px var(--accent-color);
}

.particle:nth-child(3n) {
    animation-duration: 10s;
    animation-delay: 2s;
    background: rgba(167, 139, 250, 0.1);
}

.particle:nth-child(5n) {
    animation-duration: 20s;
    animation-delay: 5s;
    background: rgba(244, 114, 182, 0.1);
}

.particle:nth-child(7n) {
    animation-duration: 12s;
    animation-delay: 8s;
    background: rgba(34, 197, 94, 0.1);
}

/* Speed Lines */
.speed-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    background-size: 20px 100%;
    opacity: 0;
    animation: speedLines 2s ease-in-out infinite;
}

.speed-line.active {
    opacity: 0.3;
    animation: speedLines 0.5s ease-in-out;
}

@keyframes speedLines {
    0% { transform: translateX(-100%); opacity: 0; }
    50% { opacity: 0.3; }
    100% { transform: translateX(100%); opacity: 0; }
}

/* Lens Flare Effects */
.lens-flare {
    position: fixed;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9995;
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lens-flare.active {
    opacity: 0.5;
    animation: lensFlare 3s ease-in-out infinite;
}

@keyframes lensFlare {
    0%, 100% { transform: scale(0.5) rotate(0deg); opacity: 0.2; }
    50% { transform: scale(1.5) rotate(180deg); opacity: 0.8; }
}

@keyframes trackingLine {
    0% { opacity: 0; transform: translateY(-10px); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: translateY(10px); }
}

@keyframes beatPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.01); }
}

/* Performance Optimizations */
body, .profile-card, .link-button, .cursor {
    will-change: transform, opacity, filter;
    transform: translateZ(0);
}

.particle, .floating-element, .speed-line, .lens-flare {
    will-change: transform, opacity;
    transform: translateZ(0);
}

/* Anime Typography Enhancements */
.profile-name {
    font-family: 'Fredoka', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: -1px;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.3);
}

.link-text {
    font-family: 'Fredoka', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 0.5px;
}

/* Enhanced Glitch Effects */
@keyframes enhancedGlitch {
    0%, 100% { 
        transform: translate(0);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    2% { 
        transform: translate(-3px, 0);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    4% { 
        transform: translate(3px, -2px);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    6% { 
        transform: translate(-3px, 2px);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    8% { 
        transform: translate(2px, 0);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    10% { 
        transform: translate(0);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

/* RGB Split Animation */
@keyframes rgbSplit {
    0%, 100% { 
        transform: translate(0);
    }
    50% { 
        transform: translate(2px, 0);
    }
}

/* Glitch Effects */
@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

@keyframes noise {
    0% { transform: translate(0, 0); }
    100% { transform: translate(1px, 1px); }
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    2% { transform: translate(-2px, 0); }
    4% { transform: translate(2px, 0); }
    6% { transform: translate(-2px, 0); }
    8% { transform: translate(2px, 0); }
    10% { transform: translate(0, 0); }
}

@keyframes neonPulse {
    0%, 100% { box-shadow: var(--neon-glow); opacity: 1; }
    50% { box-shadow: 0 0 5px var(--accent-color), 0 0 10px var(--accent-color); opacity: 0.8; }
}

@keyframes beatSync {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.02); }
    50% { transform: scale(0.98); }
    75% { transform: scale(1.01); }
}

@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-2px, 2px); }
    20% { transform: translate(2px, -2px); }
    30% { transform: translate(-2px, 0); }
    40% { transform: translate(2px, 2px); }
    50% { transform: translate(0, 0); }
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 40px;
}

.profile-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 40px var(--shadow-color);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.1), transparent 50%);
    pointer-events: none;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
    position: relative;
    z-index: 2;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.profile-avatar:hover {
    transform: scale(1.05);
    border-color: var(--accent-color);
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 3;
    letter-spacing: -2px;
    text-shadow: 3px 3px 0px rgba(0,0,0,0.3);
    animation: floatName 6s ease-in-out infinite;
}

.profile-name:hover {
    animation: glitch 0.3s ease-in-out;
}

.profile-name {
    animation: none !important;
}

.profile-name::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff00ff, #00ffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    mix-blend-mode: screen;
    opacity: 0.3;
    z-index: -1;
    filter: blur(1px);
    animation: floatName 6s ease-in-out infinite reverse;
}

.profile-name:hover::before {
    animation: rgbSplit 0.5s ease-in-out;
}

@keyframes floatName {
    0%, 100% { transform: translateY(0px) rotate(0deg) scale(1); }
    25% { transform: translateY(-5px) rotate(0.5deg) scale(1.02); }
    50% { transform: translateY(0px) rotate(0deg) scale(1); }
    75% { transform: translateY(5px) rotate(-0.5deg) scale(0.98); }
}

.profile-bio {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.copyright {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-top: 8px;
    font-family: 'Fredoka', sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.social-links {
    position: relative;
    z-index: 2;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.link-button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 16px;
    border-radius: 16px;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.link-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.link-button:hover {
    transform: translateY(-2px) scale(1.02);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
    box-shadow: 0 10px 25px rgba(56, 189, 248, 0.2), var(--neon-glow);
    animation: glitch 0.5s ease-in-out;
}

.link-button:hover::before {
    left: 100%;
}

.link-button:active {
    transform: translateY(0) scale(0.98);
    animation: screenShake 0.3s ease-in-out;
}

.link-button .link-text {
    position: relative;
    z-index: 2;
}

.link-button .link-text::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: var(--accent-color);
    opacity: 0.3;
    filter: blur(1px);
    z-index: -1;
    transform: translate(2px, -2px);
    mix-blend-mode: screen;
}

.link-button:hover .link-text::before {
    animation: beatSync 0.5s ease-in-out;
}

.link-icon {
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.link-text {
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
    transition: all 0.3s ease;
}

.link-arrow {
    font-size: 1.1rem;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.link-button:hover .link-arrow {
    opacity: 1;
    transform: translateX(4px);
}

.bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    object-fit: cover;
    filter: brightness(0.3) saturate(1.2);
    transition: transform 0.1s ease-out;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .profile-card {
        padding: 30px 20px;
    }
    
    .profile-name {
        font-size: 2rem;
    }
    
    .profile-bio {
        font-size: 0.9rem;
    }
    
    .link-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .link-button {
        padding: 15px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .profile-card {
        padding: 20px 15px;
    }
    
    .profile-name {
        font-size: 1.5rem;
    }
    
    .profile-bio {
        font-size: 0.8rem;
    }
    
    .link-button {
        padding: 12px;
        font-size: 0.9rem;
    }
}

.floating-element {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
    filter: blur(1px);
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(180deg); }
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    animation: drift 15s linear infinite;
}

@keyframes drift {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

.cursor {
    position: fixed;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease, width 0.2s ease, height 0.2s ease;
    mix-blend-mode: difference;
}

.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.color-selector {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.color-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.color-dot:hover {
    transform: scale(1.2);
    border-color: rgba(255, 255, 255, 0.8);
}

.color-dot.active::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
}

.link-preview {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.link-preview.show {
    opacity: 1;
    transform: translateY(0);
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.4s ease;
}

.loading-content {
    text-align: center;
}

.loading-content .loader {
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: loadingPulse 1.5s ease-in-out infinite;
}

.loading-content .loading-text {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

@keyframes loadingPulse {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.1) rotate(5deg); opacity: 0.7; }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .theme-toggle {
        bottom: 80px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .color-selector {
        bottom: 80px;
        left: 20px;
    }
    
    .color-dot {
        width: 25px;
        height: 25px;
    }
}

@media (max-width: 480px) {
    .theme-toggle {
        width: 40px;
        height: 40px;
    }
    
    .color-selector {
        bottom: 70px;
    }
    
    .color-dot {
        width: 20px;
        height: 20px;
    }
}

@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .theme-toggle, .color-selector, .cursor, .particles, .floating-element {
        display: none !important;
    }
    
    .profile-card {
        box-shadow: none !important;
        border: 1px solid #ccc;
    }
    
    .link-button {
        border: 1px solid #ccc;
        background: white !important;
        color: black !important;
    }
}