:root {
    --bg: #fafafa;
    --text: #333;
    --text-light: #666;
    --link: #0066cc;
    --link-hover: #0052a3;
    --border: #e0e0e0;
    --code-bg: #f5f5f5;
    --card-bg: #fff;
    --shadow: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1a1a;
        --text: #e0e0e0;
        --text-light: #999;
        --link: #66b3ff;
        --link-hover: #99ccff;
        --border: #404040;
        --code-bg: #2a2a2a;
        --card-bg: #242424;
        --shadow: rgba(0, 0, 0, 0.3);
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

/* Header */
header {
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

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

nav a:hover {
    color: var(--link);
}

/* Main content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 200px);
}

/* Hero section */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.tagline {
    font-size: 1.3rem;
    color: var(--text-light);
}

/* Research areas */
.research-areas {
    margin: 4rem 0;
}

.focus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.focus-item {
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
}

.focus-item h3 {
    margin-bottom: 0.5rem;
    color: var(--link);
}

/* Projects */
.project-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.project-card {
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

.project-card h3 {
    margin-bottom: 0.5rem;
}

.project-card a {
    color: var(--text);
    text-decoration: none;
}

.project-card a:hover {
    color: var(--link);
}

/* Tags */
.tags {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.2rem 0.6rem;
    background: var(--code-bg);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Blog posts */
.post-list {
    margin: 2rem 0;
}

.post-summary {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.post-summary:last-child {
    border-bottom: none;
}

.post-summary time {
    color: var(--text-light);
    font-size: 0.9rem;
}

.post-summary h3 {
    margin: 0.5rem 0;
}

.post-summary a {
    color: var(--text);
    text-decoration: none;
}

.post-summary a:hover {
    color: var(--link);
}

/* More links */
.more-link {
    text-align: right;
    margin-top: 1rem;
}

.more-link a {
    color: var(--link);
    text-decoration: none;
}

.more-link a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    margin-top: 4rem;
    padding: 2rem;
    border-top: 1px solid var(--border);
    background: var(--card-bg);
}

footer .container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

footer p {
    color: var(--text-light);
}

footer a {
    color: var(--link);
    text-decoration: none;
    margin: 0 0.5rem;
}

footer a:hover {
    text-decoration: underline;
}

/* Utilities */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    line-height: 1.3;
}

h2 {
    font-size: 2rem;
    margin-top: 3rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--link);
}

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

code {
    background: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
    font-size: 0.9em;
}

pre {
    background: var(--code-bg);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

pre code {
    background: none;
    padding: 0;
}

/* Publications */
.publications-list {
    margin-top: 2rem;
}

.year-section {
    margin-bottom: 3rem;
}

.year-section h2 {
    color: var(--text-light);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.publication {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
}

.publication h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    line-height: 1.4;
}

.publication .authors {
    color: var(--text-light);
    margin-bottom: 0.3rem;
}

.publication .venue {
    font-style: italic;
    margin-bottom: 0.8rem;
}

.pub-links {
    display: flex;
    gap: 1rem;
}

.pub-link {
    padding: 0.3rem 0.8rem;
    background: var(--code-bg);
    border-radius: 4px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.2s;
}

.pub-link:hover {
    background: var(--border);
}

/* Blog post styles */
.blog-post {
    max-width: 800px;
    margin: 0 auto;
}

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

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

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

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.post-content pre {
    margin: 1.5rem 0;
}

/* Project page styles */
.project-page {
    max-width: 900px;
    margin: 0 auto;
}

.project-description {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.project-links {
    margin-bottom: 2rem;
}

.project-content {
    line-height: 1.8;
}

.project-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.project-tags {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* Intro text */
.intro {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Notes styles */
.notes-placeholder {
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
    text-align: center;
}

.notes-placeholder ul {
    text-align: left;
    display: inline-block;
    margin-top: 1rem;
}

.notes-list {
    margin-top: 2rem;
}

.note-summary {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
}

.note-summary h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.note-summary time {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Note page styles */
.note-page {
    max-width: 800px;
    margin: 0 auto;
}

.note-page header {
    margin-bottom: 2rem;
}

.note-description {
    font-size: 1.2rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 1rem;
}

.note-content {
    line-height: 1.8;
}

.note-content h2 {
    margin-top: 3rem;
    margin-bottom: 1rem;
    color: var(--link);
}

.note-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.8rem;
}

.note-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--code-bg);
    border-left: 4px solid var(--link);
    font-style: italic;
}

.note-content pre {
    margin: 1.5rem 0;
}

.note-content em {
    color: var(--text-light);
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav ul {
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1.1rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .pub-links {
        flex-wrap: wrap;
    }
    
    .focus-grid {
        grid-template-columns: 1fr;
    }
}