/* Amongst Other Things — listening site (forked, polished, with marginalia) */
@import url("./colors_and_type.css");

* { box-sizing: border-box; }

html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

/* Subtle paper grain — done as a tiny SVG noise overlay, fixed, very low alpha.
   Kept under 0.04 alpha so it reads as paper, not as gradient. */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.42  0 0 0 0 0.36  0 0 0 0 0.27  0 0 0 0.6 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
  z-index: 0;
}

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: -9999px;
  background: var(--ink); color: var(--paper);
  padding: 8px 14px; border-radius: 3px;
  font-family: var(--font-utility); font-weight: 600; font-size: 12px;
  letter-spacing: 0.16em; text-transform: uppercase; z-index: 100;
}
.skip-link:focus { left: 16px; top: 16px; }

/* Page shell — single column, generous margin */
.page {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 32px 80px;
}

/* Marginalia gutters — hidden by default, restored on wider viewports */
.gutter-left,
.gutter-right {
  position: absolute;
  width: 0;
  pointer-events: none;
}

@media (min-width: 1100px) {
  .page { max-width: 760px; padding-left: 32px; padding-right: 32px; }
  .gutter-right {
    width: 140px;
    right: -160px;
    top: 0;
    pointer-events: auto;
  }
  .gutter-left {
    width: 80px;
    left: -110px;
    top: 0;
    pointer-events: auto;
  }
}

/* Boot loader — while the catalog is being fetched */
.boot-loading {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 15px;
  color: var(--shadow);
  display: grid;
  gap: 6px;
  padding: 120px 24px;
  place-items: center;
  min-height: 60vh;
}
.boot-loading-mark {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--rule);
  animation: boot-pulse 1.4s ease-in-out infinite;
}
@keyframes boot-pulse {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(-2px); }
}

/* Section labels */
.section-label {
  font-family: var(--font-utility);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--shadow);
  margin: 0 0 12px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.section-label > span {
  white-space: nowrap;
  flex: 0 0 auto;
}
.section-label > span em {
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.04em;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
}
.section-label::after {
  content: "";
  flex: 1 1 auto;
  min-width: 24px;
  border-bottom: 1px dotted var(--rule);
  transform: translateY(-3px);
}

/* Focus ring */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

button {
  font-family: inherit;
  background: transparent; border: 0; padding: 0;
  color: inherit; cursor: pointer; text-align: left;
}

/* ───── Header ───── */
.header { padding: 56px 0 0; position: relative; }
.header-top {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px;
}
.header-block { display: grid; gap: 6px; }
.wordmark {
  font-family: var(--font-display);
  font-style: italic; font-weight: 500;
  font-size: 56px; line-height: 1;
  color: var(--ink); letter-spacing: 0.005em;
}
.tagline {
  font-family: var(--font-utility);
  font-weight: 600; font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--shadow);
}

/* The header strapline — tiny printed-press meta */
.header-meta {
  display: flex; gap: 14px;
  margin-top: 18px;
  padding: 6px 0 4px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px dotted var(--rule);
  font-family: var(--font-utility);
  font-weight: 600; font-size: 10px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--shadow);
}
.header-meta .sep { color: var(--rule); }
.header-meta .vol { color: var(--ink); }

.header-ridge {
  width: 100%;
  aspect-ratio: 1174 / 856;
  margin-top: 18px;
  background: url("./assets/header-image.png") center / contain no-repeat;
  mix-blend-mode: multiply;
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0%, #000 12%, #000 82%, transparent 100%),
    linear-gradient(to right,  transparent 0%, #000 6%, #000 94%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-image:
    linear-gradient(to bottom, transparent 0%, #000 12%, #000 82%, transparent 100%),
    linear-gradient(to right,  transparent 0%, #000 6%, #000 94%, transparent 100%);
          mask-composite: intersect;
}

/* ───── RSS pill ───── */
.rss-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--shadow);
  border-radius: var(--r-pill);
  background: transparent;
  font-family: var(--font-utility);
  font-weight: 600; font-size: 11px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--shadow);
  transition: border-color 120ms ease-out, color 120ms ease-out, background 120ms ease-out;
}
.rss-pill:hover { border-color: var(--willow); }
.rss-pill.copied { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.rss-glyph {
  width: 9px; height: 9px; border-radius: 999px;
  border: 1.5px solid currentColor; position: relative;
}
.rss-glyph::after {
  content: ""; position: absolute; left: -1px; top: -1px;
  width: 5px; height: 5px;
  border: 1.5px solid currentColor; border-radius: 999px;
}

/* ───── Search bar ───── */
.search-section { margin-top: 36px; }
.search-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--r-input);
  background: transparent;
  transition: border-color 120ms ease-out;
}
.search-bar:focus-within { border-color: var(--ink); }
.search-bar svg { color: var(--shadow); flex: 0 0 auto; }
.search-bar input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-family: var(--font-utility); font-size: 14px; color: var(--ink);
}
.search-bar input::placeholder { color: var(--shadow); }
.search-bar .slash-hint {
  font-family: var(--font-mono); font-size: 11px;
  padding: 2px 6px; border: 1px solid var(--rule); border-radius: 3px;
  color: var(--shadow); background: var(--vellum);
}
.search-bar .clear-x {
  background: transparent; border: 0; padding: 4px;
  display: inline-flex; color: var(--shadow);
}
.search-bar .clear-x:hover { color: var(--ink); }

