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

html {
    font-size: 17px;
}

/* Color Variables */
:root {
    --bg-color: #faf9f7;
    --container-bg: transparent;
    --text-color: #666;
    --text-light: #888;
    --text-lighter: #999;
    --text-dark: #444;
    --text-darker: #333;
    --heading-color: #444;
    --nav-bg: rgba(250, 249, 247, 0.85);
    --nav-text: #888;
    --border-color: #e8e8e8;
    --border-light: #ddd;
    --rose-accent: #f4d3da;
    --focus-color: #999;
    --year-marker: #ccc;
    --author-underline: #f4d3da;
}

.dark-mode,
html.dark-mode body {
    --bg-color: #2a2a2a;
    --container-bg: transparent;
    --text-color: #c4c4c4;
    --text-light: #a8a8a8;
    --text-lighter: #909090;
    --text-dark: #e0e0e0;
    --text-darker: #f0f0f0;
    --heading-color: #e8e8e8;
    --nav-bg: rgba(42, 42, 42, 0.85);
    --nav-text: #a8a8a8;
    --border-color: #444;
    --border-light: #555;
    --rose-accent: #e5b8c5;
    --focus-color: #999;
    --year-marker: #555;
    --author-underline: #e5b8c5;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #333;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
}

/* Visually Hidden (for screen readers only) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica', 'Arial', sans-serif;
    line-height: 1.9;
    color: var(--text-color);
    background-color: var(--bg-color);
    padding: 0;
    padding-top: 100px;
    min-height: 100vh;
    font-weight: 400;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Sticky Navigation */
.sticky-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 18px 40px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.nav-logo {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica', 'Arial', sans-serif;
    font-size: 1.4em;
    color: var(--text-darker);
    line-height: 1;
    letter-spacing: 0;
}

.nav-name-first {
    font-weight: 800;
}

.nav-name-last {
    font-weight: 500;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
    margin-left: auto;
}

.nav-links a {
    color: var(--nav-text);
    text-decoration: none;
    font-size: 0.95em;
    transition: all 0.3s;
    letter-spacing: 0.5px;
    font-weight: 400;
    padding: 4px 8px;
    border-radius: 2px;
    border-bottom: 1px solid transparent;
}

.nav-links a:hover {
    color: var(--text-darker);
    border-bottom-color: var(--rose-accent);
}

.nav-links a:focus {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--nav-text);
    font-size: 1.2em;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.3s;
    border-bottom: 1px solid transparent;
    line-height: 1;
}

#theme-toggle:hover {
    color: var(--text-darker);
    border-bottom-color: var(--rose-accent);
}

#theme-toggle:focus {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
}

/* Container */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 60px 40px 100px 40px;
    background-color: var(--container-bg);
    min-height: calc(100vh - 100px);
}

/* Header */
header {
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    margin-bottom: 0;
}

h1 {
    font-size: 2.6em;
    font-weight: 700;
    color: var(--text-darker);
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
}

.header-role {
    font-size: 0.88em;
    font-weight: 500;
    color: var(--text-lighter);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.header-contact {
    font-size: 0.9em;
    color: var(--text-lighter);
    margin-top: 0;
    margin-bottom: 0;
}

.header-contact a {
    color: var(--text-light);
    text-decoration: none;
    border-bottom: 1px solid var(--border-light);
}

.header-contact a:hover {
    color: var(--text-darker);
}

.header-sub {
    font-size: 0.9em;
    color: var(--text-lighter);
    line-height: 1.6;
}

.header-sub a {
    color: var(--text-light);
    text-decoration: none;
    border-bottom: 1px solid var(--border-light);
}

.header-sub a:hover {
    color: var(--text-darker);
}

.header-sub em {
    font-style: italic;
}

.name-details {
    font-size: 0.95em;
    font-weight: 400;
    color: var(--text-light);
    margin-top: 6px;
    margin-bottom: 12px;
    line-height: 1.6;
    letter-spacing: 0.2px;
}

.name-details em {
    font-style: italic;
    color: var(--text-light);
}

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

section h2 {
    font-size: 1.05em;
    font-weight: 400;
    margin-bottom: 30px;
    color: var(--text-color);
    line-height: 1.8;
}

section h3 {
    font-size: 1em;
    font-weight: 500;
    margin-top: 50px;
    margin-bottom: 30px;
    color: var(--text-dark);
    letter-spacing: 0.3px;
}

section p {
    margin-bottom: 25px;
    font-size: 1em;
    line-height: 1.9;
    color: var(--text-color);
    font-weight: 400;
}

section p strong {
    font-weight: 600;
    color: var(--text-dark);
}

/* Work Section */
.work-intro {
    font-size: 1.05em;
    font-weight: 400;
    margin-bottom: 30px;
    color: var(--text-color);
    line-height: 1.8;
}

.work-list {
    margin: 25px 0;
    padding-left: 25px;
}

.work-list li {
    margin-bottom: 18px;
    line-height: 1.9;
    color: var(--text-color);
    font-size: 1em;
    font-weight: 400;
}

.work-list li strong {
    font-weight: 600;
    color: var(--text-dark);
}

.research-stream {
    margin-bottom: 32px;
    padding-left: 16px;
    border-left: 2px solid var(--rose-accent);
}

.research-stream h3 {
    font-size: 1em;
    font-weight: 600;
    color: var(--text-darker);
    margin-bottom: 6px;
}

.research-stream p {
    color: var(--text-color);
    line-height: 1.8;
    margin: 0;
}

/* News Section */
#news h2 {
    font-size: 1.05em;
    font-weight: 400;
    margin-bottom: 30px;
    color: var(--text-color);
}

