/* ==========================================================================
   Video player (video-player.js). Wistia-style: big play button, then one
   control bar along the bottom that hides while the video plays.
   ========================================================================== */
.vp {
  --vp-accent: var(--accent, #f6821f);
  position: relative; overflow: hidden; isolation: isolate;
  aspect-ratio: 16 / 9; width: min(860px, 100%); margin: 0 auto; border-radius: 22px;
  background: #000; color: #fff; outline: none;
  box-shadow: 0 0 0 1px #232323, 0 40px 80px -30px rgba(0,0,0,.8), 0 30px 80px -40px rgba(246,130,31,.45);
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.vp:focus-visible { box-shadow: 0 0 0 2px var(--vp-accent), 0 40px 80px -30px rgba(0,0,0,.8); }
.vp video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.vp-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: opacity .5s var(--ease); }
.vp.has-started .vp-poster { opacity: 0; }
.vp.is-ended .vp-poster { opacity: 1; }
.vp-shade { position: absolute; inset: auto 0 0; height: 40%; pointer-events: none; background: linear-gradient(transparent, rgba(0,0,0,.55)); transition: opacity .35s; }

/* big play button: centred, like Wistia's */
.vp-big {
  position: absolute; z-index: 3; left: 50%; top: 50%; width: 104px; height: 66px; margin: -33px 0 0 -52px;
  display: grid; place-items: center; border-radius: 16px; color: #1a0900;
  background: var(--grad, var(--vp-accent)); box-shadow: 0 18px 40px rgba(246,130,31,.45), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .35s var(--spring), opacity .3s, visibility .3s;
}
.vp-big:hover { transform: scale(1.06); }
.vp-big svg { width: 30px; height: 30px; }
.vp.is-playing .vp-big, .vp.is-loading .vp-big { opacity: 0; visibility: hidden; transform: scale(.85); }

.vp-spin { position: absolute; z-index: 3; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); border-top-color: var(--vp-accent); opacity: 0; transition: opacity .2s; animation: vp-spin .8s linear infinite; pointer-events: none; }
.vp.is-loading .vp-spin { opacity: 1; transition-delay: .25s; }
@keyframes vp-spin { to { transform: rotate(360deg); } }

/* control bar */
.vp-bar {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; height: 46px; padding: 0 8px;
  display: flex; align-items: center; gap: 2px;
  background: rgba(14,12,11,.72); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
  transition: transform .35s var(--ease), opacity .35s;
}
.vp:not(.has-started) .vp-bar { transform: translateY(100%); opacity: 0; }
.vp:not(.has-started):hover .vp-bar, .vp:not(.has-started):focus-within .vp-bar { transform: none; opacity: 1; }
.vp.is-idle .vp-bar, .vp.is-idle .vp-shade { transform: translateY(100%); opacity: 0; }
.vp.is-idle { cursor: none; }