/* ───── Chips row ───── */
.chips-section { margin-top: 32px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-chip);
  background: var(--vellum); color: var(--ink);
  font-family: var(--font-utility); font-weight: 600; font-size: 13px;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: box-shadow 120ms ease-out, background 120ms ease-out, color 120ms ease-out;
}
.chip:hover { box-shadow: 0 1px 0 0 var(--willow); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip .ct { color: var(--shadow); font-weight: 400; font-size: 11px; }
.chip[aria-pressed="true"] .ct { color: var(--willow); }

/* ───── Spotlight ───── */
.spotlight-section { margin-top: 40px; position: relative; }
.spotlight {
  background: var(--vellum);
  border-left: 3px solid var(--accent, var(--pine));
  padding: 26px 28px;
  border-radius: 0 4px 4px 0;
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 24px;
  position: relative;
}
.spotlight-thumb {
  width: 112px; height: 112px;
  border-radius: 4px;
  background: var(--vellum);
  display: grid; place-items: center;
  overflow: hidden;
}
.spotlight-thumb svg {
  width: 100%;
  height: 100%;
  display: block;
}
.spotlight-thumb svg { width: 100%; height: 100%; display: block; }

.spotlight-body { display: grid; gap: 10px; min-width: 0; }
.spotlight-meta {
  font-family: var(--font-utility); font-weight: 600; font-size: 12px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--shadow);
  display: flex; align-items: baseline; gap: 10px;
}
.spotlight-title {
  font-family: var(--font-display); font-weight: 500; font-size: 32px;
  line-height: 1.1; color: var(--ink); margin: 0;
  text-wrap: balance;
}
.spotlight-desc {
  font-family: var(--font-body); font-style: italic; font-size: 17px;
  line-height: 1.5; color: var(--ink); margin: 0;
  text-wrap: pretty;
}

/* Drop cap on spotlight description — letterpress-style versal */
.spotlight-desc::first-letter {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 500;
  font-size: 76px;
  line-height: 0.82;
  color: var(--ink);
  float: left;
  padding: 4px 10px 0 0;
  margin: 0;
  text-transform: uppercase;
}

.spotlight-tags { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 6px; }
.spot-tag {
  font-family: var(--font-utility); font-weight: 600; font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--shadow);
  background: transparent; padding: 3px 8px;
  border-radius: 999px; border: 1px solid var(--rule);
  cursor: pointer;
  transition: color 120ms ease-out, border-color 120ms ease-out, background 120ms ease-out;
}
.spot-tag:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--vellum);
}
.spot-tag.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.spot-tag.is-active::before { color: var(--willow); }
.spot-tag:hover { color: var(--ink); border-color: var(--ink); background: var(--vellum); }
.spot-tag.is-active:hover { background: var(--ink); color: var(--paper); }

/* Spotlight action row — Show series · Show similar */
.spotlight-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-top: 4px;
}
.spot-action {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 10px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--shadow);
  font-family: var(--font-utility);
  font-weight: 600; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  cursor: pointer;
  transition: color 120ms ease-out, border-color 120ms ease-out, background 120ms ease-out;
}
.spot-action:hover {
  color: var(--ink);
  border-color: var(--ink);
}
.spot-action.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.spot-action.is-active .spot-action-sub { color: var(--willow); }
.spot-action-glyph { display: inline-flex; color: currentColor; }
.spot-action-sub {
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--rule);
  font-style: italic;
  font-family: var(--font-body);
  font-size: 12px;
  margin-left: 2px;
}

