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

:root {
    --primary-color: #00d4ff;
    --secondary-color: #0066ff;
    --dark-bg: #0a0a0a;
    --card-bg: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent-gradient: linear-gradient(135deg, #00d4ff, #0066ff, #6600ff);
    --glow-color: rgba(0, 212, 255, 0.5);
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-subtle: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.2);
    --shadow-large: 0 20px 40px rgba(0, 0, 0, 0.3);
    --border-radius-small: 8px;
    --border-radius-medium: 15px;
    --border-radius-large: 20px;
}

/* Performance optimizations */
html {
    scroll-behavior: smooth;
    font-feature-settings: "liga", "kern";
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    font-display: swap;
    will-change: scroll-position;
}

/* Enhanced Animated Background with better performance */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(102, 0, 255, 0.1) 0%, transparent 50%),
        var(--dark-bg);
    animation: backgroundShift 20s ease-in-out infinite;
    will-change: background;
}

@keyframes backgroundShift {
    0%, 100% { 
        background: 
            radial-gradient(circle at 20% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(102, 0, 255, 0.1) 0%, transparent 50%),
            var(--dark-bg);
    }
    25% {
        background: 
            radial-gradient(circle at 80% 30%, rgba(255, 107, 107, 0.08) 0%, transparent 50%),
            radial-gradient(circle at 30% 70%, rgba(0, 212, 255, 0.12) 0%, transparent 50%),
            var(--dark-bg);
    }
    50% {
        background: 
            radial-gradient(circle at 40% 20%, rgba(102, 0, 255, 0.12) 0%, transparent 50%),
            radial-gradient(circle at 70% 80%, rgba(0, 255, 127, 0.08) 0%, transparent 50%),
            var(--dark-bg);
    }
    75% {
        background: 
            radial-gradient(circle at 10% 40%, rgba(255, 215, 0, 0.08) 0%, transparent 50%),
            radial-gradient(circle at 90% 60%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
            var(--dark-bg);
    }
}

@keyframes titleMorph {
    0%, 100% { 
        filter: hue-rotate(0deg) brightness(1);
        text-shadow: 0 0 20px var(--glow-color);
    }
    25% { 
        filter: hue-rotate(90deg) brightness(1.1);
        text-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
    }
    50% { 
        filter: hue-rotate(180deg) brightness(1.2);
        text-shadow: 0 0 40px rgba(0, 255, 127, 0.5);
    }
    75% { 
        filter: hue-rotate(270deg) brightness(1.1);
        text-shadow: 0 0 35px rgba(255, 215, 0, 0.5);
    }
}

@keyframes underlinePulse {
    0%, 100% { 
        transform: translateX(-50%) scaleX(1);
        opacity: 1;
    }
    50% { 
        transform: translateX(-50%) scaleX(1.5);
        opacity: 0.7;
    }
}

/* Enhanced Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    padding: 0.8rem 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    will-change: background, box-shadow;
}

nav.scrolled {
    background: rgba(5, 5, 5, 0.98);
    box-shadow: 0 4px 30px rgba(0, 212, 255, 0.25);
    border-bottom: 1px solid rgba(0, 212, 255, 0.4);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}

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

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00d4ff 0%, #0066ff 50%, #6600ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, filter;
    user-select: none;
}

.logo:hover {
    transform: scale(1.05);
    filter: brightness(1.2) drop-shadow(0 0 10px rgba(0, 212, 255, 0.5));
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
    height: 100%;
}

.nav-links li {
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
    padding: 0.7rem 1.2rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    height: 40px;
    white-space: nowrap;
    will-change: transform, color, background, border-color, box-shadow;
    z-index: 1;
}

.nav-links a::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(102, 0, 255, 0.08));
    opacity: 0;
    transition: all 0.3s ease;
    z-index: -1;
    will-change: opacity, transform;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    border-radius: 2px;
    will-change: width;
}

.nav-links a:hover::before {
    opacity: 1;
    transform: scale(1.02);
}

.nav-links a:hover::after {
    width: calc(100% - 16px);
}

.nav-links a:hover {
    color: var(--primary-color);
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.2);
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

.nav-links a:active {
    transform: translateY(0) scale(0.98);
}

.nav-links a.active {
    color: var(--primary-color);
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.4);
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.2);
}

.nav-links a.active::after {
    width: calc(100% - 16px);
    opacity: 1;
}

.nav-links a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
    border-color: rgba(0, 212, 255, 0.5);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: 2rem;
}

.hero-content {
    max-width: 900px;
    animation: fadeInUp 1s ease-out;
    position: relative;
    z-index: 10;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: 1rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 4s ease-in-out infinite alternate, textFloat 6s ease-in-out infinite;
    font-weight: 700;
    position: relative;
    text-align: center;
    will-change: text-shadow, filter, transform;
}

.hero-title::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    border-radius: var(--border-radius-medium);
    z-index: -1;
    animation: titleBorderSpin 8s linear infinite;
    will-change: transform, opacity;
}

@keyframes titleGlow {
    0% { 
        text-shadow: 0 0 20px var(--glow-color);
        filter: brightness(1);
    }
    100% { 
        text-shadow: 0 0 40px var(--glow-color), 0 0 60px rgba(0, 212, 255, 0.4);
        filter: brightness(1.2);
    }
}

@keyframes textFloat {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-10px) scale(1.02); }
}

@keyframes titleBorderSpin {
    0% { transform: rotate(0deg); opacity: 0; }
    25% { opacity: 0.3; }
    50% { opacity: 0; }
    75% { opacity: 0.3; }
    100% { transform: rotate(360deg); opacity: 0; }
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--primary-color);
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease-out 0.2s both;
    text-shadow: 0 0 10px var(--glow-color);
}

.hero-location {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-description {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    line-height: 1.8;
    margin-bottom: 3rem;
    animation: fadeInUp 1s ease-out 0.4s both;
    color: var(--text-secondary);
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    animation: fadeInUp 1s ease-out 0.6s both;
    flex-wrap: wrap;
}

.btn {
    padding: 1.2rem 2.5rem;
    border: none;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    font-size: 1.1rem;
    display: inline-block;
    cursor: pointer;
    transform-style: preserve-3d;
    will-change: transform, box-shadow;
}

.btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    position: relative;
}

.btn:hover {
    transform: translateY(-8px) rotateX(15deg);
    box-shadow: 0 20px 50px rgba(0, 212, 255, 0.6);
}

.btn:active {
    transform: translateY(-4px) rotateX(5deg) scale(0.98);
}

.btn::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.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: left;
}

.btn:hover::before {
    left: 100%;
}

.btn-secondary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
    border-radius: 50px;
    will-change: opacity;
}

.btn-secondary:hover::after {
    opacity: 0.1;
}

/* Sections */
.section {
    padding: 6rem 0;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
    position: relative;
    transition: transform 0.3s ease;
    will-change: transform;
}

.section:hover {
    transform: translateY(-2px);
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    text-align: center;
    margin-bottom: 4rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    animation: titleMorph 8s ease-in-out infinite;
    will-change: filter, text-shadow;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    width: 100px;
    height: 4px;
    background: var(--accent-gradient);
    transform: translateX(-50%);
    border-radius: 2px;
    animation: underlinePulse 3s ease-in-out infinite;
    will-change: transform, opacity;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: center;
}

.about-image {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10rem;
    color: white;
    margin: 0 auto;
    animation: imageFloat 4s ease-in-out infinite, imageRotate 20s linear infinite;
    position: relative;
    box-shadow: 0 0 60px rgba(0, 212, 255, 0.6), inset 0 0 60px rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
    will-change: transform, box-shadow;
}

.about-image:hover {
    transform: scale(1.1) rotateY(15deg);
    box-shadow: 0 0 80px rgba(0, 212, 255, 0.8), 0 20px 40px rgba(0, 0, 0, 0.3);
}

.about-image::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--primary-color), var(--secondary-color), #ff6b6b, var(--primary-color));
    z-index: -1;
    animation: ringRotate 8s linear infinite;
    opacity: 0.6;
    will-change: transform;
}

