/* CSS Variables */
:root {
    --color-primary: #1a365d;
    --color-primary-light: #2c5282;
    --color-accent: #3182ce;
    --color-text: #2d3748;
    --color-text-light: #4a5568;
    --color-text-muted: #718096;
    --color-bg: #ffffff;
    --color-bg-alt: #f7fafc;
    --color-border: #e2e8f0;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Source Serif 4', Georgia, serif;
    --max-width: 1200px;
    --nav-height: 70px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-primary);
    margin-top: 0;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

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

a:hover {
    color: var(--color-primary);
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

img {
    max-width: 100%;
    height: auto;
}

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

.navbar.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary);
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2rem;
}

.nav-menu a {
    color: var(--color-text);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

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

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

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    min-width: 180px;
    padding: 0.5rem 0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    list-style: none;
    margin: 0;
    z-index: 1000;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.nav-dropdown-menu li {
    margin: 0;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    color: var(--color-text);
    white-space: nowrap;
}

.nav-dropdown-menu a::after {
    display: none;
}

.nav-dropdown-menu a:hover {
    background: var(--color-bg-alt);
    color: var(--color-accent);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: all 0.3s;
}

/* Hero Section */
.hero {
    padding: calc(var(--nav-height) + 4rem) 0 4rem;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.hero-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4rem;
    align-items: center;
}

.hero-text h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--color-text-light);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.hero-affiliation {
    color: var(--color-accent);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--color-text-light);
    max-width: 600px;
    margin-bottom: 2rem;
}

.hero-description strong {
    color: var(--color-primary);
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    transition: all 0.2s;
}

.link-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.link-btn svg {
    flex-shrink: 0;
}

.hero-image {
    display: flex;
    justify-content: center;
}

.profile-photo {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 35%;
    border: 4px solid white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.profile-placeholder {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 600;
}

/* Sections */
.section {
    padding: 5rem 0;
}

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

.section-intro {
    font-size: 1.1rem;
    color: var(--color-text-light);
    margin-bottom: 2rem;
}

.subsection-title {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

/* About Section */
.about-content {
    font-size: 1.05rem;
    max-width: 800px;
}

.about-content p {
    margin-bottom: 1.25rem;
}

.cv-download {
    margin-top: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--color-primary-light);
    color: white;
}

/* Research Areas */
.research-areas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.research-card {
    background: var(--color-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.research-card h3 {
    margin-bottom: 0.75rem;
    color: var(--color-primary);
}

.research-card p {
    color: var(--color-text-light);
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Projects */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.project {
    background: var(--color-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.project h4 {
    margin-bottom: 0.5rem;
}

.project h4 a {
    color: var(--color-primary);
}

.project h4 a:hover {
    color: var(--color-accent);
}

.project-meta {
    font-size: 0.85rem;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
}

.project p:last-child {
    margin-bottom: 0;
    color: var(--color-text-light);
}

/* Publications */
.publications-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.publication {
    padding: 1.25rem;
    background: var(--color-bg);
    border-radius: 8px;
    border-left: 3px solid var(--color-accent);
}

.section:not(.section-alt) .publication {
    background: var(--color-bg-alt);
}

.publication h4 {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.pub-authors {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 0.25rem;
}

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

.pub-link {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Software Section */
.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.software-card {
    background: var(--color-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.software-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.software-header h3 {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1.1rem;
}

.software-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--color-accent);
    color: white;
    border-radius: 4px;
    font-weight: 500;
}

.software-card p {
    color: var(--color-text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.software-links {
    display: flex;
    gap: 1rem;
}

.software-links a {
    font-size: 0.9rem;
    font-weight: 500;
}

.collab {
    font-size: 0.85rem !important;
    color: var(--color-text-muted) !important;
    font-style: italic;
}

/* Data Products */
.data-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.data-item {
    background: var(--color-bg);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.data-item h4 {
    margin-bottom: 0.5rem;
    font-family: var(--font-sans);
}

.data-item p {
    margin-bottom: 0.5rem;
    color: var(--color-text-light);
    font-size: 0.95rem;
}

.data-item p:last-child {
    margin-bottom: 0;
}

/* Teaching Section */
.courses-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.course {
    padding: 1rem;
    background: var(--color-bg-alt);
    border-radius: 6px;
}

.section:not(.section-alt) .course {
    background: var(--color-bg-alt);
}

.section-alt .course {
    background: var(--color-bg);
}

.course h4 {
    margin-bottom: 0.5rem;
    font-family: var(--font-sans);
    font-size: 1rem;
}

.course p {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info h3,
.contact-social h3 {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.contact-info p {
    margin-bottom: 1.5rem;
}

.profile-links,
.social-links {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
}

.profile-links li,
.social-links li {
    margin-bottom: 0.5rem;
}

/* Footer */
.footer {
    padding: 2rem 0;
    background: var(--color-primary);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

.footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }

    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        gap: 0;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-menu li {
        border-bottom: 1px solid var(--color-border);
    }

    .nav-menu a {
        display: block;
        padding: 1rem;
    }

    .nav-toggle {
        display: flex;
    }

    /* Mobile dropdown */
    .nav-dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        background: var(--color-bg-alt);
        border-radius: 0;
        opacity: 1;
        visibility: visible;
        padding: 0;
        display: none;
    }

    .nav-dropdown.active .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown-menu a {
        padding-left: 2rem;
    }

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

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

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

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

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

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-links {
        justify-content: center;
    }

    .hero-image {
        order: -1;
    }

    .profile-photo {
        width: 180px;
        height: 180px;
    }

    .profile-placeholder {
        width: 150px;
        height: 150px;
        font-size: 2.5rem;
    }

    .section {
        padding: 3rem 0;
    }

    .research-areas,
    .software-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

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

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .link-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}
