:root {
    --bg-color: #F9F8F6;
    /* Wenner-Gren off-white cream */
    --text-color: #222222;
    /* Charcoal */
    --text-light: #666666;
    --accent-color: #000000;
    /* Strict black accents for elegance */
    --font-main: 'Inter', system-ui, sans-serif;
    --font-heading: 'EB Garamond', serif;
    --border-color: #e5e5e5;
    /* Very subtle 1px line */
    --nav-height: 80px;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* 3D Canvas Background */
#field-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0.8;
    pointer-events: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5 {
    font-family: var(--font-heading);
    font-weight: 400;
    color: #000;
}

h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 3rem;
    margin-bottom: 2rem;
}

h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.5rem;
}

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

a:hover {
    color: var(--text-light);
}

/* Sticky Navigation (Celeste Style) */
#top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5vw;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(249, 248, 246, 0.95), rgba(249, 248, 246, 0));
    backdrop-filter: blur(5px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, background 0.3s ease;
}

#top-nav.scrolled {
    background: rgba(249, 248, 246, 0.98);
    border-bottom: 1px solid var(--border-color);
}

.nav-brand {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 500;
}

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

.nav-links li a {
    font-size: 0.95rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    padding-bottom: 4px;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 1px;
    background: #000;
    transition: width 0.3s ease;
}

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

/* Hero Section */
.hero-section {
    min-height: 100vh;
    padding: calc(var(--nav-height) + 15vh) 5vw 10vh 5vw;
    display: flex;
    flex-direction: column;
    gap: 8vw;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5vw;
    align-items: start;
}

.hero-bottom {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.hero-bio {
    font-size: 1.4rem;
    color: var(--text-light);
    margin-top: 1.5rem;
    font-family: var(--font-heading);
    font-style: italic;
}

.hero-long-bio {
    font-size: 1.1rem;
    line-height: 1.7;
    white-space: pre-wrap;
    color: var(--text-color);
    width: 100%;
}

.hero-interests-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    background: rgba(249, 248, 246, 0.7);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

.links-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.links-grid a {
    font-size: 0.95rem;
    color: var(--text-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.hero-image-pane {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-photo {
    width: 100%;
    max-width: 450px;
    border-radius: 4px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
    filter: sepia(0.1) contrast(1.05);
    /* subtle elegant vintage pop */
}


/* Content Architecture */
#main-content {
    display: flex;
    flex-direction: column;
}

.thematic-section {
    padding: 15vh 5vw;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    border-top: 1px solid var(--border-color);
    /* 1px Wenner-Gren lines */
}

/* 3-Column Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem 2.5rem;
    margin-top: 4rem;
}

@media (max-width: 1000px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-section {
        grid-template-columns: 1fr;
        padding-top: 15vh;
    }
}

@media (max-width: 600px) {
    .project-grid {
        grid-template-columns: 1fr;
    }

    #top-nav {
        flex-direction: column;
        height: auto;
        padding: 10px 5vw;
        gap: 10px;
        background: rgba(249, 248, 246, 0.98);
    }

    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
}

.project-item {
    cursor: pointer;
    transition: transform 0.4s ease;
    display: flex;
    flex-direction: column;
}

.project-item:hover {
    transform: translateY(-5px);
}

.project-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.04);
}

.project-item h4 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.project-item p {
    font-size: 0.95rem;
    color: var(--text-light);
}

/* Publication List */
.publication-list {
    list-style: none;
    max-width: 900px;
}

.publication-list li {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.pub-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #000;
}

.pub-authors {
    font-size: 1rem;
    color: var(--text-light);
}

/* Modal Overlay for Subpage */
#subpage-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    background: rgba(249, 248, 246, 0.95);
    backdrop-filter: blur(10px);
    transition: opacity 0.4s ease, visibility 0.4s ease;
    overflow-x: hidden;
    overflow-y: auto;
}

.overlay-hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.overlay-active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.subpage-container {
    padding: 10vh 10vw 20vh 10vw;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    background: #fff;
    min-height: 100%;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.05);
    /* Paper style overlay */
}

.back-btn {
    position: fixed;
    top: 5vh;
    right: 5vw;
    background: none;
    border: none;
    font-size: 1.2rem;
    font-family: var(--font-heading);
    cursor: pointer;
    z-index: 1010;
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 40px;
    background: #fff;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #000;
    color: #fff;
}

.subpage-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

#subpage-desc {
    font-size: 1.15rem;
    width: 100%;
    margin-bottom: 3rem;
    color: var(--text-color);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.gallery-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    aspect-ratio: 1 / 1;
}