.about-image::after {
    content: '';
    position: absolute;
    top: -25px;
    left: -25px;
    right: -25px;
    bottom: -25px;
    border-radius: 50%;
    background: conic-gradient(from 180deg, transparent, rgba(0, 212, 255, 0.3), transparent);
    z-index: -2;
    animation: ringRotate 12s linear infinite reverse;
    will-change: transform;
}

@keyframes imageFloat {
    0%, 100% { transform: translateY(0px) rotateZ(0deg); }
    50% { transform: translateY(-15px) rotateZ(2deg); }
}

@keyframes imageRotate {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

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

.about-text {
    font-size: 1.2rem;
    line-height: 1.9;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    animation: fadeInRight 1s ease-out;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--border-radius-medium);
    border: 1px solid rgba(0, 212, 255, 0.2);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    will-change: transform, box-shadow, background;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    transition: left 0.6s ease;
    will-change: left;
}

.stat-item:hover::before {
    left: 100%;
}

.stat-item:hover {
    transform: translateY(-8px) rotateX(10deg);
    box-shadow: 0 15px 35px rgba(0, 212, 255, 0.4);
    border-color: var(--primary-color);
    background: rgba(0, 212, 255, 0.05);
}

.stat-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    animation: countUp 2s ease-out;
    will-change: transform, opacity;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.stat-item:hover .stat-label {
    color: var(--text-primary);
}

