:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #60a5fa;
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --dark-bg: #0f0f14;
    --dark-surface: #1a1a24;
    --dark-surface-2: #252538;
    --dark-text: #e5e7eb;
    --light-bg: #ffffff;
    --light-surface: #f9fafb;
    --light-text: #111827;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-hero: linear-gradient(135deg, #0f0f14 0%, #1a1a24 50%, #252538 100%);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 50px rgba(99, 102, 241, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--light-bg);
    color: var(--light-text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-mode {
    background: var(--dark-bg);
    color: var(--dark-text);
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.animated-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 20%, rgba(37, 99, 235, 0.1) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--gradient-hero);
    overflow: hidden;
}

body.dark-mode .hero {
    background: var(--gradient-hero);
}

body:not(.dark-mode) .hero {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.hero-content {
    text-align: center;
    z-index: 2;
    padding: 2rem;
    animation: heroFadeIn 1.5s ease-out;
}

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

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    margin-bottom: 1rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 80px rgba(99, 102, 241, 0.5);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { filter: brightness(1) saturate(1); }
    to { filter: brightness(1.2) saturate(1.2); }
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: var(--primary-light);
    margin-bottom: 2rem;
    opacity: 0.9;
}

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

.btn {
    padding: 1rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Particles */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

body.dark-mode nav {
    background: rgba(26, 26, 36, 0.9);
}

nav.scrolled {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-weight: 700;
    font-size: 1.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--light-text);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

body.dark-mode .nav-links a {
    color: var(--dark-text);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-1);
    transition: width 0.3s ease;
}

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

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

/* Section Styling */
.section {
    margin-bottom: 8rem;
    opacity: 0;
    transform: translateY(30px);
}

.section.visible {
    animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--gradient-1);
    border-radius: 2px;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-image {
    position: relative;
}

.about-image img {
    width: 100%;
    max-width: 400px;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    transition: transform 0.3s ease;
}

.about-image:hover img {
    transform: scale(1.05);
}

.about-image::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: 20px;
    bottom: 20px;
    background: var(--gradient-1);
    border-radius: 20px;
    z-index: -1;
    opacity: 0.5;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.stat-card {
    background: var(--light-surface);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

body.dark-mode .stat-card {
    background: var(--dark-surface);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::before {
    opacity: 0.1;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 1.1rem;
    color: var(--primary);
    margin-top: 0.5rem;
}

/* Publications */
.pub-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.pub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.pub-card {
    background: var(--light-surface);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

body.dark-mode .pub-card {
    background: var(--dark-surface);
}

.pub-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-1);
}

.pub-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.pub-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary);
}

.pub-authors {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

body.dark-mode .pub-authors {
    color: #999;
}

.pub-venue {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1rem;
}

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

.pub-link {
    padding: 0.4rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.pub-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Experience Timeline */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: var(--gradient-1);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding: 2rem 0;
    width: 50%;
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 4rem;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 4rem;
}

.timeline-dot {
    position: absolute;
    top: 2rem;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.timeline-item:nth-child(odd) .timeline-dot {
    right: -10px;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -10px;
}

.timeline-content {
    background: var(--light-surface);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

body.dark-mode .timeline-content {
    background: var(--dark-surface);
}

.timeline-content:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

.timeline-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.timeline-company {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-date {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

body.dark-mode .timeline-date {
    color: #999;
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.contact-card {
    background: var(--light-surface);
    padding: 3rem 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

body.dark-mode .contact-card {
    background: var(--dark-surface);
}

.contact-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.contact-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-1);
    border-radius: 50%;
    font-size: 1.5rem;
    color: white;
}

.contact-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.contact-info {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

body.dark-mode .contact-info {
    color: #999;
}

.contact-info:hover {
    color: var(--primary);
}

/* Footer */
footer {
    background: var(--gradient-1);
    color: white;
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 8rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.social-link {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

/* Dark Mode Toggle */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-xl);
    transition: all 0.3s ease;
    z-index: 999;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

.theme-toggle svg {
    width: 30px;
    height: 30px;
    fill: white;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 8rem;
    width: 50px;
    height: 50px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-xl);
    transition: all 0.3s ease;
    z-index: 998;
}

.back-to-top:hover {
    transform: translateY(-5px);
    background: var(--accent-light);
}

.back-to-top.visible {
    display: flex;
}

/* Loading Animation */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-circle {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        width: 100%;
        left: 0 !important;
        padding-left: 60px !important;
        padding-right: 20px !important;
        text-align: left !important;
    }

    .timeline-dot {
        left: 10px !important;
        right: auto !important;
    }

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

    .hero h1 {
        font-size: clamp(2.5rem, 8vw, 4rem);
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-surface);
}

body.dark-mode ::-webkit-scrollbar-track {
    background: var(--dark-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-1);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Poem Styling */
.poem-container {
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.poem-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

.poem-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    line-height: 2;
    text-align: center;
    color: var(--primary);
    position: relative;
    z-index: 1;
}

body.dark-mode .poem-text {
    color: var(--primary-light);
}

.poem-line {
    margin: 0.5rem 0;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.poem-line:nth-child(1) { animation-delay: 0.2s; }
.poem-line:nth-child(2) { animation-delay: 0.4s; }
.poem-line:nth-child(3) { animation-delay: 0.6s; }
.poem-line:nth-child(4) { animation-delay: 0.8s; }

/* News Section */
.news-ticker {
    background: var(--gradient-1);
    color: white;
    padding: 1rem;
    margin: 2rem 0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.news-content {
    display: flex;
    animation: scroll-left 30s linear infinite; 
}

@keyframes scroll-left {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.news-item {
    white-space: nowrap;
    padding: 0 2rem;
}
.news-item a {
    color: white;
    font-weight: 700;
    text-decoration: underline;
}

.news-item a:hover {
    color: var(--primary-light);
}


/* BibTeX Export Button */
.bibtex-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.bibtex-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* Acknowledgements */
.acknowledgements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.ack-card {
    background: var(--light-surface);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

body.dark-mode .ack-card {
    background: var(--dark-surface);
}

.ack-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.ack-name {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.ack-affiliation {
    font-size: 0.9rem;
    color: #666;
}

body.dark-mode .ack-affiliation {
    color: #999;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background: var(--light-surface);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    display: flex; 
    flex-direction: column; 
}

body.dark-mode .project-card {
    background: var(--dark-surface);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.project-header {
    background: var(--gradient-1);
    padding: 1.5rem;
    color: white;
}

.project-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.project-tech {
    font-size: 0.9rem;
    opacity: 0.9;
}

.project-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

body.dark-mode .project-description {
    color: #aaa;
}

.project-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.project-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}


.scholar-link-container {
    text-align: center;
    margin-bottom: 3rem;
    margin-top: -1rem; 
}

.research-interests {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--light-surface-2);
}

body.dark-mode .research-interests {
    border-top-color: var(--dark-surface-2);
}

.research-interests h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.research-interests dt {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    margin-top: 1rem;
}

.research-interests dd {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: #666;
}

body.dark-mode .research-interests dd {
    color: #999;
}

.project-image {
    width: 100%;
    height: 200px; 
    object-fit: cover; 
}

.pub-grid {
    list-style: none;
    padding: 0;
    margin: 0;
}