@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #2563eb;
    --primary-glow: #3b82f6;
    --accent-gold: #d97706;
    --text-main: #0f172a;
    --text-muted: #475569;
    --bg-base: #f8fafc;
    --glass-surface: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-premium: 0 10px 40px -10px rgba(37, 99, 235, 0.15);
    --neuron-color: rgba(37, 99, 235, 0.2);
    --synapse-color: rgba(37, 99, 235, 0.1);
    /* Fluid Transition Variable */
    --ease-fluid: cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="dark"] {
    --primary: #60a5fa;
    --accent-gold: #fbbf24;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --bg-base: #0b1120;
    --glass-surface: rgba(15, 23, 42, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-premium: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    --neuron-color: rgba(96, 165, 250, 0.3);
    --synapse-color: rgba(96, 165, 250, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-base);
    line-height: 1.75;
    overflow-x: hidden;
    transition: background-color 0.8s var(--ease-fluid), color 0.8s var(--ease-fluid);
}

/* --- ORGANIC FLUID BACKGROUND --- */
#neural-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
}

.fluid-mesh {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -2;
    background: radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.05), transparent 70%);
    filter: blur(60px);
    animation: meshPulse 10s ease-in-out infinite alternate;
}
@keyframes meshPulse { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(1.2); opacity: 0.8; } }

.container { max-width: 1000px; margin: 0 auto; padding: 0 2rem; position: relative; z-index: 1; }

/* --- FLOATING NAV ISLAND --- */
.navbar {
    position: fixed; top: 1.5rem; left: 50%; transform: translateX(-50%);
    width: min(90%, 1000px); z-index: 1000;
    background: var(--glass-surface);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow-premium);
    display: flex; justify-content: space-between; align-items: center;
    transition: all 0.5s var(--ease-fluid);
}
.nav-logo { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-size: 1.25rem; color: var(--text-main); text-decoration: none; }
.nav-menu { list-style: none; display: flex; gap: 1.5rem; }
.nav-menu a { 
    font-weight: 600; font-size: 0.9rem; color: var(--text-muted); text-decoration: none; 
    transition: color 0.3s var(--ease-fluid), transform 0.3s var(--ease-fluid);
}
.nav-menu a:hover { color: var(--primary); transform: translateY(-1px); }
.theme-toggle { background: none; border: none; cursor: pointer; font-size: 1.2rem; color: var(--text-main); transition: transform 0.5s var(--ease-fluid); }
.theme-toggle:hover { transform: rotate(20deg); }

/* --- HERO SECTION --- */
.hero { padding: 10rem 0 5rem; text-align: center; }
.profile-wrapper { position: relative; display: inline-block; margin-bottom: 2rem; }
.profile-photo {
    width: 160px; height: 160px; border-radius: 50%; object-fit: cover;
    border: 3px solid white; box-shadow: var(--shadow-premium);
    transition: transform 0.6s var(--ease-fluid);
}
.profile-wrapper:hover .profile-photo { transform: scale(1.05) rotate(2deg); }

.hero h1 {
    font-family: 'Plus Jakarta Sans'; font-size: 3.5rem; font-weight: 800;
    letter-spacing: -0.04em; margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--primary) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    transition: all 0.5s var(--ease-fluid);
}
.subtitle { font-size: 1.25rem; color: var(--text-muted); max-width: 700px; margin: 0 auto 2.5rem; }

.social-links { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.social-link {
    padding: 0.6rem 1.2rem; background: var(--glass-surface); border: 1px solid var(--glass-border);
    border-radius: 999px; font-weight: 600; font-size: 0.9rem; color: var(--text-main);
    text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
    transition: all 0.4s var(--ease-fluid);
    backdrop-filter: blur(8px);
}
.social-link:hover { 
    transform: translateY(-3px) scale(1.02); 
    border-color: var(--primary); color: var(--primary); 
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.2);
}

