/* Highlight theater: the full-window player that opens from a Performance
   Highlights card on the homepage (assets/js/highlight-theater.js).
   All clips are portrait (9:16), so the frame is sized from whichever runs out
   first, the window's height or its width. */

.ht {
  --ht-ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ht-gold: #d4b872;
  --ht-ivory: #f4efe6;
  --ht-top: 64px;
  --ht-bottom: 76px;
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  background: #06030c;
  color: var(--ht-ivory);
  overflow: hidden;
  overscroll-behavior: contain;
  -webkit-tap-highlight-color: transparent;
}
.ht.is-open { display: block; }
html.ht-lock, html.ht-lock body { overflow: hidden; }

/* The clip's own poster, blown up and blurred, lights the room. */
.ht-glow {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  object-fit: cover;
  filter: blur(70px) saturate(1.5);
  opacity: 0;
  transform: translateZ(0);
  transition: opacity 500ms ease;
  pointer-events: none;
}
.ht.is-in .ht-glow { opacity: 0.34; }
.ht::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(6, 3, 12, 0) 30%, rgba(6, 3, 12, 0.82) 100%);
  pointer-events: none;
}

.ht-top, .ht-stage, .ht-bottom { position: absolute; left: 0; right: 0; z-index: 2; }

.ht-top {
  top: 0;
  height: var(--ht-top);
  padding: 0 14px 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ht-count {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 22px;
  line-height: 1;
  color: var(--ht-ivory);
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}
.ht-count small {
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: rgba(244, 239, 230, 0.5);
  margin-left: 8px;
}

.ht-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(244, 239, 230, 0.22);
  background: rgba(15, 10, 26, 0.5);
  color: var(--ht-ivory);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 150ms var(--ht-ease), border-color 180ms ease, background-color 180ms ease, color 180ms ease, opacity 180ms ease;
}
.ht-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ht-btn:active { transform: scale(0.93); }
.ht-btn:focus-visible { outline: 2px solid var(--ht-gold); outline-offset: 3px; }
.ht-btn:disabled { opacity: 0.25; cursor: default; }

.ht-stage {
  top: var(--ht-top);
  bottom: var(--ht-bottom);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 0 16px;
}
.ht-frame {
  position: relative;
  flex: 0 0 auto;
  aspect-ratio: 9 / 16;
  height: min(100%, calc((100vw - 32px) * 16 / 9));
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(212, 184, 114, 0.28);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 240ms ease, transform 320ms var(--ht-ease);
}
.ht.is-in .ht-frame { opacity: 1; transform: none; }
/* Changing clips: a quick dip, so the swap is not a hard cut. */
.ht.is-swapping .ht-frame { opacity: 0; transform: scale(0.985); transition-duration: 120ms; }
.ht-frame video, .ht-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: cover;
  background: #000;
}

