:root {
    --bg-color: rgb(255, 253, 248);
    --text-color: #2c2c2c;
    --text-secondary: #5a5a5a;
    --text-muted: #8a8a8a;
    --border-color: #e0ddd8;
    --link-color: #2c2c2c;
    --accent-nyu: #57068c;
    --pub-img-bg: #fff;
}

[data-theme="dark"] {
    --bg-color: #1a1917;
    --text-color: #e4e0d5;
    --text-secondary: #a8a090;
    --text-muted: #6e6658;
    --border-color: #363330;
    --link-color: #e4e0d5;
    --accent-nyu: #b06ee8;
    --pub-img-bg: #2a2825;
}

* {
    box-sizing: border-box;
}

body {
    transition: background-color 0.3s ease, color 0.3s ease;
    font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
    font-size: 22px;
    line-height: 1.75;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 80px 32px;
    font-feature-settings: 'kern' 1, 'liga' 1, 'ss01' 1;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.container {
    max-width: 984px;
    margin: 0 auto;
}

/* Top navigation */
.top-nav {
    font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
    font-size: 15px;
    display: flex;
    justify-content: flex-end;
    gap: 28px;
    margin-bottom: -8px;
}

.top-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    background: none;
}

.top-nav a:hover {
    color: var(--text-color);
    background: none;
}

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 17px;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

#theme-toggle:hover {
    opacity: 1;
}

/* Name */
h1 {
    font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
    font-size: 46px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 34px 0;
    color: var(--text-color);
}

/* Intro section */
.intro {
    display: flex;
    gap: 58px;
    align-items: flex-start;
    margin-bottom: 29px;
}

.intro-text {
    flex: 1;
}

.intro-text p {
    margin: 0 0 18px 0;
    color: var(--text-color);
}

.intro-text p:last-child {
    margin-bottom: 0;
}

/* Profile photo */
.profile-photo {
    flex-shrink: 0;
    width: 168px;
    height: 168px;
    border-radius: 19px;
    object-fit: cover;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: grayscale(5%);
}

.profile-photo:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* Sections */
section {
    padding: 28px 0;
}

/* Note/callout box */
.note {
    margin: 28px 0 0 0;
    padding: 20px 24px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    font-size: 17px;
}

.note strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.note p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.65;
}

section {
    border-top: 1px solid var(--border-color);
}

section:first-of-type {
    border-top: none;
    position: relative;
    margin-top: 48px;
    padding-top: 48px;
}

section:first-of-type::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 400px;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--border-color) 15%,
        var(--border-color) 42%,
        transparent 48%,
        transparent 52%,
        var(--border-color) 58%,
        var(--border-color) 85%,
        transparent
    );
}

section:first-of-type::after {
    content: '❧';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: var(--text-muted);
    background: var(--bg-color);
    padding: 0 14px;
}

h2 {
    font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 18px 0;
}


section p {
    margin: 0 0 18px 0;
    color: var(--text-color);
    font-size: 19px;
}

section p:last-child {
    margin-bottom: 0;
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: none;
    background-image: linear-gradient(var(--border-color), var(--border-color));
    background-size: 100% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease, color 0.2s ease;
}

a:hover {
    background-image: linear-gradient(var(--text-color), var(--text-color));
}

a.nyu {
    color: var(--accent-nyu);
    background-image: linear-gradient(var(--border-color), var(--border-color));
}

a.nyu:hover {
    background-image: linear-gradient(var(--accent-nyu), var(--accent-nyu));
}

/* Links list in Research section */
.links-row {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.links-row a {
    color: #009b8a;
}

.links-row a:hover {
    color: #007a6c;
}

/* News */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.news-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 20px;
    align-items: baseline;
    font-size: 19px;
}

.news-date {
    font-size: 15px;
    color: var(--text-muted);
    white-space: nowrap;
    padding-top: 2px;
}

@media (max-width: 640px) {
    .news-item {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

/* People list */
.people-list {
    line-height: 2;
}

/* Teaching list */
.teaching-list {
    list-style: none;
    padding: 6px 0 0 0;
    margin: 0;
}

.teaching-list li {
    font-size: 16px;
    color: var(--text-muted);
    padding: 2px 0 2px 1.2em;
    position: relative;
}

.teaching-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

/* Publications */
.pub-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-top: 8px;
}

.pub {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.pub-img {
    flex-shrink: 0;
    width: 200px;
    height: 140px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--pub-img-bg);
}

.pub-info {
    flex: 1;
}

.pub-title {
    font-size: 18px !important;
    font-style: italic;
    margin-bottom: 4px !important;
}

.pub-authors {
    font-size: 16px !important;
    color: var(--text-secondary) !important;
    margin-bottom: 4px !important;
}

.pub-venue {
    font-size: 16px !important;
    color: var(--text-muted) !important;
    margin-bottom: 6px !important;
}

.pub-links {
    font-size: 16px !important;
    color: var(--text-muted) !important;
    margin-bottom: 0 !important;
}

.pub-links a {
    color: #009b8a;
}

.pub-links a:hover {
    color: #007a6c;
}

@media (max-width: 640px) {
    .pub {
        flex-direction: column;
        gap: 14px;
    }

    .pub-img {
        width: 100%;
        height: 180px;
    }
}

/* Footer */
footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
    font-size: 13px;
    color: var(--text-muted);
}

footer a {
    color: var(--text-muted);
    background-image: linear-gradient(var(--border-color), var(--border-color));
}

footer a:hover {
    color: var(--text-secondary);
}

/* Subtle page fade in */
@keyframes pageLoad {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    animation: pageLoad 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Responsive */
@media (max-width: 640px) {
    body {
        padding: 48px 24px;
        font-size: 17px;
    }

    h1 {
        font-size: 32px;
        text-align: center;
        margin-bottom: 28px;
    }

    .intro {
        flex-direction: column-reverse;
        align-items: center;
        gap: 28px;
    }

    .intro-text {
        width: 100%;
        text-align: left;
    }

    .profile-photo {
        width: 110px;
        height: 110px;
        border-radius: 14px;
    }

    section {
        padding: 20px 0;
    }

    section {
        padding: 20px 0;
    }
}