@keyframes countUp {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Skills Section */
.skills-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
}

.skills-category {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius-large);
    border: 1px solid rgba(0, 212, 255, 0.2);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    will-change: transform, box-shadow;
}

.skills-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transition: transform 0.5s ease;
    will-change: transform;
}

.skills-category:hover::before {
    transform: scaleX(1);
}

.skills-category:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 212, 255, 0.2);
    border-color: var(--primary-color);
}

.skills-category h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    animation: slideInLeft 0.8s ease-out;
}

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

.skill-item {
    background: rgba(0, 212, 255, 0.1);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    transition: var(--transition-smooth);
    border: 1px solid rgba(0, 212, 255, 0.3);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    will-change: transform, background, box-shadow;
}

.skill-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.skill-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: all 0.5s ease;
    transform: scale(0);
    will-change: opacity, transform;
}

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

.skill-item:hover {
    transform: scale(1.08) rotateY(10deg);
    background: rgba(0, 212, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
    border-color: var(--primary-color);
}

.skill-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    transition: var(--transition-smooth);
    will-change: transform, color;
}

.skill-item:hover i {
    transform: rotateY(180deg) scale(1.2);
    color: #fff;
}

/* Experience Timeline */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background: var(--accent-gradient);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
    border-radius: 3px;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    animation: timelinePulse 3s ease-in-out infinite;
    will-change: box-shadow;
}

@keyframes timelinePulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.5); }
    50% { box-shadow: 0 0 30px rgba(0, 212, 255, 0.8), 0 0 40px rgba(0, 212, 255, 0.3); }
}

.timeline-item {
    padding: 2rem 3rem;
    position: relative;
    background: var(--card-bg);
    border-radius: var(--border-radius-large);
    width: calc(50% - 40px);
    margin-bottom: 3rem;
    border: 1px solid rgba(0, 212, 255, 0.2);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-large);
    opacity: 1;
    transform: translateY(0);
    cursor: pointer;
    overflow: hidden;
    will-change: transform, box-shadow, background;
}

.timeline-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(0, 212, 255, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
    will-change: opacity;
}

.timeline-item:hover::before {
    opacity: 1;
}

.timeline-item.will-animate {
    opacity: 0;
    transform: translateY(60px) rotateX(-15deg);
}

.timeline-item.animate {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
}

.timeline-item:nth-child(odd) {
    left: 0;
    transform-origin: right center;
}

