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

:root {
    --text-color: #222;
    --bg-color: #fff;
    --accent-color: #e07c3e;
    --link-color: #c45a1a;
    --link-hover: #a04510;
    --border-color: #e0e0e0;
    --secondary-text: #666;
    --tertiary-text: #444;
    --dropdown-hover: #f5f5f5;
    --max-width: 900px;
}

/* Dark theme */
:root[data-theme="dark"] {
    --text-color: #e8e6e3;
    --bg-color: #1a1a1a;
    --accent-color: #f0a070;
    --link-color: #e8945c;
    --link-hover: #ffb080;
    --border-color: #333;
    --secondary-text: #a0a0a0;
    --tertiary-text: #b0b0b0;
    --dropdown-hover: #2a2a2a;
}

/* System preference: dark mode */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --text-color: #e8e6e3;
        --bg-color: #1a1a1a;
        --accent-color: #f0a070;
        --link-color: #e8945c;
        --link-hover: #ffb080;
        --border-color: #333;
        --secondary-text: #a0a0a0;
        --tertiary-text: #b0b0b0;
        --dropdown-hover: #2a2a2a;
    }
}

body {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.2s ease, color 0.2s ease;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--link-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* Header */
header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    max-width: var(--max-width);
    margin: 0 auto;
}

.title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.site-title {
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.site-title a {
    text-decoration: none;
    color: var(--text-color);
}

.site-title a:hover {
    color: var(--link-hover);
}

/* Navigation */
nav {
    position: relative;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    text-decoration: none;
    font-size: 1rem;
    color: var(--text-color);
}

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

/* Dropdown */
.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    list-style: none;
    padding: 0.5rem 0;
    min-width: 180px;
    z-index: 100;
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.4rem 1rem;
}

.dropdown-menu a:hover {
    background: var(--dropdown-hover);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text-color);
    transition: all 0.3s ease;
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
}

.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

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

.theme-toggle-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    list-style: none;
    padding: 0.4rem 0;
    min-width: 140px;
    z-index: 100;
    margin-top: 0.25rem;
}

.theme-dropdown.active {
    display: block;
}

.theme-dropdown button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-color);
    text-align: left;
}

.theme-dropdown button:hover {
    background: var(--dropdown-hover);
}

.theme-dropdown button.active {
    color: var(--accent-color);
}

.theme-dropdown button svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Main Content */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem;
}

/* Content Sections */
.content-section {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
    align-items: flex-start;
}

.content-section:last-child {
    border-bottom: none;
}

.content-section.reverse {
    flex-direction: row-reverse;
}

.section-image {
    flex: 0 0 280px;
}

.section-image img {
    width: 100%;
    display: block;
}

.section-content {
    flex: 1;
}

.section-content.full-width {
    flex: 1 1 100%;
}

.section-content h2 {
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

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

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

/* Blockquote */
blockquote {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
    border-left: 3px solid var(--accent-color);
    font-style: italic;
    color: var(--tertiary-text);
}

blockquote cite {
    display: block;
    margin-top: 0.5rem;
    font-style: normal;
    font-size: 0.95rem;
    color: var(--accent-color);
    font-weight: 500;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    margin-top: 2rem;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.social-links a {
    font-size: 0.95rem;
}

.contact {
    font-size: 0.95rem;
    color: var(--secondary-text);
}

/* Page-specific styles */
.page-header {
    margin-bottom: 2.5rem;
}

.page-header h1 {
    font-size: 2.2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.page-header .subtitle {
    font-size: 1.1rem;
    color: var(--secondary-text);
    font-style: italic;
}

/* Video embed */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 2rem 0;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Video link image */
.video-link {
    margin: 2rem 0;
}

.video-link a {
    position: relative;
    display: block;
}

.video-link img {
    max-width: 100%;
    display: block;
}

.video-link a::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 56px;
    background: rgba(255, 0, 0, 0.85);
    border-radius: 12px;
    transition: background 0.2s ease;
}

.video-link a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-35%, -50%);
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #fff;
    z-index: 1;
}

.video-link a:hover::after {
    background: rgba(255, 0, 0, 1);
}

/* Awards list */
.awards-list {
    list-style: none;
    margin-bottom: 1.5rem;
}

.awards-list li {
    margin-bottom: 0.5rem;
}

.awards-list li::before {
    content: '\00BB';
    margin-right: 0.5rem;
    color: var(--secondary-text);
}

.awards-list a {
    color: var(--accent-color);
    text-decoration: none;
}

.awards-list a:hover {
    color: var(--link-hover);
}

/* Publications list */
.publications-list {
    margin-bottom: 2rem;
}

.publication-item {
    margin-bottom: 1.5rem;
}

.publication-item h3 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.publication-item h3 a {
    color: var(--accent-color);
    text-decoration: none;
}

.publication-item h3 a:hover {
    color: var(--link-hover);
}

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

.publication-item .venue a {
    color: var(--accent-color);
    text-decoration: none;
}

.publication-item .venue a:hover {
    color: var(--link-hover);
}

.publication-item .excerpt {
    font-size: 0.95rem;
    color: var(--tertiary-text);
    margin-left: 1.5rem;
}

.year-section .publication-item .excerpt::before {
    content: '\00BB';
    margin-right: 0.5rem;
    color: var(--secondary-text);
}

.publication-item .excerpt a {
    color: var(--accent-color);
    text-decoration: none;
}

.publication-item .excerpt a:hover {
    color: var(--link-hover);
}

/* Press quotes */
.press-item {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    border-left: 2px solid var(--border-color);
}

.press-item .source {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 1.05rem;
}

.press-item .source a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.press-item .source a:hover {
    color: var(--link-hover);
}

.press-item .quote {
    font-style: italic;
    color: var(--tertiary-text);
    line-height: 1.6;
}

/* Year sections */
.year-section {
    margin-bottom: 3rem;
}

.year-section > h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-color);
}

.year-section h3 a {
    color: var(--accent-color);
    text-decoration: none;
}

.year-section h3 a:hover {
    color: var(--link-hover);
}

/* Bio page */
.bio-content p {
    margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 1.5rem 1rem 1rem;
    }

    .site-title {
        font-size: 1.5rem;
        margin-right: auto;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--bg-color);
        padding: 1rem 0;
        gap: 0;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        padding: 0.5rem 0;
    }

    .dropdown > a {
        display: block;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 0.5rem;
        width: 30%;
    }

    .dropdown-menu {
        position: static;
        border: none;
        padding: 0;
        display: block;
    }

    .dropdown-menu li {
        padding: 0.5rem 0;
    }

    .dropdown-menu a {
        font-size: 1rem;
    }

    main {
        padding: 1.5rem 1rem;
    }

    .content-section {
        flex-direction: column;
        gap: 1.5rem;
    }

    .content-section.reverse {
        flex-direction: column;
    }

    .section-image {
        flex: none;
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 16px;
    }

    .site-title {
        font-size: 1.3rem;
    }

    .section-image {
        max-width: 250px;
    }
}
