/* SKY APPS P3 · Motion System · 2026-11-20
 * Restrained feedback: short duration, no perpetual decorative movement,
 * transform and opacity only for spatial transitions. */
:root {
  --sky-motion-fast: 135ms;
  --sky-motion-mid: 205ms;
  --sky-motion-enter: 275ms;
  --sky-motion-ease: cubic-bezier(.2,.75,.25,1);
}
@keyframes sky-p3-appear {
  from {opacity:0; transform:translate3d(0,9px,0)}
  to {opacity:1;transform:translate3d(0,0,0)}
}
@keyframes sky-p3-dialog {
  from {opacity:0;transform:translate3d(0,11px,0) scale(.985)}
  to {opacity:1;transform:translate3d(0,0,0) scale(1)}
}
@keyframes sky-p3-fade {from {opacity:0}to{opacity:1}}
@keyframes sky-p3-spinner {to {transform:rotate(360deg)}}
@media (prefers-reduced-motion:no-preference) {
  /* Intro only, once per load: keep the hero layout geometrically unchanged. */
  .site-shell .hero-v3 .hero-copy {
    animation:sky-p3-appear 360ms var(--sky-motion-ease) both;
  }
  .site-shell .hero-v3 .hero-art-v3 {
    animation:sky-p3-appear 470ms var(--sky-motion-ease) 55ms both;
  }
  /* Cards are fully stable during catalog polling; animate deliberate filter changes only. */
  .site-shell #app-grid.sky-p3-filter-change > .app-card {
    animation:sky-p3-appear 235ms var(--sky-motion-ease) both;
  }
  .site-shell #app-grid.sky-p3-filter-change > .app-card:nth-child(2) {animation-delay:35ms}
  .site-shell #app-grid.sky-p3-filter-change > .app-card:nth-child(3) {animation-delay:65ms}
  .site-shell #app-grid.sky-p3-filter-change > .app-card:nth-child(n+4) {animation-delay:85ms}
  #guide-dialog[open],
  #sky-p2-detail[open] {
    animation:sky-p3-dialog 235ms var(--sky-motion-ease) both;
  }
  #guide-dialog[open]::backdrop,
  #sky-p2-detail[open]::backdrop {
    animation:sky-p3-fade 200ms ease-out both;
  }
  /* Admin uses independent views, not full-document reloads. Never animate login restoration. */
  body[data-sky25-section] #dashboard-screen:not([hidden]) .sky25-view:not([hidden]),
  body[data-sky25-section] #dashboard-screen:not([hidden]) .sky25-page-title:not([hidden]) {
    animation:sky-p3-appear 225ms var(--sky-motion-ease) both;
  }
  /* Account page: account subsections only, never the auth gate. */
  #user-section:not([hidden]) .account-layout .view:not([hidden]) {
    animation:sky-p3-appear 230ms var(--sky-motion-ease) both;
  }
  /* The wheel already handles physical spin and result reveal. Animate just entry. */
  #sky-wheel-overlay:not([hidden]) .sky-wheel-modal {
    animation:sky-p3-dialog 260ms var(--sky-motion-ease) both;
  }
}
/* Disable legacy card-appear on periodic Supabase refresh: keep the catalog stable. */
.site-shell #app-grid > .app-card.card-v2 {animation:none !important}
@media (prefers-reduced-motion:no-preference) {
  .site-shell #app-grid.sky-p3-filter-change > .app-card.card-v2 {
    animation:sky-p3-appear 235ms var(--sky-motion-ease) both !important;
  }
}
/* Hover always signals interactivity; nothing bounces or glows indefinitely. */
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  .site-shell .app-card.card-v2 {
    transition:transform 195ms var(--sky-motion-ease),box-shadow 195ms ease,border-color 195ms ease !important;
  }
  .site-shell .app-card.card-v2:hover {
    transform:translate3d(0,-2px,0) !important;
    box-shadow:0 12px 27px rgba(28,55,78,.10) !important;
    border-color:#c5d5e2 !important;
  }
  .site-shell .hero-platforms button,
  .site-shell .filters .filter,
  .site-shell .app-card.card-v2 .card-actions button,
  .site-shell .app-card.card-v2 .sky-p2-detail-link,
  .site-shell .hero-primary,
  .site-shell .sky-account-trigger,
  .site-shell .nav-links a,
  .sky-p2-detail-actions button,
  .guide-actions :is(button,a),
  #dashboard-screen .sky-admin-sidebar a,
  #dashboard-screen .sky-mobile-navigation a,
  #dashboard-screen .admin-panel button,
  .account-layout button,
  .account-layout a,
  .sky-p2-footer a {
    transition:background-color var(--sky-motion-mid) ease,
      color var(--sky-motion-mid) ease,
      border-color var(--sky-motion-mid) ease,
      box-shadow var(--sky-motion-mid) ease,
      transform var(--sky-motion-fast) ease !important;
  }
  .site-shell .app-card.card-v2 .card-actions button:not(:disabled):hover,
  .site-shell .hero-primary:hover,
  .sky-p2-detail-actions button:not(:disabled):hover {
    transform:translateY(-1px);
  }
  .site-shell .app-card.card-v2 .card-actions button:not(:disabled):active,
  .site-shell .hero-primary:active,
  .sky-p2-detail-actions button:not(:disabled):active {
    transform:scale(.985);
  }
}
/* Responsive: never animate sizing, width or height. */
.site-shell .filters .filter.active,
.site-shell .hero-platforms button[aria-pressed="true"] {
  box-shadow:0 2px 7px rgba(31,70,108,.075);
}
.site-shell .app-card.card-v2 .primary-download:disabled:not(.disabled)::before,
.site-shell .app-card.card-v2 .primary-download[aria-busy="true"]::before {
  content:"";display:inline-block;width:12px;height:12px;
  margin-right:7px;vertical-align:-2px;
  border:2px solid currentColor;border-right-color:transparent;
  border-radius:50%;animation:sky-p3-spinner .75s linear infinite;
}
.site-shell .app-card.card-v2 .primary-download[aria-busy="true"],
.site-shell .app-card.card-v2 .primary-download:disabled {cursor:progress}
#dashboard-screen .sky-admin-sidebar a:focus-visible,
#dashboard-screen .sky-mobile-navigation a:focus-visible,
.site-shell :is(.filter,.guide-button,.download-button,.sky-p2-detail-link):focus-visible,
#sky-p2-detail button:focus-visible {
  outline:2px solid #6b9bd6;outline-offset:3px;
}
@media (prefers-reduced-motion:reduce) {
  .site-shell .hero-v3 .hero-copy,
  .site-shell .hero-v3 .hero-art-v3,
  .site-shell #app-grid > .app-card,
  .site-shell .guide-dialog,
  #sky-p2-detail,
  #dashboard-screen .sky25-view,
  #dashboard-screen .sky25-page-title,
  #user-section .view,
  #sky-wheel-overlay .sky-wheel-modal {
    animation:none !important;
    transform:none !important;
  }
  .site-shell .app-card.card-v2,
  .site-shell .filters .filter,
  .site-shell .app-card button,
  #dashboard-screen a,
  #dashboard-screen button {
    transition:none !important;
  }
  .site-shell .app-card.card-v2 .primary-download:disabled:not(.disabled)::before,
  .site-shell .app-card.card-v2 .primary-download[aria-busy="true"]::before {animation:none !important}
}

