/* Yarn | A Story Podcast ---------------------------------------------- */

:root {
  --ink:        #08061c;
  --ink-2:      #0f0b31;
  --panel:      rgba(255, 255, 255, 0.045);
  --panel-line: rgba(255, 255, 255, 0.12);
  --violet:     #4b3bd6;
  --violet-lit: #8f81ff;
  --paper:      #f0eeff;
  --muted:      #a49ed6;
  --radius:     14px;
  --wrap:       1180px;
  --font-display: 'Courier Prime', ui-monospace, 'Courier New', monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

/* A display rule on an element beats the hidden attribute, and several here
   set one - flex list rows, grid cards. Make hidden mean hidden. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* halftone + glow backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 80% at 50% -8%, rgba(96, 76, 230, 0.55) 0%, transparent 62%),
    linear-gradient(180deg, #1a1252 0%, #0c0930 38%, var(--ink) 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255,255,255,0.5) 0.7px, transparent 0.8px);
  background-size: 7px 7px;
  opacity: 0.13;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
  pointer-events: none;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

::selection { background: var(--violet-lit); color: #0b0726; }

:focus-visible {
  outline: 2px solid var(--violet-lit);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(18px, 5vw, 40px);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---- site header ---------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease;
}

/* Solid once you are past the hero artwork - and on every page that has no
   hero, where the header is the only place the wordmark appears. */
.site-header.is-stuck {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(8, 6, 28, 0.72);
  border-bottom-color: rgba(255,255,255,0.07);
}

/* No second wordmark while the big one is still on screen. */
.site-header--over-hero .brand {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s;
}

.site-header--over-hero.is-stuck .brand {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper);
}

.brand img { width: 74px; }

.site-nav {
  display: flex;
  gap: clamp(12px, 3vw, 26px);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}

.site-nav a:hover { color: var(--paper); border-bottom-color: var(--violet-lit); }

/* ---- hero ----------------------------------------------------------- */

.hero { text-align: center; padding-bottom: clamp(36px, 6vw, 64px); }

/* The banner artwork carries the wordmark and the tagline, so it sits
   full-bleed and starts under the transparent header. */
.hero-banner {
  position: relative;
  margin-top: -60px;
  height: clamp(320px, 56vh, 560px);
  overflow: hidden;
}

.hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 46%;
}

.hero-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,6,28,0.45) 0%, transparent 22%, transparent 62%, var(--ink) 100%);
  pointer-events: none;
}

.hero-copy { margin-top: clamp(4px, 2vw, 18px); }

.hero-intro {
  max-width: 54ch;
  margin: 0 auto;
  color: #cfcaf4;
  font-size: clamp(16px, 1.6vw, 18px);
}

.hero-awards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.hero-award {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #e6e2ff;
  background: rgba(255,255,255,0.04);
}

/* ---- platform links -------------------------------------------------- */

.platforms {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
  padding: 0;
  list-style: none;
}

.platforms--left { justify-content: flex-start; }

.platform {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--panel-line);
  background: var(--panel);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--paper);
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.platform:hover {
  transform: translateY(-2px);
  background: rgba(143, 129, 255, 0.16);
  border-color: rgba(143, 129, 255, 0.55);
}

.platform svg { width: 17px; height: 17px; flex: none; }

/* ---- section furniture ----------------------------------------------- */

.section { padding-block: clamp(30px, 5vw, 56px); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.4vw, 22px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
}

.section-note { color: var(--muted); font-size: 14px; margin: 0; }

