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

:root {
    --accent:       #3d8fa3;
    --accent-dark:  #2c6b7a;
    --text:         #1c2b35;
    --text-light:   #4a5a65;
    --white:        #ffffff;
    --font-serif:   'Lora', Georgia, serif;
    --font-sans:    'Inter', system-ui, sans-serif;
}

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: #fafaf8;
}

/* ============================================================
   NAV
   ============================================================ */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    height: 60px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(61, 143, 163, 0.18);
}

.nav-name {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.01em;
    text-decoration: none;
}

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

.nav-links a {
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-light);
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

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

/* Hamburger button — hidden on desktop */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 17px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}

/* Animated X when open */
.nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ============================================================
   MOBILE NAV
   ============================================================ */
@media (max-width: 700px) {
    .navbar {
        padding: 0 1.25rem;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 60px;
        left: 0; right: 0;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        padding: 1.5rem 1.25rem 2rem;
        gap: 0;
        border-bottom: 1px solid rgba(61, 143, 163, 0.15);
        z-index: 99;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li {
        border-bottom: 1px solid rgba(0,0,0,0.06);
    }

    .nav-links a {
        display: block;
        padding: 0.85rem 0;
        font-size: 1rem;
    }

    /* Home page: panel goes full-width on mobile */
    .about-panel {
        left: 50%;
        transform: translateX(-50%) translateY(0);
        top: 75px;
        width: calc(100% - 2rem);
        max-height: calc(100vh - 85px);
        overflow-y: auto;
    }

    /* Inner pages */
    .page-content {
        padding: 2.5rem 1.25rem 4rem;
    }

    .page-title {
        font-size: 1.6rem;
    }
}

/* Music page hamburger on dark background */
body.music-page .nav-toggle span {
    background: #e0e0e0;
}

/* ============================================================
   HOME PAGE — full-screen hero
   ============================================================ */
body.home {
    overflow: hidden;
    height: 100vh;
}

.hero {
    position: relative;
    width: 100%;
    height: 100vh;
}

/* --- Carousel --- */
.carousel {
    position: absolute;
    inset: 0;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.3s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-caption {
    position: absolute;
    bottom: 1.5rem;
    left: 2rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.caption-location {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.82);
    letter-spacing: 0.03em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.caption-credit {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.42);
    font-style: italic;
    letter-spacing: 0.02em;
}

.carousel-dots {
    position: absolute;
    bottom: 1.5rem;
    right: 2rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: background 0.3s;
    border: none;
    padding: 0;
}

.dot.active {
    background: white;
}

/* --- Frosted about panel --- */
.about-panel {
    position: absolute;
    top: 50%;
    left: 5%;
    transform: translateY(calc(-50% + 30px)); /* 30px offsets the 60px nav */
    width: 340px;
    background: rgba(255, 255, 255, 0.83);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 12px;
    padding: 2.2rem 2rem;
    box-shadow: 0 8px 36px rgba(0, 0, 0, 0.14);
    z-index: 10;
}

.headshot {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    margin-bottom: 1rem;
    border: 3px solid rgba(61, 143, 163, 0.35);
    display: block;
}

.about-panel h1 {
    font-family: var(--font-serif);
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.about-panel .subtitle {
    font-size: 0.88rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 0.15rem;
}

.about-panel .institution {
    font-size: 0.83rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.about-panel .bio {
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.contact-links {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.contact-links a {
    font-size: 0.78rem;
    color: var(--accent);
    text-decoration: none;
    border: 1px solid var(--accent);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    transition: background 0.2s, color 0.2s;
}

.contact-links a:hover {
    background: var(--accent);
    color: white;
}

.contact-text {
    font-size: 0.78rem;
    color: var(--text-light);
    border: 1px solid rgba(74, 90, 101, 0.35);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

/* ============================================================
   INNER PAGES
   ============================================================ */
body.inner {
    padding-top: 60px;
    min-height: 100vh;
}

.page-content {
    max-width: 780px;
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
}

body.projects-page .page-content {
    max-width: 1000px;
}

.page-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent);
}

/* --- Projects & Papers --- */
.project-item {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 2.5rem;
    align-items: start;
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid #e0dfd8;
}

.project-item:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Reverse: image on right, flip column proportions too */
.project-item--reverse {
    grid-template-columns: 0.7fr 1.3fr;
}

.project-item--reverse .project-image {
    order: 2;
}

.project-item--reverse .project-text {
    order: 1;
}

.project-image {
    width: 100%;
    background: #f0efeb;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
}

.project-image img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

@media (max-width: 700px) {
    .project-item,
    .project-item--reverse {
        grid-template-columns: 1fr;
    }

    .project-item--reverse .project-image {
        order: 0;
    }

    .project-item--reverse .project-text {
        order: 1;
    }

    .project-image img {
        max-height: 220px;
    }
}

.project-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.project-questions {
    list-style: none;
    margin-bottom: 0.6rem;
}

.project-questions li {
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text-light);
    padding-left: 1rem;
    position: relative;
    margin-bottom: 0.25rem;
}

.project-questions li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--accent);
}

.project-link {
    margin-top: 0.6rem;
}

.project-link {
    font-size: 0.83rem;
    color: var(--text-light);
}

.project-link a {
    font-size: 0.83rem;
    color: var(--accent);
    text-decoration: none;
}

.project-link a:hover {
    text-decoration: underline;
}

/* ============================================================
   MUSIC PAGE — dark theme
   ============================================================ */
body.music-page {
    background: #0d0d0d;
}

body.music-page .navbar {
    background: rgba(13, 13, 13, 0.92);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.music-page .nav-name {
    color: #e0e0e0;
}

body.music-page .nav-links a {
    color: rgba(255, 255, 255, 0.45);
}

body.music-page .nav-links a:hover,
body.music-page .nav-links a.active {
    color: #e0e0e0;
}

body.music-page .page-content {
    color: #c8c8c8;
}

body.music-page .page-title {
    font-family: var(--font-sans);
    font-weight: 300;
    font-size: 1.5rem;
    color: #e0e0e0;
    border-bottom-color: rgba(255, 255, 255, 0.12);
    letter-spacing: 0.04em;
    text-transform: lowercase;
}

body.music-page .music-intro {
    font-size: 0.95rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2.5rem;
    max-width: 560px;
}

body.music-page .music-note {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.2);
    margin-top: 1.5rem;
}

/* Responsive video embed */
.video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    margin-top: 1rem;
    border-radius: 8px;
    overflow: hidden;
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.publications-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0dfd8;
    display: flex;
    gap: 2rem;
}

.publications-footer a {
    font-size: 0.875rem;
    color: var(--accent);
    text-decoration: none;
}

.publications-footer a:hover {
    text-decoration: underline;
}

/* --- Generic section blocks (Teaching, Outreach, Music) --- */
.section-block {
    margin-bottom: 2.2rem;
    padding-bottom: 2.2rem;
    border-bottom: 1px solid #e0dfd8;
}

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

.section-block h3 {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.45rem;
}

.section-block p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-light);
}
