/* ==========================================================================
   Base Styles and Variables
   ========================================================================== */
:root {
    --bg-color: #ffffff;
    --text-color: #404040;
    --text-muted: #666666;
    --text-light: #8c8c8c;
    --accent-color: #00C190;
    --accent-light: rgba(0, 193, 144, 0.08);
    --border-color: #f0f0f0;
    --card-border: #eef0f2;
    --header-bg: #404040;
    --header-text: #ffffff;
    --footer-bg: #404040;
    --footer-text: #ffffff;
    
    --font-primary: 'Lexend', sans-serif;
    --transition-speed: 0.3s;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px; /* Accounts for the sticky header */
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-weight: 300; /* Clean, light appearance of Lexend */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-medium {
    max-width: 950px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 100px 0;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 50px;
    letter-spacing: -0.5px;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 45px;
    height: 3px;
    background-color: var(--accent-color);
    margin-top: 12px;
}

/* ==========================================================================
   Header Navigation (Sticky)
   ========================================================================== */
.header {
    background-color: var(--header-bg);
    color: var(--header-text);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

.logo {
    color: var(--header-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    transition: color var(--transition-speed) ease;
}

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

.nav-menu {
    display: flex;
    gap: 35px;
    align-items: center;
}

.nav-menu a {
    color: var(--header-text);
    text-decoration: none;
    font-weight: 400;
    font-size: 0.95rem;
    transition: color var(--transition-speed) ease;
}

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

/* Mobile Toggle Hamburger button */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1010;
}

.menu-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--header-text);
    transition: all var(--transition-speed) ease;
}

/* ==========================================================================
   Hero Section (Layout before Bio)
   ========================================================================== */
.hero-section {
    padding: 90px 0 80px 0;
    border-bottom: 1px solid var(--border-color);
    background-color: #ffffff;
}

.hero-container {
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero-image-col {
    flex-shrink: 0;
}

.hero-photo {
    width: 230px;
    height: 230px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--border-color);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

.hero-info-col {
    flex-grow: 1;
}

.hero-name {
    font-size: 3.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 12px;
    line-height: 1.1;
    letter-spacing: -1.2px;
}

.hero-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.hero-keywords span {
    font-size: 0.85rem;
    font-weight: 400;
    background-color: #f5f5f5;
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 20px;
    transition: all var(--transition-speed) ease;
}

.hero-keywords span:hover {
    background-color: var(--accent-light);
    color: var(--accent-color);
}

.hero-contacts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px 30px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    transition: color var(--transition-speed) ease;
}

.contact-link:hover {
    color: var(--accent-color);
}

.contact-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: color var(--transition-speed) ease;
}

.contact-link:hover .contact-icon {
    color: var(--accent-color);
}

/* ==========================================================================
   About Section (Single-Column)
   ========================================================================== */
.about-content p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    color: var(--text-color);
    line-height: 1.75;
}

.about-content p a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid var(--accent-color);
    transition: color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.about-content p a:hover {
    color: var(--accent-color);
}

.about-content p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Research Section (Three-Column Desktop Layout)
   ========================================================================== */
.research-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
    align-items: stretch;
}

.research-card {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 30px;
}

.research-card-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 22px;
    color: var(--text-color);
    line-height: 1.3;
}

.research-image-wrapper {
    width: 100%;
    height: 190px;
    margin-bottom: 22px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fafbfc;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #f5f6f8;
}

.research-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.research-question {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 22px;
    padding: 14px 18px;
    background-color: #fafcfa;
    border-left: 3px solid var(--accent-color);
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: #505050;
}

.research-question strong {
    font-style: normal;
    color: var(--text-color);
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.research-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 30px;
    flex-grow: 1; /* Aligns key references perfectly at the bottom of cards */
}

.key-reference {
    margin-top: auto;
    border-top: 1px dashed var(--border-color);
    padding-top: 25px;
}

.ref-label {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1.2px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.ref-box {
    background-color: #fafafa;
    padding: 18px;
    border-radius: 8px;
    border: 1px solid #f6f6f6;
}

.ref-title {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--text-color);
    margin-bottom: 8px;
}

.ref-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.4;
}

.ref-venue {
    color: var(--accent-color);
    font-weight: 600;
}

.ref-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
    transition: color var(--transition-speed) ease;
}

.ref-link:hover {
    color: var(--accent-color);
}

.link-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* ==========================================================================
   Recent Publications Section (Two-Column Desktop Layout)
   ========================================================================== */
.publications-list {
    margin-top: 20px;
}

.pub-row {
    display: flex;
    padding: 28px 0;
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-speed) ease;
}

.pub-row:hover {
    background-color: #fafafa;
}

.pub-venue {
    flex: 0 0 220px;
    font-weight: 600;
    color: var(--accent-color); /* Highlight color for "Published at" */
    font-size: 1rem;
    padding-right: 35px;
    line-height: 1.4;
}

.pub-details {
    flex: 1;
}

.pub-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
    line-height: 1.45;
}

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

.pub-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-light);
    text-decoration: none;
    word-break: break-all;
    transition: color var(--transition-speed) ease;
}

.pub-link:hover {
    color: var(--accent-color);
}

.publications-footnote {
    margin-top: 50px;
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-color);
}

.footnote-cv-link {
    color: var(--text-color);
    text-decoration: underline;
    text-underline-offset: 4px;
    font-weight: 500;
    transition: color var(--transition-speed) ease;
}

.footnote-cv-link:hover {
    color: var(--accent-color);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 40px 0;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 300;
}

.footer p {
    margin: 0;
}

/* ==========================================================================
   Responsive Media Queries
   ========================================================================== */

/* Medium Devices (Tablets/Smaller Laptops) */
@media (max-width: 992px) {
    .research-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        max-width: 650px;
        margin: 0 auto;
    }
    
    .hero-container {
        gap: 40px;
    }
    
    .hero-name {
        font-size: 2.8rem;
    }
}

/* Small Devices (Mobile & Tablets) */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    .section {
        padding: 70px 0;
    }
    
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 35px;
    }
    
    /* Responsive Header & Navigation */
    .menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--header-bg);
        flex-direction: column;
        gap: 0;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    }
    
    .nav-menu.active {
        max-height: 250px;
    }
    
    .nav-menu a {
        display: block;
        padding: 15px 24px;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
        font-size: 1rem;
    }
    
    .nav-menu a::after {
        display: none; /* Hide desktop hover effect line on mobile */
    }
    
    .nav-menu a:last-child {
        border-bottom: none;
    }
    
    /* Hamburger Animations */
    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    /* Hero Section Mobile */
    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }
    
    .hero-photo {
        width: 180px;
        height: 180px;
    }
    
    .hero-name {
        font-size: 2.2rem;
    }
    
    .hero-keywords {
        justify-content: center;
    }
    
    .hero-contacts {
        grid-template-columns: 1fr;
        gap: 15px;
        justify-items: center;
    }
    
    /* Publications Mobile */
    .pub-row {
        flex-direction: column;
        gap: 8px;
        padding: 22px 0;
    }
    
    .pub-venue {
        flex: none;
        padding-right: 0;
        font-size: 0.95rem;
    }
    
    .pub-title {
        font-size: 1rem;
    }
}

/* Extra Small Devices (Very small phones) */
@media (max-width: 480px) {
    .hero-name {
        font-size: 1.8rem;
    }
    
    .hero-photo {
        width: 150px;
        height: 150px;
    }
}