/* Stable shared assets let the entire archive change appearance without HTML export. */
html:root {
    color-scheme: light;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-serif: var(--font-sans);
    --reading-font: var(--font-sans);
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-2: #edf1f6;
    --border: #dce3ec;
    --border-strong: #7c899b;
    --text: #182536;
    --muted: #546477;
    --accent: #1759aa;
    --accent-hover: #103e78;
    --accent-soft: #e7effb;
    --on-accent: #ffffff;
    --focus: #1759aa;
    --mark-bg: #ffe59a;
    --mark-text: #182536;
    --current-bg: #fff4ce;
    --topic: #6b3fa0;
    --person: #0d6b52;
    --company: #9a4a07;
    --product: #a3264f;
    --media: #2f55a4;
    --radius: 0.9rem;
    --shadow: 0 4px 20px rgb(24 37 54 / 0.04);
}

html:root[data-theme='midnight'] {
    color-scheme: dark;
    --bg: #101720;
    --surface: #18222e;
    --surface-2: #202e3d;
    --border: #314154;
    --border-strong: #8192a7;
    --text: #edf2f9;
    --muted: #afbed0;
    --accent: #93c3ff;
    --accent-hover: #c4dfff;
    --accent-soft: #253c57;
    --on-accent: #101720;
    --focus: #93c3ff;
    --mark-bg: #615017;
    --mark-text: #fff1bc;
    --current-bg: #3b341e;
    --topic: #c8a8f0;
    --person: #6fd6b3;
    --company: #f2b16e;
    --product: #f59ab7;
    --media: #9ab8f5;
    --shadow: 0 4px 20px rgb(0 0 0 / 0.12);
}

@media (prefers-color-scheme: dark) {
    html:root:not([data-theme='light']):not([data-theme='paper']):not([data-theme='midnight']) {
        color-scheme: dark;
        --bg: #101720;
        --surface: #18222e;
        --surface-2: #202e3d;
        --border: #314154;
        --border-strong: #8192a7;
        --text: #edf2f9;
        --muted: #afbed0;
        --accent: #93c3ff;
        --accent-hover: #c4dfff;
        --accent-soft: #253c57;
        --on-accent: #101720;
        --focus: #93c3ff;
        --mark-bg: #615017;
        --mark-text: #fff1bc;
        --current-bg: #3b341e;
        --topic: #c8a8f0;
        --person: #6fd6b3;
        --company: #f2b16e;
        --product: #f59ab7;
        --media: #9ab8f5;
        --shadow: 0 4px 20px rgb(0 0 0 / 0.12);
    }
}

html:root[data-theme='paper'] {
    --bg: #f6f1e7;
    --surface: #fffcf6;
    --surface-2: #eee7d9;
    --border: #dfd4c2;
    --border-strong: #8c7b65;
    --text: #332d25;
    --muted: #6a5c4b;
    --accent: #795027;
    --accent-hover: #573817;
    --accent-soft: #efe1ce;
    --focus: #795027;
    --reading-font: 'Charter', 'Iowan Old Style', Georgia, serif;
    --shadow: none;
}

