:root {
    --color-bg: #fafaf9;
    --color-text: #1c1917;
    --color-text-secondary: #57534e;
    --color-accent: #0369a1;
    --color-accent-hover: #0284c7;
    --color-border: #e7e5e4;
    --color-highlight: #fef3c7;
    --font-serif: 'Source Serif 4', Georgia, serif;
    --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --max-width: 960px;
}

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

html {
    font-size: 17px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-serif);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    padding: 0 1.5rem;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(250, 250, 249, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
    padding: 0 1.5rem;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.nav-name {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text);
    text-decoration: none;
}

.nav-name:hover {
    color: var(--color-accent);
}

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-links a {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-links a:hover {
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.05);
}

.nav-links a.active {
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.05);
}

.nav-links a.cv-link {
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
    margin-left: 0.5rem;
}

.nav-links a.cv-link:hover {
    background: var(--color-accent);
    color: white;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 5rem 0 6rem;
    padding-top: 80px;
}

/* Header */
header {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 2.5rem;
    align-items: start;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.profile-image {
    width: 140px;
    height: 140px;
    border-radius: 8px;
    object-fit: cover;
}

.profile-placeholder {
    width: 140px;
    height: 140px;
    border-radius: 8px;
    background: linear-gradient(135deg, #d6d3d1 0%, #a8a29e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 2.5rem;
    font-weight: 600;
    color: #78716c;
}

.header-content h1 {
    font-family: var(--font-sans);
    font-size: 1.85rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.header-content .tagline {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
}

.social-links a:hover {
    background: var(--color-text);
    border-color: var(--color-text);
}

.social-links a:hover svg {
    stroke: var(--color-bg);
}

.social-links svg {
    width: 18px;
    height: 18px;
    stroke: var(--color-text-secondary);
    transition: stroke 0.2s ease;
}

/* Research Statement */
.research-statement {
    margin-bottom: 3rem;
}

.research-statement p {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
}

.research-statement strong {
    color: var(--color-text);
    font-weight: 400;
}

/* Section styles */
section {
    margin-bottom: 3rem;
}

h2 {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-secondary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

/* Education */
.education-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.education-item .degree {
    font-weight: 600;
}

.education-item .institution {
    color: var(--color-text-secondary);
}

.education-item .year {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.education-detail {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-left: 1rem;
    margin-bottom: 1rem;
}

/* Publications */
.publication {
    margin-bottom: 1.25rem;
    padding-left: 1rem;
    border-left: 2px solid var(--color-border);
    transition: border-color 0.2s ease;
}

.publication:hover {
    border-left-color: var(--color-accent);
}

.publication-title {
    font-weight: 400;
    margin-bottom: 0.25rem;
}

.publication-title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.publication-title a:hover {
    color: var(--color-accent);
}

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

.publication-authors .me {
    font-weight: 500;
    color: var(--color-text);
}

.publication-venue {
    font-family: var(--font-sans);
    font-size: 0.85rem;
}

.publication-venue .venue-name {
    font-weight: 500;
    color: var(--color-accent);
}

.publication-venue .venue-note {
    color: var(--color-text-secondary);
    font-style: italic;
}

/* Projects */
.project {
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.project:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: #d6d3d1;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.project-title {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 600;
}

.project-date {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.project-advisors {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.75rem;
}

.project-description {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

.project-highlight {
    font-weight: 500;
    color: var(--color-text);
}

/* Awards */
.award {
    margin-bottom: 1rem;
}

.award-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.award-name {
    font-weight: 600;
}

.award-year {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.award-description {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}

/* Footer */
footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
    html {
        font-size: 16px;
    }

    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 0.75rem 0;
        gap: 0.5rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }

    .nav-links a {
        font-size: 0.85rem;
        padding: 0.4rem 0.7rem;
    }

    .container {
        padding-top: 110px;
    }

    header {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .profile-image, .profile-placeholder {
        margin: 0 auto;
    }

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

    .education-item {
        flex-direction: column;
        gap: 0.25rem;
    }

    .project-header {
        flex-direction: column;
        gap: 0.25rem;
    }

    .award-header {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Subtle animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.container > * {
    animation: fadeIn 0.5s ease forwards;
}

.container > *:nth-child(1) { animation-delay: 0s; }
.container > *:nth-child(2) { animation-delay: 0.05s; }
.container > *:nth-child(3) { animation-delay: 0.1s; }
.container > *:nth-child(4) { animation-delay: 0.15s; }
.container > *:nth-child(5) { animation-delay: 0.2s; }
.container > *:nth-child(6) { animation-delay: 0.25s; }
.container > *:nth-child(7) { animation-delay: 0.3s; }

/* Recent posts on homepage */
.recent-posts-list {
    list-style: none;
}

.recent-posts-list li {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.recent-posts-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.recent-post-title {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1rem;
}

.recent-post-title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.recent-post-title a:hover {
    color: var(--color-accent);
}

.recent-post-date {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.recent-post-excerpt {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}

.view-all-posts {
    display: inline-block;
    margin-top: 1rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

.view-all-posts:hover {
    text-decoration: underline;
}
