/* The reel page: the video first, nothing above it but the name. */

.reel-head {
  border-bottom: var(--line) solid var(--ink);
  padding: 16px 0;
}

.reel-head-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 24px;
}

.reel-name {
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  line-height: 1;
  letter-spacing: -0.01em;
}

.reel-head .mono-tag {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.reel-embed video {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: var(--ink);
}

.reel-more {
  margin-top: 18px;
  font-size: 0.9rem;
  font-weight: 700;
}

.reel-more a:hover {
  color: var(--accent);
}

/* No frame around the video. */
.reel-embed {
  border: 0;
  background: none;
}

/* The player. Without JavaScript the browser's own controls stay and none of this shows. */

.rp-big, .rp-bar { display: none; }

#reel-player { overflow: hidden; }

.rp-ready video { cursor: pointer; }
.rp-ready.is-idle, .rp-ready.is-idle video { cursor: none; }

/* The big button: the same look as the email button. */

.rp-ready .rp-big {
  display: grid;
  place-items: center;
  position: absolute;
  top: 58%;
  left: 50%;
  width: clamp(52px, 10vw, 96px);
  height: clamp(52px, 10vw, 96px);
  margin: calc(clamp(52px, 10vw, 96px) / -2) 0 0 calc(clamp(52px, 10vw, 96px) / -2);
  padding: 0;
  background: var(--accent);
  border: var(--line) solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.rp-ready .rp-big:hover {
  transform: translate(6px, 6px);
  box-shadow: 0 0 0 var(--ink);
}

/* Before play the button is drawn in the still, so this is a clear layer over the whole frame.
   ::before is the same frame with the row in red, and wipes across on hover. Nothing scales.
   The row is x 28.9%-71.1%, y 56.39%-67.5% of the frame. Change these if the frame changes. */

.rp-ready:not(.is-started) .rp-big,
.rp-ready:not(.is-started) .rp-big:hover {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  background: none;
  border: 0;
  box-shadow: none;
  transform: none;
}

.rp-ready:not(.is-started) .rp-big::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/reel-assets/reel-poster-hover.jpg?v=3") center / 100% 100% no-repeat;
  clip-path: inset(56.39% 71.1% 32.5% 28.9%);
  transition: clip-path 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

@media (hover: hover) {
  .rp-ready:not(.is-started) .rp-big:hover::before { clip-path: inset(56.39% 28.9% 32.5% 28.9%); }
}

.rp-ready:not(.is-started) .rp-big:focus-visible::before,
.rp-ready:not(.is-started) .rp-big:active::before { clip-path: inset(56.39% 28.9% 32.5% 28.9%); }

.rp-ready:not(.is-started) .rp-big svg { display: none; }

.rp-big svg { display: none; }

.rp-big svg { display: none; }

.rp-big svg { display: none; }

.rp-big svg { display: none; }

.rp-big svg { display: none; }

.rp-big svg { width: 50%; height: 50%; fill: var(--bg); }
.rp-big .rp-i-replay { display: none; }
.is-ended .rp-big .rp-i-play { display: none; }
.is-ended .rp-big .rp-i-replay { display: block; }
.rp-ready.is-started:not(.is-ended) .rp-big { display: none; }
.rp-ready.is-started.is-ended .rp-bar { display: none; }

/* The last frame has text in the middle, so "watch again" sits in the corner. */
.rp-ready.is-ended .rp-big {
  top: auto;
  left: clamp(12px, 3vw, 28px);
  bottom: clamp(12px, 3vw, 28px);
  margin: 0;
}

/* The bar: a floating card in the site's style. Only there once the reel has started. */

.rp-ready.is-started .rp-bar {
  display: flex;
  align-items: center;
  position: absolute;
  left: 14px;
  right: 18px;
  bottom: 18px;
  height: 48px;
  padding: 0 4px;
  background: var(--bg);
  color: var(--ink);
  border: var(--line) solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.15s ease;
}

.rp-ready.is-started.is-idle .rp-bar { transform: translateY(calc(100% + 26px)); }

.rp-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.rp-btn svg { width: 22px; height: 22px; fill: currentColor; }
.rp-btn { color: inherit; }
.rp-btn:hover svg { fill: var(--accent); }

.rp-toggle .rp-i-pause, .is-playing .rp-toggle .rp-i-play { display: none; }
.is-playing .rp-toggle .rp-i-pause { display: block; }
.rp-mute .rp-i-muted, .is-muted .rp-mute .rp-i-vol { display: none; }
.is-muted .rp-mute .rp-i-muted { display: block; }

.rp-time {
  flex: none;
  margin: 0 12px 0 4px;
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rp-track {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  height: 44px;
  margin-right: 12px;
  cursor: pointer;
  touch-action: none;
}

.rp-rail {
  position: relative;
  width: 100%;
  height: 8px;
  background: #d9d5ca;
}

.rp-track:hover .rp-rail { height: 12px; }

.rp-buffer, .rp-fill {
  position: absolute;
  inset: 0;
  transform: scaleX(0);
  transform-origin: left;
}

.rp-buffer { background: #a8a49a; }
.rp-fill { background: var(--accent); }

.rp-volume {
  flex: none;
  width: 72px;
  height: 44px;
  margin: 0 8px 0 0;
  background: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.rp-volume::-webkit-slider-runnable-track { height: 6px; background: var(--ink); }
.rp-volume::-moz-range-track { height: 6px; background: var(--ink); }

.rp-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 18px;
  margin-top: -6px;
  background: var(--accent);
  border: 0;
  border-radius: 0;
}

.rp-volume::-moz-range-thumb {
  width: 10px;
  height: 18px;
  background: var(--accent);
  border: 0;
  border-radius: 0;
}

.rp-big:focus-visible, .rp-btn:focus-visible, .rp-track:focus-visible, .rp-volume:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

/* Full screen */

#reel-player:fullscreen { padding-top: 0; width: 100%; height: 100%; background: #000; }
#reel-player:-webkit-full-screen { padding-top: 0; width: 100%; height: 100%; background: #000; }

/* Phones: volume is the hardware buttons; keep the bar to what fits. */

@media (hover: none), (max-width: 560px) {
  .rp-volume { display: none; }
  .rp-mute { margin-right: 0; }
}
