/* ===== CSS Variables ===== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fb;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent: #4f46e5;
    --accent-light: #6366f1;
    --accent-subtle: rgba(79, 70, 229, 0.08);
    --border-color: #e2e8f0;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Source Serif 4', Georgia, serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

.navbar.scrolled {
    border-bottom-color: var(--border-color);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

.nav-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-logo {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.nav-logo:hover {
    color: var(--accent);
}

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

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.5rem 0;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    transition: width 0.3s ease;
}

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

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: var(--accent);
}

.nav-link.active::after {
    width: 100%;
}

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

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
    border-radius: 1px;
}

/* ===== Hero Section ===== */
.hero {
    padding: 9rem 0 4rem;
    text-align: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(79, 70, 229, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(99, 102, 241, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: 2.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.hero-title {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 400;
}

.hero-affiliation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.affiliation-logo {
    height: 22px;
    width: auto;
}

.hero-focus {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    font-weight: 400;
}

/* Typing cursor effect */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--accent);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    transition: var(--transition);
}

.hero-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-subtle);
    transform: translateY(-1px);
}

.hero-links a i {
    font-size: 1rem;
}

/* ===== Section Styles ===== */
.section {
    padding: 4.5rem 0;
}

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

.section h2 {
    font-family: var(--font-serif);
    font-size: 1.65rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section h2::before {
    content: '';
    width: 4px;
    height: 1.4em;
    background: var(--accent);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ===== Scroll Reveal Animations ===== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-stagger.visible > * {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 60ms; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 120ms; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 180ms; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 240ms; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 300ms; }
.reveal-stagger.visible > *:nth-child(7) { transition-delay: 360ms; }
.reveal-stagger.visible > *:nth-child(8) { transition-delay: 420ms; }

/* ===== About Section ===== */
.about-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.about-content p:last-child {
    margin-bottom: 0;
}

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

.about-content a {
    font-weight: 500;
    text-decoration-line: underline;
    text-decoration-color: rgba(79, 70, 229, 0.3);
    text-underline-offset: 2px;
}

.about-content a:hover {
    text-decoration-color: var(--accent);
}

/* ===== Publications Section ===== */
.publication {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-primary);
    transition: var(--transition);
}

.publication:hover {
    border-color: rgba(79, 70, 229, 0.2);
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.publication:last-child {
    margin-bottom: 0;
}

.pub-status {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    color: var(--accent);
    background: var(--accent-subtle);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.pub-status.accepted {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.1);
}

.publication h3 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    color: var(--text-primary);
}

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

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

.pub-summary {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.6;
    font-style: italic;
}

.pub-abstract-toggle {
    margin-bottom: 1rem;
}

.pub-abstract-toggle summary {
    cursor: pointer;
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0;
    user-select: none;
}

.pub-abstract-toggle summary:hover {
    color: var(--accent-light);
}

.pub-abstract-toggle summary i {
    font-size: 0.65rem;
    transition: transform 0.25s ease;
}

.pub-abstract-toggle[open] summary i {
    transform: rotate(90deg);
}

.pub-abstract-toggle summary::-webkit-details-marker {
    display: none;
}

.pub-abstract {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    line-height: 1.65;
    padding-left: 1rem;
    border-left: 2px solid var(--accent);
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

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

.pub-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--accent);
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 6px;
    transition: var(--transition-fast);
}

.pub-links a:hover {
    background: var(--accent-subtle);
    border-color: var(--accent);
}

/* ===== Experience Section ===== */
.experience-list,
.education-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

/* Vertical timeline line */
.experience-list::before,
.education-list::before {
    content: '';
    position: absolute;
    left: 23px;
    top: 12px;
    bottom: 12px;
    width: 2px;
    background: var(--border-color);
    border-radius: 1px;
}

.exp-item,
.edu-item {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 1.25rem 0;
    position: relative;
    transition: var(--transition);
}

.exp-item:not(:last-child),
.edu-item:not(:last-child) {
    border-bottom: none;
}

.exp-logo,
.edu-logo {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    z-index: 1;
    transition: var(--transition);
    padding: 6px;
}

.exp-item:hover .exp-logo,
.edu-item:hover .edu-logo {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.exp-logo img,
.edu-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.exp-content,
.edu-content {
    flex: 1;
    padding-top: 2px;
}

.exp-content h3,
.edu-content h3 {
    font-size: 0.975rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.exp-type {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
}

.exp-company,
.edu-school {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.15rem;
}

.exp-date,
.edu-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.exp-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.edu-details {
    font-size: 0.825rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ===== Tech Stack Section ===== */
.tech-category {
    margin-bottom: 2.5rem;
}

.tech-category:last-child {
    margin-bottom: 0;
}

.tech-category h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tech-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 80px;
    padding: 0.75rem 0.5rem;
    border-radius: 10px;
    transition: var(--transition);
    cursor: default;
}

.tech-item:hover {
    background: var(--accent-subtle);
    transform: translateY(-3px);
}

.tech-item i {
    font-size: 2rem;
    filter: grayscale(80%) opacity(0.7);
    transition: var(--transition);
}

.tech-item:hover i {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.1);
}

.tech-item span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.tech-item:hover span {
    color: var(--text-primary);
}

.expertise-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.expertise-tags span {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.825rem;
    color: var(--text-secondary);
}

/* ===== Contact Section ===== */
.contact-content {
    text-align: center;
}

.contact-content > p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.contact-info a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.6rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    transition: var(--transition);
}

.contact-info a:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-subtle);
    transform: translateY(-1px);
}

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

.footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ===== Mobile Navigation ===== */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        align-items: center;
        padding: 2rem;
        gap: 1.5rem;
        border-bottom: 1px solid var(--border-color);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }

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

    .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);
    }
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .hero {
        padding: 7rem 0 3rem;
    }

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

    .section {
        padding: 3.5rem 0;
    }

    .section h2 {
        font-size: 1.4rem;
    }

    .hero-links {
        gap: 0.75rem;
    }

    .hero-links a {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }

    .contact-info {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .tech-grid {
        gap: 0.75rem;
    }

    .tech-item {
        min-width: 65px;
    }

    .exp-logo,
    .edu-logo {
        width: 40px;
        height: 40px;
    }

    .experience-list::before,
    .education-list::before {
        left: 19px;
    }

    .publication {
        padding: 1.25rem;
    }
}
