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

:root {
    --bg: #ffffff;
    --bg-alt: #f8f9fa;
    --text: #303030;
    --text-light: #828282;
    --accent: #0076df;
    --accent-hover: #005bb5;
    --border: #dee2e6;
    --z1: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.12), 0 1px 5px 0 rgba(0,0,0,.2);
    --z2: 0 4px 5px 0 rgba(0,0,0,.14), 0 1px 10px 0 rgba(0,0,0,.12), 0 2px 4px -1px rgba(0,0,0,.2);
    --radius: 0.25rem;
    --max-width: 900px;
}

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.8;
    font-size: 16px;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; }
strong, b { font-weight: 500; }

h1, h2, h3 { font-family: 'Roboto Slab', serif; font-weight: 400; color: var(--text); }

/* ── Navigation ── */
nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid transparent;
    padding: 0 24px;
    transition: border-color 0.3s, box-shadow 0.3s;
}
nav.scrolled { border-bottom-color: var(--border); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.nav-inner {
    max-width: var(--max-width); margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; height: 56px;
}
.nav-name {
    font-family: 'Roboto Slab', serif; font-weight: 700; font-size: 1.05rem; color: var(--text);
}
.nav-links { display: flex; gap: 24px; list-style: none; }
.nav-links a {
    color: var(--text-light); font-size: 0.88rem; font-weight: 400;
    padding: 4px 0; text-decoration: none; transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); text-decoration: none; }

/* ── Layout ── */
main { padding-top: 56px; }
section { padding: 24px 24px; }
.container { max-width: var(--max-width); margin: 0 auto; }

.section-heading {
    font-family: 'Roboto Slab', serif; font-size: 1.6rem; font-weight: 400;
    margin-bottom: 20px; color: var(--text);
}
.section-heading a { color: inherit; text-decoration: none; }
.section-heading a:hover { color: var(--accent); text-decoration: none; }

/* ── About ── */
#about { padding-top: 22px; padding-bottom: 10px; }
.about-grid {
    display: grid; grid-template-columns: 1fr 200px; gap: 40px; align-items: start;
}
.profile-photo {
    width: 170px; border-radius: var(--radius);
    box-shadow: var(--z1); transition: transform 0.4s ease;
}
.profile-photo:hover { transform: scale(1.03); }
.about-text h1 {
    font-family: 'Roboto Slab', serif; font-size: 2rem; font-weight: 300; margin-bottom: 2px;
}
.about-text h1 strong { font-weight: 700; }
.about-subtitle { font-size: 0.95rem; color: var(--text-light); margin-bottom: 16px; font-style: italic; }
.about-bio { margin-bottom: 14px; font-size: 0.95rem; }
.about-interests { font-size: 0.88rem; color: var(--text-light); margin-bottom: 20px; }
.about-interests strong { color: var(--text); font-weight: 500; }

.social-links { display: flex; gap: 12px; flex-wrap: wrap; }
.social-links a {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-light); font-size: 0.82rem; font-weight: 400;
    padding: 6px 14px; border-radius: var(--radius); border: 1px solid var(--border);
    transition: all 0.25s ease; text-decoration: none;
}
.social-links a:hover {
    color: var(--accent); border-color: var(--accent);
    box-shadow: var(--z1); transform: translateY(-2px); text-decoration: none;
}
.social-links svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── News ── */
#news { background: var(--bg-alt); padding-top: 24px; padding-bottom: 24px; }
.news-list { list-style: none; }
.news-item {
    display: grid; grid-template-columns: 90px 1fr; gap: 16px;
    padding: 8px 0; font-size: 0.9rem;
}
.news-date { font-weight: 500; color: var(--accent); font-size: 0.82rem; white-space: nowrap; }

/* ── Publications ── */
.pub-card {
    padding: 16px; margin-bottom: 14px;
    background: var(--bg); border-radius: var(--radius);
    box-shadow: var(--z1);
    transition: box-shadow 0.35s ease, transform 0.35s ease;
}
.pub-card:hover { box-shadow: var(--z2); transform: translateY(-3px); }