/* ---- filters --------------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.filter {
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--panel-line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.filter:hover { color: var(--paper); border-color: rgba(143,129,255,0.5); }

.filter[aria-pressed="true"] {
  background: var(--paper);
  border-color: var(--paper);
  color: #0b0726;
}

/* ---- episode grid ---------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: clamp(16px, 2.2vw, 28px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.card a {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.card-art {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink-2);
  border: 1px solid rgba(255,255,255,0.09);
  aspect-ratio: 1 / 1;
}

.card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.7,.3,1), filter .3s ease;
}

.card-play {
  position: absolute;
  inset: auto 12px 12px auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(10, 8, 34, 0.72);
  border: 1px solid rgba(255,255,255,0.35);
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}

.card-play svg { width: 15px; height: 15px; }

.card a:hover .card-art img,
.card a:focus-visible .card-art img { transform: scale(1.05); }

.card a:hover .card-play,
.card a:focus-visible .card-play { opacity: 1; transform: translateY(0); }

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 4px;
  font-family: var(--font-display);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet-lit);
}

.card-meta .dot { color: rgba(255,255,255,0.28); }

.card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.card-blurb {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.grid-empty {
  color: var(--muted);
  font-family: var(--font-display);
  padding: 30px 0;
}

/* ---- about ----------------------------------------------------------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
}

.about p { color: #cbc6ef; }

.about-art img {
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.12);
}

@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; }
  .about-art { order: -1; max-width: 320px; }
}

/* ---- episode page ---------------------------------------------------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: clamp(22px, 4vw, 38px);
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover { color: var(--paper); }

.episode {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: clamp(26px, 4.5vw, 56px);
  padding: clamp(22px, 4vw, 40px) 0 clamp(40px, 7vw, 80px);
  align-items: start;
}

.episode-art {
  position: sticky;
  top: 86px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 26px 70px -30px rgba(0,0,0,0.9);
}

.episode-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet-lit);
  margin-bottom: 12px;
}

.episode-eyebrow .dot { color: rgba(255,255,255,0.3); }

.episode-title {
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  font-weight: 700;
}

.player { margin: 0 0 26px; }

.player iframe {
  width: 100%;
  height: 152px;
  border: 0;
  border-radius: 12px;
  display: block;
}

.player-note {
  margin: 0 0 26px;
  padding: 16px 18px;
  border: 1px dashed var(--panel-line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  font-size: 15px;
}

.part {
  margin: 0 0 26px;
  padding: 16px;
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  background: var(--panel);
}

.part-banner {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 14px;
}

.part-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.part-head .part-meta { color: var(--muted); font-size: 12px; letter-spacing: 0.08em; }

.episode-body p { color: #d5d1f2; font-size: 17px; }

.episode-credits {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-display);
  font-size: 13.5px;
  color: var(--muted);
}

.episode-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 22px;
  padding: 0;
  list-style: none;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  text-decoration: none;
  color: var(--violet-lit);
  border-bottom: 1px solid rgba(143,129,255,0.4);
  padding-bottom: 1px;
}

.text-link svg { width: 15px; height: 15px; flex: none; opacity: .8; }

.text-link:hover { color: var(--paper); border-bottom-color: var(--paper); }

.listen-block {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.listen-block h2 {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
  font-weight: 400;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 0 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.pager a {
  text-decoration: none;
  max-width: 46%;
}

.pager .pager-label {
  display: block;
  font-family: var(--font-display);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.pager .pager-title { font-weight: 600; line-height: 1.3; }

.pager a:hover .pager-title { color: var(--violet-lit); }

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

@media (max-width: 880px) {
  .episode { grid-template-columns: 1fr; }
  .episode-art { position: static; max-width: 460px; }
}

/* ---- footer ---------------------------------------------------------- */

.site-footer {
  border-top: 1px solid rgba(255,255,255,0.09);
  padding-block: clamp(34px, 5vw, 56px);
  margin-top: clamp(30px, 6vw, 70px);
  background: rgba(5, 4, 18, 0.5);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
  align-items: start;
}

.footer-grid h2 {
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 400;
}

