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

:root {
    --primary-color: #1e3a8a;
    --secondary-color: #3b82f6;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-light: #6b7280;
    --background-primary: #ffffff;
    --background-secondary: #f8fafc;
    --background-accent: #f1f5f9;
    --border-color: #e2e8f0;
    --placeholder-color: #cbd5e1;
    --nav-height: 60px;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

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(--background-primary);
}

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

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

section {
    scroll-margin-top: var(--nav-height);
}

/* Typography */
h1, h2, h3, h4 {
    line-height: 1.3;
    color: var(--text-primary);
    text-wrap: balance;
}

/* Avoid a lone word on the last line of paragraphs and list items */
p, li {
    text-wrap: pretty;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Shared outlined link button (intro links, CV) */
.link-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-primary);
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

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

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 960px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.nav-menu {
    display: flex;
    gap: 1.75rem;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Intro */
.intro {
    padding: 3.5rem 0 3rem;
}

.intro-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 3rem;
    align-items: start;
}

.intro-name {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.intro-role {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 1.25rem;
}

.intro-bio {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.intro-interests {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.intro-interests strong {
    color: var(--text-primary);
}

.intro-seeking {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    background: rgba(30, 58, 138, 0.06);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9375rem;
}

.intro-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.profile-photo {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

/* Sections below the intro */
.news,
.research,
.experience {
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
}

/* News Section: bulleted list with a [Mon YYYY] prefix, as on most researcher homepages */
.news-list {
    padding-left: 1.25rem;
}

.news-list li {
    padding: 0.2rem 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.news-list li::marker {
    color: var(--text-light);
}

.news-date {
    color: var(--text-primary);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.news-list a {
    text-decoration: none;
}

.news-list a:hover {
    text-decoration: underline;
}

/* Research entries: image on the left (about 28%), text on the right */
.research-item {
    display: grid;
    grid-template-columns: 28% minmax(0, 1fr);
    gap: 2rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
}

.research-item {
    scroll-margin-top: calc(var(--nav-height) + 1rem);
}

.research-item:first-child {
    border-top: none;
    padding-top: 0;
}

/* Visual slot: holds a linked <img>, a <video>, or .media-placeholder */
.research-media > a {
    display: block;
}

.research-media img,
.research-media video {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-primary);
}

.media-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    aspect-ratio: 16 / 10;
    padding: 1rem;
    border: 2px dashed var(--placeholder-color);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 0.8125rem;
    text-align: center;
}

.media-placeholder i {
    font-size: 1.5rem;
    color: #94a3b8;
}

/* Very wide figures span the full width above the text */
.research-item.media-wide,
.research-item.no-media {
    grid-template-columns: minmax(0, 1fr);
}

.research-item.media-wide {
    gap: 1.25rem;
}

.research-content h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

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

.research-authors strong {
    color: var(--text-primary);
}

.equal-contrib {
    color: var(--text-light);
    font-size: 0.8125rem;
}

.research-venue {
    color: var(--primary-color);
    font-size: 0.9375rem;
    font-weight: 600;
    font-style: italic;
    margin-bottom: 0.75rem;
}

.research-description {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 0.75rem;
}

.research-highlights {
    list-style: none;
    margin-bottom: 0.75rem;
}

.research-highlights li {
    position: relative;
    padding: 0.2rem 0 0.2rem 1.4rem;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.research-highlights li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.research-highlights strong {
    color: var(--text-primary);
}

.research-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
}

.tech-tag {
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--background-secondary);
    color: var(--text-secondary);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.research-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.research-link {
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--primary-color);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

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

/* Fields still waiting for information */
.research-venue.is-placeholder,
.research-authors.is-placeholder,
.research-link.is-placeholder {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border: 1px dashed var(--placeholder-color);
    border-radius: 8px;
    color: var(--text-light);
    font-style: italic;
    font-weight: 500;
}

/* Experience & Education Section */
.experience-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem;
    margin-bottom: 1.75rem;
}

.timeline h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.0625rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.timeline h3 i {
    color: var(--primary-color);
}

.timeline-item {
    padding-left: 1rem;
    margin-bottom: 1.25rem;
    border-left: 2px solid var(--border-color);
}

.timeline-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    column-gap: 1rem;
}

.timeline-head h4 {
    font-size: 0.9875rem;
    font-weight: 600;
}

.timeline-date {
    color: var(--text-light);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.timeline-org {
    color: var(--primary-color);
    font-size: 0.9375rem;
    font-weight: 500;
}

.timeline-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Footer */
.footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.875rem;
    text-align: center;
}

.footer a {
    color: inherit;
}

/* Responsive Design */
@media (max-width: 768px) {
    .intro {
        padding-top: 2.5rem;
    }

    .intro-content {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }

    .intro-photo {
        order: -1;
    }

    .profile-photo {
        width: 140px;
    }

    .intro-name {
        font-size: 2rem;
    }

    .research-item {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    .experience-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 560px) {
    .nav-logo {
        display: none;
    }

    .nav-container {
        justify-content: center;
    }

    .nav-menu {
        gap: 1.25rem;
    }

    .container,
    .nav-container {
        padding: 0 16px;
    }
}