.timeline-item:nth-child(even) {
    left: calc(50% + 40px);
    transform-origin: left center;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    background: var(--primary-color);
    border: 4px solid var(--dark-bg);
    top: 50%;
    border-radius: 50%;
    z-index: 1;
    box-shadow: 0 0 20px var(--glow-color);
    transition: var(--transition-smooth);
    will-change: transform, box-shadow;
}

.timeline-item:nth-child(odd)::after {
    right: -65px;
}

.timeline-item:nth-child(even)::after {
    left: -65px;
}

.timeline-item:hover {
    transform: translateY(-5px) scale(1.03) rotateX(5deg);
    box-shadow: 0 20px 50px rgba(0, 212, 255, 0.3);
    border-color: var(--primary-color);
}

.timeline-item:hover::after {
    transform: scale(1.3);
    box-shadow: 0 0 30px var(--glow-color);
}

.timeline-date {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    animation: slideInLeft 0.6s ease-out;
}

.timeline-title {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    animation: slideInRight 0.6s ease-out;
}

.timeline-company {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-weight: 500;
    animation: fadeIn 0.8s ease-out;
}

.timeline-description {
    color: var(--text-secondary);
    line-height: 1.6;
    animation: fadeInUp 1s ease-out;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-large);
    overflow: hidden;
    transition: var(--transition-smooth);
    border: 1px solid rgba(0, 212, 255, 0.2);
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    will-change: transform, box-shadow;
}

.project-card:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transition: transform 0.5s ease;
    will-change: transform;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 212, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    will-change: opacity;
}

.project-card:hover::before {
    transform: scaleX(1);
}

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

.project-card:hover {
    transform: translateY(-15px) rotateX(8deg) rotateY(2deg);
    box-shadow: 0 25px 60px rgba(0, 212, 255, 0.3);
    border-color: var(--primary-color);
}

.project-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    padding: 2rem;
    text-align: center;
    transition: var(--transition-smooth);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(102, 0, 255, 0.1));
    will-change: transform, color, text-shadow;
}

.project-card:hover .project-icon {
    transform: scale(1.2) rotateY(15deg);
    color: #fff;
    text-shadow: 0 0 20px var(--primary-color);
}

.project-content {
    padding: 0 2rem 2rem;
    position: relative;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.project-card:hover .project-title {
    color: var(--primary-color);
}

.project-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
}

.project-card:hover .project-description {
    color: var(--text-primary);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    background: rgba(0, 212, 255, 0.2);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    border: 1px solid rgba(0, 212, 255, 0.3);
    cursor: pointer;
    will-change: transform, background, color, box-shadow;
}

.tech-tag:hover {
    background: var(--primary-color);
    color: var(--dark-bg);
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0, 212, 255, 0.4);
}

.tech-tag:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Contact Section */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    animation: fadeInUp 1s ease-out;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    padding: 1.5rem 2.5rem;
    background: var(--card-bg);
    border-radius: var(--border-radius-medium);
    transition: var(--transition-smooth);
    border: 1px solid rgba(0, 212, 255, 0.2);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    will-change: transform, box-shadow, background;
}

.contact-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

.contact-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    transition: left 0.6s ease;
    will-change: left;
}

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

.contact-link:hover {
    transform: translateY(-8px) rotateX(10deg);
    box-shadow: 0 15px 35px rgba(0, 212, 255, 0.4);
    border-color: var(--primary-color);
    background: rgba(0, 212, 255, 0.05);
}

.contact-link i {
    font-size: 1.8rem;
    color: var(--primary-color);
    transition: var(--transition-smooth);
    will-change: transform, text-shadow;
}

.contact-link:hover i {
    transform: rotateY(180deg) scale(1.2);
    text-shadow: 0 0 15px var(--primary-color);
}

/* Floating Particles */
.floating-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    contain: layout style paint;
}

.particle {
    position: absolute;
    background: var(--primary-color);
    border-radius: 50%;
    animation: floatEnhanced 8s ease-in-out infinite;
    opacity: 0.4;
    box-shadow: 0 0 10px currentColor;
    will-change: transform, opacity, filter;
}

