/* Video pages (/video1/ – /video4/): James's four opening options.
   The ad (media/ad.mp4, 4:5) plays inside the existing 329 x 412 video box. */
.video__vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
              background: #1a1206; }
.video__play { position: absolute; left: 50%; top: 50%; width: 74px; height: 74px; margin: -37px 0 0 -37px;
               border-radius: 50%; border: 2px solid rgba(255,255,255,.92); pointer-events: none;
               box-shadow: 0 0 18px rgba(0,0,0,.18);
               transition: opacity .7s ease, transform .7s cubic-bezier(.3,.7,.2,1); }
.video__play::after { content: ""; position: absolute; left: 50%; top: 50%; margin: -12px 0 0 -6px;
                      border-left: 19px solid #fff; border-top: 12px solid transparent; border-bottom: 12px solid transparent; }
.video__caption { transition: opacity .7s ease .15s, transform .7s cubic-bezier(.3,.7,.2,1) .15s; }
/* "nice effect": the play symbol swells and dissolves; the caption sinks and fades */
.video.is-playing .video__play { opacity: 0; transform: scale(1.6); }
.video.is-playing .video__caption { opacity: 0; transform: translate(-50%, 16px); }
.video.is-instant .video__play, .video.is-instant .video__caption { transition: none; }

/* ---- 5: spotlight — ONE dim layer over the whole page that fades in and out
   smoothly; the video sits above it the whole time (it never changes layer, so no
   part of the page can flash through as a rectangle while the dim fades). */
.vspot { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0;
         background: rgba(18, 12, 4, .58); transition: opacity 1.4s ease; }
.vspot.is-on { opacity: 1; }
body[data-video="5"] .video { z-index: 4; transition: box-shadow 1.4s ease; }
body[data-video="5"] .video.is-spot { box-shadow: 0 0 0 1px rgba(255, 226, 160, .55), 0 0 34px 6px rgba(255, 214, 140, .55); }

/* ---- 6: snowfall layer, behind the page content */
.vsnow { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---- 7: ribbon unwrap — a gold ribbon and bow tie the video like a present, then slide off */
.vrib { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transform: scale(1.06);
        transition: opacity .45s ease, transform .55s cubic-bezier(.2,.8,.3,1); }
.vrib.is-tied { opacity: 1; transform: scale(1); }
.vrib i, .vrib__bow { position: absolute; display: block; }
.vrib__v { left: 50%; top: 0; bottom: 0; width: 24px; margin-left: -12px;
           background: linear-gradient(90deg,#8a6a24,#c9a24b 20%,#f3dc9e 48%,#c9a24b 76%,#8a6a24);
           box-shadow: 0 0 6px rgba(0,0,0,.25); transition: transform .8s cubic-bezier(.6,0,.3,1); }
.vrib__h { top: 46%; left: 0; right: 0; height: 24px; margin-top: -12px;
           background: linear-gradient(180deg,#8a6a24,#c9a24b 20%,#f3dc9e 48%,#c9a24b 76%,#8a6a24);
           box-shadow: 0 0 6px rgba(0,0,0,.25); transition: transform .8s cubic-bezier(.6,0,.3,1) .08s; }
.vrib__bow { left: 50%; top: 46%; width: 130px; height: 100px; margin: -48px 0 0 -65px;
             filter: drop-shadow(0 6px 10px rgba(0,0,0,.3)); transition: transform .55s ease-in, opacity .55s ease-in; }
.vrib__tail { top: 34px; width: 18px; height: 58px; transform-origin: top center;
              background: linear-gradient(90deg,#8a6a24,#c9a24b 20%,#f3dc9e 48%,#c9a24b 76%,#8a6a24);
              clip-path: polygon(0 0,100% 0,100% 100%,50% 86%,0 100%); }
.vrib__tail--l { left: 44px; transform: rotate(22deg); } .vrib__tail--r { left: 68px; transform: rotate(-22deg); }
.vrib__loop { top: 6px; width: 60px; height: 42px; border-radius: 50%; }
.vrib__loop--l { left: 3px; transform: rotate(-16deg); background: radial-gradient(70% 70% at 40% 35%,#f3dc9e,#c9a24b 55%,#8a6a24); }
.vrib__loop--r { right: 3px; transform: rotate(16deg); background: radial-gradient(70% 70% at 60% 35%,#f3dc9e,#c9a24b 55%,#8a6a24); }
.vrib__knot { left: 54px; top: 18px; width: 22px; height: 25px; border-radius: 7px;
              background: radial-gradient(70% 70% at 45% 35%,#f3dc9e,#c9a24b 60%,#8a6a24); }
.vrib.is-off .vrib__bow { transform: translateY(-40px) scale(.2) rotate(18deg); opacity: 0; }
.vrib.is-off .vrib__v { transform: translateY(-110%); }
.vrib.is-off .vrib__h { transform: translateX(110%); }
.vrib.is-off { transition: opacity .4s ease 1s; opacity: 0; }

.vsnow--front { z-index: 6; }   /* video 8: embers drift in front of the video */

/* ---- 7: settle into place — as the doors open, each piece rises gently into place,
   one after another (uses the individual `translate` property so nothing else's
   transform is disturbed). */
@keyframes v-settle { from { opacity: 0; translate: 0 30px; } to { opacity: 1; translate: 0 0; } }
#stage.is-settling .badge, #stage.is-settling .head, #stage.is-settling .product,
#stage.is-settling .ornament, #stage.is-settling .video {
  animation: v-settle .9s cubic-bezier(.2,.75,.25,1) both; }
#stage.is-settling .badge    { animation-delay: .8s; }
#stage.is-settling .head     { animation-delay: 1s; }
#stage.is-settling .product  { animation-delay: 1.2s; }
#stage.is-settling .ornament { animation-delay: 1.3s; }
#stage.is-settling .video    { animation-delay: 1.45s; animation-duration: 1.2s; }

/* ---- 8: gold frame trace — drawn once around the video, then stays as a fine border */
.vframe { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.vframe__line { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.video.is-framed .vframe__line { opacity: 1; animation: v-trace 1.6s cubic-bezier(.45,.05,.3,1) forwards; }
@keyframes v-trace { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  #stage.is-settling .badge, #stage.is-settling .head, #stage.is-settling .product,
  #stage.is-settling .ornament, #stage.is-settling .video { animation: none; }
  .video.is-framed .vframe__line { animation: none; stroke-dashoffset: 0; }
}
