:root {
    --bg: #fafafa;
    --card: #fff;
    --text: #2d3748;
    --text-muted: #64748b;
    --accent: #1e40af;
    --accent-hover: #1e3a8a;
    --border: #e2e8f0;
    --shadow: rgba(0,0,0,0.06);
    --font-heading: 'Lora', Georgia, serif;
    --font-body: 'Lato', -apple-system, sans-serif;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --card: #1e293b;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --border: #334155;
    --shadow: rgba(0,0,0,0.3);
}

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

html { scroll-behavior: smooth; }

body {
    font: 400 1rem/1.7 var(--font-body);
    background: var(--bg);
    color: var(--text);
    transition: background .3s, color .3s;
}

.container { max-width: 880px; margin: 0 auto; padding: 0 1.5rem; }

h1, h2, h3 { font-family: var(--font-heading); font-weight: 600; color: var(--text); }

h2 {
    font-size: 1.875rem;
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    padding-bottom: .5rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: var(--accent);
}

section { padding: 5rem 0; }

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-hover); }

/* Header */
header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background .3s, border-color .3s;
}

header nav { display: flex; justify-content: space-between; align-items: center; height: 64px; }

.logo { font: 600 1.25rem var(--font-heading); color: var(--text); }

.nav-links { display: flex; gap: 1.25rem; align-items: center; }

.nav-links a {
    font-size: .9rem;
    color: var(--text-muted);
    padding: .25rem 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width .2s;
}

.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { width: 100%; }

.hamburger-icon {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: .5rem;
}

.hamburger-icon span { display: block; width: 22px; height: 2px; background: var(--text); transition: .2s; }

.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: .4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

.theme-toggle-btn:hover { background: var(--border); }
.theme-toggle-btn .moon-icon { display: none; }
.theme-toggle-btn .sun-icon { display: block; }
[data-theme="dark"] .theme-toggle-btn .moon-icon { display: block; }
[data-theme="dark"] .theme-toggle-btn .sun-icon { display: none; }

/* Profile */
#profile {
    display: flex;
    align-items: center;
    gap: 3rem;
    min-height: calc(100vh - 64px);
}

.profile-text .name-title { font-size: 2.75rem; line-height: 1.15; margin-bottom: .5rem; }
.profile-text .subtitle { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.profile-text .bio { max-width: 480px; margin-bottom: 1.5rem; line-height: 1.8; }

.profile-pic-container { flex-shrink: 0; }

.profile-pic {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--card);
    box-shadow: 0 8px 30px var(--shadow);
    transition: transform .3s;
}

.profile-pic:hover { transform: scale(1.02); }

.cta-buttons { display: flex; gap: .75rem; flex-wrap: wrap; }

.btn {
    padding: .6rem 1.25rem;
    border-radius: 5px;
    font-weight: 600;
    font-size: .9rem;
    text-align: center;
    transition: all .2s;
    border: 1px solid transparent;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }

.btn-secondary { background: var(--card); color: var(--accent); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); transform: translateY(-1px); }

/* About */
#about .about-content { max-width: 700px; margin: 0 auto; text-align: center; font-size: 1.05rem; }

/* Research Interests */
.interests-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .6rem;
    list-style: none;
    max-width: 700px;
    margin: 0 auto;
}

.interests-list li {
    background: var(--card);
    padding: .4rem 1rem;
    border-radius: 2rem;
    border: 1px solid var(--border);
    font-size: .9rem;
    transition: border-color .2s, transform .2s;
}

.interests-list li:hover { border-color: var(--accent); transform: translateY(-2px); }

/* Cards */
.project-item, .publication-item, .experience-item {
    background: var(--card);
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    transition: transform .2s, box-shadow .2s, background .3s, border-color .3s;
}

.project-item:hover, .publication-item:hover, .experience-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--shadow);
}

.project-item h3 { font-size: 1.25rem; }
.project-tech { font-size: .85rem; color: var(--text-muted); margin: .4rem 0 .75rem; }
.project-links { margin-top: .75rem; font-weight: 600; font-size: .9rem; }

.publication-item a { font: 600 1.1rem var(--font-heading); display: block; margin-bottom: .25rem; }
.publication-meta { font-size: .8rem; color: var(--text-muted); margin-bottom: .25rem; }

.experience-item h3 { font-size: 1.1rem; margin-bottom: .2rem; }
.experience-item p { margin: 0; color: var(--text-muted); font-size: .95rem; }

.view-more-container { text-align: center; margin-top: 1.5rem; }

/* Contact */
#contact { text-align: center; }
#contact p { max-width: 560px; margin: 0 auto 1.5rem; }

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: .85rem;
    transition: border-color .3s;
}

/* Animations */
.hidden { opacity: 0; transform: translateY(15px); transition: opacity .5s, transform .5s; }
.show { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 1024px) {
    .profile-pic { width: 200px; height: 200px; }
    #profile { gap: 2rem; }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--card);
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        gap: .75rem;
    }

    .nav-links.open { display: flex; }
    .nav-links a { padding: .5rem 0; }
    .theme-toggle-btn { margin-top: .5rem; }
    .hamburger-icon { display: flex; }

    #profile {
        flex-direction: column-reverse;
        text-align: center;
        padding: 2.5rem 0;
        min-height: auto;
    }

    .profile-text .bio { margin: 0 auto 1.5rem; }
    .cta-buttons { justify-content: center; }
    .profile-pic { width: 180px; height: 180px; }
    h2 { font-size: 1.5rem; }
    .profile-text .name-title { font-size: 2rem; }
    section { padding: 3.5rem 0; }
}

@media (max-width: 480px) {
    .container { padding: 0 1rem; }
    .profile-pic { width: 150px; height: 150px; }
    .profile-text .name-title { font-size: 1.75rem; }
    .btn { padding: .5rem 1rem; font-size: .85rem; }
    .project-item, .publication-item, .experience-item { padding: 1.25rem; }
}