.gallery-videos {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-top: 2rem;
    max-width: 1000px;
}

.gallery-videos iframe,
.gallery-videos video {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 4px;
}

/* Coverflow Carousel Integration */
.coverflow-gallery {
    position: relative;
    width: 100%;
    height: 60vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1200px;
    margin: 4rem 0 1rem 0;
    overflow: hidden;
}

.coverflow-item {
    position: absolute;
    width: 55%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    background: #000;
}

.coverflow-item > * {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    border: none;
}

.coverflow-item.active {
    opacity: 1;
    transform: translateX(0) scale(1);
    z-index: 5;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.coverflow-item.active > * {
    pointer-events: auto;
}

.coverflow-item.prev {
    opacity: 0.7;
    transform: translateX(-40%) scale(0.85);
    z-index: 4;
}

.coverflow-item.next {
    opacity: 0.7;
    transform: translateX(40%) scale(0.85);
    z-index: 4;
}

.coverflow-item.prev-far {
    opacity: 0.3;
    transform: translateX(-70%) scale(0.7);
    z-index: 3;
}

.coverflow-item.next-far {
    opacity: 0.3;
    transform: translateX(70%) scale(0.7);
    z-index: 3;
}

.coverflow-item.hidden {
    opacity: 0;
    transform: translateX(0) scale(0.5);
    z-index: 1;
}

.coverflow-controls {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.coverflow-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #111;
    background: transparent;
    color: #111;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.coverflow-btn:hover {
    background: #111;
    color: #fff;
}

/* High Contrast CTA Button */
.btn-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
    padding: 1rem 3rem;
    background: #111;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.btn-primary-action:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.btn-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 3rem 0;
}

/* Collaborators Box */
.collaborators-box {
    margin: 3rem 0;
    padding: 2rem 2.5rem;
    background: rgba(0, 0, 0, 0.02);
    border-left: 4px solid #111;
    border-radius: 4px;
}

.collaborators-box h4 {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    color: #333;
}

.collaborators-box p {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #555;
    margin: 0;
}

/* Publications Citation List */
.project-publications-list {
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 1px solid #ddd;
}

.project-publications-list h3 {
    font-family: 'EB Garamond', serif;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.citation-item {
    margin-bottom: 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
}

.citation-text {
    color: #444;
}

.citation-doi {
    display: inline-block;
    margin-top: 0.2rem;
    color: #555;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-bottom: 1px dotted #999;
    transition: all 0.2s ease;
}

.citation-doi:hover {
    color: #000;
    border-bottom: 1px solid #000;
}

/* Audio Convolution Module */
.convolution-module {
    margin: 4rem 0;
    padding: 3rem;
    background: linear-gradient(145deg, #fdfbf7, #f5f3ec);
    border: 1px solid #e1dfda;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.convolution-module h3 {
    font-family: 'EB Garamond', serif;
    font-size: 2.2rem;
    margin-bottom: 2rem;
    margin-top: 0 !important;
    color: #222;
    border-bottom: 2px solid #e1dfda;
    padding-bottom: 1rem;
}

.convolution-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.convolution-map {
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    background: #fff;
    padding: 1rem;
}

.convolution-map img {
    width: 100%;
    height: auto;
    display: block;
}

.convolution-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.convolution-controls audio {
    width: 100%;
    margin-bottom: 1rem;
}

.convolution-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.convolution-form-group label {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #444;
}

.convolution-form-group select {
    padding: 0.8rem 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.convolution-form-group select:hover, .convolution-form-group select:focus {
    border-color: #111;
    outline: none;
}

.toggle-container {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.toggle-container:hover {
    background: #fafafa;
}

.convolution-disclaimer {
    margin-top: 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #666;
    font-style: italic;
}

/* Rich Text Formatting inside modal */
#subpage-desc h3 {
    font-family: 'EB Garamond', serif;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.role-list {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

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