/* The animated series page: Luis's episodes pinned as prints over a still of Luke's city, like the
   2014 original in the signal chapter. Shares tokens.css and style.css (bar, pills, eyebrow, grain,
   credit) with the world; there is no WebGL here, and series.js plays the copy's reveal once. */

/* the still darkens toward the copy so the text reads; the prints carry their own shadows */
.series-page .stage::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, rgba(5, 12, 26, .9) 0%, rgba(5, 12, 26, .66) 36%, rgba(5, 12, 26, .32) 68%, rgba(5, 12, 26, .5) 100%); }
/* If the motion never runs, the copy shows anyway: the reveal sets the same visibility first. */
.js .sx .copy { animation: sx-show 0s 3s forwards; }
@keyframes sx-show { to { visibility: visible; } }

.sx { position: relative; min-height: 100svh; display: grid; align-items: center; padding: 120px clamp(24px, 5vw, 80px) 48px; }
/* two columns: the words, centred against the prints (the empty fr rows above and below take up
   the prints' extra height), and the prints. motion.js needs the paragraphs as the copy's children,
   so the columns are grid placement, not wrappers. */
.sx .copy { max-width: none; grid-template-columns: minmax(0, 32rem) minmax(0, 1fr); grid-template-rows: 1fr repeat(4, auto) 1fr;
  column-gap: clamp(32px, 6vw, 120px); align-items: start; }
.sx .copy::before { display: none; }
.sx .copy > :not(.eps) { grid-column: 1; }
.sx .eyebrow { grid-row: 2; } .sx h1 { grid-row: 3; } .sx .lede { grid-row: 4; } .sx .credit { grid-row: 5; }
.sx h1 { margin: 0; font: italic 900 clamp(3.6rem, 1.4rem + 6.4vw, 8.4rem)/.82 var(--disp); text-transform: uppercase; letter-spacing: .005em; text-wrap: balance; }
.sx .lede { max-width: 30ch; }
.sx .credit { padding-top: 6px; }

/* ---------- the episodes, as prints ---------- */
.eps { grid-column: 2; grid-row: 1 / -1; align-self: center; list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 36px 28px; }
.ep { width: clamp(230px, 19vw, 310px); }
.ep:nth-child(even) { margin-top: 64px; }
.ep-link { display: grid; gap: 5px; padding: 12px 12px 16px; border-radius: 6px; text-decoration: none; background: #f4ecdb; color: #1b1511;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .85), 0 0 0 1px rgba(0, 0, 0, .25);
  transform: rotate(var(--tilt, -3deg)); transition: transform var(--d-3) var(--ease-out), box-shadow var(--d-3) var(--ease-out); }
.ep:nth-child(even) .ep-link { --tilt: 2.5deg; }
@media (hover: hover) {
  .ep-link:hover { transform: rotate(0deg) translateY(-8px) scale(1.03); box-shadow: 0 44px 80px -26px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .25); }
  .ep-link:hover .ep-play { transform: scale(1.14); }
}
.ep-link:focus-visible { border-radius: 8px; outline-offset: 6px; }
.ep-pic { position: relative; display: grid; place-items: center; aspect-ratio: 1; margin-bottom: 7px; border-radius: 3px; overflow: hidden; background: var(--night-deep); }
.ep-pic img { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: cover; }
/* play is orange: it's something you can do */
.ep-play { grid-area: 1 / 1; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; color: var(--night-deep); background: var(--fur);
  box-shadow: 0 0 0 6px rgba(234, 119, 25, .25), 0 14px 30px -10px rgba(0, 0, 0, .8); transition: transform var(--d-3) var(--ease-out); }
.ep-play svg { width: 24px; height: 24px; margin-left: 3px; fill: currentColor; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.ep-t { font: italic 900 2.1rem/.9 var(--disp); text-transform: uppercase; }
.ep-m { display: flex; align-items: center; gap: 5px; font: 500 .8rem/1.3 var(--body); color: #4a4038; }
.ep-m svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; }

/* ---------- credits and disclaimers ---------- */
.sx-end { position: relative; display: grid; gap: 12px; max-width: 46rem; padding: 0 clamp(24px, 5vw, 80px) max(32px, env(safe-area-inset-bottom)); color: var(--mist); }
.sx-end p { margin: 0; }
.sx-end .links { color: var(--moon); }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .series-page .stage::after { background: linear-gradient(180deg, rgba(5, 12, 26, .62), rgba(5, 12, 26, .84) 46%, rgba(5, 12, 26, .92)); }
  .sx { min-height: 0; align-items: start; padding: 104px 16px 40px; }
  .sx .copy { position: relative; bottom: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .sx .copy > * { grid-row: auto; }
  .sx h1 { font-size: clamp(3.4rem, 17vw, 6rem); }
  .eps { grid-column: 1; grid-row: auto; justify-content: space-between; gap: 28px 16px; margin-top: 14px; }
  .ep { width: min(300px, 74vw); }
  .ep:nth-child(even) { margin: 0 0 0 auto; }
  .sx-end { padding: 0 16px max(28px, env(safe-area-inset-bottom)); }
}
/* tablets: the prints side by side */
@media (min-width: 600px) and (max-width: 900px) {
  .eps { justify-content: flex-start; }
  .ep { width: min(300px, 42vw); }
  .ep:nth-child(even) { margin: 40px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ep-link, .ep-play { transition: none; }
}
