:root {
  --fondo: #000000;
  --schermo: #07090d;
  --testo: #f4f5f7;
  --testo-2: rgba(244, 245, 247, .66);
  --testo-3: rgba(244, 245, 247, .4);
  --vetro: rgba(255, 255, 255, .12);
  --vetro-bordo: rgba(255, 255, 255, .16);
  --accento: #8fb8ff;        /* the single accent: moonlight blue, in the thumbnail, the timeline and the focus ring */
  --ombra: 0, 0, 0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { font-size: clamp(10px, min(2.3vw, 3vh), 16px); }
body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stage { min-height: 100vh; display: grid; place-items: center; padding: 1em; }

/* ---- the player ---- */
.player {
  position: relative;
  width: min(46em, 94vw, 150vh);
  aspect-ratio: 16 / 10;
  border-radius: 1em;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 30px 70px -40px rgba(143, 184, 255, .28);
  isolation: isolate;
}
@media (max-aspect-ratio: 1 / 1) {
  .player { aspect-ratio: 4 / 3.6; width: min(46em, 94vw); }
}

.screen {
  position: absolute; inset: 0;
  background: var(--schermo);
  transform-origin: 0 0;
  border-radius: 0;
  overflow: hidden;
  will-change: transform;
}
.screen__glow {
  position: absolute; inset: -20%;
  background: radial-gradient(40% 40% at 50% 60%, rgba(143, 184, 255, .08), transparent 70%);
}
.credits {
  position: absolute; inset: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}
.credits__roll {
  position: absolute; left: 0; right: 0; top: 0;
  display: grid; justify-items: center; gap: 1.25em;
  padding-top: 2em;
  text-align: center;
  filter: blur(.35px);
  will-change: transform;
}
.credits__roll p { display: grid; gap: .2em; font-size: 1.02em; font-weight: 500; color: var(--testo-2); font-stretch: 96%; }
.credits__roll p span { font-size: .66em; letter-spacing: .14em; text-transform: uppercase; color: var(--testo-3); font-weight: 500; }
.credits__show { font-size: 1.9em !important; font-weight: 650 !important; color: var(--testo) !important; font-stretch: 112% !important; letter-spacing: -.01em; margin-top: 1.4em; }
.credits__ep { font-size: .78em !important; color: var(--testo-3) !important; letter-spacing: .1em; text-transform: uppercase; margin-top: -.9em; }

/* the next episode, grown from the thumbnail */
.scene {
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  z-index: 3;
}
.scene .art { width: 100%; height: 100%; display: block; }
.scene__title {
  position: absolute; left: 1.6em; bottom: 2.2em;
  display: grid; gap: .25em;
}
.scene__kicker { font-size: .7em; letter-spacing: .16em; text-transform: uppercase; color: var(--accento); font-weight: 600; }
.scene__name { font-size: 2.1em; font-weight: 680; font-stretch: 112%; letter-spacing: -.01em; }

/* the timeline of the player, almost at the end */
.bar {
  position: absolute; left: 1.2em; right: 1.2em; bottom: .8em;
  height: 3px; border-radius: 3px;
  background: rgba(255, 255, 255, .16);
  overflow: hidden;
  z-index: 4;
}
.bar__done { position: absolute; inset: 0; background: var(--accento); transform-origin: 0 50%; transform: scaleX(.97); border-radius: 3px; }

/* ---- the up-next card ---- */
.next {
  position: absolute; right: 1.2em; bottom: 1.9em;
  width: min(19.5em, 60%);
  display: grid; gap: .8em;
  z-index: 5;
  opacity: 0;
  visibility: hidden;
}
.next::before {
  content: "";
  position: absolute;
  inset: -5em -3em -3em -60%;
  background: radial-gradient(60% 75% at 72% 70%, rgba(0, 0, 0, .92), rgba(0, 0, 0, .7) 50%, transparent 100%);
  z-index: -1;
  pointer-events: none;
}
.next__info { display: flex; align-items: center; gap: .75em; }
.thumb {
  flex: none;
  width: 5.6em; aspect-ratio: 16 / 9;
  border-radius: .5em;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 10px 22px -12px rgba(0, 0, 0, .9);
}
.thumb .art { width: 100%; height: 100%; display: block; }
.next__text { display: grid; gap: .15em; min-width: 0; }
.next__kicker { font-size: .66em; letter-spacing: .14em; text-transform: uppercase; color: var(--testo-3); font-weight: 600; white-space: nowrap; }
.next__title { font-size: 1.12em; font-weight: 650; font-stretch: 108%; white-space: nowrap; }

.next__actions { display: flex; align-items: center; gap: .6em; }

/* ---- the pill: --p is the countdown, from 0 to 1 ---- */
.pill {
  --p: 0;
  position: relative;
  flex: 1;
  height: 2.9em;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}
.pill__face {
  position: absolute; inset: 0;
  display: grid;
  border-radius: 999px;
  overflow: hidden;
  background: var(--vetro);
  box-shadow: inset 0 0 0 1px var(--vetro-bordo), 0 calc(4px + var(--p) * 10px) calc(10px + var(--p) * 22px) -12px rgba(255, 255, 255, calc(.06 + var(--p) * .3));
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  will-change: transform;
}
.pill:focus-visible .pill__face { box-shadow: inset 0 0 0 1px var(--vetro-bordo), 0 0 0 3px rgba(143, 184, 255, .6); }
.pill__fill {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #ffffff, #e6e9ef);
  transform-origin: 0 50%;
  transform: scaleX(var(--p));
}
.pill__fill::after {
  content: "";
  position: absolute; top: 0; bottom: 0; right: 0;
  width: 1.4em;
  background: linear-gradient(90deg, rgba(143, 184, 255, 0), rgba(143, 184, 255, .55));
  opacity: min(1, calc(var(--p) * 8), calc((1 - var(--p)) * 12));
}
.pill__label {
  grid-area: 1 / 1;
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: .45em;
  font-weight: 650;
  font-size: .95em;
  color: var(--testo);
  font-stretch: calc(100% + var(--p) * 18%);
  pointer-events: none;
  white-space: nowrap;
}
.pill__label--on { color: #0a0c10; clip-path: inset(0 calc((1 - var(--p)) * 100%) 0 0); }
.play { width: .95em; height: .95em; fill: currentColor; }
.pill__sec {
  display: inline-grid; place-items: center;
  min-width: 1.5em; height: 1.5em;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  font-size: .82em;
  font-variant-numeric: tabular-nums;
  font-stretch: 100%;
}
.pill__label--on .pill__sec { background: rgba(10, 12, 16, .1); }
.roll { display: inline-grid; overflow: hidden; height: 1.3em; line-height: 1.3em; }
.roll__line { grid-area: 1 / 1; display: block; }

.ghost {
  flex: none;
  height: 2.9em;
  padding: 0 1em;
  border-radius: 999px;
  font-size: .86em;
  font-weight: 560;
  color: var(--testo-2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  transition: color .2s ease, box-shadow .2s ease;
  outline: none;
  white-space: nowrap;
}
.ghost:focus-visible { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 0 0 3px rgba(143, 184, 255, .6); }
@media (hover: hover) {
  .ghost:hover { color: var(--testo); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .32); }
}

@media (max-aspect-ratio: 1 / 1) {
  .next { width: auto; left: 1em; right: 1em; bottom: 1.9em; }
  .thumb { width: 4.6em; }
}
