/* ==========================================================================
   Ali Cheraghian - Academic Portfolio
   Enhanced with Glassmorphism, Gradients, and Modern Visual Effects
   ========================================================================== */

/* ==========================================================================
   CSS Variables - Light Mode (Default)
   ========================================================================== */
:root {
    /* Colors */
    --primary-color: #002b5e;
    --primary-light: #0a4a8a;
    --primary-dark: #001a3a;
    --secondary-color: #a7c5ed;
    --accent-color: #00d4ff;
    --accent-warm: #f59e0b;
    --accent-warm-light: #fbbf24;
    --accent-warm-bg: rgba(245, 158, 11, 0.08);
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-color: #333;
    --text-muted: #666;
    --bg-color: #f0f4f8;
    --card-bg: #fff;
    --card-bg-glass: rgba(255, 255, 255, 0.7);
    --hover-color: #003875;
    --border-color: rgba(0, 43, 94, 0.1);
    --border-color-glass: rgba(255, 255, 255, 0.5);

    /* Shadows - Elevation System */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1), 0 6px 10px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12), 0 10px 20px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 30px rgba(0, 43, 94, 0.15);
    --shadow-color: rgba(0, 0, 0, 0.1);

    /* Glassmorphism */
    --glass-blur: 20px;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #002b5e 0%, #0a4a8a 50%, #1a6fc4 100%);
    --gradient-secondary: linear-gradient(135deg, #a7c5ed 0%, #d4e4f7 100%);
    --gradient-accent: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    --gradient-mesh: radial-gradient(at 40% 20%, rgba(0, 212, 255, 0.12) 0px, transparent 50%),
                     radial-gradient(at 80% 0%, rgba(167, 197, 237, 0.18) 0px, transparent 50%),
                     radial-gradient(at 0% 50%, rgba(0, 43, 94, 0.08) 0px, transparent 50%),
                     radial-gradient(at 80% 50%, rgba(167, 197, 237, 0.12) 0px, transparent 50%),
                     radial-gradient(at 0% 100%, rgba(0, 212, 255, 0.08) 0px, transparent 50%),
                     radial-gradient(at 60% 80%, rgba(245, 158, 11, 0.06) 0px, transparent 40%),
                     radial-gradient(at 20% 70%, rgba(139, 92, 246, 0.05) 0px, transparent 40%);

    /* Typography - Serif Display for headings */
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Animation */
    --animation-duration: 0.5s;
    --animation-timing: cubic-bezier(0.4, 0, 0.2, 1);
    --animation-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Focus */
    --focus-ring-color: #4a90d9;
    --focus-ring-offset: 2px;

    /* Spacing */
    --container-max-width: 1200px;
    --section-padding: 2rem;
    --card-radius: 16px;
    --card-radius-lg: 24px;
}

/* ==========================================================================
   CSS Variables - Dark Mode
   Managed via html.dark-mode class (set by JS based on system preference
   or user toggle). Single source of truth for dark theme variables.
   ========================================================================== */
