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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    overflow-x: hidden;
    line-height: 1.6;
    /* Performance optimizations */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
    /* Use default cursor for maximum performance */
    cursor: auto;
}

/* Simplified background particles for better performance */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.4; /* Reduced opacity */
}

.particle {
    position: absolute;
    width: 1px;
    height: 1px;
    background: #00ffff; /* Simplified solid color */
    border-radius: 50%;
    animation: float 8s linear infinite; /* Simplified animation */
    /* Reduced hardware acceleration */
    will-change: transform;
}

@keyframes float {
    0% { transform: translateY(100vh) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10px) translateX(20px); opacity: 0; }
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 50px;
    background: rgba(10, 10, 10, 0.9); /* Removed backdrop-filter for better performance */
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.3s ease; /* Simplified transition */
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #00ffff, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: brightness(1); }
    to { filter: brightness(1.3); }
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #00ffff, #ff00ff);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: #00ffff;
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    background: radial-gradient(ellipse at center, rgba(0, 255, 255, 0.1) 0%, transparent 70%);
}

.hero-content h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff, #00ffff, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: slideInUp 1s ease-out, textShine 3s ease-in-out infinite;
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes textShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-content p {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    margin-bottom: 30px;
    opacity: 0.8;
    animation: slideInUp 1s ease-out 0.2s both;
}

.cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #00ffff, #ff00ff);
    color: #000;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 18px;
    transition: all 0.3s ease;
    animation: slideInUp 1s ease-out 0.4s both;
    position: relative;
    overflow: hidden;
}

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

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

.cta-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.4);
}

/* Projects Section */
.projects {
    padding: 100px 50px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    text-align: center;
    margin-bottom: 80px;
    background: linear-gradient(135deg, #ffffff, #00ffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.project-card {
    background: rgba(255, 255, 255, 0.08); /* Simplified background */
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Simplified transition */
    position: relative;
    overflow: hidden;
    /* Reduced hardware acceleration */
    will-change: transform;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.1), rgba(255, 0, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover::before {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-8px); /* Simplified transform */
    box-shadow: 0 15px 30px rgba(0, 255, 255, 0.15); /* Reduced shadow */
    border-color: rgba(0, 255, 255, 0.3);
}

.project-icon {
    width: 100px;
    height: 100px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.project-card h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #ffffff;
}

.project-card p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    line-height: 1.6;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.tech-tag {
    background: rgba(0, 255, 255, 0.2);
    color: #00ffff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(0, 255, 255, 0.3);
}

.project-links {
    display: flex;
    gap: 15px;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #00ffff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.project-link:hover {
    color: #ff00ff;
    transform: translateX(5px);
}

/* Skills Section */
.skills {
    padding: 100px 50px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.05), rgba(255, 0, 255, 0.05));
}

.skills-container {
    max-width: 1200px;
    margin: 0 auto;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.skill-item {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, background 0.3s ease; /* Simplified transition */
    position: relative;
    overflow: hidden;
}

.skill-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #00ffff, #ff00ff);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.skill-item:hover::before {
    transform: scaleX(1);
}

.skill-item:hover {
    transform: translateY(-5px); /* Simplified transform */
    background: rgba(255, 255, 255, 0.1);
}

.skill-icon {
    font-size: 40px;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

/* Simplified hover effect - no rotation for better performance */
.skill-item:hover .skill-icon {
    transform: scale(1.1);
}

.skill-item h4 {
    font-size: 18px;
    color: #ffffff;
}

/* Contact Section */
.contact {
    padding: 100px 50px;
    text-align: center;
}

.contact-container {
    max-width: 600px;
    margin: 0 auto;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 60px;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(0, 255, 255, 0.1); /* Simplified background */
    border-radius: 50%;
    color: #ffffff;
    text-decoration: none;
    font-size: 32px;
    transition: transform 0.3s ease, background 0.3s ease; /* Simplified transition */
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.contact-link svg {
    width: 40px;
    height: 40px;
    fill: currentColor;
    z-index: 1;
    position: relative;
}

.contact-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.3), rgba(255, 0, 255, 0.3));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-link:hover::before {
    opacity: 1;
}