.footer-grid p { margin: 0 0 10px; color: #c3bee8; font-size: 15px; }

.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.footer-links a { color: #c3bee8; text-decoration: none; }
.footer-links a:hover { color: var(--paper); }

.colophon {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ---- small screens --------------------------------------------------- */

@media (max-width: 620px) {
  .brand span { display: none; }
  .brand img { width: 64px; }
  .site-nav { font-size: 11.5px; gap: 14px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .card-title { font-size: 15px; }
  .card-meta { font-size: 10.5px; letter-spacing: 0.08em; gap: 6px; }
  .card-meta .meta-date { display: none; }
  .card-blurb { display: none; }
  .card-play { width: 34px; height: 34px; inset: auto 8px 8px auto; }
  .platform { padding: 9px 13px; font-size: 13.5px; }
  .section-head { margin-bottom: 16px; }
  .filters { gap: 7px; }
  .filter { padding: 7px 11px; font-size: 11.5px; }
  .pager a { max-width: 48%; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---- listing pages (seasons, extras) --------------------------------- */

.listing-blurb {
  max-width: 62ch;
  margin: 20px 0 28px;
  color: #cbc6ef;
  font-size: 17px;
}

/* ---- documentary club ------------------------------------------------ */

.doc-title {
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.doc-subtitle {
  font-family: var(--font-display);
  font-size: clamp(14px, 2vw, 17px);
  letter-spacing: 0.08em;
  color: var(--violet-lit);
  margin: 0 0 28px;
}

.doc-intro, .doc-section p { max-width: 68ch; color: #cbc6ef; }

.doc-count {
  max-width: 68ch;
  margin: 26px 0 0;
  padding: 14px 16px;
  border-left: 2px solid var(--violet-lit);
  background: var(--panel);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
  font-size: 15px;
}

.doc-section {
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid rgba(255,255,255,0.09);
}

.doc-section h2 {
  font-family: var(--font-display);
  font-size: clamp(17px, 2.2vw, 21px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

/* One film per row: in columns it was never clear which stars belonged to
   which title. */
.doc-films {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  max-width: 68ch;
}

.doc-films li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 15px;
}

.film-title { flex: 1 1 auto; }

.film-year {
  flex: none;
  font-family: var(--font-display);
  font-size: 12.5px;
  color: var(--muted);
}

.stars {
  flex: none;
  width: 3.4em;
  text-align: right;
  color: var(--violet-lit);
  font-size: 12px;
  letter-spacing: 1px;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .hero-banner { height: clamp(260px, 38vh, 340px); }
}

/* Scroll sentinel for the header state - needs a box for IntersectionObserver. */
#hero-end { display: block; height: 1px; }

/* ---- video embed ------------------------------------------------------ */

.player--video iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
}

/* ---- press list ------------------------------------------------------- */

.press-list { list-style: none; margin: 4px 0 0; padding: 0; }

.press-list li { border-bottom: 1px solid rgba(255,255,255,0.09); }

.press-list a {
  display: grid;
  grid-template-columns: minmax(130px, 170px) 1fr;
  gap: 4px 18px;
  align-items: baseline;
  padding: 14px 0;
  text-decoration: none;
  transition: color .15s ease;
}

.press-outlet {
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--violet-lit);
}

.press-headline { color: #d5d1f2; font-size: 16px; line-height: 1.45; }

.press-list a:hover .press-headline { color: var(--paper); text-decoration: underline; }

.episode--no-art { grid-template-columns: minmax(0, 1fr); max-width: 780px; }

@media (max-width: 620px) {
  .press-list a { grid-template-columns: 1fr; gap: 2px; }
  .press-headline { font-size: 15px; }
}

/* ---- documentary club: the theme index -------------------------------- */

.doc-index {
  margin: 34px 0 10px;
  padding: 22px 0 4px;
  border-top: 1px solid rgba(255,255,255,0.09);
}

.doc-index h2 {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
  font-weight: 400;
}

.doc-index ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.doc-index a {
  display: inline-block;
  padding: 7px 13px;
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  background: var(--panel);
  color: #cbc6ef;
  text-decoration: none;
  font-size: 13.5px;
  line-height: 1.3;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.doc-index a:hover {
  color: var(--paper);
  border-color: rgba(143,129,255,0.55);
  background: rgba(143,129,255,0.14);
}

/* Room for the sticky header when a theme link jumps down the page. */
.doc-section { scroll-margin-top: 78px; }

/* ---- documentary club: links out to IMDb ------------------------------ */

.doc-films a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.18);
  transition: color .15s ease, border-color .15s ease;
}

.doc-films a:hover { color: var(--violet-lit); border-bottom-color: var(--violet-lit); }

.filter-count {
  opacity: 0.55;
  font-size: 0.85em;
  margin-left: 2px;
}

/* ---- more like this --------------------------------------------------- */

.related {
  padding-top: 26px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.related .grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }

/* ---- documentary club: search ---------------------------------------- */

.doc-search { margin: 30px 0 4px; max-width: 68ch; }

.doc-search input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 999px;
  border: 1px solid var(--panel-line);
  background: var(--panel);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 15px;
  -webkit-appearance: none;
  appearance: none;
}

.doc-search input::placeholder { color: var(--muted); }

.doc-search input:focus {
  outline: none;
  border-color: rgba(143,129,255,0.6);
  background: rgba(143,129,255,0.08);
}

.doc-search-status {
  margin: 10px 2px 0;
  min-height: 1.2em;
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet-lit);
}
