/* ══════════════════════════════════════════════════════════════
   RIPWIRE MOTION LAYER — enhancement only, no restyling.
   Everything here is additive: existing layout and colours untouched.
   ══════════════════════════════════════════════════════════════ */

/* ── scroll progress: the wire ─────────────────────────────── */
.fx-wire{position:fixed;top:0;left:0;height:2px;width:100%;z-index:80;pointer-events:none;
  transform:scaleX(0);transform-origin:0 50%;
  background:linear-gradient(90deg,var(--blue),var(--gold) 70%,var(--gold2));
  box-shadow:0 0 12px rgba(168,85,247,.45);transition:transform .08s linear}
body.bare .fx-wire{display:none}

/* ── page enter ────────────────────────────────────────────── */
@keyframes fx-page-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
body:not(.bare) main{animation:fx-page-in .5s var(--ease) both}

/* ── scroll reveal ─────────────────────────────────────────── */
.fx-watch{opacity:0;transform:translateY(22px);
  transition:opacity .7s var(--ease),transform .7s var(--ease);
  transition-delay:var(--fx-delay,0ms)}
.fx-watch.fx-on{opacity:1;transform:none}

/* ── hero: light that follows the pointer ──────────────────── */
.fx-hero-light{position:absolute;inset:0;z-index:1;pointer-events:none;opacity:0;transition:opacity .6s var(--ease);
  background:radial-gradient(420px 420px at var(--mx,50%) var(--my,40%),rgba(124,58,237,.16),rgba(168,85,247,.05) 45%,transparent 70%)}
.hero:hover .fx-hero-light{opacity:1}

