/* Same system as story.css: one reading column, serif body, Fraunces headings, light and dark themes. */
:root {
  --bg: #f6f4f1;
  --fg: #1d1b19;
  --muted: #5e5852;
  --line: #d9d3cb;
  --accent: #8f2d2d;
  --orange: #a85a0a;
  --display: "Fraunces", Georgia, serif;
  --body: "Source Serif 4", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161412;
    --fg: #ece7e1;
    --muted: #a39b92;
    --line: #38332e;
    --accent: #e08a84;
    --orange: #f0a45d;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #161412;
  --fg: #ece7e1;
  --muted: #a39b92;
  --line: #38332e;
  --accent: #e08a84;
  --orange: #f0a45d;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.65;
}

.page {
  max-width: 64rem;
  margin: 0 auto;
  padding: 3rem 1rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

h1, h2 {
  margin: 0;
  font-family: var(--display);
  line-height: 1.15;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 6vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); }

.hl-red { color: var(--accent); }
.hl-orange { color: var(--orange); }

/* Single clips and season headers share a top rule, like the story index. */
.clip,
.season {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.clip:first-child { padding-top: 0; border-top: 0; }

/* Single clips: centered title, small centered player (320 x 240, as in the original). */
.clip {
  align-items: center;
  text-align: center;
}

.clip video {
  width: 100%;
  max-width: 20rem;
  aspect-ratio: 4 / 3;
  background: #000;
}

.clip img { max-width: 100%; height: auto; }

.season h2 { text-align: center; }

.note { margin: 0; max-width: 40rem; color: var(--muted); font-size: 1rem; }
.note.hl-orange { color: var(--orange); }

/* Season grids */
.videos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.videos-wide { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.videos-wide video {
  width: 100%;
  aspect-ratio: 380 / 240;
  background: #000;
}

.video-item {
  position: relative;
  display: block;
  width: 100%;
  height: 200px;
  padding: 0;
  border: 0;
  overflow: hidden;
  cursor: pointer;
  background: #000;
}

.video-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.video-item:hover img,
.video-item:focus-visible img { transform: scale(1.1); }

.video-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.5s;
}

.video-item:hover .play-btn,
.video-item:focus-visible .play-btn { opacity: 1; }

.play-btn::before {
  content: "";
  border-style: solid;
  border-width: 10px 0 10px 20px;
  border-color: transparent transparent transparent #fff;
}

/* Player overlay */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
}

.modal[hidden] { display: flex; }
.modal.open { opacity: 1; visibility: visible; }

.modal video {
  width: min(90vw, 1000px);
  max-height: 80vh;
  background: #000;
}

.close-btn {
  position: absolute;
  top: max(10px, env(safe-area-inset-top, 0px));
  right: max(10px, env(safe-area-inset-right, 0px));
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.close-btn::before,
.close-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 20%;
  width: 60%;
  height: 2px;
  background: #fff;
  border-radius: 5px;
}

.close-btn::before { transform: rotate(45deg); }
.close-btn::after { transform: rotate(-45deg); }

.close-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .video-item img, .play-btn, .modal { transition: none; }
}

@media print {
  .noprint { display: none; }
}
