/* Motion direction: weight on arrival, a small follow-through, then a still reading surface.
   Load after app.css. The existing flip/face/sound clocks remain the source of truth. */
:root{
  --exp-turn:360ms;
  --exp-sheet:460ms;
  --exp-object:720ms;
  --exp-detail:420ms;
  --exp-trophy:640ms;
  --exp-fade:150ms;
  --exp-overlap:65ms;
  --exp-ease:cubic-bezier(.22,.72,.2,1);
  --exp-exit:cubic-bezier(.5,0,.85,.4);
}

@media (prefers-reduced-motion: no-preference){
  /* Readable objects come to rest. Lighting communicates whose turn it is without
     an endless zoom on the question, or three independent breathing loops. */
  .flip.settled .face.front,
  html[data-turn="mine"] .flip.settled .face.front,
  html[data-turn="mine"] .cardbox::before,
  .edge-glow{animation:none}

  /* Keep the existing duration and event names: sound, face swaps, settled-state
     recording and the timer all continue to share their original clock. */
  @keyframes deal-in{
    0%{opacity:0;transform:translate(22%,-6%) rotate(7deg) scale(.965)}
    48%{opacity:1}
    74%{transform:translate(-1%,.7%) rotate(-.65deg) scale(1.012,.993)}
    90%{transform:translate(.25%,-.15%) rotate(.15deg) scale(.997,1.003)}
    100%{opacity:1;transform:none}
  }
  @keyframes card-out{
    0%{opacity:1;transform:none}
    22%{opacity:1;transform:translate(1.8%,-2.4%) rotate(1.4deg) scale(1.015)}
    56%{opacity:1}
    100%{opacity:0;transform:translate(-74%,11%) rotate(-11deg) scale(.97)}
  }
  @keyframes lift{
    0%{opacity:0;transform:translateY(10px)}
    78%{opacity:1;transform:translateY(-1px)}
    100%{opacity:1;transform:none}
  }
  @keyframes hero-in{
    0%{opacity:0;transform:translateY(16px) scale(.97)}
    62%{opacity:1;transform:translateY(-3px) scale(1.012)}
    82%{transform:translateY(1px) scale(.997)}
    100%{opacity:1;transform:none}
  }
  @keyframes chip-in{
    0%{opacity:0;transform:translateY(11px) rotate(-2deg) scale(.93)}
    64%{opacity:1;transform:translateY(-2px) rotate(.5deg) scale(1.015)}
    100%{opacity:1;transform:none}
  }
  @keyframes seat-pop{
    0%{transform:translateY(4px) scale(.98)}
    68%{transform:translateY(-1px) scale(1.008)}
    100%{transform:none}
  }
  @keyframes heartbeat{
    0%,100%{transform:none}
    22%{transform:translateY(-2px) scale(1.012)}
    43%{transform:translateY(1px) scale(.997)}
    64%{transform:translateY(-1px) scale(1.006)}
    82%{transform:none}
  }
  @keyframes experience-seat-turn{
    0%{transform:translateY(2px) scale(.9,.8)}
    58%{transform:translateY(-1px) scale(1.025,1.12)}
    82%{transform:translateY(.3px) scale(.995,.97)}
    100%{transform:none}
  }

  /* A single arrival replaces the overly elastic pop on every new person. The
     identity stays legible; the tick can supply the playful secondary motion. */
  .pchip{animation:chip-in var(--exp-detail) var(--exp-ease) backwards}
  .seat.on{animation:seat-pop var(--exp-detail) var(--exp-ease)}
  .flip:not(.leaving):not(.fold):not(.chosen-out):not(.from-pick){animation-timing-function:var(--exp-ease)}
  :is(#chips,.ritual-seats) .chip.now{animation:experience-seat-turn var(--exp-turn) var(--exp-ease)}
  /* The certificate now carries an illustrated prop. Keep its entrance on the
     same face-swap clock as the original icon, with one effect per trophy. */
  .cert.flip:not(.held) .cert-ico :is(.ico,.result-prop){animation:trophy-in var(--exp-trophy) var(--exp-ease) calc(var(--fw) + var(--t-card) * var(--swap)) backwards}

  /* Feedback lives on touch and release. A control does not shrink merely because
     it has remained :active after a touch on Safari. */
  :is(.btn,.pill,.vopt,.seat,.pchip,.opt){transition:scale var(--t-snappy) var(--spring-snappy)}
  :is(.btn,.vopt,.seat,.pchip):active{scale:1}
  :is(.btn,.pill).pressed:not([disabled]){scale:.965;transition-duration:var(--t-fast)}
  :is(.seat,.vopt,.opt).pressed:not([disabled]){scale:.985;transition-duration:var(--t-fast)}
}

@media (prefers-reduced-motion: reduce){
  /* app.css has legacy unconditional :active scaling. Keep this preference quiet
     during interaction as well as during screen transitions. */
  :is(.btn,.pill,.vopt,.seat,.pchip,.opt),
  :is(.btn,.pill,.vopt,.seat,.pchip,.opt):active,
  :is(.btn,.pill,.vopt,.seat,.pchip,.opt).pressed,
  .pill.stamp:active .dot{scale:none;transition:none}
}