html.dark-mode {
    --primary-color: #58a6ff;
    --primary-light: #79c0ff;
    --primary-dark: #388bfd;
    --secondary-color: #8b949e;
    --accent-color: #00d4ff;
    --accent-warm: #fbbf24;
    --accent-warm-light: #fcd34d;
    --accent-warm-bg: rgba(251, 191, 36, 0.1);
    --text-color: #c9d1d9;
    --text-muted: #8b949e;
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --card-bg-glass: rgba(22, 27, 34, 0.8);
    --hover-color: #79c0ff;
    --border-color: rgba(139, 148, 158, 0.2);
    --border-color-glass: rgba(88, 166, 255, 0.2);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 30px rgba(88, 166, 255, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --glass-bg: rgba(22, 27, 34, 0.85);
    --glass-border: rgba(88, 166, 255, 0.15);
    --gradient-primary: linear-gradient(135deg, #161b22 0%, #21262d 50%, #30363d 100%);
    --gradient-mesh: radial-gradient(at 40% 20%, rgba(88, 166, 255, 0.1) 0px, transparent 50%),
                     radial-gradient(at 80% 0%, rgba(139, 148, 158, 0.1) 0px, transparent 50%),
                     radial-gradient(at 0% 50%, rgba(88, 166, 255, 0.08) 0px, transparent 50%);
    --focus-ring-color: #58a6ff;
}

/* ==========================================================================
   Scroll Progress Bar
   ========================================================================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-warm), var(--accent-color));
    z-index: 10001;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
    min-height: 100vh;
}

/* Mesh gradient background overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-mesh);
    pointer-events: none;
    z-index: -1;
}

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

/* ==========================================================================
   Accessibility - Skip Link
   ========================================================================== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-primary);
    color: #fff;
    padding: 1rem 2rem;
    z-index: 10000;
    border-radius: 0 0 var(--card-radius) var(--card-radius);
    text-decoration: none;
    font-weight: 600;
    transition: top 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.skip-link:focus {
    top: 0;
    outline: none;
}

/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Focus States - Accessibility
   ========================================================================== */
:focus-visible {
    outline: 3px solid var(--focus-ring-color);
    outline-offset: var(--focus-ring-offset);
    border-radius: 4px;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--focus-ring-color);
    outline-offset: var(--focus-ring-offset);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-10px) rotate(2deg);
    }
    66% {
        transform: translateY(5px) rotate(-1deg);
    }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(0, 212, 255, 0);
    }
}

@keyframes borderGlow {
    0%, 100% {
        border-color: var(--secondary-color);
        box-shadow: 0 0 20px rgba(167, 197, 237, 0.3);
    }
    50% {
        border-color: var(--accent-color);
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.4);
    }
}

/* Animation utilities - prevent flicker */
.animate-on-load {
    opacity: 0;
    animation-fill-mode: both;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    line-height: 1.3;
    font-family: var(--font-display);
}

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

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

/* ==========================================================================
   Layout - Header with Animated Gradient
   ========================================================================== */
header {
    background: var(--gradient-primary);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    color: #fff;
    padding: 4rem 0 3rem;
    position: relative;
    overflow: hidden;
}

/* Subtle background texture */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color), var(--secondary-color));
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

html.dark-mode header {
    background: var(--gradient-primary);
}

html.dark-mode header::after {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--primary-color));
    background-size: 200% 100%;
}

.header-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--section-padding);
    position: relative;
    z-index: 1;
}

.hero-layout {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    text-align: left;
}

.hero-text {
    flex: 1;
    min-width: 0;
}

header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
    opacity: 0;
    animation: fadeInUp var(--animation-duration) var(--animation-timing) forwards;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

header .title {
    font-size: 1.2rem;
    margin: 0.5rem 0;
    color: var(--secondary-color);
    opacity: 0;
    animation: fadeInUp var(--animation-duration) var(--animation-timing) 0.2s forwards;
}

.hero-tagline {
    font-size: 1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
    margin: 0.75rem 0;
    line-height: 1.6;
    opacity: 0;
    animation: fadeInUp var(--animation-duration) var(--animation-timing) 0.3s forwards;
}

html.dark-mode .hero-tagline {
    color: rgba(201, 209, 217, 0.85);
}

.hero-venues {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
}

.hero-venue-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.12);
    color: var(--accent-warm-light);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin: 0.15rem 0.1rem;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

html.dark-mode .hero-venue-tag {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.25);
}

/* Hero Metric Badges */
.hero-metrics {
    display: flex;
    gap: 0.75rem;
    margin: 1rem 0;
    opacity: 0;
    animation: fadeInUp var(--animation-duration) var(--animation-timing) 0.35s forwards;
}

.metric-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 70px;
}

.metric-badge:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-2px);
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 500;
    line-height: 1.2;
}