@keyframes floatEnhanced {
    0%, 100% { 
        transform: translateY(0px) translateX(0px) rotate(0deg) scale(1); 
        opacity: 0.4; 
        filter: hue-rotate(0deg);
    }
    25% { 
        transform: translateY(-40px) translateX(20px) rotate(90deg) scale(1.2); 
        opacity: 0.8; 
        filter: hue-rotate(90deg);
    }
    50% { 
        transform: translateY(-20px) translateX(-15px) rotate(180deg) scale(0.8); 
        opacity: 1; 
        filter: hue-rotate(180deg);
    }
    75% { 
        transform: translateY(-50px) translateX(10px) rotate(270deg) scale(1.1); 
        opacity: 0.6; 
        filter: hue-rotate(270deg);
    }
}

/* CHARACTER GUIDE - Desktop Only */
.character-guide {
    position: fixed;
    width: 90px;
    height: 110px;
    z-index: 1500;
    pointer-events: auto;
    cursor: pointer;
    transition: var(--transition-smooth);
    animation: characterIdle 3s ease-in-out infinite;
    will-change: transform, left, top;
    display: block;
}

.character-guide.moving {
    animation: characterMove 2s ease-in-out infinite;
}

.character-guide.excited {
    animation: characterExcited 0.6s ease-in-out 3;
}

.character-guide.thinking {
    animation: characterThink 4s ease-in-out infinite;
}

.character {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
    contain: layout style;
}

.character-guide:hover .character {
    transform: scale(1.15);
}

.character-body {
    position: absolute;
    width: 45px;
    height: 55px;
    background: var(--accent-gradient);
    border-radius: 25px 25px 18px 18px;
    top: 28px;
    left: 22px;
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.4);
    animation: bodyBreathe 3s ease-in-out infinite;
    transition: var(--transition-smooth);
    will-change: background, animation;
}

.character-guide.excited .character-body {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53, #ff6b6b);
    animation: bodyExcited 0.4s ease-in-out infinite;
}

.character-head {
    position: absolute;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ffffff, #f8f8f8, #e0e0e0);
    border-radius: 50%;
    top: 5px;
    left: 25px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
    animation: headBob 2.5s ease-in-out infinite;
    transition: var(--transition-smooth);
    border: 2px solid rgba(0, 212, 255, 0.3);
    will-change: transform;
}

.character-eyes {
    position: absolute;
    top: 14px;
    left: 10px;
    width: 20px;
    height: 10px;
    contain: layout style;
}

.eye {
    position: absolute;
    width: 7px;
    height: 7px;
    background: #333;
    border-radius: 50%;
    animation: eyeBlink 5s infinite;
    transition: var(--transition-smooth);
    will-change: transform, height, background;
}

.eye.left { left: 2px; }
.eye.right { right: 2px; }

.character-guide:hover .eye {
    height: 4px;
    border-radius: 0 0 7px 7px;
    background: #000;
    animation: none;
}

.character-guide.thinking .eye {
    animation: eyesThinking 2s ease-in-out infinite;
}

.character-smile {
    position: absolute;
    top: 25px;
    left: 13px;
    width: 14px;
    height: 7px;
    border: 2px solid #333;
    border-top: none;
    border-radius: 0 0 14px 14px;
    animation: smileDefault 3s ease-in-out infinite;
    transition: var(--transition-smooth);
    will-change: width, height, left, border-color;
}

.character-guide:hover .character-smile {
    width: 18px;
    height: 9px;
    left: 11px;
    border-width: 3px;
    animation: smileHappy 0.5s ease-in-out infinite;
}

.character-guide.excited .character-smile {
    width: 20px;
    height: 12px;
    left: 10px;
    border-color: #ff6b6b;
    animation: smileExcited 0.3s ease-in-out infinite;
}