/* --- SECTIONS & CARDS --- */
.section { padding: 4rem 0; }
.section-title {
    font-family: 'Plus Jakarta Sans'; font-size: 1.75rem; font-weight: 700;
    margin-bottom: 2rem; display: flex; align-items: center; gap: 1rem;
}
.section-title::before { content: ''; width: 4px; height: 24px; background: var(--primary); border-radius: 2px; }

.card {
    background: var(--glass-surface); border: 1px solid var(--glass-border);
    border-radius: 20px; padding: 2rem; margin-bottom: 2rem;
    backdrop-filter: blur(12px); box-shadow: var(--shadow-premium);
    transition: transform 0.5s var(--ease-fluid), box-shadow 0.5s var(--ease-fluid);
}
.card:hover { transform: translateY(-5px); box-shadow: 0 20px 50px -10px rgba(37, 99, 235, 0.2); }

/* Timeline */
.timeline-item { position: relative; padding-left: 2rem; margin-bottom: 2.5rem; transition: transform 0.3s var(--ease-fluid); }
.timeline-item:hover { transform: translateX(5px); }
.timeline-item::before {
    content: ''; position: absolute; left: 0; top: 0.5rem; width: 10px; height: 10px;
    border-radius: 50%; background: var(--primary); border: 2px solid var(--bg-base);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2); transition: all 0.3s var(--ease-fluid);
}
.timeline-item:hover::before { transform: scale(1.3); box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.1); }

.timeline-header { display: flex; justify-content: space-between; flex-wrap: wrap; margin-bottom: 0.5rem; }
.timeline-title { font-weight: 700; font-size: 1.1rem; }
.timeline-subtitle { color: var(--primary); font-weight: 600; font-size: 0.95rem; }
.timeline-date { font-size: 0.85rem; color: var(--text-muted); background: rgba(0,0,0,0.03); padding: 0.25rem 0.75rem; border-radius: 999px; }

/* Projects Grid */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.project-card {
    background: var(--glass-surface); border: 1px solid var(--glass-border);
    border-radius: 16px; padding: 1.5rem; transition: all 0.5s var(--ease-fluid); backdrop-filter: blur(12px);
}
.project-card:hover { 
    transform: translateY(-8px) scale(1.01); 
    border-color: var(--primary); 
    box-shadow: var(--shadow-premium); 
}
.project-icon { font-size: 2rem; margin-bottom: 1rem; transition: transform 0.5s var(--ease-fluid); }
.project-card:hover .project-icon { transform: scale(1.1) rotate(-5deg); }

/* Publications */
.pub-card {
    background: var(--glass-surface); border-left: 4px solid var(--primary);
    padding: 1.5rem; margin-bottom: 1.5rem; border-radius: 0 12px 12px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03); transition: all 0.4s var(--ease-fluid); backdrop-filter: blur(12px);
}
.pub-card:hover { transform: translateX(8px); background: white; }
[data-theme="dark"] .pub-card:hover { background: rgba(30, 41, 59, 0.8); }
.pub-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.5rem; line-height: 1.4; }
.pub-meta { font-size: 0.9rem; color: var(--text-muted); }
.badge {
    display: inline-block; padding: 0.2rem 0.6rem; border-radius: 4px;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; margin-right: 0.5rem;
    transition: transform 0.3s var(--ease-fluid);
}
.badge:hover { transform: scale(1.1); }
.badge-q1 { background: #fef3c7; color: #d97706; border: 1px solid #fcd34d; }
.badge-cite { background: #dbeafe; color: #1e40af; }

/* Footer */
.footer { text-align: center; padding: 3rem 0; color: var(--text-muted); font-size: 0.9rem; border-top: 1px solid var(--glass-border); margin-top: 4rem; }

/* Animations */
.fade-in { opacity: 0; transform: translateY(40px); transition: all 1s var(--ease-fluid); }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .nav-menu { display: none; }
    .timeline-header { flex-direction: column; }
}
