/* Secret Heaven — interaction motion only. Load after the existing styles.
   Independent scale preserves each control's existing transform and gradients. */
@media (prefers-reduced-motion: no-preference) {
  body :is(
    .micro-button, .icon-button, .menu-toggle, .release-tab,
    .platform-switch button, .tiny-links a, .license-row a,
    .shp-artwork-commission__cta, .shp-artwork-service-link,
    .shp-artwork-footer-link, .shp-conditions-button,
    .shp-sc-primary, .shp-sc-secondary, .shp-support-action,
    .shp-demo-cta, .shp-demo-views button, .shp-private-beatpack-cta,
    .shp-help-launch, .shp-help-chip, .shp-help-close, .shp-help-send,
    .shp-help-links a, .shp-help-handoff a,
    .studio-submit, .studio-guest-link, .studio-guest-secondary, .studio-logout,
    .pack-action-main, .pack-action-secondary, .beat-pack-listen,
    [id="preview-license"], .text-link
  ) {
    /* Targeted overrides compose with the several existing theme layers. */
    transition-property: scale, transform, opacity, color, background-color,
      border-color, box-shadow, filter !important;
    transition-duration: 160ms !important;
    transition-timing-function: cubic-bezier(.23, 1, .32, 1) !important;
  }

  body :is(
    .micro-button, .icon-button, .menu-toggle, .release-tab,
    .platform-switch button, .tiny-links a, .license-row a,
    .shp-artwork-commission__cta, .shp-artwork-service-link,
    .shp-artwork-footer-link, .shp-conditions-button,
    .shp-sc-primary, .shp-sc-secondary, .shp-support-action,
    .shp-demo-cta, .shp-demo-views button, .shp-private-beatpack-cta,
    .shp-help-launch, .shp-help-chip, .shp-help-close, .shp-help-send,
    .shp-help-links a, .shp-help-handoff a,
    .studio-submit, .studio-guest-link, .studio-guest-secondary, .studio-logout,
    .pack-action-main, .pack-action-secondary, .beat-pack-listen,
    [id="preview-license"], .text-link
  ):not(:disabled):not([aria-disabled="true"]):not(.shp-support-disabled):active {
    scale: .985;
    transition-duration: 120ms !important;
  }

  .shop-dialog[open],
  .artwork-dialog[open] {
    animation: shp-motion-panel-in 220ms cubic-bezier(.32, .72, 0, 1);
  }

  .shop-dialog[open]::backdrop,
  .artwork-dialog[open]::backdrop {
    animation: shp-motion-backdrop-in 200ms ease-out;
  }

  .shp-help-panel:not([hidden]) {
    transform-origin: right bottom;
    animation: shp-motion-panel-in 220ms cubic-bezier(.32, .72, 0, 1);
  }

  @media (max-width: 650px) {
    #main-nav.open {
      animation: shp-motion-menu-in 200ms cubic-bezier(.32, .72, 0, 1);
    }
  }

  @keyframes shp-motion-panel-in {
    from { opacity: .72; transform: translateY(8px) scale(.985); }
    to { opacity: 1; transform: none; }
  }

  @keyframes shp-motion-menu-in {
    from { opacity: .72; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
  }

  @keyframes shp-motion-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

/* Keep keyboard focus immediate, including inside unrevealed sections. */
body :focus-visible {
  transition: none !important;
}

html.js-reveal .reveal:focus-within {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* Touch must not retain the existing hover lifts after a tap.
   Leave the theme's colors, borders, shadows and decorations intact. */
@media (hover: none), (pointer: coarse) {
  body :is(
    .micro-button, .icon-button, .menu-toggle, .tiny-links a, .license-row a,
    .shp-artwork-commission__cta, .shp-artwork-service-link,
    .shp-artwork-footer-link, .shp-conditions-button,
    .shp-sc-primary, .shp-sc-secondary, .shp-support-action,
    .shp-demo-cta, .shp-demo-views button, .shp-private-beatpack-cta,
    .shp-help-launch, .shp-help-chip, .shp-help-close, .shp-help-send,
    .shp-help-links a, .shp-help-handoff a,
    .studio-submit, .studio-guest-link, .studio-guest-secondary, .studio-logout,
    .pack-action-main, .pack-action-secondary, .beat-pack-listen,
    [id="preview-license"], .text-link
  ):hover {
    transform: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }

  html.js-reveal .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  #main-nav.open,
  .shop-dialog[open], .artwork-dialog[open],
  .shop-dialog[open]::backdrop, .artwork-dialog[open]::backdrop,
  .shp-help-panel:not([hidden]) {
    animation: none !important;
    transition: none !important;
  }

  body :is(
    .micro-button, .icon-button, .menu-toggle, .release-tab,
    .platform-switch button, .tiny-links a, .license-row a,
    .shp-artwork-commission__cta, .shp-artwork-service-link,
    .shp-artwork-footer-link, .shp-conditions-button,
    .shp-sc-primary, .shp-sc-secondary, .shp-support-action,
    .shp-demo-cta, .shp-demo-views button, .shp-private-beatpack-cta,
    .shp-help-launch, .shp-help-chip, .shp-help-close, .shp-help-send,
    .shp-help-links a, .shp-help-handoff a,
    .studio-submit, .studio-guest-link, .studio-guest-secondary, .studio-logout,
    .pack-action-main, .pack-action-secondary, .beat-pack-listen,
    [id="preview-license"], .text-link
  ) {
    scale: none !important;
    transition: none !important;
  }
}
