/* ===== CSS Variables ===== */
:root {
    --color-primary: #0a66c2;
    --color-primary-dark: #084e9a;
    --color-text: #1a1a1a;
    --color-text-light: #666;
    --color-bg: #ffffff;
    --color-bg-alt: #f8f9fa;
    --color-border: #e0e0e0;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --container-width: 1100px;
    --transition: 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
}

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

a:hover {
    color: var(--color-primary-dark);
}

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

/* ===== Container ===== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: all var(--transition);
}

.navbar.scrolled {
    border-bottom-color: var(--color-border);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    color: var(--color-text-light);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color var(--transition);
}

.nav-links a:hover {
    color: var(--color-primary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: all var(--transition);
}

/* ===== Hero Section ===== */
.hero {
    padding: 140px 0 80px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero-text {
    flex: 1;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--color-text);
}

.hero .subtitle {
    font-size: 1.25rem;
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.hero .tagline {
    font-size: 1rem;
    color: var(--color-text-light);
    font-weight: 400;
    margin-bottom: 16px;
    line-height: 1.6;
}

/* Hero roles line */
.hero-roles {
    margin-top: 4px;
    margin-bottom: 24px;
    font-size: 0.95rem;
    color: var(--color-text-light);
}

.hero-roles strong {
    color: var(--color-text);
    font-weight: 600;
    margin-right: 8px;
}

.hero-links {
    display: flex;
    gap: 16px;
}

.hero-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-bg);
    color: var(--color-text-light);
    font-size: 1.25rem;
    border: 1px solid var(--color-border);
    transition: all var(--transition);
}

.hero-links a:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.hero-image {
    flex-shrink: 0;
}

.hero-image img,
.placeholder-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.placeholder-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-alt);
    color: var(--color-border);
    font-size: 4rem;
}

/* ===== Sections ===== */
.section {
    padding: 80px 0;
}

.section-alt {
    background: var(--color-bg-alt);
}

.section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 40px;
    color: var(--color-text);
}

.section-intro {
    color: var(--color-text-light);
    margin-bottom: 32px;
    max-width: 700px;
}

/* ===== About Section ===== */
.about-content p {
    margin-bottom: 16px;
    color: var(--color-text-light);
}

.about-content strong {
    color: var(--color-text);
}

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

.looking-for {
    padding: 16px 20px;
    background: var(--color-bg-alt);
    border-left: 3px solid var(--color-primary);
    border-radius: 0 8px 8px 0;
    margin-top: 8px;
}

.cv-download {
    margin-top: 24px;
}

/* ===== Writing Section ===== */
.post {
    padding: 24px;
    background: var(--color-bg-alt);
    border-radius: 12px;
    margin-bottom: 16px;
}

.post h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.post h3 a {
    color: var(--color-text);
}

.post h3 a:hover {
    color: var(--color-primary);
}

.post-excerpt {
    color: var(--color-text-light);
    margin: 8px 0 16px;
    line-height: 1.6;
}

.post-meta {
    color: var(--color-text-light);
    font-size: 0.95rem;
    margin-bottom: 18px;
}

/* ===== Publication Descriptions ===== */
.pub-description {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 8px;
    line-height: 1.5;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 120, 212, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* ===== Research Grid ===== */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.research-card {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    transition: all var(--transition);
}

.research-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.research-card i {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 16px;
}

.research-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.research-card p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

/* ===== Publications ===== */
.publications-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.publication {
    display: flex;
    gap: 24px;
    padding: 24px;
    background: var(--color-bg-alt);
    border-radius: 12px;
    transition: all var(--transition);
}

.publication:hover {
    background: #f0f4f8;
}

.pub-year {
    flex-shrink: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary);
    min-width: 50px;
}

.pub-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.pub-content .authors {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 4px;
}

.pub-content .venue {
    font-size: 0.85rem;
    color: var(--color-text-light);
    font-style: italic;
    margin-bottom: 12px;
}

.pub-links {
    display: flex;
    gap: 12px;
}

.pub-links a {
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: white;
    border-radius: 4px;
    border: 1px solid var(--color-border);
}

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

.more-publications {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
    text-align: center;
    color: var(--color-text-light);
}

/* ===== Timeline ===== */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--color-border);
}

.timeline-item {
    position: relative;
    padding-bottom: 32px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -38px;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--color-primary);
}

.timeline-date {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.timeline-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-content .company {
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.timeline-content p:last-child {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

/* ===== Contact ===== */
.contact-content {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.contact-content>p {
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.email {
    font-size: 1.1rem;
    margin-bottom: 32px;
}

.email a {
    font-weight: 500;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ===== Footer ===== */
footer {
    padding: 32px 0;
    text-align: center;
    border-top: 1px solid var(--color-border);
}

footer p {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 24px;
        gap: 16px;
        border-bottom: 1px solid var(--color-border);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition);
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .hero {
        padding: 120px 0 60px;
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        gap: 32px;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero-links {
        justify-content: center;
    }

    .hero-image img,
    .placeholder-photo {
        width: 150px;
        height: 150px;
    }

    .section {
        padding: 60px 0;
    }

    .section h2 {
        font-size: 1.75rem;
        margin-bottom: 32px;
    }

    .publication {
        flex-direction: column;
        gap: 8px;
    }

    .timeline {
        padding-left: 24px;
    }

    .timeline-item::before {
        left: -30px;
        width: 10px;
        height: 10px;
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }

    .contact-links .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .research-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Article Page ===== */
.article-page {
    padding: 120px 0 80px;
}

.article {
    max-width: 720px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 40px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 24px;
}

.back-link:hover {
    color: var(--color-primary);
}

.article h1 {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
    color: var(--color-text);
}

.article-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.article-content .lead {
    font-size: 1.15rem;
    color: var(--color-text);
    margin-bottom: 32px;
}

.article-content h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 16px;
    color: var(--color-text);
}

.article-content p {
    margin-bottom: 20px;
    color: var(--color-text-light);
}

.article-content a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 40px 0;
}

@media (max-width: 768px) {
    .article-page {
        padding: 100px 0 60px;
    }

    .article h1 {
        font-size: 1.75rem;
    }

    .article-content {
        font-size: 1rem;
    }
}