.contact-link:hover {
    transform: translateY(-8px) scale(1.05); /* Simplified transform */
    background: rgba(0, 255, 255, 0.3); /* Simplified background */
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 255, 255, 0.3); /* Reduced shadow */
    border-color: rgba(0, 255, 255, 0.5);
}

.contact-text {
    margin-top: 30px;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
}

/* Footer */
footer {
    padding: 50px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(255, 0, 255, 0.2));
    border-radius: 50%;
    color: #ffffff;
    text-decoration: none;
    font-size: 20px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-link svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.social-link:hover {
    transform: translate3d(0, -5px, 0) scale(1.1);
    background: linear-gradient(135deg, #00ffff, #ff00ff);
    color: #000;
    box-shadow: 0 10px 25px rgba(0, 255, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    nav {
        padding: 15px 20px;
    }

    .nav-links {
        gap: 20px;
    }

    .hero, .projects, .skills, .contact {
        padding: 50px 20px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 20px;
    }

    .contact-links {
        gap: 30px;
    }

    .contact-link {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }

    .contact-link svg {
        width: 35px;
        height: 35px;
    }
}

/* Scroll animations - optimized and enhanced with directional variants */
.fade-in {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
    transition: all 0.8s ease;
    will-change: transform, opacity;
}

.fade-in.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Directional fade animations */
.fade-in-left {
    opacity: 0;
    transform: translate3d(-50px, 0, 0);
    transition: all 0.8s ease;
    will-change: transform, opacity;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.fade-in-right {
    opacity: 0;
    transform: translate3d(50px, 0, 0);
    transition: all 0.8s ease;
    will-change: transform, opacity;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.fade-in-up {
    opacity: 0;
    transform: translate3d(0, 50px, 0);
    transition: all 0.8s ease;
    will-change: transform, opacity;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Staggered animations for skill items */
.skill-item {
    transition-delay: calc(var(--item-index, 0) * 0.1s);
}

/* Typing animation for hero text */
@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #00ffff }
}

.typing-animation {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid #00ffff;
    width: 0;
    animation: 
        typing 3.5s steps(40, end) forwards,
        blink-caret 0.75s step-end infinite;
}

/* Performance optimizations for animated elements */
.project-card,
.skill-item,
.contact-link,
.social-link,
.cta-button {
    /* Reduce repaints */
    backface-visibility: hidden;
}

/* Performance-based particle variations */
.particle-enhanced {
    background: linear-gradient(45deg, #00ffff, #ff00ff, #ffff00);
    width: 3px;
    height: 3px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.particle-complex {
    background: radial-gradient(circle, #00ffff, #ff00ff, #ffff00, #ff0080);
    width: 4px;
    height: 4px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.7);
    border-radius: 50%;
}

/* Background effects for high-performance devices */
.background-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.floating-orb {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.3), transparent);
    animation: float-orb 8s ease-in-out infinite;
}

.orb-1 {
    width: 200px;
    height: 200px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
    background: radial-gradient(circle, rgba(255, 0, 255, 0.3), transparent);
}

.orb-3 {
    width: 100px;
    height: 100px;
    top: 40%;
    left: 70%;
    animation-delay: 4s;
    background: radial-gradient(circle, rgba(255, 255, 0, 0.3), transparent);
}

@keyframes float-orb {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.3; }
    50% { transform: translate3d(20px, -30px, 0) scale(1.1); opacity: 0.6; }
}

.mesh-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 0, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 0, 0.05) 0%, transparent 50%);
    animation: mesh-shift 10s ease-in-out infinite;
}

@keyframes mesh-shift {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    33% { transform: translate3d(10px, -10px, 0) rotate(1deg); }
    66% { transform: translate3d(-10px, 10px, 0) rotate(-1deg); }
}

/* All custom cursor and performance detection CSS removed for better performance */

/* Optimize animations for better 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;
    }

    .particle,
    .floating-orb,
    .mesh-gradient,
    .cursor-glow {
        display: none !important;
    }
}