.tag-filter-note {
  display: flex; align-items: baseline; gap: 12px;
  margin: -2px 0 6px;
  font-family: var(--font-body); font-style: italic;
  font-size: 13px;
  color: var(--shadow);
}
.tag-filter-note em {
  font-style: italic;
  color: var(--ink);
  border-bottom: 1px solid var(--willow);
}
.tag-filter-clear {
  font-family: var(--font-utility); font-weight: 600;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--shadow);
  background: transparent; border: 0;
  padding: 2px 0;
  cursor: pointer;
  border-bottom: 1px dotted var(--rule);
  transition: color 120ms ease-out, border-color 120ms ease-out;
}
.tag-filter-clear:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* The big "NO. 06" stamp in the right gutter — only on wide screens */
.spotlight-stamp {
  position: absolute;
  right: -130px;
  top: 8px;
  width: 120px;
  text-align: right;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  color: var(--sandstone);
  line-height: 0.85;
  user-select: none;
  pointer-events: none;
}
.spotlight-stamp .stamp-no {
  display: block;
  font-family: var(--font-utility);
  font-style: normal;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--shadow);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.spotlight-stamp .stamp-num {
  font-size: 84px;
  letter-spacing: -0.02em;
}
.spotlight-stamp .stamp-rule {
  display: block;
  width: 60%;
  margin: 6px 0 0 auto;
  border-top: 1px solid var(--rule);
}
.spotlight-stamp .stamp-month {
  display: block;
  font-family: var(--font-utility);
  font-style: normal;
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--shadow);
  margin-top: 6px;
}

@media (max-width: 1099px) {
  .spotlight-stamp { display: none; }
}

/* ───── Rabbit holes (series suggestions) ───── */
.rabbit-holes-section {
  margin-top: 32px;
}
.rabbit-holes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.rabbit-hole {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  padding: 16px 18px 14px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 4px;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease-out, background 140ms ease-out, transform 140ms ease-out;
}
.rabbit-hole:hover {
  border-color: var(--ink);
  background: var(--vellum);
}
.rabbit-hole:hover .rh-arrow {
  transform: translateX(2px);
  color: var(--accent, var(--pine));
}
.rabbit-hole.is-active {
  background: var(--ink);
  border-color: var(--ink);
}
.rabbit-hole.is-active .rh-name { color: var(--paper); }
.rabbit-hole.is-active .rh-count { color: var(--willow); }
.rabbit-hole.is-active .rh-latest-label { color: var(--willow); }
.rabbit-hole.is-active .rh-latest-title { color: var(--paper); }
.rabbit-hole.is-active .rh-arrow { color: var(--willow); }

.rh-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.rh-channel {
  font-family: var(--font-utility);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rule);
}
.rabbit-hole.is-active .rh-channel { color: var(--willow); opacity: 0.7; }
.rh-name {
  font-family: var(--font-utility);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}
.rh-count {
  font-family: var(--font-utility);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--shadow);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rh-latest {
  display: grid;
  gap: 2px;
  padding-top: 6px;
  border-top: 1px dotted var(--rule);
}
.rabbit-hole.is-active .rh-latest { border-top-color: rgba(201,182,110,0.35); }
.rh-latest-label {
  font-family: var(--font-utility);
  font-weight: 600;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--shadow);
}
.rh-latest-title {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  text-wrap: pretty;
}
.rh-arrow {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-family: var(--font-utility);
  color: var(--rule);
  font-size: 14px;
  line-height: 1;
  transition: transform 140ms ease-out, color 140ms ease-out;
}

/* ───── Feedback panel: marginal note + reader's mark ───── */
.feedback {
  display: grid;
  gap: 10px;
  padding-top: 12px;
}
.feedback-rule {
  height: 1px;
  border-bottom: 1px dotted var(--rule);
  margin: 2px 0 4px;
}
.feedback-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.feedback-headings {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.feedback-label {
  font-family: var(--font-utility);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--shadow);
}
.feedback-sub {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 12px;
  line-height: 1.35;
  color: var(--shadow);
}
.feedback-marks { display: flex; gap: 6px; }
.feedback-mark {
  width: 28px; height: 28px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1;
  color: var(--shadow);
  transition: border-color 120ms ease-out, background 120ms ease-out, color 120ms ease-out;
}
.feedback-mark:hover { border-color: var(--ink); color: var(--ink); }
.feedback-mark.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--willow);
}

