:root {
    --text-main: #1a1a1a;
    --text-light: #f4f1ed;
    --accent-orange: #e67e22; 
    --light-cream: rgba(250, 248, 242, 0.95);
    --banner-dark: rgba(30, 32, 33, 0.85); 
    --link-blue: #425ab2;
    --link-hover: #1a252f;
}

/* 1. GLOBAL FIX FOR OVER-SCROLL BOUNCE */
html {
    /* Matches the dark banner color to prevent background reveal during bounce */
    background-color: #1e2021; 
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    line-height: 1.8;
}

.fixed-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('images/lichen1.jpg');
    background-size: cover;
    background-position: center;
    z-index: -1;
}

/* 2. NAVIGATION & FOOTER WITH ELASTIC BOUNCE FIX */
.navbar, .site-footer {
    background: var(--banner-dark);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-light);
}

.navbar { 
    padding: 1.5rem 0; 
    position: sticky;
    z-index: 100;
    /* Massive 300px buffer to catch high-speed scrolls */
    top: -300px; 
    margin-top: -300px;
    /* This ensures the visible part of the banner is still 1.5rem + text */
    padding-top: calc(1.5rem + 300px);
}

.site-footer { 
    text-align: center; 
    font-size: 0.8rem;
    position: relative;
    z-index: 10;
    padding: 40px 0; 
    box-shadow: 0 1000px 0 1000px var(--banner-dark);
    /* This clip-path ensures the shadow ONLY goes down, not up or sideways */
    clip-path: inset(0px -100% -1000px -100%);
}

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

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 700;
}

.nav-links { list-style: none; display: flex; }
.nav-links li { margin-left: 30px; }
.nav-links a { 
    text-decoration: none; 
    color: #bbb;
    font-size: 0.85rem; 
    text-transform: uppercase; 
    letter-spacing: 1.5px;
    font-weight: 600;
}

.nav-links a.active { 
    color: var(--text-light); 
    border-bottom: 2px solid var(--accent-orange); 
    padding-bottom: 5px; 
}

/* COMMON LAYOUT */
.container {
    max-width: 1100px;
    margin: 60px auto;
    padding: 0 40px;
}

.main-panel {
    background: var(--light-cream);
    padding: 60px;
    border-radius: 2px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.sub-logo {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: #000;
    margin-bottom: 2rem;
}

/* BIO PAGE SPECIFIC */
.bio-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 60px;
    align-items: start;
}

.headshot {
    width: 100%;
    height: auto;
    border: 1px solid rgba(0,0,0,0.08);
}

.bio-intro {
    font-size: 1.45rem;
    line-height: 1.3;
    color: #1a252f;
    font-family: 'Playfair Display', serif;
    margin-bottom: 1.8rem;
    display: block;
}

.bio-text p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: #333;
}

.bio-text a, .writing-item a, .comp-details a, #email-box a, .profile-row a {
    color: var(--link-blue);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.bio-text a:hover, .writing-item a:hover, .comp-details a:hover, #email-box a:hover, .profile-row a:hover {
    text-decoration: underline;
    color: var(--link-hover);
}

.academic-highlight { font-weight: 600; color: #2c3e50; }

/* WRITINGS & BOOK COVERS */
.writing-section { margin-bottom: 3.5rem; }
.writing-section h3 {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #d35400;
    margin-bottom: 1.5rem;
    font-weight: 600;
}
.writing-item {
    margin-bottom: 1.4rem;
    line-height: 1.7;
    color: #333;
    font-size: 0.95rem;
}

.book-entry {
    display: flex;
    gap: 25px;
    margin-bottom: 2.5rem;
    align-items: flex-start;
}

.book-cover, .cover-spacer {
    flex-shrink: 0;
    width: 120px;
}

.book-cover {
    height: auto;
    border-radius: 2px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.book-cover:hover {
    transform: scale(1.03);
}

.cover-spacer { height: 1px; }

/* MUSIC PAGE SPECIFIC */
.section-title {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-orange);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 5px;
    margin: 2.5rem 0 1.5rem 0;
}
.list-item { margin-bottom: 1.5rem; }
.list-item strong { font-size: 1.05rem; color: #1a252f; }
.comp-details {
    display: block;
    padding-left: 1.5rem;
    font-size: 0.95rem;
    color: #444;
    margin-top: 0.25rem;
}

/* YouTube Responsive Container */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin: 1.5rem 0 3rem 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: 2px;
}

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

/* TABLES */
.perf-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; line-height: 1.5; margin-top: 1rem; table-layout: fixed; margin-bottom: 100px; }
.perf-table td { vertical-align: top; padding: 12px 15px 12px 0; border-bottom: 1px solid rgba(0,0,0,0.06); word-wrap: break-word; }
.col-title { width: 28%; font-weight: 600; color: #1a252f; }
.col-perf { width: 32%; color: #444; }
.col-loc { width: 25%; color: #666; }
.col-date { width: 15%; white-space: nowrap; text-align: left; color: #888; }
.full-titles { font-weight: 600; font-style: italic; }

/* FLOATING PLAYER */
#global-audio-player {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0,0,0,0.1); padding: 12px 0; display: none; z-index: 1000;
}
.player-container { max-width: 900px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; gap: 15px; }
#now-playing { font-size: 0.75rem; color: #d35400; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; max-width: 25%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
audio { height: 32px; flex-grow: 1; filter: grayscale(1) opacity(0.8); }
#close-player { background: none; border: none; font-size: 1.2rem; color: #888; cursor: pointer; padding: 5px; }

/* CONTACT PAGE SPECIFIC */
.contact-wrapper { max-width: 100%; margin-top: 3rem; display: flex; flex-direction: column; align-items: center; text-align: center; }
.address-block { font-size: 1.05rem; line-height: 1.8; color: #1a252f; font-style: normal; margin-bottom: 2.5rem; }
.contact-name { font-weight: 600; font-size: 1.1rem; display: block; margin-bottom: 0.2rem; }
#email-box { margin-bottom: 5rem; }
.profile-row { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 2.5rem; padding-top: 2rem; border-top: 1px solid rgba(0,0,0,0.06); }

/* MISC & FADE */
.fade-in { animation: fadeIn 1.5s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* RESPONSIVE QUERIES */
@media (max-width: 900px) {
    .bio-layout { grid-template-columns: 1fr; }
    .nav-container { flex-direction: column; gap: 20px; }
    .nav-links li { margin: 0 10px; }
    .profile-row { flex-direction: column; gap: 1.5rem; align-items: center; }
}

@media (max-width: 600px) {
    .book-entry {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .cover-spacer { display: none; }
    /* Revert bounce fix slightly for mobile headers if sticky feels jittery */
    .navbar { top: -50px; margin-top: -50px; padding-top: calc(1.5rem + 50px); }
    .site-footer { 
        padding: 40px 0; 
    }
}

.research-links-footer {
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0,0,0,0.06);
    text-align: center;
}

.research-links-footer p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.research-links-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.research-links-row a {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--link-blue);
    text-decoration: none;
}

.research-links-row a:hover {
    text-decoration: underline;
    color: var(--link-hover);
}

/* Mobile adjustment */
@media (max-width: 600px) {
    .research-links-row {
        flex-direction: column;
        gap: 1rem;
    }
}