/* Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a68;
    --text-muted: #6b6b8d;
    --background: #ffffff;
    --background-alt: #f8f9fc;
    --accent: #0066ff;
    --accent-hover: #0052cc;
    --accent-light: #e6f0ff;
    --border: #e8e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --radius: 8px;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 0.2s ease;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--text-primary);
    background-color: var(--background);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.375rem; margin-top: 2.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.125rem; margin-bottom: 0.5rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

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

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

/* Header */
.site-header {
    padding: 1.25rem 0;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.9);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.site-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

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

.nav-links {
    list-style: none;
    display: flex;
    gap: 0.25rem;
}

.nav-links a {
    display: block;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
    background: var(--accent-light);
}

/* Main Content */
main {
    flex: 1;
    padding: 3rem 0;
}

/* Home Page */
.home .intro {
    margin-bottom: 2.5rem;
}

.home .name {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.home .title {
    font-size: 1.125rem;
    color: var(--text-muted);
    font-weight: 400;
}

.home-content {
    margin-bottom: 2.5rem;
}

.home-content p {
    font-size: 1.0625rem;
    line-height: 1.7;
}

/* News Section */
.home .news {
    margin-bottom: 2.5rem;
}

.home .news h2 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 500;
}

.news-list {
    list-style: disc;
    padding-left: 1.25rem;
    color: var(--text-secondary);
}

.news-list li {
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.home .news h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}

.updates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 640px) {
    .updates-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

.updates-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
    color: var(--text-secondary);
}

.updates-list li {
    margin-bottom: 0.4rem;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.update-date {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    margin-right: 0.35rem;
}

.home .contact {
    padding: 1.5rem;
    background: var(--background-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.home .contact h2 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 500;
}

.home .contact p {
    margin-bottom: 0;
    color: var(--text-primary);
}

/* Page Styles */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    margin-bottom: 0;
}

/* Publications */
.publication-section {
    margin-bottom: 3rem;
}

.publication-section h2 {
    margin-top: 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--text-primary);
    margin-bottom: 1.5rem;
}

.publication {
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    background: var(--background-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.publication:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.publication-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.375rem 0;
    line-height: 1.4;
}

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

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

.publication-authors {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.publication-venue {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.publication-links {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pub-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-secondary);
    transition: all var(--transition);
}

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

/* Publication Takeaway */
.publication-takeaway-text {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0.375rem 0 0 0;
    line-height: 1.5;
    font-style: italic;
}

/* Work in Progress */
.wip-item {
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    background: var(--background-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.wip-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.wip-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.375rem 0;
    line-height: 1.4;
    display: flex;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 0.5rem;
}

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

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

.wip-authors {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.wip-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.wip-links {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.status-badge.status-r-r,
.status-badge.status-rr,
.status-badge[class*="status-rr-"] {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-badge.status-working-paper {
    background: #fef3c7;
    color: #b45309;
}

.status-badge.status-draft {
    background: #f3f4f6;
    color: #4b5563;
}

/* CV Page */
.cv-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    background: var(--accent);
    color: white;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.download-btn:hover {
    background: var(--accent-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.cv-embed {
    width: min(1100px, 95vw);
    height: 90vh;
    min-height: 700px;
    margin-left: 50%;
    transform: translateX(-50%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--background-alt);
}

@media (max-width: 640px) {
    .cv-embed {
        width: 100%;
        margin-left: 0;
        transform: none;
        height: 80vh;
        min-height: 500px;
    }
}

.cv-embed object {
    width: 100%;
    height: 100%;
    display: block;
}

.cv-embed p {
    padding: 2rem;
    color: var(--text-secondary);
}

.cv-content h2 {
    margin-top: 2.5rem;
}

.cv-content h2:first-child {
    margin-top: 0;
}

.cv-content ul {
    padding-left: 1.25rem;
    color: var(--text-secondary);
}

.cv-content li {
    margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
    padding: 2rem 0;
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: var(--background-alt);
}

.site-footer .disclaimer {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.site-footer .copyright {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 640px) {
    html {
        font-size: 15px;
    }

    .site-header {
        padding: 1rem 0;
    }

    .nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 0.125rem;
    }

    .nav-links a {
        padding: 0.375rem 0.625rem;
        font-size: 0.8125rem;
    }

    main {
        padding: 2rem 0;
    }

    .home .name {
        font-size: 2rem;
    }

    .cv-page .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .publication,
    .wip-item {
        padding: 1rem;
    }
}

/* Focus states for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--accent-light);
    color: var(--accent-hover);
}
