/* =====================================================================
   .shock SHOWREEL ENGINE — showreel.css
   Styles the Ken Burns still-reel: stage, layers, transitions, HUD.
   Theme variables come from shock.css; sensible fallbacks inline.
   ===================================================================== */

.reel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg, #0c0c0f);
  isolation: isolate;
}

.reel__stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* two stacked layers crossfade; each holds a transformable frame */
.reel__layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  will-change: opacity;
}
.reel__layer:first-child { opacity: 1; }

.reel__frame {
  position: absolute;
  inset: -2%;                 /* bleed so Ken Burns never shows an edge */
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  will-change: transform;
  transform: scale(1.04);
  backface-visibility: hidden;
}

/* whip-pan transition helper */
.reel__layer.is-whip { animation: reel-whip 220ms ease; }
@keyframes reel-whip {
  0%   { filter: blur(6px); transform: translateX(6%); }
  100% { filter: blur(0);   transform: translateX(0); }
}

/* flash / fade-black overlay */
.reel__fx {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: #fff;
  z-index: 3;
}

/* cinematic grade: vignette + subtle top/bottom gradient for legibility */
.reel__grade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0,0,0,.42) 100%),
    linear-gradient(to top, rgba(0,0,0,.40), transparent 22%, transparent 80%, rgba(0,0,0,.20));
}

/* lower-third label */
.reel__label {
  position: absolute;
  left: clamp(16px, 4vw, 48px);
  bottom: clamp(64px, 12vh, 110px);
  z-index: 4;
  max-width: 60%;
  color: #fff;
  font-weight: 600;
  font-size: clamp(15px, 2.4vw, 26px);
  letter-spacing: .01em;
  text-shadow: 0 2px 18px rgba(0,0,0,.6);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s ease, transform .5s ease;
  padding-left: 14px;
  border-left: 3px solid var(--accent, #c8070a);
}
.reel__label.is-on { opacity: 1; transform: translateY(0); }

/* background mode: ambient only, no controls, no pointer */
.reel--bg { pointer-events: none; }
.reel--bg .reel__label { display: none; }

/* ---------------- controls bar (full mode) ---------------- */
.reel__bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px clamp(12px, 3vw, 26px);
  background: linear-gradient(to top, rgba(8,8,11,.86), rgba(8,8,11,0));
  opacity: 0;
  transition: opacity .25s ease;
}
.reel--full:hover .reel__bar,
.reel--full:focus-within .reel__bar,
.reel--full.is-playing .reel__bar { opacity: 1; }
.reel--full:not(.is-playing) .reel__bar { opacity: 1; }   /* visible at rest */

.reel__bar-left, .reel__bar-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.reel__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
  color: #fff;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.reel__btn:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.4); }
.reel__btn:active { transform: scale(.94); }
.reel__btn--music { width: 34px; height: 34px; }

.reel__counter {
  font-variant-numeric: tabular-nums;
  font-size: 13px; color: rgba(255,255,255,.82);
  letter-spacing: .04em;
}

.reel__track {
  flex: 1 1 auto;
  height: 4px;
  border-radius: 3px;
  background: rgba(255,255,255,.18);
  cursor: pointer;
  position: relative;
}
.reel__track:hover { height: 6px; }
.reel__fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0;
  border-radius: 3px;
  background: var(--accent, #c8070a);
  transition: width .25s linear;
}

.reel__chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.reel__chip {
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.reel__chip:hover { background: rgba(255,255,255,.16); color: #fff; }
.reel__chip[aria-current="true"] {
  background: var(--accent, #c8070a);
  border-color: var(--accent, #c8070a);
  color: #fff;
}

/* empty / failed state: keep host background, hide bar */
.reel--empty .reel__bar { display: none; }

@media (max-width: 640px) {
  .reel__chips { display: none; }              /* keep the bar uncluttered on phones */
  .reel__bar { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .reel__frame { transition: none !important; }
  .reel__fill { transition: none; }
}