.ht-bottom {
  bottom: 0;
  height: var(--ht-bottom);
  padding: 0 20px env(safe-area-inset-bottom, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.ht-caption { text-align: center; min-width: 0; }
.ht-venue {
  display: block;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 20px;
  line-height: 1.2;
  color: var(--ht-ivory);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ht-hint {
  display: block;
  margin-top: 5px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(244, 239, 230, 0.45);
}
/* Arrows sit beside the frame on wide screens and in the bottom bar on narrow ones. */
.ht-bottom .ht-nav { display: none; }

@media (hover: hover) and (pointer: fine) {
  .ht-btn:hover:not(:disabled) { border-color: var(--ht-gold); color: var(--ht-gold); background: rgba(15, 10, 26, 0.8); }
}

@media (max-width: 720px) {
  .ht { --ht-top: 54px; --ht-bottom: 70px; }
  .ht-top { padding: 0 8px 0 16px; }
  .ht-count { font-size: 19px; }
  .ht-stage { padding: 0 8px; gap: 0; }
  .ht-stage .ht-nav { display: none; }
  .ht-bottom .ht-nav { display: flex; }
  .ht-bottom { justify-content: space-between; padding-left: 12px; padding-right: 12px; }
  .ht-frame { height: min(100%, calc((100vw - 16px) * 16 / 9)); border-radius: 14px; }
  .ht-venue { font-size: 17px; }
}
/* Phone held sideways: give the clip nearly all the height. */
@media (max-height: 500px) {
  .ht { --ht-top: 0px; --ht-bottom: 0px; }
  .ht-top { height: 52px; z-index: 3; }
  .ht-count { display: none; }
  .ht-top { justify-content: flex-end; }
  .ht-bottom { display: none; }
  .ht-stage { padding: 6px 16px; }
  .ht-stage .ht-nav { display: flex; }
  .ht-frame { border-radius: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .ht-frame, .ht.is-swapping .ht-frame { transform: none; }
}

/* Julie's player shell, laid over each clip hosted on this site: her mark in
   the corner, her controls along the bottom. */
.ht-shell { position: absolute; inset: 0; z-index: 2; }
.ht-tap { position: absolute; inset: 0; cursor: pointer; transition: background-color 220ms ease; }
.ht-shell.is-paused .ht-tap { background: rgba(6, 3, 12, 0.38); }
.ht-shell::before, .ht-shell::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 96px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
}
.ht-shell::before { top: 0; background: linear-gradient(180deg, rgba(6, 3, 12, 0.6), rgba(6, 3, 12, 0)); opacity: 1; }
.ht-shell::after { bottom: 0; height: 120px; background: linear-gradient(0deg, rgba(6, 3, 12, 0.72), rgba(6, 3, 12, 0)); }
.ht-shell.show-ui::after { opacity: 1; }

.ht-brand {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  pointer-events: none;
}
.ht-brand img { height: 22px; width: auto; display: block; }
.ht-brand span {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(244, 239, 230, 0.88);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.ht-big {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 76px;
  height: 76px;
  margin: -38px 0 0 -38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(212, 184, 114, 0.6);
  background: rgba(15, 10, 26, 0.66);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--ht-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.94);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms var(--ht-ease), background-color 180ms ease, color 180ms ease;
}
.ht-big svg { width: 26px; height: 26px; fill: currentColor; margin-left: 3px; }
.ht-shell.is-paused .ht-big { opacity: 1; transform: none; pointer-events: auto; }
.ht-big:active { transform: scale(0.95); }
/* Buffering: a gold ring where the play button sits. */
.ht-shell.is-waiting:not(.is-paused) .ht-big { opacity: 1; transform: none; border-color: rgba(212, 184, 114, 0.2); border-top-color: var(--ht-gold); background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; animation: ht-spin 0.7s linear infinite; }
.ht-shell.is-waiting:not(.is-paused) .ht-big svg { display: none; }
@keyframes ht-spin { to { transform: rotate(360deg); } }

.ht-bar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 48px;
  padding: 0 4px;
  border-radius: 14px;
  background: rgba(15, 10, 26, 0.58);
  border: 1px solid rgba(244, 239, 230, 0.12);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms var(--ht-ease);
}
.ht-shell.show-ui .ht-bar { opacity: 1; transform: none; pointer-events: auto; transition-duration: 220ms; }
.ht-ctl {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ht-ivory);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 140ms var(--ht-ease), background-color 160ms ease, color 160ms ease;
}
.ht-ctl svg { width: 19px; height: 19px; fill: currentColor; }
.ht-ctl:active { transform: scale(0.92); }
.ht-ctl[hidden] { display: none; }
.ht-ctl:focus-visible, .ht-big:focus-visible, .ht-track:focus-visible { outline: 2px solid var(--ht-gold); outline-offset: 2px; }
.ht-track { position: relative; flex: 1 1 auto; height: 44px; margin: 0 6px; cursor: pointer; touch-action: none; }
.ht-track::before, .ht-fill { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 3px; }
.ht-track::before { background: rgba(244, 239, 230, 0.24); }
.ht-fill { background: linear-gradient(90deg, #a855f7, var(--ht-gold)); transform: scaleX(0); transform-origin: 0 50%; transition: transform 260ms linear; }
.ht-track.is-dragging .ht-fill { transition: none; }
.ht-time {
  flex: 0 0 auto;
  margin: 0 4px 0 2px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: rgba(244, 239, 230, 0.8);
  white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) {
  .ht-ctl:hover { background: rgba(244, 239, 230, 0.1); color: var(--ht-gold); }
  .ht-big:hover { background: rgba(212, 184, 114, 0.94); color: #0a0616; }
}
/* True full screen keeps the shell: the frame fills the screen's height. */
.ht:fullscreen { --ht-top: 0px; --ht-bottom: 0px; }
.ht:fullscreen .ht-top, .ht:fullscreen .ht-bottom, .ht:fullscreen .ht-stage .ht-nav { display: none; }
.ht:fullscreen .ht-stage { padding: 0; }
.ht:fullscreen .ht-frame { border-radius: 0; box-shadow: none; height: min(100%, calc(100vw * 16 / 9)); }
@media (max-width: 420px) { .ht-brand span { letter-spacing: 0.2em; } }
