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

:root {
    --text: #212529;
    --text-muted: #6c757d;
    --bg: #ffffff;
    --bg-alt: #f8f9fa;
    --border: #dee2e6;
    --link: #2563eb;
    --link-hover: #000000;
    --accent: #212529;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
    --max-width: 1020px;
}

html { font-size: 16px; height: 100%; }

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--link);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
}
a:hover {
    color: var(--link-hover);
    border-bottom-color: var(--text-muted);
}

/* ===== Nav ===== */
nav {
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 100;
}

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

.nav-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    border-bottom: none;
}
.nav-name:hover { border-bottom: none; }

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

.nav-links a {
    font-size: 0.95rem;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* ===== Main ===== */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
    flex: 1;
    width: 100%;
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }

p { margin-bottom: 0.75rem; }

.muted { color: var(--text-muted); font-size: 0.9rem; }

/* ===== About Grid ===== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 290px;
    gap: 2.5rem;
    align-items: start;
    margin-bottom: 2.5rem;
}

.about-photo {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 4.5rem;
}

.about-photo img {
    width: 100%;
    border-radius: 50%;
}

.photo-email {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    text-align: center;
    font-family: var(--font-mono);
}

.bio { color: var(--text); font-size: 0.93rem; }

.bio-list {
    margin: 0.25rem 0 0.75rem 1.5rem;
    font-size: 0.93rem;
    color: var(--text);
    line-height: 1.7;
}
.bio-list li { margin-bottom: 0.2rem; }

.social-icons {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}
.social-icons a {
    color: var(--text-muted);
    font-size: 1.25rem;
    border-bottom: none;
    transition: color 0.15s;
}
.social-icons a:hover { color: var(--text); border-bottom: none; }

/* ===== News ===== */
.news {
    margin-top: 0;
    background: var(--bg-alt);
    border-left: 3px solid var(--accent);
    padding: 0.5rem 1.5rem;
    border-radius: 0 6px 6px 0;
}

.news-list {
    margin: 0.25rem 0 0 1.5rem;
    font-size: 0.93rem;
    line-height: 1.7;
}
.news-list li { margin-bottom: 0.15rem; }
.news-date {
    display: inline-block;
    width: 5.5rem;
    font-weight: 600;
}

/* ===== Publications ===== */
.selected-pubs { margin-top: 3rem; }
.selected-pubs h2 { margin-bottom: 0; }
.pub-list { margin-top: 0; }

.pub {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--bg-alt);
}

.pub-venue {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #374151;
    background: #e5e7eb;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    margin-bottom: 0.4rem;
}

.pub-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

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

.pub-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 0;
}
.pub-links a {
    font-size: 0.85rem;
    color: var(--link);
    border-bottom: 1px dotted var(--text-muted);
}

/* ===== Blog Post Content ===== */
article h1 { margin-top: 0; margin-bottom: 1rem; }
article h2 { margin-top: 2rem; }
article h3 { margin-top: 1.5rem; }
article p { margin-bottom: 1rem; line-height: 1.8; }
article ul, article ol { margin: 1rem 0; padding-left: 1.5rem; }
article li { margin-bottom: 0.4rem; }
article code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-alt);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}
article pre {
    background: var(--bg-alt);
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1rem 0;
}
article pre code { background: none; padding: 0; }
article blockquote {
    border-left: 3px solid var(--border);
    padding-left: 1rem;
    color: var(--text-muted);
    margin: 1rem 0;
}
article img { max-width: 100%; border-radius: 5px; margin: 1rem 0; }

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .about-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .about-photo {
        order: -1;
        max-width: 160px;
        margin: 0 auto;
        padding-top: 0;
    }
    .social-icons { justify-content: center; }
    .nav-links { gap: 1rem; }
    .nav-links a { font-size: 0.85rem; }
    h1 { font-size: 1.5rem; }
}
