/* Full-bleed looping media. Nothing else on the page. */

:root {
  --bg: #000;
  /* How much the blurred backdrop is softened and dimmed. */
  --backdrop-blur: 44px;
  --backdrop-dim: 0.5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg);
  overflow: hidden;
}

body { color-scheme: dark; }

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  /* Nothing here is interactive — don't let it be selected or dragged. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.stage > *:not([hidden]) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* The clip itself: always shown whole, never cropped. */
.clip {
  object-fit: contain;
  z-index: 1;
}

/* A blurred, zoomed copy of the same file filling the leftover space.
   Scaled up so the blur radius has pixels to work with at the edges
   instead of smearing into transparency. */
.backdrop {
  object-fit: cover;
  z-index: 0;
  filter: blur(var(--backdrop-blur)) brightness(var(--backdrop-dim));
  transform: scale(1.15);
}

/* Respect users who ask for less motion: JS pauses both videos, so the
   poster frame stays put. Drop the backdrop's blur cost entirely. */
@media (prefers-reduced-motion: reduce) {
  .backdrop { display: none; }
}

/* Sound toggle. Sits above the stage, bottom-right, out of the way of the
   clip. Deliberately quiet until you go looking for it. */
.sound {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 2;

  /* 44px is the smallest comfortable touch target. */
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;

  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
  opacity: 0.7;
  /* A hairline ring so the control still reads as a control on footage that
     is as dark as the button itself. */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22), 0 1px 6px rgba(0, 0, 0, 0.4);
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.sound:hover,
.sound:focus-visible { opacity: 1; background: rgba(0, 0, 0, 0.65); }

/* Keyboard users need to see where they are; mouse users don't need a ring. */
.sound:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.sound svg {
  width: 22px;
  height: 22px;
  overflow: visible;
}

.sound .speaker { fill: currentColor; }

.sound .waves,
.sound .cross {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* Muted (the default): show the cross. Unmuted: show the waves. */
.sound[aria-pressed="false"] .waves,
.sound[aria-pressed="true"] .cross { display: none; }

/* No video, no sound to offer. */
.sound[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .sound { transition: none; }
}