.character-arm {
    position: absolute;
    width: 18px;
    height: 5px;
    background: linear-gradient(90deg, #00d4ff, #0066ff);
    border-radius: 12px;
    top: 40px;
    transition: var(--transition-smooth);
    will-change: transform, background, animation;
}

.character-arm.left {
    left: 10px;
    transform-origin: right center;
    animation: armWaveLeft 3s ease-in-out infinite;
}

.character-arm.right {
    right: 10px;
    transform-origin: left center;
    animation: armWaveRight 3s ease-in-out infinite 0.5s;
}

.character-guide:hover .character-arm {
    animation: armCelebrate 0.6s ease-in-out infinite;
}

.character-guide.excited .character-arm {
    animation: armExcited 0.3s ease-in-out infinite;
    background: linear-gradient(90deg, #ff6b6b, #ff8e53);
}

.character-leg {
    position: absolute;
    width: 8px;
    height: 25px;
    background: linear-gradient(180deg, #00d4ff, #0066ff);
    border-radius: 4px;
    bottom: 2px;
    will-change: transform;
}

.character-leg.left {
    left: 30px;
    animation: legWalk 1.2s ease-in-out infinite;
}

.character-leg.right {
    right: 30px;
    animation: legWalk 1.2s ease-in-out infinite 0.6s;
}

.character-guide.moving .character-leg {
    animation-duration: 0.8s;
}

.speech-bubble {
    position: absolute;
    bottom: 120px;
    left: -80px;
    background: rgba(26, 26, 26, 0.95);
    color: var(--text-primary);
    padding: 15px 20px;
    border-radius: 25px;
    border: 2px solid var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(15px) scale(0.8);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
    backdrop-filter: blur(15px);
    max-width: 220px;
    white-space: normal;
    text-align: center;
    z-index: 1600;
    will-change: opacity, transform;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid var(--primary-color);
}

.speech-bubble.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.speech-bubble.excited {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    animation: bubbleExcited 0.5s ease-in-out infinite;
}

.speech-bubble.excited::after {
    border-top-color: #ff6b6b;
}

.speech-bubble.thinking {
    border-style: dashed;
    border-color: #ffd93d;
    background: rgba(255, 217, 61, 0.1);
    animation: bubbleThinking 2s ease-in-out infinite;
}

.speech-bubble.thinking::after {
    border-top-color: #ffd93d;
    border-top-style: solid;
}

/* CHARACTER ANIMATIONS */
@keyframes characterIdle {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(1deg); }
}

@keyframes characterMove {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-5px) rotate(-2deg); }
    75% { transform: translateY(-5px) rotate(2deg); }
}

@keyframes characterExcited {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-15px) scale(1.1); }
}

@keyframes characterThink {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-2px) rotate(-1deg); }
    75% { transform: translateY(-2px) rotate(1deg); }
}

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

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

@keyframes headBob {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(-1deg); }
}

@keyframes eyeBlink {
    0%, 85%, 100% { transform: scaleY(1); }
    90%, 95% { transform: scaleY(0.1); }
}

@keyframes eyesThinking {
    0%, 100% { transform: translateX(0px); }
    25% { transform: translateX(-1px); }
    75% { transform: translateX(1px); }
}

@keyframes smileDefault {
    0%, 100% { transform: scaleX(1); }
    50% { transform: scaleX(1.1); }
}

@keyframes smileHappy {
    0%, 100% { transform: scaleX(1) scaleY(1); }
    50% { transform: scaleX(1.2) scaleY(1.3); }
}

@keyframes smileExcited {
    0%, 100% { transform: scaleX(1); }
    50% { transform: scaleX(1.3); }
}

@keyframes armWaveLeft {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-20deg); }
    75% { transform: rotate(10deg); }
}

@keyframes armWaveRight {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-10deg); }
}

@keyframes armCelebrate {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-40deg); }
    75% { transform: rotate(40deg); }
}

@keyframes armExcited {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
}

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

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