.pub-header { margin-bottom: 12px; }
.pub-title {
    font-family: 'Roboto Slab', serif; font-size: 1.05rem; font-weight: 400;
    margin-bottom: 4px; line-height: 1.45;
}
.pub-authors { font-size: 0.85rem; color: var(--text-light); margin-bottom: 4px; }
.pub-authors .me { color: var(--text); font-weight: 500; }
.pub-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pub-venue { font-size: 0.82rem; font-weight: 400; }
.pub-venue.published { color: var(--accent); font-style: italic; }
.pub-venue.preprint { color: #c9302c; font-style: italic; }

.pub-links { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-sm {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 12px; font-size: 0.78rem; font-weight: 400;
    border-radius: var(--radius); border: 1px solid var(--border);
    background: var(--bg); color: var(--text-light);
    cursor: pointer; font-family: 'Roboto', sans-serif; transition: all 0.25s ease; text-decoration: none;
}
.btn-sm:hover {
    color: var(--accent); border-color: var(--accent);
    transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,.1); text-decoration: none;
}
.btn-sm svg { width: 14px; height: 14px; }

.pub-gallery { margin-top: 12px; }
.pub-gallery-row {
    display: flex; gap: 10px;
}
.pub-gallery-item {
    flex: 1 1 0; min-width: 0;
    height: 155px;
    display: flex; flex-direction: column;
    border-radius: var(--radius); overflow: hidden;
    background: #fff; border: 1px solid var(--border);
    cursor: pointer;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.pub-gallery-item:hover { box-shadow: var(--z1); transform: translateY(-2px); }
.pub-gallery-item img {
    flex: 1; min-height: 0;
    object-fit: contain;
    padding: 6px;
    transition: transform 0.4s ease;
}
.pub-gallery-item:hover img { transform: scale(1.04); }
.pub-gallery-label {
    flex-shrink: 0;
    font-size: 0.62rem; font-weight: 500; color: var(--text-light);
    text-transform: uppercase; letter-spacing: 0.06em;
    padding: 1px 6px 4px; text-align: center; line-height: 1.3;
}

/* ── Teaching ── */
#teaching { background: var(--bg-alt); }
.teaching-item { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.teaching-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.teaching-item h3 { font-size: 0.95rem; margin-bottom: 2px; }
.teaching-meta { font-size: 0.85rem; color: var(--text-light); }

/* ── Honors & Service ── */
.hs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.hs-subtitle { font-family: 'Roboto Slab', serif; font-size: 1.1rem; font-weight: 400; margin-bottom: 16px; }
.hs-list { list-style: none; }
.hs-list li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; line-height: 1.5; }
.hs-list li:last-child { border-bottom: none; }
.hs-year { font-size: 0.78rem; color: var(--text-light); display: block; }

/* ── Footer ── */
footer {
    text-align: center; padding: 20px 24px;
    border-top: 1px solid var(--border); color: var(--text-light); font-size: 0.82rem;
}
footer a { text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Lightbox ── */
#lightbox {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.92); z-index: 1000; cursor: zoom-out;
    align-items: center; justify-content: center; padding: 32px;
    opacity: 0; transition: opacity 0.3s ease;
}
#lightbox.show { display: flex; opacity: 1; }
#lightbox img {
    max-width: 100%; max-height: 100%; border-radius: var(--radius);
    box-shadow: 0 12px 48px rgba(0,0,0,.5);
    transform: scale(0.95); transition: transform 0.3s ease;
}
#lightbox.show img { transform: scale(1); }

/* ── Scroll Animations ── */
[data-animate] {
    opacity: 0; transform: translateY(28px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
[data-animate].visible { opacity: 1; transform: translateY(0); }
[data-animate]:nth-child(2) { transition-delay: 0.08s; }
[data-animate]:nth-child(3) { transition-delay: 0.16s; }
[data-animate]:nth-child(4) { transition-delay: 0.24s; }
[data-animate]:nth-child(5) { transition-delay: 0.32s; }
[data-animate]:nth-child(6) { transition-delay: 0.40s; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .about-grid { grid-template-columns: 1fr; text-align: center; }
    .profile-photo { margin: 0 auto; width: 160px; order: -1; }
    .social-links { justify-content: center; }
    .pub-gallery-row { flex-wrap: wrap; }
    .pub-gallery-item { flex: 1 1 45%; height: 130px; }
    .hs-grid { grid-template-columns: 1fr; gap: 32px; }
    .nav-links { gap: 16px; }
    .nav-links a { font-size: 0.82rem; }
    section { padding: 48px 20px; }
}
@media (max-width: 480px) {
    .nav-inner { flex-direction: column; height: auto; padding: 10px 0; gap: 6px; }
    main { padding-top: 88px; }
    html { scroll-padding-top: 100px; }
    .news-item { grid-template-columns: 80px 1fr; gap: 10px; }
    section { padding: 40px 16px; }
    #about { padding-top: 48px; }
}
