:root {
    --bg-color: #0f141c;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #60a5fa;
    --accent-light: rgba(96, 165, 250, 0.15);
    --border-color: #1e293b;
    --card-bg: #1e2530;
    --transition: all 0.25s ease-in-out;
}

/* Dark mode configurations */
[data-theme="light"] {
    --bg-color: #fcfbf9;
    --text-main: #1c1c1c;
    --text-muted: #555555;
    --accent: #2c5282; /* Scholarly deep blue */
    --accent-light: rgba(44, 82, 130, 0.1);
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    transition: var(--transition);
}

.container {
    max-width: 850px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header & Theme Switcher */
/* header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 40px;
} */

.theme-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}

.theme-btn:hover {
    color: var(--accent);
}

/* Sticky Navigation Header Styles */
.sticky-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--bg-color);
    border-bottom: 1px solid transparent;
    padding: 16px 0;
    margin-bottom: 40px;
    transition: padding 0.3s ease, border-color 0.3s ease;
}

/* Scrolled state applied via JavaScript */
.sticky-nav.scrolled {
    padding: 12px 0;
    border-color: var(--border-color);
    backdrop-filter: blur(8px); /* Subtle premium glassmorphic effect */
    background-color: var(--card-bg); /* Slightly opaque to enhance readability while maintaining design consistency */
}

[data-theme="dark"] .sticky-nav.scrolled {
    background-color: var(--card-bg);
}

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

/* Brand Name in Nav Bar */
.nav-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none; /* Prevents clicking when invisible */
}

.nav-logo.show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Section Shortcut Anchors */
.nav-links {
    display: flex;
    gap: 20px;
    margin-left: auto;
    margin-right: 24px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

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

/* Adjust page layout behavior for smooth scroll anchoring */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Prevents sticky nav from obscuring section titles */
}

/* Mobile Responsive Optimization (Up to 900px) */
@media (max-width: 900px) {
    .nav-container {
        position: relative; /* Anchor the absolute navigation dropdown */
    }

    /* Show the hamburger icon button */
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: 1.25rem;
        cursor: pointer;
        margin-left: auto;
        margin-right: 20px;
        transition: var(--transition);
    }

    .menu-toggle:hover {
        color: var(--accent);
    }

    /* Transform horizontal links into a stacked vertical column layout */
    .nav-links {
        display: none; /* Hidden by default */
        flex-direction: column;
        position: absolute;
        top: 100%;
        right: 20px;
        background-color: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 16px;
        gap: 14px;
        width: 200px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        margin: 8px 0 0 0;
        z-index: 1001;
    }

    /* Active dynamic toggle state triggered via JS class styling injection */
    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        font-size: 1rem;
        width: 100%;
        padding: 4px 0;
    }
}

/* Hide the toggle button by default on desktop resolutions higher than 900px */
@media (min-width: 901px) {
    .menu-toggle {
        display: none;
    }
}

/* Profile Intro */
.profile {
    margin-bottom: 50px;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.title-sub {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-weight: 300;
}

.bio {
    font-size: 1.05rem;
    color: var(--text-main);
    margin-bottom: 25px;
    text-align: justify;
}

/* Badges / Links Container */
.links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
}

.link-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    background-color: var(--card-bg);
    transition: var(--transition);
}

.link-card:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.link-card i {
    font-size: 1rem;
}

/* Structural Layout Sections */
section {
    margin-bottom: 50px;
}

h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    color: var(--text-main);
}

/* Research Field Tags */
.interests-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Teaching Section Elements */
.teaching-intro {
    margin-bottom: 20px;
}

.mentor-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.mentor-link:hover {
    text-decoration: underline;
}

.course-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.course-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.course-info strong {
    color: var(--text-main);
}

.course-years {
    font-size: 0.9rem;
    color: var(--accent);
    background-color: var(--accent-light);
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 500;
    margin-top: 4px;
}

.edu-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.edu-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    align-items: baseline;
}

.edu-year {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--accent);
    background-color: var(--accent-light);
    padding: 3px 10px;
    border-radius: 4px;
    display: inline-block;
}

.edu-degree {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2px;
}

.edu-institution {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Academic Service Section Styling */
.service-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.service-item {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: var(--transition);
}

.service-item:hover {
    border-color: var(--accent);
}

.service-icon {
    font-size: 1.2rem;
    color: var(--accent);
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 2px;
}

.service-details strong {
    color: var(--text-main);
    font-size: 1.05rem;
    display: block;
    margin-bottom: 4px;
}

.service-meta {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.service-meta:last-child {
    margin-bottom: 0;
}

/* Responsive alignment for smaller mobile viewports */
@media(max-width: 600px) {
    .service-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .service-icon {
        justify-content: flex-start;
    }
}


/* Publications Module */
.pub-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.pub-item {
    padding-left: 12px;
    border-left: 2px solid var(--border-color);
    transition: var(--transition);
}

.pub-item:hover {
    border-left-color: var(--accent);
}

.pub-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.pub-authors {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.pub-authors .me {
    font-weight: 600;
    text-decoration: underline;
    color: var(--text-main);
}

.pub-venue {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--accent);
}

.pub-year {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-left: 6px;
    font-style: normal;
}

/* Footer rules */
footer {
    margin-top: 80px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Responsive Overrides */
@media(max-width: 600px) {
    h1 { font-size: 2.2rem; }
    .links-grid { gap: 8px; }
    .link-card { width: 100%; justify-content: center; }
    .course-card { flex-direction: column; align-items: flex-start; }
    .course-years { width: max-content; }
    .edu-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .edu-year {
        width: max-content;
        font-size: 0.85rem;
    }
}