.feedback-add {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 13px;
  color: var(--shadow);
  background: transparent;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
  text-align: left;
  transition: color 120ms ease-out;
}
.feedback-add:hover { color: var(--ink); }
.feedback-add::before {
  content: "✉ ";
  font-style: normal;
  color: var(--rule);
  margin-right: 4px;
  transition: color 120ms ease-out;
}
.feedback-add:hover::before { color: var(--accent, var(--pine)); }

.feedback-display {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px 8px 12px;
  background: var(--paper);
  border-left: 2px solid var(--willow);
  border-radius: 0 3px 3px 0;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  width: 100%;
  border-top: 0; border-right: 0; border-bottom: 0;
  transition: background 120ms ease-out;
}
.feedback-display:hover { background: var(--vellum); }
.feedback-display-status {
  margin-left: auto;
  font-family: var(--font-utility);
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--shadow);
  white-space: nowrap;
  align-self: center;
  padding-left: 8px;
}
.feedback-display-status::before {
  content: "✓ ";
  color: var(--pine);
  margin-right: 2px;
}
.feedback-display-mark {
  font-family: var(--font-display);
  font-style: normal;
  font-size: 16px;
  color: var(--sandstone);
  line-height: 1;
  flex: 0 0 auto;
}
.feedback-display-text { text-wrap: pretty; }

.feedback-edit { display: grid; gap: 8px; }
.feedback-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  resize: vertical;
  min-height: 56px;
}
.feedback-input:focus { outline: 0; border-color: var(--ink); }
.feedback-edit-actions { display: flex; gap: 8px; align-items: center; }
.feedback-btn {
  padding: 6px 12px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 3px;
  font-family: var(--font-utility);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms ease-out;
}
.feedback-btn:hover { background: var(--river); }
.feedback-btn--ghost {
  background: transparent;
  color: var(--shadow);
}
.feedback-btn--ghost:hover { background: transparent; color: var(--ink); }
.feedback-btn--right { margin-left: auto; }

/* ───── Mark glyph on archive rows ───── */
.archive-mark {
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1;
  color: var(--sandstone);
  margin-right: 2px;
}
.archive-mark--star  { color: var(--sandstone); }
.archive-mark--note  { color: var(--river); }
.archive-mark--query { color: var(--shadow); }

/* ───── Resume affordance + listened progress on archive rows ───── */
.archive-row { position: relative; }

/* Thin progress sliver layered onto the bottom dotted divider.
   Solid accent line indicates the listened portion of each episode. */
.archive-progress {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  pointer-events: none;
}
.archive-progress-fill {
  display: block;
  height: 100%;
  background: var(--accent, var(--pine));
  opacity: 0.55;
  transition: width 200ms ease-out, opacity 120ms ease-out;
}
.archive-row:hover .archive-progress-fill { opacity: 0.85; }

/* Completed rows: full-width fill, dim the title slightly so unplayed work
   stands out at a glance. */
.archive-row.is-completed .archive-title { color: var(--shadow); }
.archive-row.is-completed .archive-progress-fill { opacity: 0.4; }

/* "Listened" badge — replaces the topic chip in the meta line when an
   episode has been fully or near-fully heard. */
.archive-listened {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-utility);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.archive-listened-check {
  display: inline-flex;
  align-items: center;
  color: var(--willow);
}
.archive-check { display: none; } /* superseded by the listened badge */

/* Resume label (in-progress rows) */
.archive-resume {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-utility);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent, var(--pine));
  white-space: nowrap;
}
.archive-resume-t {
  color: var(--shadow);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 12px;
}
.archive-row.is-resumable .archive-num { color: var(--accent, var(--pine)); }


