/* Motion for every CPOTrack page; driven by motion.js. Calm on purpose: short distances,
   one easing curve, nothing bounces. All of it sits under `.motion`, which motion.js only
   sets when the visitor has not asked for reduced motion. */

/* ---------------------------------------------------------------- reveal on view */
.motion [data-mo] {
  transition: opacity .75s var(--ease) var(--mo-d, 0ms), transform .75s var(--ease) var(--mo-d, 0ms);
}
.motion [data-mo]:not(.mo-in) { opacity: 0; transform: translateY(18px); }
.motion [data-mo].mo-instant { transition: none; }
/* The product shot rises a little further, after the headline. */
.motion .stage[data-mo] { transition-duration: 1s, 1s; transition-delay: .35s, .35s; }
.motion .stage[data-mo]:not(.mo-in) { transform: translateY(40px); }
.motion .how-row > .browser[data-mo]:not(.mo-in), .motion .split > .browser[data-mo]:not(.mo-in) { transform: translateY(26px) scale(.985); }

/* ---------------------------------------------------------------- bars grow */
.motion :is(.ex-row .bar i, .idx-track i, .seat-bar i, .bartrack i, .h2h-bar i, .divbar) {
  transform-origin: left center;
  animation: mo-grow 1.1s var(--ease) .2s both;
}
.motion :is(.idx-track i, .divbar)[style*="right:50%"] { transform-origin: right center; }
.motion [data-chart="years"] rect[data-tip] { transform-box: fill-box; transform-origin: 50% 100%; animation: mo-grow-y .9s var(--ease) .15s both; }
.motion :is([data-chart="box"], [data-cmp]) svg { animation: mo-fade .8s var(--ease) .1s both; }
/* Held until their card is revealed, so they grow while someone is looking. */
.motion [data-mo]:not(.mo-in) :is(.ex-row .bar i, .idx-track i, .seat-bar i, .bartrack i, .h2h-bar i, .divbar, [data-chart="years"] rect[data-tip], [data-chart="box"] svg) { animation-play-state: paused; }
@keyframes mo-grow { from { transform: scaleX(0); } }
@keyframes mo-grow-y { from { transform: scaleY(0); } }
@keyframes mo-fade { from { opacity: 0; } }

/* ---------------------------------------------------------------- devices */
.motion .phone-shell, .motion .aside-phone { animation: mo-float 7s ease-in-out 1.4s infinite; }
@keyframes mo-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------------------------------------------------------------- hover and press */
.motion :is(.ex-card, .feat .fi, .logo-chip, .how-row > .browser, .split > .browser, .seat-side, .faq details, .card2, .tour-tile, .saved-card) {
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .2s;
}
@media (hover: hover) {
  .motion :is(.ex-card, .logo-chip, .how-row > .browser, .split > .browser, .seat-side, .tour-tile, .saved-card):hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
  .motion .feat:hover .fi { transform: translateY(-2px) rotate(-4deg); }
  .motion .how-row:hover .how-n { transform: scale(1.06); }
}
.motion .how-n { transition: transform .3s var(--ease); }
.motion :is(.btn, .btn-mini, .chip, .save-btn, .search-go):active { transform: scale(.97); }
.motion .btn { transition: background .15s, border-color .15s, color .15s, opacity .15s, transform .12s; }
/* Menus and dialogs open, they do not just appear. */
.motion .acct-menu:not([hidden]), .motion .rowmenu[open] .rowmenu-list { animation: mo-pop .18s var(--ease) both; transform-origin: top right; }
.motion dialog.confirm[open] { animation: mo-pop .2s var(--ease) both; }
.motion .faq details[open] p { animation: mo-drop .3s var(--ease) both; }
@keyframes mo-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes mo-drop { from { opacity: 0; transform: translateY(-6px); } }

/* ---------------------------------------------------------------- the headline word */
.motion .hero h1 em { display: inline-block; animation: mo-word 1s var(--ease) .45s both; }
@keyframes mo-word { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } }

@media (prefers-reduced-motion: reduce) {
  .motion *, .motion *::before, .motion *::after { animation: none !important; transition: none !important; }
}
