/* Layout: an evening in Lizzy's studio. Espresso and cocoa browns, caramel light, a little sage from her
   botanical wallpaper. Big serif wordmark, photos of her, and questions that pop up and talk back. */
:root {
  --bg: #e6d2b8;
  --surface: #f0e3d1;
  --sunk: #d9c0a1;
  --ink: #2a1a10;
  --muted: #5e4332;
  --line: #ccb08f;
  --accent: #6b3f24;
  --accent-ink: #f6ecdf;
  --caramel: #8a5528;
  --sage: #5b6c47;
  --band: #3a2518;
  --band-ink: #f3e6d4;
  color-scheme: light;
  --font-display: "Gloock", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --font-mono: "DM Mono", ui-monospace, Menlo, monospace;
  --step--1: 0.86rem;
  --step-0: 1.05rem;
  --step-1: 1.3rem;
  --step-2: 1.7rem;
  --step-3: clamp(2rem, 4.4vw, 3.1rem);
  --step-4: clamp(3.6rem, 10.5vw, 7.8rem);
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #3a2518;
    --surface: #4a3021;
    --sunk: #2e1d12;
    --ink: #f6e9d8;
    --muted: #d6bb9e;
    --line: #5e402c;
    --accent: #e2ae79;
    --accent-ink: #2e1d12;
    --caramel: #eab886;
    --sage: #b3c39a;
    --band: #f0e1cc;
    --band-ink: #3a2518;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #3a2518;
  --surface: #4a3021;
  --sunk: #2e1d12;
  --ink: #f6e9d8;
  --muted: #d6bb9e;
  --line: #5e402c;
  --accent: #e2ae79;
  --accent-ink: #2e1d12;
  --caramel: #eab886;
  --sage: #b3c39a;
  --band: #f0e1cc;
  --band-ink: #3a2518;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--caramel); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.05; text-wrap: balance; margin: 0; }
p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }

