:root {
    --primary-color: #5BAEC7;
    --primary-dark: #3A8CA8;
    --accent-color: #A4D4E4;
    --text-dark: #1a2a35;
    --text-medium: #4a6575;
    --text-light: #7a9aaa;
    --bg-cream: #FFFBEA;
    --bg-white: #FFFFFF;
    --border-color: #C5E4EF;
    --shadow-subtle: rgba(91, 174, 199, 0.08);
    --shadow-medium: rgba(91, 174, 199, 0.15);
}

/* Font families */
.font-palatino {
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
}

.font-computer-modern {
    font-family: 'STIX Two Text', 'Computer Modern Serif', 'Latin Modern Roman', 'Times New Roman', serif;
}

.font-noto-sans {
    font-family: 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;
}

/* Controls bar */
.controls-bar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.85rem;
    color: var(--text-medium);
}

.font-select {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-cream);
    color: var(--text-dark);
    font-size: 0.85rem;
    cursor: pointer;
}

.font-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-cream);
    color: var(--text-dark);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

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

body {
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
    font-size: 1.125rem;
    color: var(--text-dark);
    background: var(--bg-cream);
    line-height: 1.7;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navigation */
.nav-container {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] .nav-container {
    background: rgba(255, 255, 255, 0.98);
}

[data-theme="dark"] .nav-container {
    background: rgba(22, 32, 40, 0.98);
}

.nav-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

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

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-medium);
    text-decoration: none;
    font-size: 0.95rem;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Main Container */
.main-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero-section {
    padding: 4rem 0 5rem;
    animation: fadeInUp 0.8s ease-out;
}

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

.hero-title {
    font-size: 2.5rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-medium);
    margin-bottom: 1.75rem;
    letter-spacing: 0.01em;
}

.hero-text {
    max-width: 660px;
    text-align: left;
}

.hero-description {
    font-size: 1.05rem;
    color: var(--text-medium);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.philosophy-text {
    font-style: italic;
    color: var(--text-light);
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.philosophy-line {
    display: block;
}

.hero-links {
    margin-top: 2rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.hero-links a {
    color: var(--text-dark);
    text-decoration: none;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
    font-size: 0.95rem;
}

.hero-links a:hover {
    border-bottom-color: var(--primary-color);
}

/* Hero Image */
.hero-image {
    max-width: 260px;
    width: 100%;
    margin-bottom: 2rem;
}

.image-frame {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-subtle);
    animation: fadeIn 1s ease-out 0.3s backwards;
}

.image-frame img {
    width: 100%;
    height: auto;
    display: block;
}

.image-placeholder {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.9rem;
    border-radius: 4px;
    font-style: italic;
}

/* Footer */
.footer {
    background: var(--bg-cream);
    border-top: 1px solid var(--border-color);
    margin-top: 5rem;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.footer-contact {
    text-align: center;
}

.footer-contact h3 {
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.footer-email {
    color: var(--text-medium);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.footer-social a {
    color: var(--text-medium);
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.footer-social a:hover {
    color: var(--primary-dark);
}

.footer-copyright {
    color: var(--text-light);
    font-size: 0.85rem;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

    .hero-title {
        font-size: 2rem;
    }

    .controls-bar {
        padding: 0.5rem 1rem;
        gap: 1rem;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .nav-links {
        gap: 1.25rem;
        flex-wrap: wrap;
        justify-content: center;
    }

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

    .hero-links {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-image {
        max-width: 280px;
    }

    .controls-bar {
        flex-direction: column;
        gap: 0.75rem;
    }

    .control-group {
        width: 100%;
        justify-content: center;
    }

    .recent-work-grid {
        grid-template-columns: 1fr;
    }
}

/* Contact button */
.hero-actions {
    margin-top: 2rem;
    text-align: center;
}

.contact-btn {
    display: inline-block;
    padding: 0.7rem 1.6rem;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: background-color 0.3s ease;
}

.contact-btn:hover {
    background: var(--primary-dark);
}

/* Footer email link */
.footer-email a {
    color: inherit;
    text-decoration: none;
}

.footer-email a:hover {
    color: var(--primary-color);
}

/* Home page section headings */
.home-section-heading {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 1.25rem;
}

/* Conference toggle button on home page */
.conf-more-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--primary-color);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0.65rem;
    margin-top: 0.4rem;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    font-family: inherit;
}

.conf-more-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.conf-details-panel {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-white);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* Recent work section */
.recent-work-section {
    padding: 3rem 0 2rem;
    border-top: 1px solid var(--border-color);
}

.recent-work-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.recent-work-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
    padding: 1.25rem 1.5rem;
    transition: border-left-color 0.3s ease, box-shadow 0.3s ease;
}

.recent-work-card:hover {
    border-left-color: var(--primary-dark);
    box-shadow: 0 2px 10px var(--shadow-medium);
}

.recent-work-card .card-type {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-family: 'Noto Sans', sans-serif;
}

.recent-work-card h3 {
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
    line-height: 1.45;
}

.recent-work-card h3 a {
    color: inherit;
    text-decoration: none;
}

.recent-work-card h3 a:hover {
    color: var(--primary-color);
}

.recent-work-card .card-meta {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Upcoming conferences section */
.upcoming-conf-section {
    padding: 2rem 0 3rem;
    border-top: 1px solid var(--border-color);
}

.upcoming-conf-list {
    display: flex;
    flex-direction: column;
}

.upcoming-conf-item {
    display: flex;
    gap: 2rem;
    align-items: baseline;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.upcoming-conf-date {
    font-size: 0.85rem;
    color: var(--text-light);
    min-width: 160px;
    flex-shrink: 0;
}

.upcoming-conf-details {
    flex: 1;
}

.upcoming-conf-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.upcoming-conf-location {
    font-size: 0.9rem;
    color: var(--text-medium);
    margin-top: 0.15rem;
}

@media (max-width: 640px) {
    .upcoming-conf-item {
        flex-direction: column;
        gap: 0.25rem;
    }

    .upcoming-conf-date {
        min-width: unset;
    }
}

/* CV embed */
.cv-embed-wrapper {
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.cv-embed {
    width: 100%;
    height: 80vh;
    min-height: 600px;
    border: none;
    display: block;
}

/* Teaching table */
.teaching-table-wrapper {
    overflow-x: auto;
}

.teaching-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

.teaching-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.teaching-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-medium);
    vertical-align: top;
    line-height: 1.5;
}

.teaching-table td.course-title {
    font-weight: 600;
    color: var(--text-dark);
}

.teaching-table tr:last-child td {
    border-bottom: none;
}

.teaching-table tr:hover td {
    background: rgba(91, 174, 199, 0.04);
}