/* hero aura clip (black-background footage, screen blended) */
.hero-aura{position:absolute;inset:-8% -4% auto auto;width:64%;height:118%;object-fit:cover;z-index:0;
  mix-blend-mode:screen;opacity:.55;pointer-events:none;z-index:0;
  -webkit-mask-image:radial-gradient(70% 70% at 60% 45%,#000 40%,transparent 78%);
  mask-image:radial-gradient(70% 70% at 60% 45%,#000 40%,transparent 78%)}
@media(max-width:860px){.hero-aura{width:120%;inset:-6% -20% auto auto;opacity:.42}}

/* reel + stage: pointer parallax (JS sets --px/--py) */
.reel{transform:translate3d(calc(var(--px,0)*10px),calc(var(--py,0)*10px),0) rotate(calc(var(--px,0)*1.2deg));
  transition:transform .5s var(--ease)}
.hero-stage .ghost{transition:transform .6s var(--ease)}
.hero-stage .ghost.g1{transform:translate3d(calc(var(--px,0)*-14px),calc(var(--py,0)*-10px),0) rotate(-8deg)}
.hero-stage .ghost.g2{transform:translate3d(calc(var(--px,0)*16px),calc(var(--py,0)*8px),0) rotate(7deg)}

/* sheen footage over the card stack */
.reel-sheen{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none;
  mix-blend-mode:screen;opacity:.22;transition:opacity .5s var(--ease);z-index:3;border-radius:inherit}
.hero-stage:hover .reel-sheen{opacity:.7}

/* ── cards: tilt, glare, hairline ──────────────────────────── */
.fx-tilt{transform-style:preserve-3d;transform:perspective(900px) rotateX(calc(var(--ty,0)*1deg)) rotateY(calc(var(--tx,0)*1deg)) translateY(var(--lift,0));
  transition:transform .35s var(--ease),box-shadow .35s var(--ease)}
.fx-tilt .fx-glare{position:absolute;inset:0;z-index:5;pointer-events:none;opacity:0;transition:opacity .3s var(--ease);
  border-radius:inherit;
  background:radial-gradient(circle at var(--gx,50%) var(--gy,50%),rgba(255,255,255,.20),rgba(255,255,255,.05) 35%,transparent 62%);
  mix-blend-mode:screen}
.fx-tilt:hover .fx-glare{opacity:1}
.pack,.tile,.live-item,.rail-item,.vault-item{position:relative;transform-style:preserve-3d}
.pack{transition:box-shadow .35s var(--ease),border-color .35s var(--ease)}
.pack:hover{box-shadow:0 24px 60px rgba(10,14,48,.65),0 0 0 1px rgba(168,85,247,.35),0 0 48px rgba(168,85,247,.14)}
.pack:hover .pack-peek{transform:scale(1.06) translateZ(10px)}
.pack-peek{transition:transform .6s var(--ease)}
.tile:hover .tile-card img{transform:scale(1.05)}
.tile-card img{transition:transform .6s var(--ease)}

/* gold hairline that draws on hover */
.pack::after,.live-item::after,.rail-item::after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:linear-gradient(120deg,transparent 30%,rgba(168,85,247,.55) 50%,transparent 70%);
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;mask-composite:exclude;padding:1px;opacity:0;transition:opacity .3s var(--ease)}
.pack:hover::after,.live-item:hover::after,.rail-item:hover::after{opacity:1}

/* ── buttons: sheen sweep + press ──────────────────────────── */
.btn,.ghost{position:relative;overflow:hidden;transition:transform .25s var(--ease-snap),box-shadow .3s var(--ease),background .2s}
.btn:hover{box-shadow:0 10px 28px rgba(124,58,237,.28)}
.btn::after{content:"";position:absolute;top:0;bottom:0;width:45%;left:-60%;pointer-events:none;
  background:linear-gradient(100deg,transparent,rgba(255,255,255,.35),transparent);transform:skewX(-18deg)}
.btn:hover::after{animation:fx-sheen .85s var(--ease) forwards}
@keyframes fx-sheen{to{left:120%}}
.btn:active,.ghost:active{transform:translateY(1px) scale(.995)}

/* ── counters ──────────────────────────────────────────────── */
.fx-count{display:inline-block;font-variant-numeric:tabular-nums}

/* ── ticker ────────────────────────────────────────────────── */
.ticker-track{will-change:transform}
.ticker:hover .ticker-track{animation-duration:120s}

/* ── live + rail stagger ───────────────────────────────────── */
.live-item,.rail-item,.tile,.pack{will-change:transform,opacity}
@keyframes fx-rise{from{opacity:0;transform:translateY(14px) scale(.985)}to{opacity:1;transform:none}}
.fx-stagger>*{animation:fx-rise .55s var(--ease) both;animation-delay:calc(var(--i,0)*45ms)}

/* ── nav ───────────────────────────────────────────────────── */
.nav.is-stuck{box-shadow:0 12px 40px rgba(4,6,20,.55)}
.nav-links a{position:relative}
.nav-links a::after{content:"";position:absolute;left:0;right:0;bottom:-6px;height:1px;background:var(--gold);
  transform:scaleX(0);transform-origin:0 50%;transition:transform .3s var(--ease)}
.nav-links a:hover::after,.nav-links a.is-active::after{transform:scaleX(1)}
.live-dot{animation:fx-pulse 2.4s var(--ease) infinite}
@keyframes fx-pulse{0%,100%{box-shadow:0 0 0 0 rgba(16,185,129,.5)}50%{box-shadow:0 0 0 5px rgba(16,185,129,0)}}

/* ── pack opening stage: extra rings & light ───────────────── */
.rip-stage .fx-ring,.rip-stage .fx-ring2{position:absolute;left:50%;top:50%;width:420px;height:420px;margin:-210px 0 0 -210px;
  border-radius:50%;border:1px solid rgba(168,85,247,.35);pointer-events:none;z-index:1;opacity:0}
.rip-stage.is-live .fx-ring{animation:fx-ring 2.6s var(--ease) infinite}
.rip-stage.is-live .fx-ring2{animation:fx-ring 2.6s var(--ease) .8s infinite}
@keyframes fx-ring{0%{opacity:.55;transform:scale(.55)}70%{opacity:0;transform:scale(1.25)}100%{opacity:0;transform:scale(1.25)}}

/* ── fallbacks ─────────────────────────────────────────────── */
@media (prefers-reduced-motion:reduce){
  .fx-watch{opacity:1!important;transform:none!important;filter:none!important}
  .fx-tilt,.reel-stack,.hero-stage .ghost{transition:none!important;transform:none!important}
  body:not(.bare) main{animation:none}
  .fx-stagger>*{animation:none}
  .btn:hover::after{animation:none}
}

/* ── pack CTA spark ────────────────────────────────────────── */
.fx-spark{position:absolute;left:50%;top:50%;width:16px;height:16px;margin:-8px 0 0 -8px;border-radius:50%;
  pointer-events:none;background:radial-gradient(circle,rgba(192,132,252,.95),rgba(168,85,247,.5) 45%,transparent 70%);
  animation:fx-spark .8s var(--ease) forwards;z-index:6}
@keyframes fx-spark{0%{transform:scale(.4);opacity:.9}60%{transform:scale(7);opacity:.5}100%{transform:scale(11);opacity:0}}

/* ── rip stage: spark plate behind the reveal ──────────────── */
.rip-spark{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none;
  mix-blend-mode:screen;opacity:.42;z-index:1}
.rip-stage.postfilm .rip-spark{opacity:.22}

/* ══ motion set 2 — entrance, rules, magnetism, float ═══════ */

/* hero copy: line-by-line rise */
.fx-line{display:block;overflow:hidden}
.fx-line>span{display:block;transform:translateY(105%);animation:fx-line .9s var(--ease) forwards;animation-delay:var(--d,0ms)}
@keyframes fx-line{to{transform:translateY(0)}}
.fx-fade{opacity:0;animation:fx-fade .8s var(--ease) forwards;animation-delay:var(--d,0ms)}
@keyframes fx-fade{to{opacity:1}}
.hero h1 .fx-line>span{will-change:transform}

/* section rule draws left → right when revealed */
.sec-head h2,.section-head h2{position:relative;padding-bottom:10px}
.sec-head h2::after,.section-head h2::after{content:"";position:absolute;left:0;bottom:0;height:1px;width:100%;
  background:linear-gradient(90deg,var(--gold),rgba(168,85,247,0));transform:scaleX(0);transform-origin:0 50%;
  transition:transform .9s var(--ease) .1s}
.fx-on .sec-head h2::after,.fx-on.section-head h2::after,.fx-on .section-head h2::after{transform:scaleX(1)}

/* magnetic buttons */
.btn{transition:transform .18s var(--ease-snap),box-shadow .3s var(--ease),background .2s}
.btn.fx-magnet{will-change:transform}

/* ticker items */
.tick{transition:transform .3s var(--ease),color .3s}
.tick:hover{transform:translateY(-2px)}
.ticker{transition:opacity .3s}

/* live feed arrival */
.live-item.fx-hot{animation:fx-hot 3.2s var(--ease) 1}
@keyframes fx-hot{0%,100%{box-shadow:none}25%{box-shadow:0 0 0 1px rgba(168,85,247,.55),0 12px 40px rgba(168,85,247,.14)}}

/* hero reel float — theme.css already runs the float keyframes on .reel-stack */

/* pack foil: slow breathing shine */
@keyframes fx-foil{0%,100%{opacity:.55}50%{opacity:.95}}
.pack-foil{animation:fx-foil 6.5s ease-in-out infinite}
.pack:nth-child(2n) .pack-foil{animation-delay:-2.2s}
.pack:nth-child(3n) .pack-foil{animation-delay:-4.1s}

/* card art: sheen band on hover */
.tile-art::after,.card-visual::after{content:"";position:absolute;inset:0;pointer-events:none;opacity:0;
  background:linear-gradient(105deg,transparent 35%,rgba(255,255,255,.16) 50%,transparent 65%);
  transform:translateX(-100%);transition:opacity .2s}
.tile:hover .tile-art::after,.card-visual:hover::after{opacity:1;animation:fx-sheen 1.1s var(--ease) forwards}

@media (prefers-reduced-motion:reduce){
  .fx-line>span{animation:none;transform:none}
  .fx-fade{opacity:1;animation:none}
  .reel-stack{animation:none}
  .pack-foil{animation:none}
  .tile:hover .tile-art::after,.card-visual:hover::after{animation:none;opacity:0}
}

/* ══ motion set 3 — CTA band light + card lift ═══════════════ */

/* generated no-bg plate behind the CTA band */
.cta-band{position:relative;overflow:hidden}
.cta-band .band-light{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;
  mix-blend-mode:screen;opacity:.30;pointer-events:none;z-index:0;
  -webkit-mask-image:radial-gradient(95% 130% at 50% 50%,#000 28%,transparent 76%);
  mask-image:radial-gradient(95% 130% at 50% 50%,#000 28%,transparent 76%)}
.cta-band > *:not(.band-light){position:relative;z-index:1}

/* tiles lift toward the pointer */
.tile{transition:transform .35s var(--ease),box-shadow .35s var(--ease)}
.tile:hover{transform:translateY(-4px);box-shadow:0 18px 40px rgba(0,0,0,.45)}
.tile-meta strong{transition:color .25s}
.tile:hover .tile-meta strong{color:var(--gold)}

/* live feed rows nudge in */
.live-item{transition:transform .3s var(--ease),background .3s}
.live-item:hover{transform:translateX(3px)}

/* odds table rows slide in when their section reveals */
.fx-on .odds tbody tr{animation:fx-row .55s var(--ease) both}
.fx-on .odds tbody tr:nth-child(2){animation-delay:.06s}
.fx-on .odds tbody tr:nth-child(3){animation-delay:.12s}
.fx-on .odds tbody tr:nth-child(4){animation-delay:.18s}
.fx-on .odds tbody tr:nth-child(5){animation-delay:.24s}
@keyframes fx-row{from{opacity:0;transform:translateX(-8px)}to{opacity:1;transform:none}}


/* ── layering: generated plates are backdrop only, cards stay solid ── */
.hero-stage,.reel-stack,.reel,.hero-copy{position:relative;z-index:2}
.pack-art,.pack-peek,.tile-art,.card-visual{position:relative;z-index:2}
.cta-band .band-light{z-index:0}

/* ══════════════════════════════════════════════════════════════
   MOBILE GPU GUARD — iOS Safari WebView crash protection.
   A blur/backdrop-filter on a tall section (e.g. a 7000px
   section) rasterises into one layer bigger than the GPU
   texture budget, and the tab dies. Filters are decoration;
   on touch we swap them for nothing and stop the decorative
   infinite loops. Layout and colour are untouched.
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  /* no blur layers at all — this is the crash */
  .fx-watch{filter:none !important;will-change:auto !important}
  .fx-watch:not(.fx-on){opacity:1 !important;transform:none !important}
  .fx-hero-light{display:none !important}
  .hero-aura{mix-blend-mode:normal !important;opacity:.35 !important}

  /* frosted glass → flat tint */
  header.nav,.tabbar,.mob-cta,.hp-live,.sheet-head,.modal-card{
    -webkit-backdrop-filter:none !important;backdrop-filter:none !important;
    background:rgba(9,11,18,.94) !important}

  /* stop decorative infinite loops (compositor stays asleep).
     The hero card stream is deliberately NOT in this list: it is two
     transform-only columns, which costs one composited layer each, and a
     frozen hero is the first thing the owner notices. The per-card face
     flip (100+ opacity animations) stays off — that was the expensive part. */
  .hs-face,
  .cine-shuffle i,.cine-card-wrap::after,.hero-scroll::after,
  .hero-buy,.btn,.pack-foil,.pack-sweep,.fx-spark,.fx-ring,.fx-ring2,
  .tierPulse,.slabSheen,.packSweep,.glowPulse,.sheen,.ticker,.shuffle{
    animation:none !important}
  .hs-track{animation:hsUp 30s linear infinite !important;will-change:transform}
  .hs-b .hs-track{animation-duration:38s !important;animation-direction:reverse !important}
  .hero-v2 .hero-prize{animation:heroFloat 8.5s ease-in-out infinite !important}

  /* big raster layers: no promotion */
  .fx-tilt,.tile,.pack,.rail-item{will-change:auto !important;transform:none !important}
}
