:root {
  --fondo: #000000;
  --testo: #f5f6f4;
  --testo-2: rgba(245, 246, 244, .62);
  --testo-3: rgba(245, 246, 244, .38);
  --vetro: rgba(18, 20, 22, .72);
  --vetro-bordo: rgba(255, 255, 255, .1);
  --accento: #8be3c9;        /* the single accent: sea-glass mint, in the CC underline, the timeline and the choices */
  --cap-fondo: rgba(6, 8, 9, .62);
}

* { 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: "Geist 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; }
button:focus-visible { outline: 1.5px solid var(--accento); outline-offset: 2px; border-radius: .5em; }

.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: #050607;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .07), 0 40px 80px -50px rgba(139, 227, 201, .25);
  isolation: isolate;
}
@media (max-aspect-ratio: 1 / 1) {
  .player { aspect-ratio: 4 / 3.7; width: min(46em, 94vw); }
}

/* the frame: shapes and light, a harbour at dusk */
.frame { position: absolute; inset: 0; overflow: hidden; }
.frame__sky {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #0b1418 0%, #17323a 42%, #2e5258 58%, #0b1416 60%, #050809 100%);
}
.frame__sun {
  position: absolute; left: 62%; top: 49%;
  width: 18%; aspect-ratio: 1;
  border-radius: 50%;
  translate: -50% -50%;
  background: radial-gradient(circle, rgba(232, 255, 246, .9) 0 18%, rgba(139, 227, 201, .35) 34%, rgba(139, 227, 201, 0) 70%);
  filter: blur(1px);
}
.frame__sea {
  position: absolute; left: 0; right: 0; top: 59%; bottom: 0;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 7px),
    radial-gradient(30% 50% at 62% 0%, rgba(139, 227, 201, .22), transparent 70%);
}
.frame__line { position: absolute; left: 0; right: 0; top: 59%; height: 1px; background: rgba(232, 255, 246, .28); }
.frame__grain {
  position: absolute; inset: 0; opacity: .14; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}
.frame::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .45), transparent 22%, transparent 62%, rgba(0, 0, 0, .7));
}

.top { position: absolute; left: 1.4em; top: 1.1em; display: grid; gap: .15em; z-index: 2; }
.top__title { font-size: .95em; font-weight: 600; letter-spacing: -.01em; }
.top__ep { font-size: .75em; color: var(--testo-2); }

/* ---- the subtitles ---- */
.caps {
  position: absolute; left: 6%; right: 6%; bottom: 4.8em;
  display: grid; justify-items: center;
  z-index: 3; pointer-events: none;
}
.cap {
  position: relative;
  max-width: 100%;
  padding: .22em .55em .26em;
  border-radius: .4em;
  background: var(--cap-fondo);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-size: 1.25em;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.005em;
  text-align: center;
  text-wrap: balance;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .05);
}
.cap:empty { display: none; }
.w { display: inline-block; will-change: transform, opacity, filter; }
.cap__who { color: var(--accento); font-weight: 600; }

/* ---- the control bar ---- */
.bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: .9em;
  padding: .9em 1.1em 1em;
  z-index: 4;
}
.icon { width: 2.2em; height: 2.2em; display: grid; place-items: center; border-radius: 50%; }
.icon svg { width: 1.3em; height: 1.3em; fill: var(--testo); }
.time { font-family: "Geist Mono Variable", ui-monospace, monospace; font-size: .75em; color: var(--testo-2); font-variant-numeric: tabular-nums; }
.track { position: relative; flex: 1; height: .25em; border-radius: 1em; background: rgba(255, 255, 255, .18); }
.track__done { position: absolute; inset: 0; border-radius: inherit; background: var(--accento); transform-origin: 0 50%; transform: scaleX(.29); }
.track__head { position: absolute; top: 50%; left: 29%; width: .7em; height: .7em; border-radius: 50%; background: #fff; translate: -50% -50%; box-shadow: 0 0 0 3px rgba(139, 227, 201, .18); }

.cc { position: relative; display: grid; justify-items: center; padding: .3em .2em .45em; border-radius: .4em; }
.cc__box {
  display: block;
  padding: .12em .32em;
  border: 1.5px solid currentColor;
  border-radius: .3em;
  font-size: .72em; font-weight: 700; letter-spacing: .04em; line-height: 1.1;
}
.cc__line { position: absolute; left: 18%; right: 18%; bottom: .1em; height: 2px; border-radius: 2px; background: var(--accento); transform-origin: 50% 50%; }

/* ---- the CC menu ---- */
.menu {
  position: absolute; right: .9em; bottom: 3.9em;
  width: 13.5em;
  padding: .7em;
  border-radius: .9em;
  background: var(--vetro);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 0 0 1px var(--vetro-bordo), 0 18px 40px -18px rgba(0, 0, 0, .8);
  transform-origin: 88% 100%;
  z-index: 5;
}
.menu[hidden] { display: none; }
.menu__head { font-size: .7em; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--testo-3); padding: .2em .5em .5em; }
.menu__list { display: grid; }
.menu__list button {
  display: flex; align-items: center; justify-content: space-between;
  padding: .42em .55em;
  border-radius: .5em;
  font-size: .85em; text-align: left;
  color: var(--testo-2);
  transition: background-color .2s, color .2s;
}
.menu__list button[aria-checked="true"] { color: var(--testo); background: rgba(255, 255, 255, .05); }
.menu__list svg { width: 1em; height: 1em; fill: none; stroke: var(--accento); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu__list svg path { stroke-dasharray: 1; stroke-dashoffset: 1; }
@media (hover: hover) {
  .menu__list button:hover { background: rgba(255, 255, 255, .06); color: var(--testo); }
  .icon:hover svg, .cc:hover { opacity: .9; }
}
.menu__size { display: flex; align-items: center; justify-content: space-between; gap: .6em; padding: .55em .55em .15em; margin-top: .35em; border-top: 1px solid rgba(255, 255, 255, .08); }
.menu__label { font-size: .85em; color: var(--testo-2); }
.sizes { position: relative; display: flex; padding: .18em; border-radius: 2em; background: rgba(255, 255, 255, .07); }
.sizes button { position: relative; z-index: 1; width: 2.1em; height: 1.7em; border-radius: 2em; font-size: .78em; font-weight: 600; color: var(--testo-2); transition: color .2s; }
.sizes button[aria-checked="true"] { color: #06110d; }
.sizes__knob { position: absolute; top: .18em; left: .18em; width: 1.64em; height: 1.33em; border-radius: 2em; background: var(--accento); box-shadow: 0 2px 8px -2px rgba(139, 227, 201, .5); }

/* on a phone: a taller player, everything in em tied to width and height */
@media (max-aspect-ratio: 1 / 1) {
  .caps { bottom: 4.2em; left: 4%; right: 4%; }
  .menu { width: 12.5em; bottom: 3.6em; padding: .55em; }
  .menu__list button { padding: .34em .5em; }
}
