:root {
    --bg-dark: #0a0a0f;
    --text-main: #ffffff;
    --text-muted: #a0a0c0;
    --primary: #6366f1;
    --accent: #8b5cf6;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Dynamic Background */
.background-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.15), transparent 60%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15), transparent 40%);
    z-index: -1;
    animation: pulse 10s ease-in-out infinite alternate;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* Navigation */
.glass-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: rgba(10, 10, 15, 0.85);
    /* Darker and more opaque */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.highlight {
    color: var(--primary);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: var(--glass);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
}

/* Hero Section */
.hero {
    min-height: 40vh;
    /* Strongly reduced from 70vh to pull content up */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4rem 10% 0 10%;
    /* More top padding, less bottom padding */
    gap: 4rem;
}

.hero-content {
    flex: 1;
}

h1 {
    font-size: 3.5rem;
    /* Reduced for a tighter layout */
    line-height: 1.1;
    margin-bottom: 1rem;
    font-weight: 800;
}

.gradient-text {
    background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    /* Fixed compatibility warning */
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    /* Reduced to pull up next section */
    max-width: 600px;
}

/* Content Sections */
.content-section,
.features {
    padding: 1rem 10% 4rem 10%;
    /* Tiny top padding to close the gap */
}

.content-section h2,
.section-header h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, white, var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bio-text {
    font-size: 1.1rem;
    max-width: 800px;
    color: var(--text-muted);
}

/* Page Header (for non-home pages) */
.page-header {
    padding: 6rem 10% 2rem 10%;
    /* Reduced padding */
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    /* Reduced from 4rem for "Selected Publications" etc */
    line-height: 1.1;
    margin-bottom: 1rem;
}

.page-header .subtitle {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* Markdown Content (Bio, Publications, Portfolio) */
.markdown-body {
    max-width: 900px;
    margin: 0;
    /* Align with header (parent padding handles the rest) */
    color: #ffffff;
    /* Brighter white for bio/content */
    font-size: 1.15rem;
    line-height: 1.6;
}

#markdown-content {
    font-size: 1.05rem;
}

#markdown-content h1,
#markdown-content h2,
#markdown-content h3 {
    font-size: 1.05rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    color: var(--text-main);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-size: 1.4rem;
}

.markdown-body p {
    margin-bottom: 1.2rem;
}

.markdown-body ul {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.markdown-body strong {
    color: var(--primary);
}

.blog-post p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Nav Links */
.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: #ffffff !important;
    /* Force pure white for visibility */
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    transition: all 0.3s;
    position: relative;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    /* Shadow to help on bright areas */
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary) !important;
    text-shadow: none;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

/* Grid Container */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    padding: 2rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: transform 0.3s ease, background 0.3s;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
}

.icon-box {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.feature-card p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Papers List */
.papers-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 900px;
}

.paper-card {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    align-items: flex-start;
    transition: transform 0.3s ease, background 0.3s;
}

.paper-card:hover {
    transform: translateX(10px);
    background: rgba(255, 255, 255, 0.08);
}

.paper-year {
    font-family: 'Courier New', monospace;
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2rem;
    padding-top: 0.2rem;
}

.paper-details h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.journal {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 1rem;
}

.paper-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.paper-link:hover {
    text-decoration: underline;
}

/* Mobile & Tablet Adjustments */
@media (max-width: 900px) {
    h1 {
        font-size: 2.8rem;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding: 4rem 5% 0 5%;
        min-height: auto;
    }

    .hero-visual {
        margin-top: 2rem;
    }

    .abstract-shape {
        width: 200px;
        height: 200px;
    }

    .content-section,
    .features,
    .page-header {
        padding: 3rem 5%;
    }

    .grid-container {
        grid-template-columns: 1fr;
        /* Stack cards vertically */
    }
}

@media (max-width: 600px) {
    .glass-nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    h1 {
        font-size: 2.2rem;
    }

    .paper-card {
        padding: 1.5rem;
    }

    .paper-year {
        font-size: 1rem;
    }
}