.player {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 0;
}
.player-button {
  width: 32px; height: 32px;
  color: var(--shadow);
  opacity: 0.65;
  display: grid; place-items: center;
  background: transparent; border: 0;
  cursor: pointer;
  padding: 0;
  transition: transform 120ms ease-out, color 120ms ease-out, opacity 120ms ease-out;
}
.player-button:hover { opacity: 0.95; color: var(--accent, var(--pine)); }
.player-button .pp-glyph {
  width: 28px; height: 28px;
  display: block;
}
.player-button:hover { transform: rotate(-1.5deg) scale(1.04); }
.player-button:active { transform: scale(0.96); }
.archive-play svg { display: block; }
.player-track {
  flex: 1;
  height: 5px;
  background: var(--vellum-deep);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
}
.player-fill {
  height: 100%;
  background: var(--accent, var(--pine));
  border-radius: 999px;
}
.player-dot {
  width: 9px; height: 9px;
  background: var(--ink);
  border-radius: 999px;
  position: absolute; top: 50%;
  transform: translate(-50%, -50%);
}
.player-time {
  font-family: var(--font-utility); font-size: 11px;
  color: var(--river); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ───── Result-count line ───── */
.result-count {
  font-family: var(--font-utility); font-size: 13px;
  color: var(--shadow);
  margin: 32px 0 6px;
}

/* ───── Earlier / Search list ───── */
.list-section { margin-top: 36px; position: relative; }
.archive-list {
  display: grid;
  border-top: 1px dotted var(--rule);
}

.archive-row {
  display: grid;
  grid-template-areas: "num play thumb title meta";
  grid-template-columns: auto auto auto 1fr auto;
  align-items: baseline;
  column-gap: 12px;
  row-gap: 4px;
  padding: var(--row-y, 12px) 0;
  border-bottom: 1px dotted var(--rule);
  background: transparent;
  width: 100%;
  cursor: pointer;
  text-align: left;
  transition: color 120ms ease-out;
}
.archive-row:hover .archive-title,
.archive-row:focus-visible .archive-title { color: var(--accent, var(--pine)); }

.archive-num {
  grid-area: num;
  font-family: var(--font-utility); font-weight: 600; font-size: 10px;
  letter-spacing: 0.14em; color: var(--shadow);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  align-self: baseline;
}
.archive-play {
  grid-area: play;
  color: var(--shadow); opacity: 0.55;
  font-size: 12px; line-height: 1;
  transition: color 120ms ease-out, opacity 120ms ease-out;
}
.archive-thumb {
  grid-area: thumb;
  width: 28px; height: 28px;
  border: 1px solid var(--rule);
  align-self: center;
  overflow: hidden;
  flex-shrink: 0;
}
.archive-thumb svg { display: block; width: 100%; height: 100%; }
.archive-row:hover .archive-play { opacity: 1; color: var(--accent, var(--pine)); }
.archive-title {
  grid-area: title;
  font-family: var(--font-body); font-size: 16px;
  color: var(--ink); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.archive-meta {
  grid-area: meta;
  display: flex; align-items: baseline; gap: 10px;
  white-space: nowrap;
}
.archive-snippet {
  grid-column: title;
  font-family: var(--font-body); font-style: italic; font-size: 13px;
  color: var(--shadow);
  line-height: 1.4;
}
.archive-badge {
  font-family: var(--font-utility); font-weight: 600; font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--shadow);
  background: var(--vellum); padding: 3px 8px; border-radius: 999px;
}
.archive-when {
  font-family: var(--font-utility); font-size: 12px;
  letter-spacing: 0.04em; color: var(--shadow);
  font-variant-numeric: tabular-nums;
}

/* Density variants — driven from data-density on .page */
.page[data-density="loose"]    { --row-y: 14px; }
.page[data-density="regular"]  { --row-y: 10px; }
.page[data-density="ledger"]   { --row-y: 6px;  }

mark { background: var(--mark-bg); color: var(--ink); padding: 0 1px; border-radius: 1px; }

/* ───── Marginalia ───── */
.note {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 12px;
  line-height: 1.45;
  color: var(--shadow);
  text-align: left;
  pointer-events: auto;
}
.note .note-rule {
  display: block;
  width: 22px; height: 1px;
  background: var(--rule);
  margin: 0 0 6px;
}
.note small {
  display: block;
  font-family: var(--font-utility);
  font-style: normal;
  font-weight: 600;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rule);
  margin-bottom: 4px;
}

/* The "page number" stamp on each major section, sitting in the left gutter */
.folio {
  position: absolute;
  left: -64px;
  top: 6px;
  width: 40px;
  text-align: right;
  font-family: var(--font-utility);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rule);
  line-height: 1.4;
}
.folio b {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0;
  color: var(--shadow);
  text-transform: none;
}
@media (max-width: 1099px) { .folio { display: none; } }

/* ───── Empty states ───── */
.empty-search {
  font-family: var(--font-utility); font-size: 13px;
  color: var(--shadow); padding: 14px 0 18px;
}

