/* PagePop WOW works (M6). Scoped under html.wow; motion sits in prefers-reduced-motion:no-preference. */

/* live pill on every shot (static) */
html.wow .works .shot .wow-live{position:absolute;top:12px;inset-inline-end:12px;z-index:4;pointer-events:none;
 display:inline-flex;align-items:center;gap:7px;padding:5px 11px 5px 10px;border-radius:999px;
 font:700 12px/1 Rubik,system-ui,sans-serif;letter-spacing:.01em;color:#f4eef9;
 background:rgba(8,11,22,.74);box-shadow:0 0 0 1px rgba(16,185,129,.38) inset,0 6px 18px -8px rgba(0,0,0,.8);
 -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
html.wow .works .shot .wow-live i{position:relative;width:7px;height:7px;border-radius:50%;background:#10B981;
 box-shadow:0 0 8px rgba(16,185,129,.9)}
html.wow .works .shot .wow-live i::after{content:"";position:absolute;inset:0;border-radius:50%;background:#10B981;opacity:0}
html.wow .works .shot .wow-scan,html.wow .works .wow-glare{position:absolute;pointer-events:none}
html.wow .works .shot .wow-scan{inset:0;z-index:5;opacity:0;
 background:linear-gradient(180deg,rgba(191,174,244,0),rgba(191,174,244,.6) 32%,rgba(244,238,249,.96) 50%,rgba(191,174,244,.6) 68%,rgba(191,174,244,0))}

/* keyboard focus always visible (the reel padding leaves room for the ring) */
html.wow .works>a.work:focus-visible{outline:2px solid #BFAEF4;outline-offset:3px}

/* phone reel controls are hidden on wide screens */
html.wow .wow-perf,html.wow .wow-rnav{display:none}

@media (prefers-reduced-motion:no-preference){
 html.wow:not(.wow-rm) .works .shot .wow-live i::after{animation:wow-ping 2.4s cubic-bezier(.2,.7,.3,1) infinite}

 /* power-on: a thin line opens into the picture */
 html.wow:not(.wow-rm) .works.wow-arm .shot{opacity:0;transform:scale(.55,.02);transform-origin:50% 50%}
 html.wow:not(.wow-rm) .works.wow-arm .shot.wow-on{animation:wow-boot .62s cubic-bezier(.3,.7,.2,1) var(--wd,0ms) both}
 html.wow:not(.wow-rm) .works.wow-arm .shot.wow-on .wow-scan{animation:wow-scan .9s ease-out var(--wd,0ms) both}

 /* desktop tilt and glare (class added on first mouse hover) */
 html.wow:not(.wow-rm) .works>a.work.wow-t{transition:box-shadow .3s,opacity .7s;
  transform:perspective(900px) translate3d(0,var(--ly,0px),0) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg))}
 html.wow:not(.wow-rm) .works .wow-glare{inset:-50%;z-index:6;opacity:0;transition:opacity .4s;
  background:radial-gradient(circle at 50% 50%,rgba(191,174,244,.18),rgba(191,174,244,.06) 22%,transparent 42%);
  transform:translate3d(var(--gx,0),var(--gy,0),0)}
 html.wow:not(.wow-rm) .works>a.work.wow-hov .wow-glare{opacity:1}

 /* the screenshot pans slowly while hovered, returns on leave */
 html.wow:not(.wow-rm) .works>a.work.wow-t .shot img{transition:transform .9s cubic-bezier(.2,.7,.3,1);transform-origin:50% 30%}
 html.wow:not(.wow-rm) .works>a.work.wow-hov .shot img{transform:scale(1.13) translate3d(0,-4%,0);transition:transform 6s linear}
 html.wow:not(.wow-rm) .works .shot.wow-tall img{height:auto;min-height:100%;object-fit:fill}
 html.wow:not(.wow-rm) .works>a.work.wow-hov .shot.wow-tall img{transform:translate3d(0,var(--sy,0px),0)}
}
@keyframes wow-boot{0%{opacity:0;transform:scale(.55,.02)}30%{opacity:1;transform:scale(1,.02)}100%{opacity:1;transform:none}}
@keyframes wow-scan{0%,38%{opacity:1}100%{opacity:0}}
@keyframes wow-ping{0%{opacity:.7;transform:scale(1)}80%,100%{opacity:0;transform:scale(2.8)}}

/* phone: the grid becomes a horizontal reel from first paint (no late reflow, CLS stays 0).
   Before the script inserts the perforation strip and the nav, the grid margins reserve their exact space. */
@media (max-width:820px){
 html.wow #works .works{margin-top:58px;margin-bottom:50px}
 html.wow #works .works.wow-w{margin-top:12px;margin-bottom:0}
 html.wow #works .works{display:flex;gap:14px;margin-inline:calc(-1*var(--pad,16px));
  padding:12px 9vw 22px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;
  overscroll-behavior-x:contain;contain:paint;scrollbar-width:none}
 html.wow #works .works::-webkit-scrollbar{display:none}
 html.wow #works .works>a.work{flex:0 0 82vw;max-width:82vw;scroll-snap-align:center;scroll-snap-stop:always;scroll-margin-inline:16px}
 html.wow .wow-perf{display:block;height:12px;margin:34px calc(-1*var(--pad,16px)) 0;pointer-events:none;
  background:repeating-linear-gradient(90deg,transparent 0 9px,rgba(167,173,204,.12) 9px 21px) 0 50%/100% 6px no-repeat;
  border-block:1px solid rgba(167,173,204,.07)}
 html.wow .wow-rnav{display:flex;align-items:center;justify-content:center;gap:16px;margin-top:6px}
 html.wow .wow-dots{display:flex;gap:7px;align-items:center;pointer-events:none}
 html.wow .wow-dots i{width:6px;height:6px;border-radius:999px;background:rgba(167,173,204,.35);transition:transform .3s,background-color .3s}
 html.wow .wow-dots i.on{background:#BFAEF4;transform:scale(1.5)}
 html.wow .wow-rb{min-width:76px;min-height:44px;padding:0 16px;border-radius:999px;border:0;cursor:pointer;
  font:600 14px/1 Rubik,system-ui,sans-serif;color:#f4eef9;background:#11152e;
  box-shadow:0 0 0 1px rgba(191,174,244,.28) inset;transition:box-shadow .25s,opacity .25s}
 html.wow .wow-rb:hover{box-shadow:0 0 0 1px rgba(191,174,244,.6) inset}
 html.wow .wow-rb:focus-visible{outline:2px solid #BFAEF4;outline-offset:3px}
 html.wow .wow-rb[aria-disabled="true"]{opacity:.45;cursor:default}
 html.wow #works .works>a.work:hover,html.wow #works .works>a.work:focus-within{transform:none}
 /* coverflow, driven by the reel scroll position (JS sets the vars; RTL-safe) */
 @media (prefers-reduced-motion:no-preference){
  html.wow:not(.wow-rm) .works.wow-reel>a.work.wow-rp{transition:box-shadow .3s;transform-origin:var(--rox,50%) 50%;
   transform:perspective(900px) scale(var(--rs,1)) rotateY(var(--rr,0deg));opacity:var(--ro,1)}
 }
}
