/* Import high-end typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* Root Variables - Premium Light Academic Palette */
:root {
    --bg-light: #ffffff;
    --bg-alt: #f8fafc;        /* Soft slate/grey for alternate sections */
    --bg-card: #ffffff;
    --bg-card-hover: #fafafa;
    --border-light: #e2e8f0;  /* Slate-200 */
    --border-hover: #cbd5e1;  /* Slate-300 */
    
    --primary: #2563eb;       /* Professional Royal Blue */
    --primary-glow: rgba(37, 99, 235, 0.12);
    --secondary: #4f46e5;     /* Sleek Indigo */
    --secondary-glow: rgba(79, 70, 229, 0.1);
    --accent: #0891b2;        /* Elegant Teal */
    --accent-glow: rgba(8, 145, 178, 0.12);
    
    --text-main: #0f172a;     /* Deep Slate (Headings & Titles) */
    --text-muted: #334155;    /* Charcoal (Body & Paragraphs) */
    --text-dark: #64748b;     /* Slate Gray (Subtitles, labels) */
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: 'Outfit', 'Space Grotesk', sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-light);
    color: var(--text-muted);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

body {
    position: relative;
    overflow-x: hidden;
    background-color: var(--bg-light);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-light);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    border: 2px solid var(--bg-light);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Background Clean Canvas (Replaces neon ambient glows) */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -10;
    overflow: hidden;
    pointer-events: none;
    background: var(--bg-light);
}

/* Deactivate floating purple glows silently */
.ambient-glow-1, .ambient-glow-2 {
    display: none;
}

/* Clean, Premium Academic Card Styles */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02), 0 1px 3px rgba(0, 0, 0, 0.01);
    transition: var(--transition-smooth);
}

.glass-panel:hover {
    border-color: var(--border-hover);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.02);
}

/* Header & Navigation Bar */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    transition: var(--transition-smooth);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid transparent;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    transition: var(--transition-smooth);
}

header.scrolled .nav-container {
    padding: 14px 30px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0;
}

.logo-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary-glow);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    position: relative;
    padding: 6px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: var(--transition-smooth);
    border-radius: 2px;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
}

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

.social-pill {
    background: var(--bg-alt);
    border: 1px solid var(--border-light);
    border-radius: 30px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.social-pill a {
    color: var(--text-dark);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
}

.social-pill a:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.social-icon svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

/* Sections Global Styles */
section {
    padding: 90px 20px;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    scroll-margin-top: 90px;
}

#about {
    position: relative;
}

.first-section {
    padding-top: 140px;
}

.section-tag {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--primary);
    margin-bottom: 8px;
    display: inline-block;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 36px;
    color: var(--text-main);
    position: relative;
}

.section-title span {
    background: linear-gradient(135deg, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* About / Biography Section */
.bio-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
}

.bio-card {
    padding: 36px;
    font-size: 1.05rem;
    color: var(--text-muted);
}

.bio-card p {
    margin-bottom: 20px;
}

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

.bio-card strong {
    color: var(--text-main);
    font-weight: 600;
}

.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.timeline-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-card {
    position: relative;
    padding: 24px 30px;
    display: flex;
    flex-direction: column;
}

.timeline-item {
    position: relative;
    padding-left: 24px;
    border-left: 2px solid rgba(37, 99, 235, 0.15);
    padding-bottom: 12px;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: -6px;
    top: 6px;
    width: 10px;
    height: 10px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.3);
}

.timeline-period {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.timeline-role {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.timeline-inst {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.timeline-desc {
    font-size: 0.9rem;
    color: var(--text-dark);
}

/* Publications Section */
.publications-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

/* Publications Grid */
.pub-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* High-Readability Publication Card */
.pub-card {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 24px;
    padding: 24px;
    align-items: start;
    transition: var(--transition-smooth);
}

.pub-media {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/10.5;
    border: 1px solid var(--border-light);
    background: var(--bg-alt);
}

.pub-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.pub-card:hover .pub-media img {
    transform: scale(1.04);
}

.pub-info {
    display: flex;
    flex-direction: column;
}

.pub-venue-badge {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    align-self: flex-start;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.15);
    padding: 4px 10px;
    border-radius: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.pub-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-main);
    margin-bottom: 8px;
    text-decoration: none;
    transition: var(--transition-smooth);
}

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

.pub-authors {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.45;
}

/* Highlighting the main author Yuan Dong on light background */
.pub-authors strong {
    color: var(--text-main);
    font-weight: 700;
}

.pub-authors.collapsible {
    position: relative;
    max-height: 3.95em;
    overflow: hidden;
}

.pub-authors.collapsible.expanded {
    max-height: none;
    overflow: visible;
}

.pub-authors.collapsible:not(.expanded)::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 1.8em;
    pointer-events: none;
    background: linear-gradient(rgba(255, 255, 255, 0), var(--bg-card));
}

.author-toggle {
    align-self: flex-start;
    margin: -2px 0 12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
}

.author-toggle:hover {
    color: var(--secondary);
}

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

/* Premium Academic Action Link Tags */
.pub-link-btn {
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-alt);
    border: 1px solid var(--border-light);
    padding: 6px 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
    font-family: var(--font-heading);
}

.pub-link-btn:hover {
    color: var(--primary);
    background: var(--bg-light);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.pub-link-btn.featured {
    color: var(--primary);
    border-color: rgba(37, 99, 235, 0.20);
    background: rgba(37, 99, 235, 0.04);
}

.pub-link-btn.featured:hover {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
}

.pub-link-btn svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
}

/* Footer Section */
footer {
    border-top: 1px solid var(--border-light);
    background: var(--bg-alt);
    padding: 36px 20px;
    position: relative;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-text {
    font-size: 0.88rem;
    color: var(--text-dark);
}

/* Animations Scroll Reveal Class */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .bio-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .pub-card {
        grid-template-columns: 180px 1fr;
    }
    
}

@media (max-width: 768px) {
    .nav-container {
        padding: 16px 20px;
    }
    
    header.scrolled .nav-container {
        padding: 12px 20px;
    }
    
    .nav-menu {
        display: none; /* Auto hides nav links on mobile for simplicity, keeping clean logo and profile links */
    }
    
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 24px;
    }
    
    .pub-card {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .pub-media {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }
    
    .pub-links {
        gap: 6px;
    }
}