.metric-label {
    font-size: 0.7rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

html.dark-mode .metric-badge {
    background: rgba(88, 166, 255, 0.1);
    border-color: rgba(88, 166, 255, 0.2);
    color: var(--text-color);
}

html.dark-mode .metric-badge:hover {
    background: rgba(88, 166, 255, 0.2);
    color: #fff;
}

html.dark-mode header .title {
    color: #8b949e;
}

/* ==========================================================================
   Dark Mode Toggle - Enhanced
   ========================================================================== */
.theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.4s var(--animation-timing);
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1) rotate(15deg);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(255, 255, 255, 0.2);
}

.theme-toggle:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    position: absolute;
    transition: opacity 0.4s ease, transform 0.4s var(--animation-bounce);
}

.theme-toggle .sun-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.theme-toggle .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

html.dark-mode .theme-toggle .sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

html.dark-mode .theme-toggle .moon-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

/* ==========================================================================
   Component - Profile Photo with Gradient Ring
   ========================================================================== */
.profile-photo {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
    border: 4px solid transparent;
    background:
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        linear-gradient(135deg, var(--secondary-color), var(--accent-color), var(--secondary-color)) border-box;
    box-shadow:
        var(--shadow-xl),
        0 0 40px rgba(167, 197, 237, 0.3);
    object-fit: cover;
    opacity: 0;
    animation: scaleIn var(--animation-duration) var(--animation-timing) forwards;
}

html.dark-mode .profile-photo {
    background:
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        linear-gradient(135deg, var(--primary-color), var(--accent-color), var(--primary-color)) border-box;
    box-shadow:
        var(--shadow-xl),
        0 0 40px rgba(88, 166, 255, 0.2);
}

/* ==========================================================================
   Component - Contact Links with Glass Effect
   ========================================================================== */
.contact-links {
    margin: 0.75rem 0 0;
    opacity: 0;
    animation: fadeInUp var(--animation-duration) var(--animation-timing) 0.4s forwards;
}

.contact-links a {
    color: #fff;
    text-decoration: none;
    margin: 0.25rem;
    padding: 0.6rem 1.25rem;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    transition: all 0.4s var(--animation-timing);
    display: inline-block;
    font-weight: 400;
    box-shadow: var(--shadow-sm);
}

.contact-links a:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(255, 255, 255, 0.2);
}

html.dark-mode .contact-links a {
    color: var(--text-color);
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

html.dark-mode .contact-links a:hover {
    background: rgba(88, 166, 255, 0.2);
    color: #fff;
    box-shadow: var(--shadow-lg), 0 0 20px rgba(88, 166, 255, 0.3);
}

/* Social link with icon */
.social-link {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
}

.social-icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.social-link:hover .social-icon {
    transform: scale(1.15);
}

/* ==========================================================================
   Component - Bio/About Section
   ========================================================================== */
.bio-text {
    max-width: 850px;
    margin: 2rem auto;
    line-height: 1.8;
    text-align: center;
    color: rgba(255, 255, 255, 0.95);
    opacity: 0;
    animation: fadeInUp var(--animation-duration) var(--animation-timing) 0.5s forwards;
}

.bio-text p {
    margin: 0 0 1rem 0;
}

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

.bio-text strong {
    color: #fff;
    font-weight: 600;
}

.bio-text .research-interests {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin: 1.25rem 0;
    font-size: 0.95rem;
}

html.dark-mode .bio-text {
    color: var(--text-color);
}

html.dark-mode .bio-text strong {
    color: var(--primary-color);
}

html.dark-mode .bio-text .research-interests {
    background: rgba(88, 166, 255, 0.1);
    border-color: rgba(88, 166, 255, 0.2);
}

/* ==========================================================================
   Section Navigation (Sticky)
   ========================================================================== */
.section-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.section-nav a {
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1.5px solid var(--primary-color);
    background: transparent;
    transition: all 0.3s ease;
}

.section-nav a:hover {
    color: #fff;
    background: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .section-nav {
        gap: 0.3rem;
        padding: 0.6rem 0.75rem;
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .section-nav::-webkit-scrollbar { display: none; }
    .section-nav a {
        padding: 0.4rem 0.9rem;
        font-size: 0.78rem;
    }
}

/* ==========================================================================
   Layout - Main Content
   ========================================================================== */
main {
    padding: var(--section-padding);
    max-width: var(--container-max-width);
    margin: 0 auto;
}

/* ==========================================================================
   Component - News Section with Glassmorphism
   ========================================================================== */
.news-section {
    max-width: 900px;
    margin: 3rem auto;
    text-align: left;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    padding: var(--section-padding);
    border-radius: var(--card-radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

/* Accent top bar - warm */
.news-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-warm), var(--accent-warm-light), transparent);
    border-radius: var(--card-radius-lg) var(--card-radius-lg) 0 0;
}

/* Subtle gradient overlay - warm tint */
.news-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.news-section:hover {
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    transform: translateY(-2px);
}

.news-section h2 {
    text-align: left;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 0.75rem;
}

.news-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.news-section ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 1;
}