.news-item {
    margin-bottom: 25px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.news-date {
    font-size: 0.85em;
    color: var(--text-lighter);
    font-weight: 400;
    min-width: 110px;
    flex-shrink: 0;
    padding-top: 2px;
}

.news-content {
    margin: 0;
    font-size: 1em;
    line-height: 1.8;
    color: var(--text-color);
    font-weight: 400;
}

/* Publications Section */
#publications h2 {
    font-size: 1.05em;
    font-weight: 400;
    margin-bottom: 40px;
    color: var(--text-color);
}

.year-group {
    position: relative;
    margin-bottom: 40px;
    padding-top: 50px;
}

.year-group:first-child {
    padding-top: 0;
}

.year-group:not(:first-child)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--border-color);
}

.year-marker {
    display: block;
    text-align: right;
    font-size: 1.5em;
    font-weight: 300;
    color: var(--year-marker);
    margin-top: -50px;
    margin-bottom: 50px;
    letter-spacing: 0.5px;
}

.publication {
    margin-bottom: 25px;
    padding-bottom: 0;
    border-bottom: none;
}

.publication:last-child {
    border-bottom: none;
}

.pub-title {
    display: block;
    font-weight: 400;
    font-size: 1em;
    margin-bottom: 6px;
    color: var(--text-dark);
    line-height: 1.6;
}

.pub-authors {
    display: block;
    color: var(--text-light);
    margin-bottom: 4px;
    font-size: 0.95em;
    font-weight: 400;
    line-height: 1.6;
}

.author-name {
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--author-underline);
    text-decoration-thickness: 1px;
}

.pub-venue {
    display: block;
    color: var(--text-lighter);
    font-style: italic;
    margin-bottom: 10px;
    font-size: 0.9em;
    font-weight: 300;
    line-height: 1.6;
}

.pub-links {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pub-button {
    color: var(--text-lighter);
    text-decoration: none;
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 400;
    padding: 3px 8px;
    border: none;
    border-radius: 0;
    display: inline-block;
    transition: all 0.2s;
    border-bottom: 1px solid transparent;
}

.pub-button:hover {
    color: var(--text-darker);
    border-bottom-color: var(--rose-accent);
}

.pub-button:focus {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
}

/* CV Section */
.cv-link {
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 400;
    border-bottom: 1px solid var(--year-marker);
    padding: 2px 4px;
    display: inline-block;
}

.cv-link:hover {
    color: var(--text-darker);
    border-bottom-color: var(--rose-accent);
}

.cv-link:focus {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
}

/* Contact Section */
.contact-info p {
    margin-bottom: 18px;
    line-height: 1.9;
    font-size: 1em;
}

.contact-info strong {
    font-weight: 600;
    color: var(--text-dark);
}

.social-links {
    margin-top: 25px;
}

.social-links a {
    color: var(--text-light);
    text-decoration: none;
    margin-right: 18px;
    transition: all 0.3s;
    font-weight: 400;
    padding: 4px 8px;
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    border-bottom: 1px solid transparent;
}

.social-links a:hover {
    color: var(--text-darker);
    border-bottom-color: var(--rose-accent);
}

.social-links a:focus {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
}

/* Footer */
footer {
    text-align: center;
    padding: 50px 0 80px 0;
    margin-top: 80px;
    border-top: 1px solid var(--border-light);
    color: var(--text-lighter);
    font-size: 0.85em;
    font-weight: 400;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding-top: 110px;
    }

    .nav-container {
        padding: 15px 20px;
    }

    .nav-logo {
        font-size: 1.6em;
    }

    .nav-links {
        gap: 25px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links a {
        font-size: 0.9em;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    #theme-toggle {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .container {
        padding: 40px 25px 70px 25px;
    }

    .news-item {
        flex-direction: column;
        gap: 5px;
    }

    .news-date {
        min-width: auto;
    }

    h1 {
        font-size: 1.6em;
    }
}
