:root {
    /* Colors - Elegant Modern Palette */
    --bg-primary: #1a1d21; /* Deep Charcoal */
    --bg-secondary: #22262b; /* Slightly lighter charcoal */
    --bg-card: rgba(255, 255, 255, 0.05); /* Glassmorphism base */
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    
    --text-primary: #f0f2f5; /* Soft White */
    --text-secondary: #a0aec0; /* Muted Gray */
    --text-accent: #64ffda; /* Teal Accent */
    
    --accent-primary: #64ffda; /* Teal */
    --accent-secondary: #818cf8; /* Indigo */
    --accent-tertiary: #94a3b8; /* Slate */
    
    --border-color: rgba(255, 255, 255, 0.1);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Animated background orbs for fluid effect */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
}

body::before {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(100, 255, 218, 0.15), transparent);
    top: -250px;
    left: -250px;
    animation: float-orb-1 25s ease-in-out infinite;
}

body::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.12), transparent);
    bottom: -200px;
    right: -200px;
    animation: float-orb-2 30s ease-in-out infinite;
}

/* Smooth floating animations */
@keyframes float-orb-1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30vw, 20vh) scale(1.1);
    }
    50% {
        transform: translate(10vw, 40vh) scale(0.9);
    }
    75% {
        transform: translate(-10vw, 20vh) scale(1.05);
    }
}

@keyframes float-orb-2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(-20vw, -30vh) scale(0.95);
    }
    50% {
        transform: translate(-40vw, -15vh) scale(1.1);
    }
    75% {
        transform: translate(-15vw, -25vh) scale(0.9);
    }
}


h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1.2;
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

/* Typography Utilities */
.section-title {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-lg);
    position: relative;
    display: inline-block;
}

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

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: transparent; /* Start transparent */
    backdrop-filter: blur(0px); /* Start clear */
    z-index: 1000;
    padding: 1.5rem 0; /* Larger padding initially */
    border-bottom: 1px solid transparent;
    transition: all var(--transition-medium);
}

.navbar.scrolled {
    background: rgba(26, 29, 33, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem 0; /* Shrink on scroll */
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    opacity: 0; /* Hidden initially */
    transform: translateY(-10px);
    transition: all var(--transition-medium);
    pointer-events: none; /* Prevent clicking when hidden */
}

.navbar.scrolled .logo {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

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

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width var(--transition-medium);
}

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

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

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 0;
    position: relative;
    overflow: hidden;
}

/* Fluid Animation */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.hero-content {
    animation: float 6s ease-in-out infinite;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.hero-content .tagline {
    font-size: 1.5rem;
    color: var(--accent-primary);
    margin-bottom: 2rem;
}

.hero-content .bio {
    max-width: 600px;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-link {
    color: var(--text-secondary);
    font-size: 1.5rem;
}

.social-link:hover {
    color: var(--accent-primary);
    transform: translateY(-3px);
}

/* Sections */
.section {
    padding: var(--spacing-xl) 0;
}

/* Cards & Grids */
.grid-list, .projects-grid, .books-grid, .articles-grid, .links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: transform var(--transition-medium), background var(--transition-medium);
}

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

.card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.card .meta {
    color: var(--accent-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: block;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Timeline (Experience) */
.timeline {
    position: relative;
    border-left: 2px solid var(--border-color);
    margin-left: 1rem;
    padding-left: 2rem;
}

.timeline-item {
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.6rem;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    background: var(--bg-primary);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
}

/* Library */
.library-subsection {
    margin-bottom: 4rem;
}

.library-subsection h3 {
    margin-bottom: 2rem;
    color: var(--accent-secondary);
}

/* Buttons & Links */
.btn-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--accent-primary);
    font-weight: 500;
    border-bottom: 1px solid transparent;
}

.btn-link:hover {
    border-bottom-color: var(--accent-primary);
}

/* Footer */
.footer {
    padding: 4rem 0;
    background: var(--bg-secondary);
    text-align: center;
    color: var(--text-secondary);
}

.copyright {
    margin-top: 2rem;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 1024px) {
    :root {
        --spacing-lg: 3rem;
        --spacing-xl: 6rem;
    }

    .hero-content h1 {
        font-size: 3.5rem;
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-md: 1.5rem;
        --spacing-lg: 2.5rem;
        --spacing-xl: 4rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content .tagline {
        font-size: 1.2rem;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(26, 29, 33, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 999;
        padding: 2rem;
    }

    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        margin: 1rem 0;
    }

    .nav-links a {
        font-size: 1.5rem;
    }
    
    .mobile-menu-btn {
        display: block;
        z-index: 1001;
        position: relative;
        width: 30px;
        height: 20px;
    }

    .mobile-menu-btn span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: var(--text-primary);
        position: absolute;
        transition: all 0.3s ease;
    }

    .mobile-menu-btn span:nth-child(1) { top: 0; }
    .mobile-menu-btn span:nth-child(2) { top: 9px; }
    .mobile-menu-btn span:nth-child(3) { top: 18px; }

    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg);
        top: 9px;
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg);
        top: 9px;
    }

    .grid-list, .projects-grid, .books-grid, .articles-grid, .links-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 1.5rem;
    }

    .timeline {
        margin-left: 0.5rem;
        padding-left: 1.5rem;
    }
    
    .timeline-item::before {
        left: -2.1rem;
    }

    .social-links {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center; /* Center align on mobile if preferred, or keep left */
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
        word-wrap: break-word; /* Ensure long words don't overflow */
    }
    
    .hero-content .tagline {
        font-size: 1.1rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .social-links {
        gap: 0.8rem;
    }
    
    .social-link {
        font-size: 1.2rem;
    }
}
