body {
    font-family: 'Raleway', sans-serif;
    margin: 0;
    padding: 20px;
    max-width: 800px;
    margin: auto;
    line-height: 1.6;
    background-color: #f8f8f8;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}

h1, h2 {
    font-weight: 600;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

p {
    font-size: 1rem;
    color: #666;
    font-weight: 300;
}

nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

nav a {
    font-weight: 400;
}

/* Global link styling for consistent appearance across all states in light mode */
a:link,
a:visited,
a:hover,
a:active,
a:focus {
    color: #333; /* Same as the body text color */
    text-decoration: none;
}

/* Optional: Add underline on hover for nav links only */
nav a:hover {
    text-decoration: underline;
}

.job {
    margin-bottom: 2rem;
}

.job h3 {
    margin-bottom: 0.2rem;
    font-weight: 600;
    font-size: 1.2rem;
    color: #333;
}

.job .meta {
    font-size: 0.9rem;
    color: #888;
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.job ul {
    padding-left: 20px;
    margin-top: 0.5rem;
}

.job li {
    margin-bottom: 0.5rem;
    color: #666;
    font-weight: 300;
}

.edu {
    margin-bottom: 1.25rem;
}

.edu h3 {
    margin-bottom: 0.2rem;
    font-weight: 600;
    font-size: 1.2rem;
    color: #333;
}

.edu .meta {
    font-size: 0.9rem;
    color: #888;
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.edu p {
    margin-top: 0;
    margin-bottom: 0;
}

.publication {
    margin-bottom: 1.25rem;
}

.publication h3 {
    margin-bottom: 0.2rem;
    font-weight: 600;
    font-size: 1.2rem;
    color: #333;
}

.publication .meta {
    font-size: 0.9rem;
    color: #888;
    margin-top: 0;
    margin-bottom: 0.2rem;
    font-style: italic;
}

.publication p {
    margin-top: 0;
    margin-bottom: 0;
}

.talk {
    margin-bottom: 1.25rem;
}

.talk h3 {
    margin-bottom: 0.2rem;
    font-weight: 600;
    font-size: 1.2rem;
    color: #333;
}

.talk .meta {
    font-size: 0.9rem;
    color: #888;
    margin-top: 0;
    margin-bottom: 0.2rem;
    font-style: italic;
}

.talk p {
    margin-top: 0;
    margin-bottom: 0;
}

.post {
    margin-bottom: 1.25rem;
}

.post h3 {
    margin-bottom: 0.2rem;
    font-weight: 600;
    font-size: 1.2rem;
    color: #333;
}

.post .meta {
    font-size: 0.9rem;
    color: #888;
    margin-top: 0;
    margin-bottom: 0;
    font-style: italic;
}

/* ===== Blog Post ===== */
.blog-post {
    max-width: 640px;
    margin: 0 auto;
}

.blog-post header {
    margin-bottom: 2rem;
}

.blog-post h1 {
    margin-bottom: 0.3rem;
}

.blog-post .meta {
    font-size: 0.9rem;
    color: #888;
    margin-top: 0;
    font-style: italic;
}

.blog-post h2 {
    font-size: 1.3rem;
    margin-top: 2rem;
}

.blog-post h3 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
}

.blog-post p {
    margin-bottom: 1rem;
    color: #333;
    font-weight: 400;
}

.blog-post a {
    text-decoration: underline;
}

.blog-post pre {
    background-color: #f0f0f0;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.4;
}

.blog-post code {
    font-size: 0.9em;
}

.blog-post blockquote {
    border-left: 3px solid #ccc;
    margin-left: 0;
    padding-left: 1rem;
    color: #666;
    font-style: italic;
}

.blog-post img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.blog-post-nav {
    max-width: 640px;
    margin: 3rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #f8f8f8;
    }
    h2 {
        border-top-color: #333;
    }
    p {
        color: #bbbbbb;
    }
    .job h3 {
        color: #f8f8f8;
    }
    .job .meta {
        color: #aaa;
    }
    .job li {
        color: #bbbbbb;
    }
    .edu h3 {
        color: #f8f8f8;
    }
    .edu .meta {
        color: #aaa;
    }
    .publication h3 {
        color: #f8f8f8;
    }
    .publication .meta {
        color: #aaa;
    }
    .talk h3 {
        color: #f8f8f8;
    }
    .talk .meta {
        color: #aaa;
    }
    /* Override global link color in dark mode */
    a:link,
    a:visited,
    a:hover,
    a:active,
    a:focus {
        color: #f8f8f8;
    }
    .post h3 {
        color: #f8f8f8;
    }
    .post .meta {
        color: #aaa;
    }
    .blog-post p {
        color: #f8f8f8;
    }
    .blog-post .meta {
        color: #aaa;
    }
    .blog-post pre {
        background-color: #1e1e1e;
    }
    .blog-post blockquote {
        border-left-color: #555;
        color: #bbb;
    }
    .blog-post-nav {
        border-top-color: #333;
    }
}