:root {
  --ink: #241c33;
  --ink-soft: #6c6485;
  --paper: #f3eef8;
  --card: #fbf8fd;
  --line: #ddd3e6;
  --marigold: #d98b1f;
  --moss: #4a6b59;

  --measure: 68rem;
  --step: clamp(1.25rem, 3vw, 2.25rem);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: "DM Mono", ui-monospace, monospace;
  font-feature-settings: "tnum";
}

main {
  width: min(100% - 2.5rem, var(--measure));
  margin-inline: auto;
}

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

/* Masthead ------------------------------------------------------------- */

.masthead {
  width: min(100% - 2.5rem, var(--measure));
  margin: clamp(2.5rem, 7vw, 5rem) auto clamp(2rem, 5vw, 3.5rem);
}

.eyebrow {
  margin: 0;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--moss);
}

.wordmark {
  margin: 0.15em 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 144;
  font-weight: 700;
  font-size: clamp(4rem, 18vw, 11rem);
  line-height: 0.82;
  letter-spacing: -0.03em;
}

.standfirst {
  margin: 1rem 0 0;
  max-width: 34ch;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--ink-soft);
}

/* Player --------------------------------------------------------------- */

.frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #1a1426;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 24px 48px -32px rgba(36, 28, 51, 0.7);
}

.player,
.player iframe,
.player .video-el {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #1a1426;
}

.placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.5rem;
  padding: 1.5rem;
  text-align: center;
  background: repeating-linear-gradient(
    -45deg,
    #221a31,
    #221a31 14px,
    #271e38 14px,
    #271e38 28px
  );
  color: #e6dff0;
}

.placeholder[hidden] {
  display: none;
}

.placeholder-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-variation-settings: "SOFT" 60, "WONK" 1;
  font-size: 1.35rem;
}

.placeholder-body {
  margin: 0;
  color: #b7abc9;
  font-size: 0.95rem;
}

.placeholder code {
  font-family: "DM Mono", ui-monospace, monospace;
  color: var(--marigold);
}

.now-playing {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: 1.25rem;
}

.now-playing-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 60;
  font-weight: 600;
  font-size: clamp(1.5rem, 3.4vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.now-playing-meta {
  margin: 0;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* The tape: a scrub map of where the chapters actually fall ------------- */

.tape {
  margin-top: 1.25rem;
}

.tape-track {
  position: relative;
  height: 26px;
  background: linear-gradient(var(--line), var(--line)) center / 100% 2px no-repeat;
  cursor: pointer;
}

.tape-progress {
  position: absolute;
  top: 50%;
  left: 0;
  height: 2px;
  width: 0;
  transform: translateY(-50%);
  background: var(--moss);
}

.tape-ticks {
  position: absolute;
  inset: 0;
}

.tick {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 12px;
  margin-left: -1px;
  transform: translateY(-50%);
  background: var(--ink-soft);
  transition: height 140ms ease, background-color 140ms ease;
}

.tick.is-active {
  height: 24px;
  background: var(--marigold);
}

.tape-ends {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

/* Chapters ------------------------------------------------------------- */

.rubric {
  margin: clamp(2rem, 5vw, 3rem) 0 0.75rem;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--moss);
}

.chapters {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.chapter-button {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  width: 100%;
  padding: 0.7rem 0.5rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease, padding-left 140ms ease;
}

.chapter-button:hover {
  background: var(--card);
  padding-left: 0.85rem;
}

.chapter-time {
  flex: none;
  min-width: 4.5ch;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  color: var(--marigold);
}

.chapter-button[aria-current="true"] {
  background: var(--card);
}

.chapter-button[aria-current="true"] .chapter-name {
  font-weight: 600;
}

.chapter-button[aria-current="true"] .chapter-time {
  color: var(--ink);
  background: var(--marigold);
  border-radius: 2px;
  padding-inline: 0.3em;
}

/* Archive -------------------------------------------------------------- */

.archive {
  margin-bottom: clamp(3rem, 8vw, 6rem);
}

.reel {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.reel-button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0.25rem 1rem;
  width: 100%;
  padding: 1rem;
  border: 0;
  background: var(--paper);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.reel-button:hover {
  background: var(--card);
}

.reel-button[aria-current="true"] {
  background: var(--card);
  box-shadow: inset 3px 0 0 var(--marigold);
}

.reel-title {
  font-family: "Fraunces", Georgia, serif;
  font-variation-settings: "SOFT" 40, "WONK" 1;
  font-weight: 600;
  font-size: 1.15rem;
}

.reel-meta {
  grid-column: 1 / -1;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}

.reel-duration {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* Colophon ------------------------------------------------------------- */

.colophon {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 3rem;
}

.colophon p {
  width: min(100% - 2.5rem, var(--measure));
  margin: 0 auto;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
