/* ================================================
   Academic Homepage - Minimal but Memorable
   ================================================ */

:root {
    /* Colors - Light Mode */
    --color-bg: #fafafa;
    --color-text: #111111;
    --color-text-secondary: #444444;
    --color-text-muted: #777777;
    --color-accent: #1a1a1a;
    --color-accent-light: #e8e8e8;
    --color-border: #e0e0e0;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Georgia', 'Times New Roman', serif;
}

[data-theme="dark"] {
    --color-bg: #0d0d0d;
    --color-text: #f0f0f0;
    --color-text-secondary: #c0c0c0;
    --color-text-muted: #888888;
    --color-accent: #ffffff;
    --color-accent-light: #222222;
    --color-border: #2a2a2a;
}

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

html {
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    line-height: 1.65;
    color: var(--color-text);
    background: var(--color-bg);
    transition: background 0.3s, color 0.3s;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.theme-toggle:hover {
    opacity: 1;
}

.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }
[data-theme="dark"] .theme-toggle .sun-icon { display: block; }
[data-theme="dark"] .theme-toggle .moon-icon { display: none; }

/* Layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem 3rem;
}

.loading {
    text-align: center;
    padding: 4rem;
    color: var(--color-text-muted);
}

/* ================================================
   Hero Section - The Memorable Part
   ================================================ */
.profile-header {
    margin-bottom: 2.5rem;
}

.profile-name {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.profile-tagline {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-style: italic;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    max-width: 500px;
}

.profile-affiliation {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

/* Contact Links - Horizontal, Minimal */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.9rem;
}

.contact-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.15s;
}

.contact-link:hover {
    color: var(--color-text);
}

.contact-link svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

/* Avatar - Optional, Subtle */
.avatar-container {
    float: right;
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.avatar {
    width: 165px;
    height: 165px;
    border-radius: 4px;
    object-fit: cover;
    filter: grayscale(20%);
}

/* ================================================
   Content Sections
   ================================================ */
.markdown-content h1 {
    display: none;
}

.markdown-content h2 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--color-border);
}

.markdown-content h2:first-of-type {
    margin-top: 0;
}

.markdown-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
}

.markdown-content p {
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
}

.markdown-content ul, .markdown-content ol {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    color: var(--color-text-secondary);
}

.markdown-content li {
    margin-bottom: 0.4rem;
}

.markdown-content a {
    color: var(--color-text);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity 0.15s;
}

.markdown-content a:hover {
    opacity: 0.7;
}

.markdown-content blockquote {
    border-left: 2px solid var(--color-border);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--color-text-muted);
    font-style: italic;
}

.markdown-content strong {
    font-weight: 600;
    color: var(--color-text);
}

.markdown-content code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85em;
    background: var(--color-accent-light);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

/* ================================================
   Publications - Special Styling
   ================================================ */
.publication {
    margin-bottom: 1.5rem;
    padding-left: 0;
}

.pub-title {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.pub-title a {
    text-decoration: none;
}

.pub-title a:hover {
    text-decoration: underline;
}

.pub-authors {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.2rem;
}

.pub-authors .me {
    font-weight: 600;
    color: var(--color-text);
}

.pub-venue {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-style: italic;
}

.pub-links {
    font-size: 0.8rem;
    margin-top: 0.35rem;
}

.pub-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    margin-right: 0.75rem;
}

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

/* ================================================
   Navigation Links - Distinct
   ================================================ */
.nav-section {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.nav-item {
    font-size: 1rem;
    color: var(--color-text);
    text-decoration: none;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.15s;
}

.nav-item:hover {
    border-bottom-color: var(--color-text);
}

/* Navigate section - horizontal flex layout for links */
.markdown-content h2:last-of-type + ul,
.markdown-content h2:last-of-type + p + ul {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    list-style: none;
    padding-left: 0;
    margin-top: 0.75rem;
}

.markdown-content h2:last-of-type + ul li,
.markdown-content h2:last-of-type + p + ul li {
    margin-bottom: 0;
}

.markdown-content h2:last-of-type + ul li a,
.markdown-content h2:last-of-type + p + ul li a {
    font-size: 1rem;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    transition: border-color 0.15s;
}

.markdown-content h2:last-of-type + ul li a:hover,
.markdown-content h2:last-of-type + p + ul li a:hover {
    opacity: 1;
    border-bottom-color: var(--color-text);
}

/* News Items */
.news-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.news-date {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    min-width: 70px;
    flex-shrink: 0;
}

.news-content {
    color: var(--color-text-secondary);
}

/* ================================================
   Footer
   ================================================ */
.footer {
    margin-top: 0.5rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.footer a {
    color: inherit;
}

.footer code {
    font-size: 0.75rem;
    background: var(--color-accent-light);
    padding: 0.1em 0.3em;
    border-radius: 2px;
}

/* ================================================
   Page Navigation (for sub-pages)
   ================================================ */
.page-nav {
    margin-bottom: 2rem;
}

.page-nav a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s;
}

.page-nav a:hover {
    color: var(--color-text);
}

/* Page Title */
.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.page-description {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
}

/* Horizontal rule in content */
.markdown-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 1.5rem 0;
}

/* Project cards */
.project-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.25rem 1.5rem 1.25rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.project-card:hover {
    border-color: var(--color-text-muted);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .project-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.project-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--color-text);
}

.project-card p {
    margin-bottom: 0.75rem;
}

.project-card p:last-child {
    margin-bottom: 0;
}

.project-card p strong a {
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.85rem;
}

.project-card em {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Fallback for markdown-content h3 outside cards */
.markdown-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    color: var(--color-text);
}

.markdown-content h3 + p strong a {
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.85rem;
}

/* Larger H2 for subpages (publications, projects) */
.page-content .markdown-content h2 {
    font-size: 1.5rem;
    font-weight: 650;
    text-transform: none;
    letter-spacing: -0.01em;
    color: var(--color-text);
    margin: 2.5rem 0 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.page-content .markdown-content h2:first-of-type {
    margin-top: 0;
}

/* ================================================
   Responsive
   ================================================ */
@media (max-width: 600px) {
    html {
        font-size: 16px;
    }
    
    .container {
        padding: 2.5rem 1.25rem 0.5rem;
    }
    
    .profile-name {
        font-size: 2.5rem;
    }
    
    .profile-tagline {
        font-size: 1.15rem;
    }
    
    .avatar-container {
        float: none;
        margin: 0 0 1rem 0;
    }
    
    .avatar {
        width: 100px;
        height: 100px;
    }
    
    .contact-links {
        gap: 0.75rem;
    }
    
    .nav-section {
        gap: 1.25rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
}

