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

:root {
    /* Light theme (default) */
    --primary-color: #D47A48;
    --text-color: #24292e;
    --text-secondary: #586069;
    --border-color: #e1e4e8;
    --bg-color: #ffffff;
    --bg-secondary: #f6f8fa;
    --link-color: #D47A48;
    --link-hover: #b86538;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-hover: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
    --max-width: 900px;
    --header-bg: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] {
    /* Dark theme */
    --primary-color: #D47A48;
    --text-color: #e1e4e8;
    --text-secondary: #8b949e;
    --border-color: #30363d;
    --bg-color: #0d1117;
    --bg-secondary: #161b22;
    --link-color: #D47A48;
    --link-hover: #e68a5c;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 3px 6px rgba(0, 0, 0, 0.5), 0 3px 6px rgba(0, 0, 0, 0.6);
    --header-bg: rgba(13, 17, 23, 0.9);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    font-size: 16px;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header and Navigation */
.header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 0;
    flex-wrap: wrap;
    flex: 1;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    width: 100%;
}

/* Sections */
.section {
    padding: 4rem 0;
    border-bottom: 1px solid var(--border-color);
}

.section:last-of-type {
    border-bottom: none;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.subsection-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 3rem 0 1.5rem 0;
    color: var(--text-color);
}

/* About Section */
.about-section {
    padding-top: 3rem;
}

.about-content {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.profile-container {
    flex: 0 0 200px;
}

.headshot {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.headshot:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.name {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.title {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.affiliation {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    border: 1px solid;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--link-hover);
    border-color: var(--link-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: var(--bg-color);
    color: var(--primary-color);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-secondary);
    border-color: var(--primary-color);
}

.btn-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.bio {
    margin-top: 2rem;
    line-height: 1.8;
}

.bio p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.bio-details {
    margin-top: 1rem;
}

.bio-summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.95rem;
    transition: opacity 0.2s;
    user-select: none;
}

.bio-summary::-webkit-details-marker {
    display: none;
}

.bio-summary:hover {
    opacity: 0.8;
}

.bio-arrow {
    font-size: 0.75rem;
    transition: transform 0.3s;
    display: inline-block;
}

.bio-details[open] .bio-arrow {
    transform: rotate(180deg);
}

.bio-more {
    margin-top: 1rem;
    padding-top: 1rem;
}

.bio-more p {
    margin-bottom: 0;
    color: var(--text-color);
}

/* Research Section */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.research-item {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.research-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.research-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    margin-bottom: 0;
}

.research-item h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
    padding: 1.5rem 1.5rem 0 1.5rem;
}

.research-item p {
    color: var(--text-color);
    line-height: 1.7;
    padding: 0 1.5rem 1.5rem 1.5rem;
    margin: 0;
}

/* Publications Section */
.publications-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.publication-item {
    padding: 1.5rem;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s;
}

.publication-item:hover {
    box-shadow: var(--shadow);
    transform: translateX(5px);
}

.publication-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.publication-authors {
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

.publication-venue {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.publication-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.pub-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s;
}

.pub-link:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.note {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* News Section */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.news-item {
    display: flex;
    gap: 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.news-item:last-child {
    border-bottom: none;
}

.news-date {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 100px;
    font-size: 0.95rem;
}

.news-content {
    flex: 1;
    color: var(--text-color);
}

.news-content p {
    line-height: 1.7;
}

/* Openings Section */
.openings-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.opening-item {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
}

.opening-item:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.opening-summary {
    list-style: none;
    cursor: pointer;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--text-color);
    transition: background-color 0.2s;
    user-select: none;
}

.opening-summary::-webkit-details-marker {
    display: none;
}

.opening-summary:hover {
    background-color: rgba(212, 122, 72, 0.1);
}

.opening-item[open] .opening-summary {
    border-bottom: 1px solid var(--border-color);
}

.opening-title {
    color: var(--primary-color);
    font-weight: 600;
}

.opening-arrow {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: transform 0.3s;
    margin-left: 1rem;
}

.opening-item[open] .opening-arrow {
    transform: rotate(180deg);
}

.opening-content {
    padding: 1.5rem;
    color: var(--text-color);
    line-height: 1.8;
}

.opening-content p {
    margin-bottom: 1rem;
}

.opening-content ul {
    margin: 1rem 0 1rem 2rem;
    padding: 0;
}

.opening-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.opening-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.opening-content a:hover {
    text-decoration: underline;
}

.opening-content strong {
    color: var(--text-color);
}

/* Contact Section */
.contact-info {
    line-height: 2;
}

.contact-info p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

.contact-info strong {
    color: var(--text-color);
    margin-right: 0.5rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        gap: 1rem;
        padding: 0.8rem 0;
    }

    .theme-toggle {
        align-self: flex-end;
        margin-left: 0;
    }

    .nav-link {
        font-size: 0.85rem;
    }

    .section {
        padding: 2.5rem 0;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .about-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-container {
        flex: 0 0 auto;
    }

    .name {
        font-size: 2rem;
    }

    .links {
        justify-content: center;
    }

    .research-grid {
        grid-template-columns: 1fr;
    }

    .news-item {
        flex-direction: column;
        gap: 0.5rem;
    }

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

    .opening-summary {
        padding: 1.2rem;
        font-size: 1rem;
    }

    .opening-content {
        padding: 1.2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .name {
        font-size: 1.75rem;
    }

    .btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

