/* --- General Styles & Theming --- */
:root {
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #343a40;
    --text-color-light: #6c757d;
    --text-color-strong: #212529;
    --border-color: #dee2e6;
    --primary-color: #0056b3;
    --link-hover-color: #004185;
    --nav-bg: rgba(255, 255, 255, 0.85);
    --shadow-light: rgba(0, 0, 0, 0.04);
    --icon-color: #343a40;
    --button-bg: #212529;
    --button-text: #ffffff;
}

body.dark {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --text-color-light: #adb5bd;
    --text-color-strong: #ffffff;
    --border-color: #333333;
    --primary-color: #60a5fa;
    --link-hover-color: #93c5fd;
    --nav-bg: rgba(20, 20, 20, 0.85);
    --shadow-light: rgba(0, 0, 0, 0.2);
    --icon-color: #e0e0e0;
    --button-bg: #f8f9fa;
    --button-text: #121212;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

/* --- Navigation --- */
.top-nav {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    padding: 1rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s, border-color 0.3s;
}

.top-nav a {
    color: var(--text-color-light);
    text-decoration: none;
    margin: 0 1rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

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

/* --- Header --- */
.header {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    margin-top: 4rem;
    margin-bottom: 4rem;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
}

.header-content h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color-strong);
}

.header-content .title, .header-content .affiliations {
    margin: 0.25rem 0;
    font-size: 1.1rem;
    color: var(--text-color-light);
    font-weight: 400;
}

.header-content .about-intro {
    margin-top: 1rem;
    font-size: 1.05rem;
    max-width: 65ch;
}

.cv-link {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.2s;
}

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

/* --- General Section Styling --- */
.section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color-strong);
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
}

/* --- Two Column Layout --- */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
}

/* --- Scientific Focus Areas --- */
.focus-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.focus-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.focus-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px var(--shadow-light);
}

.focus-card .icon {
    width: 36px;
    height: 36px;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.focus-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--text-color-strong);
}

.focus-card p {
    margin: 0;
    color: var(--text-color-light);
    line-height: 1.7;
}

/* --- Projects & Media --- */
.project {
    margin-bottom: 2rem;
}
.project-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color-strong);
}
.project-meta {
    font-size: 0.9rem;
    color: var(--text-color-light);
    margin-bottom: 0.5rem;
}
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.media-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* --- Publications --- */
.subsection-title {
    margin-top: 2rem;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-color-strong);
}
.publication {
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 3px solid var(--border-color);
}
.pub-title {
    font-weight: 500;
}
.pub-title a {
    color: var(--text-color);
    text-decoration: none;
}
.pub-title a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}
.pub-authors, .pub-journal {
    font-size: 0.95rem;
    color: var(--text-color-light);
}
.pub-journal {
    font-style: italic;
}

/* --- Contact --- */
.contact-section { 
    background-color: var(--card-bg); 
    border: 1px solid var(--border-color); 
    border-radius: 12px; 
    padding: 2rem; 
}
.contact-title { 
    font-size: 1.5rem; 
    margin-top: 0; 
    text-align: center; 
}
.contact-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 2rem; 
    margin-top: 2rem; 
    text-align: center; 
}
.contact-label { 
    font-weight: 600; 
    margin-bottom: 0.25rem; 
}
.contact-item, .contact-item a { 
    color: var(--text-color-light); 
    text-decoration: none; 
}
.contact-item a:hover { 
    color: var(--primary-color); 
}

/* --- Utility Buttons --- */
#scrollTopBtn, #theme-toggle {
    position: fixed;
    bottom: 20px;
    background-color: var(--card-bg);
    color: var(--icon-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
#scrollTopBtn { 
    right: 20px; 
    display: none; 
}
#theme-toggle { 
    left: 20px; 
}
#scrollTopBtn:hover, #theme-toggle:hover {
    transform: translateY(-3px);
    background-color: var(--bg-color);
}

#theme-toggle svg { 
    width: 20px; 
    height: 20px; 
}
.sun { 
    display: none; 
}
body.dark .sun { 
    display: block; 
}
body.dark .moon { 
    display: none; 
}

/* --- Responsive Design --- */
@media (max-width: 900px) {
    .two-column {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .header-content {
        margin-top: 1rem;
    }
    .media-grid {
        grid-template-columns: 1fr;
    }
}