.wrap {
  max-width: 1160px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.hand { font-family: var(--font-hand); font-weight: 700; color: var(--caramel); }
section { padding-block: 88px; }
.section-head { display: grid; gap: 12px; margin-bottom: 40px; max-width: 62ch; }
.section-head h2 { font-size: var(--step-3); }
.section-head p { color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; font-weight: 600; text-decoration: none;
  border: 1.5px solid var(--ink); font-size: var(--step--1); cursor: pointer; background: transparent;
  transition: transform .15s ease, background .15s, color .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost:hover { background: var(--ink); color: var(--bg); }

/* Rise-in: content is always visible; motion only nudges it into place. */
.js .rise { transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.js .rise:not(.in) { transform: translateY(22px); }
@media (prefers-reduced-motion: reduce) { .js .rise:not(.in) { transform: none; } }

/* Nav */
nav { padding-block: 18px; }
nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { font-family: var(--font-display); font-size: var(--step-1); text-decoration: none; }
nav ul { list-style: none; display: flex; align-items: center; gap: 22px; margin: 0; padding: 0; flex-wrap: wrap; }
nav ul a { text-decoration: none; font-weight: 500; font-size: var(--step--1); }
nav ul a:hover { color: var(--caramel); }

/* Small pill buttons, used for player controls and the theme switch */
.mini {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  font-size: 0.8rem; cursor: pointer; font-family: var(--font-mono); text-decoration: none;
}
.mini:hover { border-color: var(--caramel); color: var(--caramel); }
.theme-btn { padding: 7px 14px; }

footer { padding-block: 40px 56px; border-top: 1px solid var(--line); }
footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
footer .links { display: flex; gap: 20px; flex-wrap: wrap; font-size: var(--step--1); align-items: center; }
.email { user-select: all; font-family: var(--font-mono); font-size: 0.85rem; }

/* Arched photo with a sticker and speech bubble, on the home page and /archive */
.hero-photo { position: relative; min-width: 0; }
.hero-photo img { border-radius: 220px 220px var(--radius) var(--radius); aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.bubble {
  position: absolute; left: -28px; bottom: 56px; max-width: 250px;
  background: var(--surface); color: var(--ink); border-radius: 18px 18px 18px 4px;
  padding: 14px 16px; box-shadow: 0 14px 40px rgba(43, 29, 22, .22); display: grid; gap: 4px;
}
.bubble .label { font-size: 0.7rem; }
.bubble p { font-family: var(--font-display); font-size: 1.08rem; line-height: 1.25; }
.sticker {
  position: absolute; right: -10px; top: 36px; transform: rotate(8deg);
  background: var(--sage); color: var(--accent-ink); font-family: var(--font-hand); font-size: 1.5rem; font-weight: 700;
  padding: 8px 16px; border-radius: 12px; line-height: 1.1; text-align: center;
}
@media (prefers-reduced-motion: no-preference) {
  .bubble { animation: bob 5s ease-in-out infinite; }
  @keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
}

/* Marquee band */
.band { background: var(--band); color: var(--band-ink); overflow: hidden; padding-block: 18px; }
.track { display: flex; gap: 48px; width: max-content; font-family: var(--font-display); font-size: var(--step-1); white-space: nowrap; }
.track span::after { content: "✦"; margin-left: 48px; color: var(--caramel); }
@media (prefers-reduced-motion: no-preference) {
  .track { animation: slide 48s linear infinite; }
  .band:hover .track { animation-play-state: paused; }
  @keyframes slide { to { transform: translateX(-50%); } }
}

/* Archive player, on the home page and /archive */
.archive .wrap { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; }
.big { font-family: var(--font-display); font-size: var(--step-4); line-height: .9; color: var(--caramel); }
.archive .links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.archive-side { display: grid; gap: 28px; align-content: start; min-width: 0; }
.player {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; display: grid; gap: 14px; min-width: 0;
}
.player h3 { font-size: var(--step-2); }
.player .desc { color: var(--muted); font-size: var(--step--1); max-height: 7.5em; overflow: auto; }
.controls { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.playbtn {
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  transition: transform .15s ease;
}
.playbtn:hover { transform: scale(1.06); }
.playbtn svg { width: 22px; height: 22px; fill: currentColor; }
#seek { width: 100%; accent-color: var(--caramel); }
.time { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.player-row { display: flex; gap: 8px; flex-wrap: wrap; }
.browse { display: grid; gap: 14px; min-width: 0; align-content: start; }
.browse input[type="search"] {
  width: 100%; padding: 13px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: var(--step--1);
}
.years { display: flex; gap: 8px; flex-wrap: wrap; }
.years .mini[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.arc { list-style: none; margin: 0; padding: 0; max-height: 560px; overflow-y: auto; border-top: 1px solid var(--line); }
.arc li { border-bottom: 1px solid var(--line); }
.arc > li:not(.row) > button, .arc > li:not(.row) > a {
  width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer; text-decoration: none;
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 8px; border-radius: 10px; transition: background .15s;
}
.arc > li:not(.row) > button:hover, .arc > li:not(.row) > a:hover { background: var(--sunk); }
.arc [aria-current="true"] { background: var(--sunk); }
.arc [aria-current="true"] .ic { background: var(--accent); color: var(--accent-ink); }
.arc .ic { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; }
.arc .ic svg { width: 13px; height: 13px; fill: currentColor; }
.arc strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.arc .meta { color: var(--muted); font-size: 0.82rem; }
.arc .dur { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.arc .empty { padding: 20px 8px; color: var(--muted); }

@media (max-width: 900px) {
  .archive .wrap { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .hero-photo { max-width: 460px; }
  .bubble { left: 12px; bottom: 20px; }
  .sticker { right: 8px; }
}

/* Episode pages */
main { padding-block: 24px 88px; }
main h1 { font-size: var(--step-3); }
.episode header { display: grid; gap: 14px; max-width: 62ch; }

/* Archive page */
main.archive-page { padding-block: 0; }
.arc-hero { padding-block: 32px 72px; }
.arc-hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 56px; align-items: center; }
.arc-hero .copy { display: grid; gap: 18px; min-width: 0; }
.arc-hero h1 { font-size: var(--step-3); max-width: 16ch; }
.arc-hero p { color: var(--muted); max-width: 46ch; }
.count { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.count .hand { font-size: 2.2rem; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.stats div { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; min-width: 0; }
.stats dt { order: 2; }
.stats dd { margin: 0; font-family: var(--font-display); font-size: var(--step-2); line-height: 1.1; }
.arc-hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.arc-hero .hero-photo { width: 100%; max-width: 440px; justify-self: end; }
.bubble a { text-decoration: none; font-family: var(--font-display); font-size: 1.08rem; line-height: 1.25; }
.bubble a:hover { color: var(--caramel); }

.archive.full .archive-side { position: sticky; top: 24px; align-self: start; }
.archive.full .arc { max-height: none; overflow: visible; }
.arc .yr { padding: 28px 8px 10px; border-bottom: 1px solid var(--line); }
.arc .yr h2 { font-size: var(--step-2); color: var(--caramel); }
.arc .row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 18px 8px; transition: background .15s; }
.arc .row:hover { background: var(--sunk); }
.arc .row .ic { width: 44px; height: 44px; background: transparent; cursor: pointer; color: inherit; padding: 0; }
.arc .row .ic:hover { border-color: var(--caramel); color: var(--caramel); }
.arc .row .ic svg { width: 15px; height: 15px; }
.arc .title { display: grid; gap: 4px; text-decoration: none; min-width: 0; }
.arc .title strong { font-size: var(--step-1); line-height: 1.25; }
.arc .title:hover strong { color: var(--caramel); }
.arc .sum {
  color: var(--muted); font-size: var(--step--1); max-width: 68ch;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.arc .more { font-size: 0.82rem; font-weight: 600; color: var(--accent); }
.arc .row .dur { padding-top: 10px; }

@media (max-width: 900px) {
  .arc-hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .arc-hero .hero-photo { justify-self: start; }
  .archive.full .archive-side { position: static; }
  /* Once something plays, the player docks at the bottom of the screen so it stays in reach while scrolling */
  .archive.full.started .player {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 20; padding: 14px 16px; gap: 8px;
    box-shadow: 0 14px 40px rgba(43, 29, 22, .3);
  }
  .archive.full.started .player .desc, .archive.full.started .player .player-row { display: none; }
  .archive.full.started .player h3 { font-size: var(--step-1); }
  .archive.full.started .playbtn { width: 44px; height: 44px; }
  .archive.full.started { padding-bottom: 180px; }
}
@media (max-width: 560px) {
  .arc .row { grid-template-columns: 44px minmax(0, 1fr); }
  .arc .row .dur { display: none; }
}

.episode .wrap { max-width: 760px; display: grid; gap: 24px; }
.back { text-decoration: none; width: fit-content; }
.back:hover { color: var(--caramel); }
.episode h1 { overflow-wrap: anywhere; }
.ep-audio { width: 100%; accent-color: var(--caramel); }
.ep-links { display: flex; gap: 12px; flex-wrap: wrap; }
.notes { display: grid; gap: 16px; overflow-wrap: anywhere; }
.notes ul, .notes ol { margin: 0; padding-left: 1.3em; }
.notes a { color: var(--accent); }
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.step { display: grid; gap: 4px; padding: 16px; border-radius: var(--radius); background: var(--surface); text-decoration: none; min-width: 0; }
.step:hover { background: var(--sunk); }
.step strong { font-weight: 600; overflow-wrap: anywhere; }
.step.older { grid-column: 2; text-align: right; }
@media (max-width: 560px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .step.older { grid-column: auto; text-align: left; }
}
