/* Load last. Keep the original art, layout and visible motion; avoid repeatedly
   painting large surfaces or reserving a compositor layer for every product.
   performance.js owns visibility/viewport markers. No motion preference toggle. */

/* Pausing, rather than removing animations, resumes their original timeline.
   Observe whole sections with a viewport margin, never every product card. */
html[data-towa-perf-hidden="true"] *,
html[data-towa-perf-hidden="true"] *::before,
html[data-towa-perf-hidden="true"] *::after,
.page:not(.active),
.page:not(.active) *,
.page:not(.active)::before,
.page:not(.active)::after,
.page:not(.active) *::before,
.page:not(.active) *::after,
[data-towa-perf-offscreen="true"],
[data-towa-perf-offscreen="true"] *,
[data-towa-perf-offscreen="true"]::before,
[data-towa-perf-offscreen="true"]::after,
[data-towa-perf-offscreen="true"] *::before,
[data-towa-perf-offscreen="true"] *::after {
  animation-play-state: paused !important;
}

/* These native promotions are hidden by store-focus.css. Descendants may
   otherwise retain their infinite timelines even while their page is active. */
body.towa-store-focus #page-home > .hero *,
body.towa-store-focus #page-home > .hero *::before,
body.towa-store-focus #page-home > .hero *::after,
body.towa-store-focus #page-shop #shopSpotlight *,
body.towa-store-focus #page-shop #shopSpotlight *::before,
body.towa-store-focus #page-shop #shopSpotlight *::after {
  animation-play-state: paused !important;
}

/* Hundreds of idle cards do not need permanent GPU layers. Actual transforms
   still animate normally; the two official-background layers and roulette
   track keep their own deliberate will-change declarations. */
.hero-card,
.service-card,
.direct-service-card,
.crew-card,
.item-card,
.bundle-card,
.calc-box,
.recharge-box {
  will-change: auto !important;
}

/* Native hover states/shadows remain, but do not rasterize a changing filter
   or shadow throughout every frame of a card transition. */
.item-card,
.bundle-card,
.service-card,
.direct-service-card,
.crew-card {
  transition-property: transform, opacity, border-color !important;
}
.item-card img,
.bundle-card img {
  transition-property: transform, opacity !important;
}

/* These sticky surfaces already have nearly opaque original backgrounds.
   Sampling the scrolling shop behind them adds work without changing content. */
.th332-header,
#page-shop .shop-discovery-bar,
#page-shop .shop-sidebar,
#page-shop .bundle-object-count {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Keep the entrance trajectories and timing; blur interpolation requires an
   additional raster pass per entering card, including all shop sections. */
.motion-reveal {
  filter: none !important;
  transition-property: opacity, transform !important;
}
@keyframes pagePro {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
@keyframes towaStageUp {
  from { opacity: 0; transform: translateY(25px); }
  to { opacity: 1; transform: none; }
}
@keyframes towaConsoleEnter {
  from { opacity: 0; transform: translate3d(42px,20px,0) rotateY(-6deg) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes towaCardWave {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes signalCopyIn {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}
@keyframes consoleDock {
  from { opacity: 0; transform: translate3d(36px,18px,0) rotateY(-5deg); }
  to { opacity: 1; transform: none; }
}

/* The existing perspective grid moves by one complete native 72px cell.
   A transform replaces full-viewport background-position painting, with the
   same existing texture/perspective and no change to document geometry. */
@keyframes gridDrift {
  from {
    transform: perspective(650px) rotateX(58deg)
      translate3d(0,calc(var(--scroll-shift,0px) * .12),-110px);
  }
  to {
    transform: perspective(650px) rotateX(58deg)
      translate3d(72px,calc(var(--scroll-shift,0px) * .12 + 72px),-110px);
  }
}

/* Retain each collection heading's original gradient and entrance line draw.
   Its continuous accent now breathes using opacity instead of repainting it. */
@keyframes towaCollectionFlow {
  0%, 100% { opacity: 1; }
  50% { opacity: .68; }
}
