/* home-warp.css — the "magic transport" transition that stitches the
   card pick on the gate to the arrival on a design page.

   Two halves, same flash colour, so they read as one motion:
   1. .warp-* : the hyperspace warp played on the gate after a card is
      chosen (streaks + flash, origin at the picked card).
   2. .jh-arrive : the arrival dissolve played on the destination page
      when it was reached from the trick (an inline <head> script adds
      the class before first paint, so the overlay covers instantly).

   Reduced motion collapses both to a quick fade. Everything here is
   pointer-events:none and self-removing, so it never blocks the page. */

/* ============== GATE: warp ============== */
.warp-stage{
  position:fixed; inset:0; z-index:9998; pointer-events:none;
  opacity:0; transition:opacity .18s ease-out;
}
.warp-stage.on{ opacity:1; }
.warp-stage canvas{ position:absolute; inset:0; width:100%; height:100%; display:block; }

/* the central flash that fills the screen at the peak (origin = picked card) */
.warp-flash{
  position:fixed; inset:0; z-index:9999; pointer-events:none; opacity:0;
  background:radial-gradient(circle at var(--wx,50%) var(--wy,50%),
    #ffffff 0%, var(--accent) 34%, transparent 70%);
}
.warp-flash.fire{ animation:warpFlash .62s cubic-bezier(.5,0,.75,1) forwards; }
@keyframes warpFlash{
  0%   { opacity:0; transform:scale(.2); }
  62%  { opacity:.95; }
  100% { opacity:1; transform:scale(2.6); }
}

/* the chosen card rushes toward the viewer and dissolves into the warp */
.trick-card.rush{
  animation:cardRush .6s cubic-bezier(.55,.05,.7,.2) forwards;
  z-index:5; position:relative;
}
@keyframes cardRush{
  0%   { transform:translateZ(0) scale(1);        filter:brightness(1);   opacity:1; }
  55%  { transform:translateZ(0) scale(1.35);     filter:brightness(1.6); opacity:1; }
  100% { transform:translateZ(0) scale(5.5);      filter:brightness(3);   opacity:0; }
}
.trick.dealing .trick-card:not(.rush){ animation:cardScatter .5s ease-in forwards; }
@keyframes cardScatter{ to{ opacity:0; transform:translateY(26px) scale(.82); } }
.trick.dealing .trick-title{ animation:cardScatter .4s ease-in forwards; }

/* ============== DESTINATION: arrival ============== */
/* Covers the whole page instantly (class set pre-paint), then dissolves
   outward — you emerge from the same flash the gate ended on. */
.jh-arrive::before{
  content:""; position:fixed; inset:0; z-index:10000; pointer-events:none;
  background:radial-gradient(circle at 50% 42%,
    #ffffff 0%, var(--accent) 34%, var(--bg,#0b0f14) 72%);
  animation:arriveFlash .8s cubic-bezier(.4,.1,.3,1) forwards;
}
@keyframes arriveFlash{
  0%   { opacity:1;  transform:scale(1);   }
  45%  { opacity:.7; }
  100% { opacity:0;  transform:scale(1.4); }
}
/* content rises out of the light */
.jh-arrive .home-wrap,
.jh-arrive main.home-wrap{
  animation:arriveIn .9s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes arriveIn{
  0%   { opacity:0; transform:scale(1.035); filter:blur(3px); }
  100% { opacity:1; transform:none;         filter:none; }
}

@media (prefers-reduced-motion: reduce){
  .warp-stage canvas{ display:none; }
  .warp-flash.fire{ animation:warpFlashQuick .22s linear forwards; }
  @keyframes warpFlashQuick{ 0%{opacity:0} 100%{opacity:1} }
  .trick-card.rush,
  .trick.dealing .trick-card:not(.rush),
  .trick.dealing .trick-title{ animation:none; }
  .jh-arrive::before{ animation-duration:.24s; }
  .jh-arrive .home-wrap, .jh-arrive main.home-wrap{ animation:none; }
}
