:root {
  color-scheme: dark;
  --ink: #090908;
  --charcoal: #181715;
  --paper: #f3eedf;
  --muted: #bdb7aa;
  --sand: #ba7f4f;
  --sage: #8d9b7d;
  --clay: #a86145;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { background: var(--ink); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--paper);
  font-family: ui-rounded, -apple-system, BlinkMacSystemFont, "SF Pro Rounded", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: calc(14px + var(--safe-top)) 20px calc(34px + var(--safe-bottom));
}

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 27px; height: 36px; object-fit: contain; }
.brand h1 { margin: 0; font-size: 20px; font-weight: 520; letter-spacing: .075em; }
.brand p { margin: 2px 0 0; color: var(--muted); font: 600 8px/1.2 ui-monospace, monospace; letter-spacing: .14em; }
.today-pill {
  margin-left: auto;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--paper);
  color: var(--ink);
  font: 750 10px/1 ui-monospace, monospace;
  letter-spacing: .12em;
}
#installButton:not([hidden]) + #todayPill { display: none; }

.editorial { margin-top: 34px; }
.eyebrow { margin: 0 0 14px !important; color: var(--sand) !important; font: 550 11px/1.4 ui-monospace, monospace !important; letter-spacing: .12em; text-transform: uppercase; }
.editorial h2 { margin: 0; max-width: 640px; font: 400 clamp(34px, 8vw, 52px)/1.02 Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
.editorial > p:last-child { margin: 17px 0 0; max-width: 580px; color: var(--muted); font-size: 15px; line-height: 1.55; }

.status { margin: 34px 0; padding: 16px; border-radius: 18px; background: var(--charcoal); color: var(--muted); font-size: 14px; }
.status.error { color: var(--paper); border: 1px solid rgba(243,238,223,.18); }

.episodes { margin-top: 32px; }
.section-label { display: flex; justify-content: space-between; margin-bottom: 15px; color: var(--muted); font: 650 10px/1 ui-monospace, monospace; letter-spacing: .13em; }
.episode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.episode-card {
  min-height: 252px;
  display: flex;
  flex-direction: column;
  padding: 17px;
  border: 0;
  border-radius: 27px;
  text-align: left;
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
}
.episode-card:nth-child(2) { background: var(--sage); }
.episode-card:nth-child(3) { background: var(--sand); }
.episode-card:nth-child(4) { background: var(--clay); color: var(--paper); }
.card-top, .card-bottom { display: flex; justify-content: space-between; align-items: center; }
.card-top { font: 650 11px/1 ui-monospace, monospace; letter-spacing: .1em; }
.card-symbol { font: 300 23px/1 Georgia, serif; }
.card-rule { width: 100%; height: 1px; margin: 16px 0; background: currentColor; opacity: .24; }
.card-category { opacity: .7; font: 750 9px/1.2 ui-monospace, monospace; letter-spacing: .1em; }
.episode-card h3 { margin: 12px 0 18px; font: 520 18px/1.17 Georgia, "Times New Roman", serif; }
.card-bottom { margin-top: auto; }
.card-duration { display: block; font: 700 11px/1.2 ui-monospace, monospace; }
.card-action { display: block; margin-top: 3px; opacity: .62; font-size: 10px; }
.card-play { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 50%; background: currentColor; }
.card-play::after { content: "▶"; margin-left: 2px; color: var(--paper); font-size: 12px; }
.episode-card:nth-child(4) .card-play::after { color: var(--clay); }
.freshness { min-height: 16px; margin: 14px 0 0; text-align: center; color: var(--muted); font: 500 10px/1.5 ui-monospace, monospace; }
.freshness.stale { color: var(--sand); }
.footer-note { margin: 34px 0 0; text-align: center; color: #6f6b63; font: 600 8px/1 ui-monospace, monospace; letter-spacing: .18em; }

.player {
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: var(--ink); color: var(--paper);
}
.player::backdrop { background: var(--ink); }
.player-sheet { width: min(640px, 100%); min-height: 100%; margin: 0 auto; padding: calc(14px + var(--safe-top)) 24px calc(22px + var(--safe-bottom)); }
.player-header { display: flex; justify-content: space-between; align-items: center; }
.round-button { width: 43px; height: 43px; border-radius: 50%; border: 1px solid rgba(243,238,223,.22); background: transparent; color: var(--paper); font-size: 24px; line-height: 1; }
.now-playing { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 750 9px/1 ui-monospace, monospace; letter-spacing: .13em; }
.now-playing img { width: 15px; height: 22px; }
.header-spacer { width: 43px; }
.artwork {
  position: relative; width: min(88vw, 410px); aspect-ratio: 1; margin: 24px auto 0; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  border: 0; border-radius: 34px; background: var(--paper); color: var(--ink);
  box-shadow: 0 20px 42px rgba(0,0,0,.35);
}
.art-category { font: 750 10px/1 ui-monospace, monospace; letter-spacing: .15em; }
.art-glyph { font: 300 82px/.9 Georgia, serif; }
.art-rule { width: 42px; height: 1px; background: currentColor; }
.art-brand { font: 650 9px/1 ui-monospace, monospace; letter-spacing: .22em; }
.save-label { position: absolute; bottom: 18px; opacity: .52; font: 650 8px/1 ui-monospace, monospace; letter-spacing: .08em; }
.player-copy { margin: 28px auto 0; text-align: center; }
.player-copy h3 { margin: 0; font: 520 26px/1.12 Georgia, serif; }
.player-copy p { margin: 12px auto 0; max-width: 560px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.timeline { margin-top: 26px; }
.timeline input { width: 100%; accent-color: var(--sand); }
.timeline div { display: flex; justify-content: space-between; margin-top: 7px; color: var(--muted); font: 550 10px/1 ui-monospace, monospace; }
.controls { display: flex; justify-content: center; align-items: center; gap: 40px; margin-top: 24px; }
.controls button { border: 0; background: none; color: var(--paper); font-size: 30px; }
.controls button small { font-size: 10px; margin-left: -12px; }
.controls .play-button { width: 76px; height: 76px; border-radius: 50%; background: var(--paper); color: var(--ink); font-size: 25px; }
.speed-control { width: max-content; display: flex; align-items: center; gap: 8px; margin: 24px auto 0; padding: 9px 14px; border: 1px solid rgba(243,238,223,.2); border-radius: 999px; color: var(--muted); font: 650 10px/1 ui-monospace, monospace; letter-spacing: .08em; }
.speed-control select { border: 0; background: transparent; color: var(--paper); }
.player-message { min-height: 18px; margin: 15px 0 0; text-align: center; color: var(--sand); font-size: 12px; }

@media (max-width: 390px) {
  .shell { padding-left: 16px; padding-right: 16px; }
  .episode-grid { gap: 10px; }
  .episode-card { min-height: 236px; padding: 14px; }
  .episode-card h3 { font-size: 16px; }
  .artwork { margin-top: 15px; }
  .player-copy h3 { font-size: 22px; }
}

@media (min-width: 680px) {
  .episode-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
