:root {
    --bg-color: #fff;
    --text-color: #333;
    --text-muted: #666;
    --link-color: #0066cc;
    --link-hover-color: #004499;
    --border-color: #eee;
    --code-bg: #f8f9fa;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #111;
        --text-color: #eee;
        --text-muted: #aaa;
        --link-color: #66b3ff;
        --link-hover-color: #99ccff;
        --border-color: #333;
        --code-bg: #222;
    }
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    font-size: 18px;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

.container {
    max-width: 54rem;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header */
.masthead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.masthead-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.masthead-title a {
    color: var(--text-color);
    text-decoration: none;
}

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

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-color);
    text-decoration: none;
}

.nav-link.active {
    font-weight: 700;
}

/* Footer */
.footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    text-align: center;
}

/* Layout Utilities */
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }
.mt-4 { margin-top: 1.5rem; }

/* Grid for Work/Projects */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.grid-item {
    margin-bottom: 2rem;
}

/* Lists */
.list-unstyled {
    list-style: none;
    padding-left: 0;
}

.list-item {
    margin-bottom: 1.5rem;
}

.list-item-title {
    font-weight: 600;
    display: block;
    font-size: 1.1rem;
}

.list-item-meta {
    font-size: 0.9em;
    color: var(--text-muted);
    display: block;
    margin-top: 0.25rem;
}

/* Hero Section */
.hero {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 4rem;
}

@media (min-width: 768px) {
    .hero {
        flex-direction: row;
        align-items: flex-start;
    }
}

.hero-avatar img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
}

.hero-content {
    flex: 1;
}

.social-links {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--text-muted);
    font-size: 1.25rem;
}

.social-links a:hover {
    color: var(--link-color);
}

/* Images */
img.img-fluid {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.book-cover {
    width: 80px;
    height: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-right: 1.5rem;
}

.media {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.media-body {
    flex: 1;
}

hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Specific styling for papers/talks */
.pub-title {
    font-weight: 600;
}

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