.news-section li {
    position: relative;
    padding: 1rem 0 1rem 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.6;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    border-radius: 8px;
}

.news-section li:last-child {
    border-bottom: none;
}

.news-section li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1.35rem;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    transition: all 0.3s ease;
}

.news-section li:hover {
    transform: translateX(8px);
    background: rgba(167, 197, 237, 0.1);
    padding-left: 2rem;
}

.news-section li:hover::before {
    transform: scale(1.3);
    box-shadow: 0 0 10px var(--accent-color);
}

.news-section a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.news-section a:hover {
    color: var(--hover-color);
}

.news-older {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.news-older.expanded {
    max-height: 1000px;
}

.news-toggle {
    display: block;
    margin: 1rem auto 0;
    padding: 0.5rem 1.5rem;
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--animation-timing);
    position: relative;
    z-index: 1;
}

.news-toggle:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.venue {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.85em;
    background: var(--border-color);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
}

/* ==========================================================================
   Component - CV Section (Experience & Education)
   ========================================================================== */
.cv-section {
    max-width: 900px;
    margin: 3rem auto;
    text-align: left;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    padding: var(--section-padding);
    border-radius: var(--card-radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.cv-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

/* CV section accent bar - green tint */
.cv-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #10b981, #34d399, transparent);
    border-radius: var(--card-radius-lg) var(--card-radius-lg) 0 0;
}

.cv-section:hover {
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    transform: translateY(-2px);
}

.cv-section h2 {
    text-align: left;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 0.5rem;
}

.cv-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.cv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

/* Centered full-width row for an odd research card */
.cv-col--center {
    grid-column: 1 / -1;
    width: calc(50% - 1rem);
    margin: 0 auto;
}

.cv-list {
    position: relative;
}

/* Vertical timeline line */
.cv-list:not(.research-list) {
    padding-left: 1.25rem;
    border-left: 2px solid var(--border-color);
    margin-left: 0.25rem;
}

.cv-list:not(.research-list) .cv-item {
    position: relative;
}

.cv-list:not(.research-list) .cv-item::before {
    content: '';
    position: absolute;
    left: -1.55rem;
    top: 0.65rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid var(--card-bg);
    box-shadow: 0 0 0 2px var(--primary-color);
    z-index: 1;
}

.cv-list:not(.research-list) .cv-item.cv-item--current::before {
    background: var(--accent-warm);
    box-shadow: 0 0 0 2px var(--accent-warm);
}

.cv-item {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-color);
}

.cv-item:last-child {
    border-bottom: none;
}

.cv-year {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 0.5rem;
    white-space: nowrap;
}

.cv-title {
    font-weight: 600;
    color: var(--primary-color);
}

.cv-sub {
    font-size: 0.82rem;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 0.15rem;
    padding-left: 0;
}

