/* Maxwell's Pendulum: The Plan */
:root {
    --bg: #08080d;
    --surface: #111118;
    --surface-hover: #1a1a25;
    --text: #e8e6e0;
    --text-muted: #7d7a72;
    --accent: #c4956a;
    --accent-dim: rgba(196, 149, 106, 0.15);
    --link: #7d9bc1;
    --link-hover: #a3bdd9;
    --border: #222233;
    --max-width: 800px;
}

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

html { font-size: 17px; scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* Header — compact on inner pages */
header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.header-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: var(--max-width);
    margin: 0 auto;
    color: var(--text);
}

.header-art {
    width: 48px;
    height: 48px;
    border-radius: 8px;
}

.site-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.site-subtitle {
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 0.1rem;
}

/* Hide compact header on homepage — hero takes over */
body.home header { display: none; }

/* Main */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    flex: 1;
    width: 100%;
}

/* ── Homepage Hero ─────────────────────────────────── */
.hero {
    text-align: center;
    padding: 3rem 0 2.5rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}

.hero-art {
    width: 100%;
    max-width: var(--max-width);
    height: auto;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 80px rgba(196,149,106,0.08);
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.25rem;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--accent);
    font-weight: 400;
    margin-bottom: 1.75rem;
}

.hero-links {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.hero-player {
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
}

.hero-player iframe {
    border-radius: 12px;
}

/* ── About section ─────────────────────────────────── */
.about {
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}

.about p {
    margin-bottom: 1.1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.75;
}

.about p:first-child {
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.6;
}

/* ── Episode grid ──────────────────────────────────── */
.episodes h2 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    font-weight: 600;
}

.episode-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.episode-card {
    display: grid;
    grid-template-columns: 3.5rem 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    background: var(--surface);
    color: var(--text);
    transition: all 0.15s ease;
}

.episode-card:hover {
    background: var(--surface-hover);
    color: var(--text);
    padding-left: 1.5rem;
}

.ep-number {
    font-size: 0.75rem;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.ep-title {
    font-size: 0.9rem;
    font-weight: 500;
}

.ep-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── Episode page ──────────────────────────────────── */
.episode-header {
    margin-bottom: 2.5rem;
}

.ep-number-large {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 700;
    background: var(--accent-dim);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    margin-bottom: 0.75rem;
}

.episode-header h2 {
    font-size: 2rem;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

.episode-header time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Infographic */
.infographic {
    margin: 2rem 0;
}

.infographic img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* ── Audio player / Spotify embed ──────────────────── */
.audio-player {
    margin: 2rem 0;
}

.audio-player h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.audio-player iframe {
    border-radius: 12px;
    display: block;
}

.spotify-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.spotify-link:hover { color: var(--accent); }

audio {
    width: 100%;
    height: 48px;
    border-radius: 8px;
}

/* ── Show notes ────────────────────────────────────── */
.show-notes {
    margin: 2.5rem 0;
}

.show-notes h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.show-notes h2 { font-size: 1.3rem; margin: 1.5rem 0 0.75rem; font-weight: 600; }
.show-notes p { margin-bottom: 1rem; }
.show-notes ul, .show-notes ol { margin: 0.75rem 0 1rem 1.5rem; }
.show-notes li { margin-bottom: 0.5rem; }
.show-notes strong { color: var(--accent); font-weight: 600; }
.show-notes hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ── Research brief ────────────────────────────────── */
.research-brief {
    margin: 2.5rem 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.research-brief > h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 600;
}

.research-brief details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.research-brief summary {
    cursor: pointer;
    color: var(--link);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.research-brief details[open] summary {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.research-brief h1 { font-size: 1.4rem; margin: 1.5rem 0 0.75rem; font-weight: 600; }
.research-brief h2 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; font-weight: 600; }
.research-brief h3 { font-size: 1rem; margin: 1.25rem 0 0.5rem; text-transform: none; letter-spacing: normal; font-weight: 600; }
.research-brief p { margin-bottom: 1rem; font-size: 0.95rem; }
.research-brief ul, .research-brief ol { margin: 0.75rem 0 1rem 1.5rem; font-size: 0.95rem; }
.research-brief li { margin-bottom: 0.4rem; }
.research-brief blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-muted);
    font-style: italic;
}

/* ── Footnotes ─────────────────────────────────────── */
.footnote {
    font-size: 0.8rem;
    color: var(--text-muted);
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    padding-top: 1rem;
}

.footnote hr { border-color: var(--border); margin-bottom: 1rem; }
.footnote ol { margin-left: 1.5rem; }
.footnote li { margin-bottom: 0.4rem; line-height: 1.5; word-break: break-all; }
.footnote li p { margin-bottom: 0.15rem; }
.footnote-backref { margin-left: 0.25rem; text-decoration: none; opacity: 0.5; font-size: 0.75rem; }

sup a { color: var(--accent); font-size: 0.75em; padding: 0 0.15em; }

/* ── Episode nav ───────────────────────────────────── */
.episode-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.nav-prev, .nav-next {
    font-size: 0.85rem;
    max-width: 45%;
}

.nav-next { margin-left: auto; text-align: right; }

/* ── Footer ────────────────────────────────────────── */
footer {
    padding: 2.5rem 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

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

.footer-links a { font-size: 0.8rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }

.footer-copy {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ── Mobile ────────────────────────────────────────── */
@media (max-width: 768px) {
    html { font-size: 16px; }
    .hero-art { max-width: 100%; }
    .hero-title { font-size: 1.6rem; }
    .header-art { width: 40px; height: 40px; }
    .site-title { font-size: 1rem; }
    .episode-header h2 { font-size: 1.5rem; }
    .episode-card { grid-template-columns: 3rem 1fr; }
    .ep-date { display: none; }
    .episode-nav { flex-direction: column; }
    .nav-prev, .nav-next { max-width: 100%; text-align: left; }
    .hero-player { max-width: 100%; }
}
