/* Root Variables */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-colored: 0 10px 15px -3px rgb(99 102 241 / 0.1), 0 4px 6px -4px rgb(99 102 241 / 0.1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

/* Smooth scroll behavior with offset for fixed navbar */
html {
    scroll-padding-top: 80px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    box-shadow: var(--shadow-lg);
}

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

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
    display: block;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

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

/* Hero Section */
.hero {
    margin-top: 70px;
    padding: 2rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 50%, #faf5ff 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.4rem;
}

.hero-affiliation {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.education {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 3px solid var(--primary-light);
}

.education p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.hero-photo {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--bg-primary);
    box-shadow: var(--shadow-colored);
    transition: transform 0.3s ease;
}

.hero-photo:hover {
    transform: scale(1.05);
}

.hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Sections */
.section {
    padding: 2.5rem 2rem;
}

.section-white {
    background-color: var(--bg-primary);
}

.section-gray {
    background-color: var(--bg-secondary);
}

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

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-color) 100%);
    margin: 0 auto 1.5rem;
    border-radius: 2px;
}

/* Research Interests */
.research-content {
    max-width: 800px;
    margin: 0 auto;
}

.lead {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
    text-align: center;
}

/* Publications */
.publications-list {
    max-width: 850px;
    margin: 0 auto;
}

.publication {
    background-color: var(--bg-primary);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 0.75rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.section-gray .publication {
    background-color: var(--bg-primary);
}

.publication:hover {
    box-shadow: var(--shadow-lg);
    transform: translateX(4px);
    border-left-color: var(--secondary-color);
}

.publication h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.publication .authors {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.publication .authors strong {
    color: var(--primary-color);
    font-weight: 600;
}

.publication .venue {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.pub-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pub-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 850px;
    margin: 0 auto;
}

.project-card {
    background-color: var(--bg-primary);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.project-card:hover {
    box-shadow: var(--shadow-colored);
    transform: translateY(-8px);
    border-color: var(--primary-light);
}

.project-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.project-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.project-card a:not(.btn) {
    color: var(--primary-color);
    text-decoration: none;
}

.project-card a:not(.btn):hover {
    text-decoration: underline;
}

/* CV Section */
.cv-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.cv-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Contact Section */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.contact-email {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.contact-email:hover {
    color: var(--primary-hover);
    transform: scale(1.05);
}

.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.social-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.social-link:hover {
    color: var(--primary-color);
    background-color: var(--bg-secondary);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--secondary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-colored);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--text-primary) 0%, #0f172a 100%);
    color: rgba(255, 255, 255, 0.7);
    padding: 2rem;
    text-align: center;
}

.footer-content p {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow-colored);
}

.scroll-to-top:hover {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: var(--shadow-xl);
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar .container {
        padding: 1rem 1.5rem;
    }

    .nav-brand {
        font-size: 1.1rem;
    }

    .nav-toggle {
        display: flex;
        z-index: 1001;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 0;
        box-shadow: var(--shadow-lg);
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease-in-out, opacity 0.2s ease-in-out, visibility 0s linear 0.25s;
        opacity: 0;
        visibility: hidden;
    }

    .nav-links.active {
        max-height: 500px;
        padding: 1.5rem 2rem;
        opacity: 1;
        visibility: visible;
        transition: max-height 0.25s ease-in-out, opacity 0.2s ease-in-out, visibility 0s linear 0s;
    }

    .nav-links li {
        margin: 0.5rem 0;
    }

    .nav-links a {
        display: block;
        padding: 0.75rem 0;
        font-size: 1rem;
    }

    .nav-links a::after {
        display: none;
    }

    .hero {
        margin-top: 70px;
        padding: 1.5rem 1.5rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.25rem;
    }

    .hero-photo {
        margin: 0 auto;
        width: 200px;
        height: 200px;
    }

    .hero-text h1 {
        font-size: 1.75rem;
    }

    .education {
        border-left: none;
        border-top: 3px solid var(--primary-light);
        padding-left: 0;
        padding-top: 0.75rem;
    }

    .section {
        padding: 2rem 1.5rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

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

    .publication {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 1.75rem;
    }

    .hero-title {
        font-size: 1.1rem;
    }

    .hero-photo {
        width: 200px;
        height: 200px;
    }

    .section-title {
        font-size: 1.5rem;
    }
}
