[data-film-stage]:empty::before {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  content: "";
}

.vp {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 24px 70px #411f552e;
  isolation: isolate;
  touch-action: pan-y;
}

.vp-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vp:fullscreen {
  aspect-ratio: auto;
  border-radius: 0;
  background: var(--heading);
}

.vp:fullscreen .vp-video {
  object-fit: contain;
}

.vp-big,
.vp-bar {
  transition: opacity .25s ease;
}

.vp.is-quiet .vp-big,
.vp.is-quiet .vp-bar {
  opacity: 0;
  pointer-events: none;
}

.vp-big {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 72px;
  height: 72px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--heading) 40%, transparent);
  color: var(--paper);
  cursor: pointer;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(6px);
}

.vp-big svg {
  width: 36px;
  height: 36px;
  fill: currentColor;
}

.vp-bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  gap: 4px;
  padding: 48px 16px 12px;
  color: var(--paper);
}

.vp-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.vp-gap {
  flex: 1;
}

.vp-time {
  min-width: 8.5ch;
  font-size: var(--type-ui);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.vp-icon {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
}

.vp-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.vp-big:focus-visible,
.vp-icon:focus-visible,
.vp-seek:focus-visible {
  outline: 1px solid var(--paper);
  outline-offset: 2px;
}

.vp-seek {
  width: 100%;
  height: 24px;
  margin: 0;
  accent-color: var(--purple);
  cursor: pointer;
  touch-action: none;
}

.vp-demo-heading {
  margin: 0 0 8px;
}

.vp-demo-intro {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: var(--type-body);
  line-height: 1.5;
}

.vp-demo-chips {
  display: flex;
  gap: 8px;
  margin: 0 -2px 12px;
  padding: 2px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.vp-demo-chips::-webkit-scrollbar {
  display: none;
}

.vp-demo-chip {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 6px 16px;
  border: 1px solid var(--paper-clear);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: var(--type-ui);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  scroll-snap-align: start;
}

.vp-demo-chip:hover,
.vp-demo-chip[aria-selected="true"] {
  border-color: var(--paper-clear);
  background: var(--tone);
  color: var(--purple-ink);
}

#how {
  height: calc(100svh - 83px);
  min-height: 0;
}

@media (max-width: 900px) {
  #how {
    height: calc(100svh - 73px);
  }
}

@media (max-height: 520px) {
  #how {
    height: auto;
  }
}

#how [data-film-stage] {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  container-type: inline-size;
}

#how [data-film-stage] > * {
  flex-shrink: 0;
}

#how [data-film-stage] > .vp-room {
  flex: 0 1 auto;
  height: calc(100cqw * 9 / 16);
  min-height: 0;
  container-type: size;
}

.vp-room > .vp {
  width: min(100%, 100cqh * 16 / 9);
  margin-inline: auto;
}

@media (max-width: 699px) {
  [data-film-stage]:empty::before {
    aspect-ratio: 4 / 5;
  }

  #how [data-film-stage] > .vp-room {
    height: calc(100cqw * 5 / 4);
  }

  .vp-room > .vp {
    width: min(100%, 100cqh * 4 / 5);
  }

  .vp {
    border-radius: 12px;
  }

  .vp-big {
    width: 64px;
    height: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vp-big,
  .vp-bar {
    transition: none;
  }
}