.vp-btn { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: #f2f2f2; transition: background .2s, color .2s; }
.vp-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.vp-btn:focus-visible { outline: 2px solid var(--vp-accent); outline-offset: -2px; }
.vp-btn svg { width: 20px; height: 20px; }
.vp-pp svg { width: 22px; height: 22px; }
.vp-pp .i-pause, .vp.is-playing .vp-pp .i-play { display: none; }
.vp.is-playing .vp-pp .i-pause { display: block; }
.vp-fs .i-fs-out, .vp.is-fs .vp-fs .i-fs-in { display: none; }
.vp.is-fs .vp-fs .i-fs-out { display: block; }
.vp.is-pip .vp-pip { color: var(--vp-accent); }

.vp-time { flex: none; padding: 0 8px 0 4px; font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; color: #f2f2f2; white-space: nowrap; }
.vp-dur { color: rgba(255,255,255,.5); }

/* timeline */
.vp-track { position: relative; flex: 1; min-width: 60px; height: 38px; margin: 0 10px 0 6px; cursor: pointer; touch-action: none; outline: none; }
.vp-rail { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; overflow: hidden; background: rgba(255,255,255,.2); transition: height .2s, margin .2s; }
.vp-track:hover .vp-rail, .vp.is-scrubbing .vp-rail { height: 6px; margin-top: -3px; }
.vp-rail i { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); }
.vp-buf { background: rgba(255,255,255,.3); }
.vp-hov { background: rgba(255,255,255,.22); opacity: 0; transition: opacity .2s; }
.vp-track:hover .vp-hov { opacity: 1; }
.vp-prog { background: var(--grad, var(--vp-accent)); }
.vp-knob { position: absolute; top: 50%; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(246,130,31,.45), 0 2px 6px rgba(0,0,0,.5); transform: scale(.7); transition: transform .2s var(--spring); pointer-events: none; }
.vp-track:hover .vp-knob, .vp-track:focus-visible .vp-knob, .vp.is-scrubbing .vp-knob { transform: scale(1); }
.vp-track:focus-visible .vp-rail { box-shadow: 0 0 0 2px var(--vp-accent); }
.vp-tip {
  position: absolute; bottom: 34px; padding: 4px 8px; border-radius: 7px; transform: translateX(-50%);
  font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; color: #fff; background: rgba(10,10,10,.9); box-shadow: 0 0 0 1px rgba(255,255,255,.1);
  opacity: 0; transition: opacity .15s; pointer-events: none; white-space: nowrap;
}
.vp-track:hover .vp-tip, .vp.is-scrubbing .vp-tip { opacity: 1; }

/* volume: the slider slides out next to the speaker on hover */
.vp-vol { display: flex; align-items: center; }
.vp-vol-range {
  --p: 100%; width: 0; height: 4px; margin: 0; opacity: 0; cursor: pointer; border-radius: 4px; -webkit-appearance: none; appearance: none;
  background: linear-gradient(90deg, #fff var(--p), rgba(255,255,255,.25) var(--p)); transition: width .25s var(--ease), opacity .2s, margin .25s var(--ease);
}
.vp-vol:hover .vp-vol-range, .vp-vol:focus-within .vp-vol-range { width: 72px; opacity: 1; margin: 0 10px 0 4px; }
.vp-vol-range::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
.vp-vol-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
.vp-vol-range:focus-visible { outline: 2px solid var(--vp-accent); outline-offset: 4px; }
.vp .i-vol .x { display: none; }
.vp.is-muted .i-vol .w1, .vp.is-muted .i-vol .w2 { display: none; }
.vp.is-muted .i-vol .x { display: block; }

/* settings menu */
.vp-set { position: relative; }
.vp-gear svg { transition: transform .4s var(--ease); }
.vp-gear[aria-expanded="true"] { background: rgba(255,255,255,.1); }
.vp-gear[aria-expanded="true"] svg { transform: rotate(60deg); }
.vp-menu {
  position: absolute; right: -46px; bottom: 48px; width: 236px; padding: 12px; border-radius: 14px;
  background: rgba(16,14,13,.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 20px 50px rgba(0,0,0,.6);
  animation: vp-pop .22s var(--ease);
}
.vp-menu[hidden] { display: none; }
@keyframes vp-pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.vp-mh { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.5); margin: 2px 2px 8px; }
.vp-mh + .vp-opts + .vp-mh { margin-top: 14px; }
.vp-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.vp-opt { height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; color: #e8e8e8; background: rgba(255,255,255,.06); transition: background .2s, color .2s; }
.vp-opt:hover { background: rgba(255,255,255,.12); }
.vp-opt.on { background: var(--vp-accent); color: #1a0900; font-weight: 600; }
.vp-opt sup { font-size: 8px; font-weight: 700; margin-left: 2px; vertical-align: 4px; }
.vp-opt:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

/* full screen: drop the card styling */
.vp.is-fs { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
.vp.is-fs .vp-bar { height: 54px; padding: 0 16px; }

@media (max-width: 640px) {
  .vp { border-radius: 16px; }
  .vp-big { width: 76px; height: 50px; margin: -25px 0 0 -38px; border-radius: 13px; }
  .vp-big svg { width: 24px; height: 24px; }
  .vp-bar { height: 42px; padding: 0 4px; }
  .vp-btn { width: 34px; height: 34px; }
  .vp-btn svg { width: 18px; height: 18px; }
  .vp-dur, .vp-vol-range { display: none; }
  .vp-time { padding: 0 2px; font-size: 11.5px; }
  .vp-track { margin: 0 6px; }
  .vp-menu { right: -76px; width: 214px; }
}
@media (prefers-reduced-motion: reduce) {
  .vp *, .vp *::before { transition: none !important; animation: none !important; }
  .vp-spin { border-top-color: rgba(255,255,255,.18); }
}
