.sv-player {
  --sv-accent: #e08a4f;
  --sv-bg: #241318;
  --sv-radius: 20px;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--sv-bg);
  border-radius: var(--sv-radius);
  overflow: hidden;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  isolation: isolate;
}

.sv-player__media,
.sv-player__video,
.sv-player__embed-frame,
.sv-player__poster-img,
.sv-player__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.sv-player__video,
.sv-player__poster-img {
  object-fit: cover;
}

.sv-player__iframe {
  border: 0;
}

/* fullscreen sizing: aspect-ratio box would otherwise letterbox in native fullscreen */
.sv-player:fullscreen,
.sv-player:-webkit-full-screen {
  aspect-ratio: auto;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

.sv-player__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 20%, rgba(0,0,0,0) 65%, rgba(0,0,0,.55) 100%);
  pointer-events: none;
  transition: opacity .25s ease;
}

.sv-player__top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
}

.sv-player__label {
  font-size: 14px;
  letter-spacing: .01em;
  color: rgba(255,255,255,.9);
}

.sv-player__controls {
  display: flex;
  gap: 8px;
}

.sv-player__icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s ease;
  padding: 0;
}

.sv-player__icon-btn:hover { background: rgba(255,255,255,.24); }

.sv-icon { width: 16px; height: 16px; }

.sv-icon--unmuted { display: none; }
.sv-player.is-unmuted .sv-icon--muted { display: none; }
.sv-player.is-unmuted .sv-icon--unmuted { display: block; }

.sv-icon--collapse { display: none; }
.sv-player.is-fullscreen .sv-icon--expand { display: none; }
.sv-player.is-fullscreen .sv-icon--collapse { display: block; }

.sv-player__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}

.sv-player__play:hover {
  transform: translate(-50%, -50%) scale(1.06);
  background: rgba(255,255,255,.24);
}

.sv-player__play svg {
  width: 24px;
  height: 24px;
  color: #fff;
  margin-left: 3px;
}

.sv-player.is-playing .sv-player__play { opacity: 0; pointer-events: none; }

/* while playing, the label and heading get out of the way of the footage —
   controls (mute/fullscreen) stay visible since they're still needed mid-playback */
.sv-player__label,
.sv-player__bottom {
  opacity: 1;
  transition: opacity .25s ease;
}

.sv-player.is-playing .sv-player__label,
.sv-player.is-playing .sv-player__bottom {
  opacity: 0;
  pointer-events: none;
}

.sv-player.is-playing:hover .sv-player__label,
.sv-player.is-playing:hover .sv-player__bottom {
  opacity: 1;
  pointer-events: auto;
}

.sv-player.is-playing .sv-player__scrim {
  opacity: 0;
  transition: opacity .25s ease;
}

.sv-player.is-playing:hover .sv-player__scrim {
  opacity: 1;
}

.sv-player__bottom {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  padding: 24px 28px;
}

.sv-player__heading {
  margin: 0;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  line-height: 1.2;
}

@media (max-width: 520px) {
  .sv-player__top { padding: 16px; }
  .sv-player__bottom { padding: 16px; }
  .sv-player__play { width: 52px; height: 52px; }
}
