:root {
    --text: #1a1a1a;
    --text-secondary: #555;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --border: #e5e7eb;
    --bg: #fff;
    --bg-alt: #f9fafb;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --text: #e7e7e7;
        --text-secondary: #a3a3a3;
        --accent: #60a5fa;
        --accent-hover: #93c5fd;
        --border: #2e2e2e;
        --bg: #121212;
        --bg-alt: #1a1a1a;
    }
}

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

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

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

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

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
header {
    padding: 64px 0 48px;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

header p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 560px;
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
    font-size: 0.95rem;
}

.links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Sections */
section {
    padding: 32px 0;
    border-top: 1px solid var(--border);
}

section h2 {
    font-size: 1.15rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Publications */
.pub {
    margin-bottom: 24px;
}

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

.pub .title a {
    color: var(--text);
}

.pub .title a:hover {
    color: var(--accent);
}

.pub .authors {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-top: 2px;
}

.pub .venue {
    font-size: 0.9rem;
    margin-top: 2px;
    font-style: italic;
    color: var(--text-secondary);
}

/* Experience */
.item {
    margin-bottom: 20px;
}

.item .role {
    font-weight: 600;
}

.item .org {
    color: var(--text-secondary);
}

.item .period {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* Education */
.edu {
    margin-bottom: 16px;
}

.edu .degree {
    font-weight: 600;
}

.edu .school {
    color: var(--text-secondary);
}

.edu .year {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* Blog */
.post-header {
    padding: 48px 0 24px;
}

.post-header h1 {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: 8px;
}

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

.site-name {
    padding: 24px 0 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.post-content {
    padding-bottom: 48px;
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote {
    margin-bottom: 16px;
}

.post-content h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 32px 0 12px;
}

.post-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 24px 0 10px;
}

.post-content ul,
.post-content ol {
    padding-left: 24px;
}

.post-content blockquote {
    border-left: 3px solid var(--border);
    padding-left: 16px;
    color: var(--text-secondary);
}

.post-content img {
    max-width: 100%;
    height: auto;
}

.post-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88em;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
}

.post-content pre {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px 16px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.post-content pre code {
    background: none;
    border: none;
    padding: 0;
}

/* Footer */
footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}

@media print {
    :root {
        --text: #000;
        --text-secondary: #333;
        --accent: #000;
        --bg: #fff;
    }

    header, section, footer {
        padding: 16px 0;
    }

    a {
        text-decoration: none;
    }

    .links a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: var(--text-secondary);
    }
}

@media (max-width: 600px) {
    header {
        padding: 40px 0 32px;
    }

    header h1 {
        font-size: 1.6rem;
    }

    .links {
        gap: 14px;
    }
}