@media (max-width: 768px) {
    .cv-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .cv-col--center {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cv-section {
        padding: 1.25rem;
        margin: 1.5rem auto;
    }
    .cv-year {
        display: block;
        margin-bottom: 0.1rem;
    }
}

/* ==========================================================================
   Component - Chatbot Section (Compact)
   ========================================================================== */
.chatbot-section {
    max-width: 900px;
    margin: 3rem auto;
    text-align: left;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    padding: 1.5rem 2rem;
    border-radius: var(--card-radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.chatbot-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.chatbot-section:hover {
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    transform: translateY(-2px);
}

.chatbot-section h2 {
    text-align: left;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-size: 1.3rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.chatbot-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.chatbot-intro {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.chatbot-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.sample-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
}

.sample-question {
    background: var(--border-color);
    color: var(--text-color);
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    font-size: 0.82rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.sample-question:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.chatbot-launch-button {
    display: inline-block;
    padding: 0.55rem 1.5rem;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    flex-shrink: 0;
}

.chatbot-launch-button:hover {
    background: var(--hover-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.chatbot-launch-button:focus-visible {
    outline: 3px solid var(--focus-ring-color);
    outline-offset: 2px;
}

/* ==========================================================================
   Component - Publications Section with Glass Effect
   ========================================================================== */
.publications-section {
    max-width: var(--container-max-width);
    margin: 3rem auto;
    text-align: left;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    padding: var(--section-padding);
    border-radius: var(--card-radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
    transition: all 0.4s ease;
    position: relative;
}

.publications-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 43, 94, 0.03) 0%, transparent 50%);
    pointer-events: none;
    border-radius: var(--card-radius-lg);
}

.publications-section:hover {
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.publications-section h2 {
    text-align: left;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 0.75rem;
}

.publications-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

/* Citation Stats Container */
.stats-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

.citation-graph {
    flex: 1;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-md);
    height: 300px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.citation-graph:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.citation-graph h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.citation-stats {
    flex: 1;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.citation-stats:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.citation-stats h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding: 1rem;
    border-radius: 12px;
    border-bottom: none;
    transition: all 0.3s ease;
    background: var(--accent-warm-bg);
    border: 1px solid rgba(245, 158, 11, 0.1);
}

.stat-item:hover {
    transform: translateX(5px);
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.2);
}

html.dark-mode .stat-item {
    background: var(--accent-warm-bg);
    border-color: rgba(251, 191, 36, 0.1);
}

html.dark-mode .stat-item:hover {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.25);
}

.stat-label {
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 400;
}

.stat-value {
    color: var(--primary-color);
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--accent-warm), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Publications List with CSS Grid */
.publications-list {
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

.publications-list h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.publications-list h4 {
    display: inline-block;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin: 2.5rem 0 1.25rem;
    padding: 0.4rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50px;
    border-bottom: none;
    border-image: none;
    position: relative;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
}

html.dark-mode .publications-list h4 {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.15), rgba(88, 166, 255, 0.25));
    color: var(--primary-color);
}

.publications-list h4:first-child {
    margin-top: 0;
}

.publications-list ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.publications-list ul:last-child {
    margin-bottom: 0;
}

/* Publication Item - CSS Grid Layout with Card Effect */
.publications-list li,
.publication-item {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    padding: 1.25rem;
    border-radius: var(--card-radius);
    transition: all 0.4s var(--animation-timing);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.publications-list li:hover,
.publication-item:hover {
    transform: translateY(-2px);
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.publication-thumbnail {
    width: 130px;
    height: 90px;
    object-fit: contain;
    background-color: rgba(240, 244, 248, 0.5);
    padding: 0.5rem;
    margin: 0;
    display: block;
    border-radius: 8px;
    transition: all 0.4s var(--animation-timing);
    border: 1px solid var(--border-color);
}

html.dark-mode .publication-thumbnail {
    background-color: rgba(30, 35, 42, 0.5);
}

.publications-list li:hover .publication-thumbnail,
.publication-item:hover .publication-thumbnail {
    transform: scale(1.08);
    box-shadow: var(--shadow-md);
}

.publication-content {
    flex: 1;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.publication-content strong {
    color: var(--primary-color);
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.publication-content a {
    text-decoration: none;
    transition: color 0.3s ease;
}

.publication-badge {
    display: inline-block;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.6rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    margin-left: 0.35rem;
}

.publication-content a:hover strong {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   Component - Research Areas (extends CV Section styles)
   ========================================================================== */
.research-venues {
    font-size: 0.78rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 0.2rem;
}

.research-col-heading {
    visibility: hidden;
}

/* Research Area Cards - uses .cv-item.research-card for specificity over .cv-item */
.cv-item.research-card {
    position: relative;
    padding: 0.75rem 0.75rem 0.75rem 3rem;
    border-radius: 10px;
    border-bottom: none;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.research-icon {
    position: absolute;
    left: 0.6rem;
    top: 0.75rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}

.cv-item.research-card--vlm {
    background: rgba(99, 102, 241, 0.06);
    border-left: 3px solid rgba(99, 102, 241, 0.4);
}
.research-card--vlm .research-icon { color: #6366f1; }

.cv-item.research-card--mllm {
    background: rgba(239, 68, 68, 0.06);
    border-left: 3px solid rgba(239, 68, 68, 0.4);
}
.research-card--mllm .research-icon { color: #ef4444; }

.cv-item.research-card--distill {
    background: rgba(245, 158, 11, 0.06);
    border-left: 3px solid rgba(245, 158, 11, 0.4);
}
.research-card--distill .research-icon { color: #f59e0b; }

.cv-item.research-card--3d {
    background: rgba(16, 185, 129, 0.06);
    border-left: 3px solid rgba(16, 185, 129, 0.4);
}
.research-card--3d .research-icon { color: #10b981; }

.cv-item.research-card--fewshot {
    background: rgba(236, 72, 153, 0.06);
    border-left: 3px solid rgba(236, 72, 153, 0.4);
}
.research-card--fewshot .research-icon { color: #ec4899; }

.cv-item.research-card--tta {
    background: rgba(0, 212, 255, 0.06);
    border-left: 3px solid rgba(0, 212, 255, 0.4);
}
.research-card--tta .research-icon { color: #00d4ff; }

.cv-item.research-card--applied {
    background: rgba(245, 158, 11, 0.04);
    border-left: 3px solid rgba(139, 92, 246, 0.4);
}
.research-card--applied .research-icon { color: #8b5cf6; }

.research-card:hover {
    transform: translateX(4px);
}

html.dark-mode .research-card--vlm { background: rgba(99, 102, 241, 0.08); }
html.dark-mode .research-card--mllm { background: rgba(239, 68, 68, 0.08); }
html.dark-mode .research-card--distill { background: rgba(245, 158, 11, 0.08); }
html.dark-mode .research-card--3d { background: rgba(16, 185, 129, 0.08); }
html.dark-mode .research-card--fewshot { background: rgba(236, 72, 153, 0.08); }
html.dark-mode .research-card--tta { background: rgba(0, 212, 255, 0.08); }
html.dark-mode .research-card--applied { background: rgba(139, 92, 246, 0.08); }

/* ==========================================================================
   Component - Venue Tier Badges
   ========================================================================== */
.venue-badge {
    display: inline;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    letter-spacing: 0.3px;
    vertical-align: middle;
    margin-left: 0.25rem;
    line-height: 1;
    white-space: nowrap;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.venue-badge.tier-1 {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

html.dark-mode .venue-badge.tier-1 {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.venue-badge.tier-2 {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
}

html.dark-mode .venue-badge.tier-2 {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

/* ==========================================================================
   Component - Publication Filters
   ========================================================================== */
.pub-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.filter-btn {
    padding: 0.4rem 1rem;
    border: 1.5px solid var(--primary-color);
    border-radius: 50px;
    background: transparent;
    color: var(--primary-color);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.filter-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.filter-btn.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Scroll-spy Active Nav State with Animated Indicator
   ========================================================================== */
.section-nav a.active {
    color: #fff;
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 43, 94, 0.3);
}

/* ==========================================================================
   Component - Footer with Glass Effect
   ========================================================================== */
footer {
    background: var(--gradient-primary);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    color: rgba(255, 255, 255, 0.9);
    padding: 2.5rem 2rem;
    text-align: center;
    margin-top: 3rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color), var(--secondary-color));
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

html.dark-mode footer {
    background: var(--gradient-primary);
}

.footer-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    position: relative;
    z-index: 1;
}

.footer-copyright {
    font-size: 0.9rem;
    font-weight: 400;
}

/* Visitor Counter in Footer - Glass Style */
.visitor-counter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.visitor-counter:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
}

html.dark-mode .visitor-counter {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(88, 166, 255, 0.2);
}

.visitor-counter-label {
    font-weight: 600;
}

.visitor-counter[hidden] {
    display: none;
}

.visitor-icon {
    display: block;
    opacity: 0.8;
}

.visitor-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.visitor-counter-label {
    opacity: 0.85;
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.text-center {
    text-align: center;
}

/* ==========================================================================
   Section Separators
   ========================================================================== */
.section-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0 auto;
    max-width: 200px;
    padding: 0.5rem 0;
}

.section-separator::before,
.section-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--secondary-color));
    opacity: 0.4;
}

.section-separator::after {
    background: linear-gradient(90deg, var(--secondary-color), transparent);
}

.section-separator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-warm), var(--primary-color));
    opacity: 0.5;
    flex-shrink: 0;
}

/* ==========================================================================
   Scroll Reveal Animations
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Publications section: fade only, skip transform (too large for smooth translateY) */
.publications-section.reveal {
    transform: none;
    transition: opacity 0.5s ease;
}

.publications-section.reveal.visible {
    transform: none;
}

/* ==========================================================================
   Staggered Reveal Animations
   ========================================================================== */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.24s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.32s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.4s; }

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body::before {
        display: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    header {
        padding: 1rem 0;
        background: #002b5e !important;
        color: #fff !important;
    }

    header h1 {
        font-size: 24pt;
        color: #fff !important;
    }

    .theme-toggle,
    .chatbot-section,
    .visitor-counter,
    .skip-link,
    .scroll-progress {
        display: none !important;
    }

    a {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }

    .contact-links a[href]::after {
        content: none;
    }

    .publications-list li,
    .publication-item {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    h2, h3, h4 {
        page-break-after: avoid;
    }

    img {
        max-width: 100% !important;
    }

    .publication-thumbnail {
        width: 80px;
        height: 60px;
    }
}

/* ==========================================================================
   Media Queries - Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    :root {
        --section-padding: 1.5rem;
        --card-radius: 12px;
        --card-radius-lg: 16px;
    }

    .hero-layout {
        flex-direction: column;
        text-align: center;
    }

    .hero-text {
        text-align: center;
    }

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

    .contact-links {
        text-align: center;
    }

    header h1 {
        font-size: 2rem;
    }

    header .title {
        font-size: 1.1rem;
    }

    .profile-photo {
        width: 140px;
        height: 140px;
    }

    .contact-links a {
        margin: 0.25rem;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .stats-container {
        flex-direction: column;
    }

    .citation-graph {
        display: none;
    }

    .citation-stats {
        width: 100%;
    }

    /* Stack publications on mobile */
    .publications-list li,
    .publication-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .publication-thumbnail {
        width: 100%;
        max-width: 200px;
        height: auto;
        margin: 0 auto;
    }

    /* Chatbot responsive */
    .chatbot-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .chatbot-launch-button {
        text-align: center;
    }

    /* Footer responsive */
    .footer-content {
        padding: 0 1rem;
    }

    /* Remove backdrop-filter on mobile for performance */
    .publications-section,
    .news-section,
    .cv-section,
    .chatbot-section,
    .section-nav {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--card-bg);
    }

    /* Publications section: always visible, no animation */
    .publications-section.reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    /* Simplify publication cards on mobile */
    .publications-list li,
    .publication-item {
        transition: none;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }

    .publication-thumbnail {
        transition: none;
    }

    .publication-content strong {
        transition: none;
    }

    /* Disable all hover transforms on mobile */
    .publications-section:hover,
    .news-section:hover,
    .cv-section:hover,
    .chatbot-section:hover {
        transform: none;
        box-shadow: var(--shadow-lg);
    }

    .publications-list li:hover,
    .publication-item:hover {
        transform: none;
    }

    .publications-list li:hover .publication-thumbnail,
    .publication-item:hover .publication-thumbnail {
        transform: none;
    }

    .citation-graph:hover,
    .citation-stats:hover,
    .stat-item:hover {
        transform: none;
    }

    /* Research cards - reduce left padding for icons */
    .cv-item.research-card {
        padding: 0.6rem 0.6rem 0.6rem 2.5rem;
    }

    .research-icon {
        left: 0.5rem;
        top: 0.6rem;
        width: 20px;
        height: 20px;
    }

    .research-icon svg {
        width: 18px;
        height: 18px;
    }

    /* CV timeline - adjust for single column */
    .cv-list:not(.research-list) {
        padding-left: 1rem;
        margin-left: 0.15rem;
    }

    .cv-list:not(.research-list) .cv-item::before {
        left: -1.25rem;
        width: 8px;
        height: 8px;
    }

    /* Hero venue tags - ensure wrapping */
    .hero-venues {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }

    /* Publication year badges - reduce spacing */
    .publications-list h4 {
        margin: 1.75rem 0 1rem;
        font-size: 0.9rem;
        padding: 0.35rem 1rem;
    }

    /* Stat items - reduce padding */
    .stat-item {
        padding: 0.75rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    /* Reduce hero gap in column layout */
    .hero-layout {
        gap: 1.5rem;
    }
}

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

    header .title {
        font-size: 1rem;
    }

    .profile-photo {
        width: 120px;
        height: 120px;
    }

    .hero-metrics {
        gap: 0.5rem;
    }

    .metric-badge {
        padding: 0.4rem 0.75rem;
        min-width: 60px;
    }

    .metric-value {
        font-size: 1.1rem;
    }

    .contact-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .contact-links a {
        flex: 0 1 auto;
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .research-col-heading {
        display: none;
    }

    .pub-filters {
        gap: 0.35rem;
    }

    .filter-btn {
        padding: 0.3rem 0.75rem;
        font-size: 0.75rem;
    }

    .news-section,
    .publications-section {
        padding: 1.25rem;
        margin: 1.5rem auto;
    }

    .theme-toggle {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    /* Research cards - compact on small screens */
    .cv-item.research-card {
        padding: 0.5rem 0.5rem 0.5rem 2.25rem;
    }

    .research-icon {
        left: 0.4rem;
        top: 0.5rem;
        width: 18px;
        height: 18px;
    }

    .research-icon svg {
        width: 16px;
        height: 16px;
    }

    /* CV timeline - compact */
    .cv-list:not(.research-list) {
        padding-left: 0.85rem;
        margin-left: 0.1rem;
    }

    .cv-list:not(.research-list) .cv-item::before {
        left: -1.1rem;
        width: 7px;
        height: 7px;
    }

    /* Hero venue tags */
    .hero-venue-tag {
        font-size: 0.7rem;
        padding: 0.1rem 0.4rem;
    }

    /* Publication year badges */
    .publications-list h4 {
        margin: 1.5rem 0 0.75rem;
        font-size: 0.85rem;
        padding: 0.3rem 0.9rem;
    }

    /* Stat items */
    .stat-item {
        padding: 0.6rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: currentColor;
        --glass-bg: var(--card-bg);
    }

    .contact-links a,
    .sample-question,
    .chatbot-launch-button {
        border-width: 2px;
    }

    :focus-visible {
        outline-width: 4px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    header {
        animation: none;
        background-size: 100% 100%;
    }

    .chatbot-container {
        animation: none;
        background-size: 100% 100%;
    }

    .reveal,
    .reveal-stagger > * {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .scroll-progress {
        display: none;
    }
}