/* ───── Now Playing bar ───── */
.now-playing {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: rgba(244,237,224,0.94);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
          backdrop-filter: blur(14px) saturate(140%);
  border-top: 1px solid var(--ink);
  box-shadow: 0 -1px 0 0 var(--rule) inset, 0 -10px 30px -10px rgba(31,42,53,0.18);
  animation: np-rise 240ms cubic-bezier(.2,.7,.2,1);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@keyframes np-rise {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Slim full-width progress strip at top of the bar (shown only on mobile) */
.np-progress {
  display: none;
  height: 4px;
  background: var(--vellum-deep);
  cursor: pointer;
  touch-action: none;
  position: relative;
}
.np-progress-fill {
  height: 100%;
  background: var(--accent, var(--pine));
}

.np-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 28px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 1fr auto auto auto;
  align-items: center;
  gap: 14px;
}
.np-thumb {
  width: 40px; height: 40px;
  border-radius: 4px;
  background: var(--vellum);
  overflow: hidden;
  border: 0; padding: 0;
  cursor: pointer;
  display: block;
  transition: transform 120ms ease-out;
}
.np-thumb svg { width: 100%; height: 100%; display: block; }
.np-thumb:hover { transform: scale(1.04); }

.np-play { color: var(--shadow); opacity: 0.85; }
.np-play:hover { color: var(--accent, var(--pine)); opacity: 1; }

.np-meta { display: grid; gap: 2px; min-width: 0; }
.np-label {
  font-family: var(--font-utility); font-weight: 600;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--shadow);
}
.np-title {
  font-family: var(--font-body); font-style: italic;
  font-size: 14px; color: var(--ink); line-height: 1.25;
  background: transparent; border: 0; padding: 0; cursor: pointer; text-align: left;
  transition: color 120ms ease-out;
  /* Single-line clip; child .np-title-track owns the actual layout */
  overflow: hidden;
  white-space: nowrap;
  display: block;
  width: 100%;
}
.np-title:hover { color: var(--accent, var(--pine)); }
.np-title-track {
  display: inline-flex;
  align-items: baseline;
  gap: 32px;
  white-space: nowrap;
}
.np-title-inner { flex: 0 0 auto; }
/* Default (non-marquee): show only the first span; clip with ellipsis. */
.np-title:not(.is-marquee) .np-title-inner {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np-title:not(.is-marquee) .np-title-inner--dup { display: none; }
/* Marquee: scroll the track left, looping via a duplicated span.
   The keyframes hold the start for the first ~15% of the cycle so the
   title sits still for a beat before scrolling, both on first run and
   between loops. animation-delay adds an extra pause on first appearance. */
.np-title.is-marquee .np-title-track {
  animation: np-marquee 18s linear infinite;
  animation-delay: 2s;
  animation-play-state: paused;
}
.np-title.is-marquee.is-running .np-title-track {
  animation-play-state: running;
}
@keyframes np-marquee {
  0%, 15%  { transform: translateX(0); }
  100%     { transform: translateX(calc(-50% - 16px)); }
}
@media (prefers-reduced-motion: reduce) {
  .np-title.is-marquee .np-title-track { animation: none; }
}

.np-time {
  font-family: var(--font-utility); font-size: 11px;
  color: var(--river); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.np-track {
  height: 6px;
  background: var(--vellum-deep);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  touch-action: none;
}
.np-fill {
  height: 100%;
  background: var(--accent, var(--pine));
  border-radius: 999px;
}
.np-dot {
  width: 11px; height: 11px;
  background: var(--ink);
  border-radius: 999px;
  position: absolute; top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 2px rgba(31,42,53,0.25);
}
.np-close {
  background: transparent; border: 0;
  width: 32px; height: 32px;
  color: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  cursor: pointer;
  transition: color 120ms ease-out, background 120ms ease-out;
}
.np-close:hover { color: var(--ink); background: var(--vellum); }

/* Keep page content above the bar */
.page.has-now-playing { padding-bottom: 120px; }

/* ───── Footer ───── */
.footer {
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px dotted var(--rule);
  display: grid; gap: 14px;
}
.footer-prompt { font-family: var(--font-body); font-size: 14px; color: var(--ink); }
.footer-feed-row { display: flex; gap: 8px; align-items: stretch; }
.footer-feed {
  flex: 1; padding: 10px 14px;
  border: 1px solid var(--rule); border-radius: 3px;
  font-family: var(--font-mono); font-size: 13px;
  color: var(--river); background: transparent;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.footer-copy {
  padding: 0 16px;
  border: 1px solid var(--shadow); border-radius: 3px;
  background: transparent;
  font-family: var(--font-utility); font-weight: 600; font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--shadow); cursor: pointer;
  transition: background 120ms ease-out, color 120ms ease-out;
}
.footer-copy:hover { color: var(--ink); border-color: var(--ink); }
.footer-copy.copied { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.footer-credit {
  font-family: var(--font-utility); font-size: 11px;
  letter-spacing: 0.04em; color: var(--shadow); padding-top: 2px;
}

.colophon {
  margin-top: 32px;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 13px;
  color: var(--shadow);
  line-height: 1.5;
  border-top: 1px dotted var(--rule);
  padding-top: 16px;
  text-wrap: pretty;
}

/* ───── Mobile ───── */
@media (max-width: 720px) {
  /* Two-row archive entries: title on its own line, meta beneath. */
  .archive-row {
    grid-template-areas:
      "num title play"
      ".   meta  .";
    grid-template-columns: auto 1fr auto;
    column-gap: 10px;
    row-gap: 2px;
    padding: 12px 0;
  }
  .archive-num { align-self: start; padding-top: 3px; }
  .archive-play { align-self: start; padding-top: 5px; }
  .archive-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.3;
    /* allow up to 2 lines, then clamp — keeps row heights predictable */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .archive-meta {
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
  }
  .archive-badge {
    background: transparent;
    padding: 0;
    color: var(--shadow);
    font-size: 10px;
  }
  .archive-badge::after {
    content: " ·";
    color: var(--rule);
    margin-left: 4px;
  }
  .archive-when {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }
  .archive-snippet {
    grid-column: 2;
    margin-top: 4px;
  }
}
@media (max-width: 640px) {
  .page { padding: 0 18px 64px; }
  .header { padding: 32px 0 0; }
  .wordmark { font-size: 44px; }
  .header-top { grid-template-columns: 1fr auto; align-items: start; }
  /* Chips: wrap into a compact index instead of horizontal scroll. */
  .chips-row {
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 0;
    gap: 6px;
    mask-image: none;
    -webkit-mask-image: none;
  }
  .chip {
    white-space: nowrap;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 12px;
  }
  .chip .ct { font-size: 10px; }
  .spotlight {
    padding: 18px; gap: 14px;
    grid-template-columns: 64px 1fr;
  }
  .spotlight-thumb { width: 64px; height: 64px; }
  .spotlight-title { font-size: 22px; }
  .spotlight-desc::first-letter { font-size: 52px; padding: 2px 6px 0 0; line-height: 0.85; }
  .spotlight-stamp { display: none; }

  /* Spotlight actions: stack labels, hide secondary descriptor on narrow */
  .spotlight-actions { gap: 6px; }
  .spot-action { padding: 6px 10px; font-size: 10px; }
  .spot-action-sub { display: none; }

  /* Tighter dotted-rule label on narrow */
  .section-label::after { min-width: 16px; }

  /* Now-playing bar: keep title readable, drop secondary time labels */
  .np-inner {
    grid-template-columns: 32px 1fr auto;
    grid-template-rows: auto auto;
    padding: 10px 16px;
    gap: 6px 10px;
    align-items: center;
  }
  .np-play  { grid-column: 1; grid-row: 1; }
  .np-meta  { grid-column: 2; grid-row: 1; min-width: 0; }
  .np-close { grid-column: 3; grid-row: 1; }
  .np-track { grid-column: 1 / -1; grid-row: 2; }
  .np-cur, .np-dur { display: none; }
  .np-label { font-size: 9px; }
  .np-title { font-size: 13px; }

  .rabbit-holes-grid { grid-template-columns: 1fr; }
  .rabbit-hole { padding: 14px 16px 12px; }
  .rh-latest-title { font-size: 13px; }

  /* Now-playing bar: native podcast-app pattern.
     - Thin scrub strip at top of bar
     - Single row with thumb, title, play (touch target), close */
  .page.has-now-playing { padding-bottom: 96px; }
  .now-playing { padding-bottom: env(safe-area-inset-bottom, 0); }
  .np-progress { display: block; }
  .np-inner {
    grid-template-columns: 44px minmax(0, 1fr) 44px 28px;
    grid-template-rows: auto;
    padding: 8px 14px;
    gap: 12px;
    align-items: center;
  }
  .np-thumb { grid-column: 1; width: 44px; height: 44px; border-radius: 6px; }
  .np-meta  { grid-column: 2; min-width: 0; }
  .np-play  { grid-column: 3; width: 44px; height: 44px; }
  .np-play .pp-glyph { width: 32px; height: 32px; }
  .np-close { grid-column: 4; width: 28px; height: 28px; }
  .np-track { display: none; }
  .np-cur, .np-dur { display: none; }
  .np-label {
    font-size: 9px;
    letter-spacing: 0.16em;
  }
  .np-title {
    font-size: 14px;
    line-height: 1.2;
  }

  /* Tag-filter note can wrap */
  .tag-filter-note { flex-wrap: wrap; gap: 6px; }
}

@media (max-width: 380px) {
  .archive-num { display: none; }
  .archive-row {
    grid-template-areas:
      "title play"
      "meta  .";
    grid-template-columns: 1fr auto;
  }
  .archive-snippet { grid-column: 1; }
  .spotlight-actions { flex-direction: column; align-items: stretch; }
  .spot-action { justify-content: center; }
}

/* ── Show notes (companion content under the spotlight player) ───────────── */
.show-notes {
  margin: var(--sp-5) 0 var(--sp-2);
  display: flex;
  flex-direction: column;
}
.show-notes-toggle {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3) 0;
  background: transparent;
  border: 0;
  border-top: var(--bd-rule);
  border-bottom: var(--bd-rule);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.show-notes-toggle:hover { background: var(--vellum); }
.show-notes-toggle:focus-visible { outline: var(--focus-outline); outline-offset: var(--focus-offset); }
.show-notes-toggle-label {
  font-family: var(--font-utility);
  font-weight: 600;
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--ink);
}
.show-notes-toggle-sub {
  font-family: var(--font-utility);
  font-size: var(--fs-meta);
  color: var(--shadow);
  letter-spacing: 0.02em;
  flex: 1;
}
.show-notes-toggle-chev {
  font-family: var(--font-utility);
  font-size: var(--fs-utility);
  color: var(--shadow);
  margin-left: auto;
}
.show-notes.is-open .show-notes-toggle { border-bottom-color: transparent; }
.show-notes-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  padding: var(--sp-5) 0 var(--sp-3);
  border-bottom: var(--bd-rule);
}
.show-notes-summary p {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
}
.show-notes-summary p:last-child { margin-bottom: 0; }
.show-notes-block { display: flex; flex-direction: column; gap: var(--sp-3); }
.show-notes-heading {
  font-family: var(--font-utility);
  font-weight: 600;
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--shadow);
  margin: 0;
}