@keyframes bubbleThinking {
    0%, 100% { border-color: #ffd93d; opacity: 1; }
    50% { border-color: #ffeb3b; opacity: 0.8; }
}

/* Animation keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes logoGlow {
    0% { text-shadow: 0 0 20px var(--glow-color); }
    100% { text-shadow: 0 0 40px var(--glow-color), 0 0 60px rgba(0, 212, 255, 0.3); }
}

@keyframes glow {
    from { text-shadow: 0 0 20px var(--glow-color); }
    to { text-shadow: 0 0 30px var(--glow-color), 0 0 40px var(--glow-color); }
}

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

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

/* MOBILE OPTIMIZATION - Hide Character on Small Screens */
@media (max-width: 1024px) {
    .nav-links {
        gap: 1.5rem;
    }
    
    .skills-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }
    
    /* Hide character guide on tablets and smaller */
    .character-guide {
        display: none !important;
    }
}

@media (max-width: 768px) {
    /* Completely hide character guide on mobile */
    .character-guide,
    .speech-bubble {
        display: none !important;
    }
    
    .hero-title { 
        font-size: clamp(2rem, 8vw, 3rem);
        animation: titleGlow 4s ease-in-out infinite alternate;
    }
    
    .hero-subtitle { 
        font-size: clamp(1rem, 4vw, 1.4rem); 
    }
    
    .about-image {
        width: 250px;
        height: 250px;
        font-size: 6rem;
    }
    
    .timeline-item { 
        width: 100%; 
        left: 0 !important; 
        margin-left: 0;
        padding: 1.5rem 2rem;
    }
    
    .timeline::after { 
        left: 20px; 
    }
    
    .timeline-item::after {
        left: -30px !important;
        right: auto !important;
    }
    
    /* Mobile Navigation */
    .nav-links { 
        display: none; 
    }
    
    .nav-container {
        justify-content: center;
    }
    
    .logo {
        font-size: 1.4rem;
    }
    
    .cta-buttons { 
        flex-direction: column; 
        align-items: center; 
        gap: 1rem;
    }
    
    .contact-links { 
        flex-direction: column; 
        align-items: center; 
        gap: 1rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 25px rgba(0, 212, 255, 0.4);
    }
    
    .section {
        padding: 4rem 0;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 1rem;
    }
    
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 1rem;
    }
    
    .hero {
        padding: 1rem;
    }
    
    .project-card {
        margin: 0 0.5rem;
    }
    
    .timeline-item {
        padding: 1rem 1.5rem;
    }
    
    .btn {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    .section-title {
        font-size: clamp(2rem, 6vw, 2.5rem);
    }
    
    .hero-description {
        font-size: clamp(0.9rem, 2vw, 1.1rem);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --primary-color: #00ffff;
        --card-bg: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .floating-particles {
        display: none;
    }
    
    .bg-animation {
        animation: none;
    }
}

/* Dark mode preference (already dark, but for consistency) */
@media (prefers-color-scheme: dark) {
    :root {
        --dark-bg: #000000;
        --card-bg: #111111;
    }
}

/* Print styles */
@media print {
    .character-guide,
    .floating-particles,
    .bg-animation,
    nav {
        display: none;
    }
    
    .section {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    .hero {
        height: auto;
        page-break-after: always;
    }
}

/* Performance optimizations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
    animation: pulse 1.5s infinite;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Selection styles */
::selection {
    background: rgba(0, 212, 255, 0.3);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(0, 212, 255, 0.3);
    color: var(--text-primary);
}

/* Focus management for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: var(--dark-bg);
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Enhanced button focus states */
button:focus-visible,
.btn:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.2);
}

/* Improved link states */
a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Error states */
.error {
    color: #ff6b6b;
    border-color: #ff6b6b;
}

.error:focus-visible {
    outline-color: #ff6b6b;
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.2);
}

/* Success states */
.success {
    color: #4ecdc4;
    border-color: #4ecdc4;
}

.success:focus-visible {
    outline-color: #4ecdc4;
    box-shadow: 0 0 0 4px rgba(78, 205, 196, 0.2);
}