html { scroll-padding-top: 1.5rem; }
body { font-size: 1rem; line-height: 1.7; letter-spacing: -0.008em; }
main { padding-block: clamp(1.5rem, 3vw, 3rem) 4rem; }
h1 { font-family: var(--font-sans); font-weight: 750; letter-spacing: -0.045em; line-height: 1.13; font-size: clamp(2rem, 1.4rem + 2vw, 3.2rem); }
h2, h3 { letter-spacing: -0.025em; }
.wrap { max-width: 76rem; padding-inline: max(clamp(1rem, 4vw, 3rem), env(safe-area-inset-left, 0px)); }
.narrow { max-width: 54rem; }
.brand { font-family: var(--font-sans); font-weight: 750; font-size: 1.15rem; letter-spacing: -0.04em; }
.brand-site { display: inline-flex; align-items: center; gap: 0.65rem; }
.brand-site::before { content: ''; width: 0.65rem; height: 0.65rem; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 5px var(--accent-soft); }
.header-row { gap: 1rem; padding-block: 1.15rem; }
.header-search { margin-left: auto; }
.theme-picker { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.theme-picker select { min-height: 2.75rem; max-width: 100%; padding: 0.45rem 0.55rem; border: 1px solid var(--border); border-radius: 0.65rem; background: var(--surface-2); color: var(--text); font: inherit; font-size: 1rem; cursor: pointer; }
.show-nav { background: var(--surface); }
.show-nav ul { gap: 0.5rem; }
.show-nav a { padding-block: 0.85rem; font-size: 0.9rem; }
.show-nav a[aria-current='page'] { color: var(--accent); }
.show-head { gap: clamp(1.25rem, 3vw, 2.5rem); padding-block: 0.25rem 1rem; align-items: center; }
.show-head-art { width: clamp(5.5rem, 10vw, 8rem); height: auto; border-radius: 1.25rem; box-shadow: var(--shadow); }
.lede { font-size: 1.0625rem; line-height: 1.75; }
.section-title { font-family: var(--font-sans); font-size: 1.15rem; font-weight: 700; border: 0; padding: 0; margin-block: 2rem 1rem; }
.episode-card { background: var(--surface); padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); margin-block: 0.8rem; gap: 1.15rem; box-shadow: var(--shadow); }
.episode-card:hover { border-color: var(--border-strong); }
.episode-card-art { flex: 0 0 5rem; width: 5rem; }
.episode-card-art img { border-radius: 0.65rem; }
.episode-card-title { font-family: var(--font-sans); font-size: 1.15rem; font-weight: 700; line-height: 1.4; }
.episode-card-title a { color: var(--text); }
.episode-card-title a:hover { color: var(--accent); }
.episode-card-blurb { color: var(--muted); line-height: 1.7; font-family: var(--reading-font); }
.meta { font-size: 0.8125rem; }
.split { gap: 2.5rem; }
.split-side .panel { background: var(--surface); border: 1px solid var(--border); padding: 1.25rem; border-radius: var(--radius); }
.split-side .panel + .panel { margin-top: 1rem; }
.ranked li { padding-block: 0.5rem; font-size: 0.9375rem; }
.ranked a { text-decoration: none; }
.ranked a:hover { text-decoration: underline; }
.prose, .transcript-lines p, .mention-list .context { font-family: var(--reading-font); }
.prose { max-width: 65ch; line-height: 1.85; }
.prose h1, .prose h2, .prose h3 { font-family: var(--font-sans); }
.transcript-lines { max-width: 70ch; }
.search-row input, .header-search input { border-color: var(--border-strong); }
.search-row button, .header-search button, .ts-large, .chip[aria-current='true'] { color: var(--on-accent); }
.episode-head h1, .entity-head h1 { max-width: 24ch; }
.site-footer { padding-block: 2rem; line-height: 1.8; }
.theme-picker:focus-within { color: var(--accent); }

@media (max-width: 39.99rem) {
    .header-row { gap: 0.75rem; }
    .brand { flex: 1; }
    .theme-picker { margin-left: auto; gap: 0.35rem; }
    .theme-picker > span:first-child { font-size: 0.75rem; }
    .theme-picker select { max-width: 7.5rem; }
    .header-search { order: 3; flex-basis: 100%; max-width: none; }
    .show-head { align-items: start; }
    .show-head h1 { font-size: 1.8rem; }
    .show-head .lede { font-size: 0.9375rem; }
    .episode-card { padding: 1rem; gap: 0.85rem; }
    .episode-card-art { flex-basis: 3.5rem; width: 3.5rem; }
    .episode-card-title { font-size: 1.0625rem; }
    .split { gap: 0; }
    .transcript-lines li { grid-template-columns: 4.5rem minmax(0, 1fr); gap: 0.5rem; }
}

@media (max-width: 23rem) {
    .brand { font-size: 1rem; }
    .theme-picker > span:first-child { display: none; }
    .episode-card { flex-wrap: wrap; }
}