/* Chapters — clickable seek list */
.chapters {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: var(--bd-rule);
}
.chapter {
  border-bottom: var(--bd-rule);
}
.chapter-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: var(--sp-4);
  width: 100%;
  align-items: baseline;
  padding: var(--sp-3) var(--sp-2);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.chapter-row:hover,
.chapter-row:focus-visible {
  background: var(--vellum);
  outline: none;
}
.chapter-time {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--river);
  font-variant-numeric: tabular-nums;
}
.chapter-title {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-snug);
}
.chapter.is-active .chapter-row {
  background: var(--vellum);
}
.chapter.is-active .chapter-time { color: var(--pine); font-weight: 600; }
.chapter.is-active .chapter-title { color: var(--ink); font-weight: 500; }
.chapter.is-disabled .chapter-row { cursor: default; opacity: 0.55; }
.chapter.is-disabled .chapter-row:hover { background: transparent; }

/* Takeaways */
.show-notes-takeaways {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.show-notes-takeaways li {
  padding-left: var(--sp-4);
  position: relative;
  font-size: var(--fs-body);
  line-height: var(--lh-snug);
  color: var(--ink);
}
.show-notes-takeaways li::before {
  content: "·";
  position: absolute;
  left: 0;
  top: -0.05em;
  color: var(--sandstone);
  font-weight: 700;
  font-size: 1.4em;
  line-height: 1;
}

/* Sources */
.show-notes-sources {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.show-notes-sources li {
  font-size: var(--fs-small);
  line-height: var(--lh-snug);
  color: var(--ink);
}
.show-notes-sources a {
  color: var(--river);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 2px;
}
.show-notes-sources a:hover { color: var(--ink); text-decoration-color: var(--ink); }
.show-notes-source-note { color: var(--shadow); font-style: italic; }

@media (max-width: 560px) {
  .chapter-row { grid-template-columns: 52px 1fr; gap: var(--sp-3); }
}
