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

/* Performance optimizations */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding-top: 80px; /* Add padding to account for sticky navigation */
    font-display: swap; /* Improve font loading performance */
}

/* Preload critical images */
.profile-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 5px solid white;
    margin: 0 auto 30px;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

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

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.hero-content h1 {
    font-size: 3.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 1.5em;
    margin-bottom: 30px;
    opacity: 0.9;
}

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

.social-links a {
    color: white;
    font-size: 2em;
    transition: transform 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-5px);
}

/* Hamburger Navigation Styles */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(102, 126, 234, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 15px 0;
    border-bottom: 2px solid rgba(240, 240, 240, 0.3);
    transition: all 0.3s ease;
    /* Ensure it's always visible */
    transform: translateY(0);
    opacity: 1;
}

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

.nav-brand {
    color: white;
    font-weight: 600;
    font-size: 1.2em;
    letter-spacing: 0.5px;
    z-index: 1002;
}

.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 30px;
    height: 22px;
    position: relative;
    z-index: 1002;
}

.hamburger:focus {
    outline: 2px solid rgba(255,255,255,0.5);
    outline-offset: 2px;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: white;
    transition: all 0.3s ease;
    transform-origin: center;
    border-radius: 2px;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    list-style: none;
    padding: 80px 0 50px 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    transition: right 0.3s ease-in-out;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 1001;
}

.nav-menu.active {
    right: 0;
}

.nav-menu li {
    width: 80%;
    text-align: center;
}

.nav-menu li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1em;
    padding: 15px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
}

.nav-menu li a:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.nav-menu li a i {
    font-size: 1.2em;
}

/* Mobile overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Body scroll lock when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .nav-menu {
        width: 280px;
    }
    
    .nav-menu li a {
        font-size: 1em;
        padding: 12px 18px;
    }
    
    .nav-brand {
        font-size: 1.1em;
    }
}

/* Back to Top Button Base Styles */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-decoration: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

/* Back to Top Button Styles */
#backToTop.visible {
    opacity: 1;
    visibility: visible;
}

#backToTop:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

@media (max-width: 768px) {
    #backToTop {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.1em;
    }
    
    .hero-content h1 {
        font-size: 2.5em;
    }

    .hero-content p {
        font-size: 1.2em;
    }

    .section {
        margin: 20px 0;
        padding: 40px 0;
    }

    .section-title {
        font-size: 2em;
    }

    .social-links {
        flex-wrap: wrap;
    }
}

.section {
    background: white;
    margin: 40px 0;
    padding: 60px 0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.section-title {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 50px;
    color: #333;
    position: relative;
}

.section-title::after {
    content: '';
    width: 100px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.work-experience {
    display: grid;
    gap: 30px;
}

.job {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    border-left: 5px solid #667eea;
    transition: transform 0.3s ease;
}

.job:hover {
    transform: translateY(-5px);
}

.job-title {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 10px;
}

.company {
    font-size: 1.2em;
    color: #667eea;
    margin-bottom: 10px;
}

.job-duration {
    color: #666;
    margin-bottom: 15px;
}

.job-description {
    color: #555;
}

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

.skill-category {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.skill-category h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.skill-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
}

.talks-grid {
    display: grid;
    gap: 25px;
}

.talk {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border-left: 5px solid #764ba2;
}

.talk-title {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 10px;
}

.conference {
    color: #764ba2;
    font-weight: bold;
    margin-bottom: 5px;
}

.talk-date {
    color: #666;
    font-size: 0.9em;
}

footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 40px 0;
    margin-top: 60px;
}

/* Animation for expanding talks section */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
