/*
 * Unified public-page motion contract for:
 * /gm2, /money, /tutorial, /ddt, /ldxp-shop and /temp-redeem.
 * Visual feedback only. Business state controllers remain authoritative.
 */

body.user-entry-page {
  --apple-motion-ease-out: var(--ease-out, cubic-bezier(.23, 1, .32, 1));
  --apple-motion-ease-standard: var(--ease-in-out, cubic-bezier(.77, 0, .175, 1));
  --apple-motion-hover: var(--motion-base, 180ms);
  --apple-motion-press: var(--motion-fast, 120ms);
  --apple-motion-state: var(--motion-base, 180ms);
  --apple-motion-reveal: var(--motion-slow, 260ms);
  --apple-motion-stagger: 40ms;
  --apple-motion-focus: rgba(138, 90, 23, .34);
  --apple-motion-focus-soft: rgba(138, 90, 23, .12);
}

/*
 * One short entrance establishes hierarchy. It runs once, never blocks input,
 * and only animates opacity and transform.
 */
@keyframes ue-public-enter {
  from {
    opacity: .01;
    transform: translate3d(0, 8px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

body.user-entry-page.user-entry-public-shell-ready .entry-top-nav-shell {
  animation: ue-public-enter var(--apple-motion-reveal) var(--apple-motion-ease-out) both;
}

body.user-entry-page.user-entry-public-shell-ready #entryTop,
body.user-entry-page.user-entry-public-shell-ready #heroSection {
  animation: ue-public-enter var(--apple-motion-reveal) var(--apple-motion-ease-out) 40ms both;
}

/* Existing page reveal hooks are normalized to the same 8px / 260ms rhythm. */
body.op-entry-redesign.ddt-wa-theme.ddtfx-ready [data-ddtfx-reveal],
body.user-entry-page.ddt-wa-theme.ddtfx-ready [data-ddtfx-reveal],
body.user-entry-page.gm2-titanium-surface .gm2-anim-reveal,
body.user-entry-page.shop-wa-theme .shop-anim-in,
body.user-entry-page.money-wa-theme [data-anim-enter],
body.user-entry-page.temp-redeem-wa .tr-anim-in {
  opacity: 1 !important;
  transform: translate3d(0, 8px, 0) !important;
  transition-property: transform, opacity !important;
  transition-duration: var(--apple-motion-reveal) !important;
  transition-timing-function: var(--apple-motion-ease-out) !important;
}

body.user-entry-page.ddt-wa-theme.ddtfx-ready [data-ddtfx-reveal].ddtfx-in,
body.user-entry-page.gm2-titanium-surface .gm2-anim-reveal.gm2-anim-in,
body.user-entry-page.shop-wa-theme .shop-anim-in.is-inview,
body.user-entry-page.money-wa-theme [data-anim-enter].is-in,
body.user-entry-page.temp-redeem-wa .tr-anim-in.is-inview {
  transform: translate3d(0, 0, 0) !important;
}

body.user-entry-page.ddt-wa-theme.ddtfx-ready [data-ddtfx-stagger] > *,
body.user-entry-page.gm2-titanium-surface .gm2-anim-stagger > *,
body.user-entry-page.shop-wa-theme .shop-anim-stagger > *,
body.user-entry-page.temp-redeem-wa .tr-anim-stagger > *,
body.user-entry-page.temp-redeem-wa .user-flow-map .user-flow-step {
  opacity: 1 !important;
  transform: translate3d(0, 8px, 0) !important;
  transition-property: transform, opacity !important;
  transition-duration: var(--apple-motion-reveal) !important;
  transition-timing-function: var(--apple-motion-ease-out) !important;
}

body.user-entry-page.ddt-wa-theme.ddtfx-ready [data-ddtfx-stagger].ddtfx-in > *,
body.user-entry-page.gm2-titanium-surface .gm2-anim-stagger.gm2-anim-in > *,
body.user-entry-page.shop-wa-theme .shop-anim-stagger.shop-anim-in > *,
body.user-entry-page.temp-redeem-wa .tr-anim-stagger.is-inview > *,
body.user-entry-page.temp-redeem-wa .user-flow-map.is-inview .user-flow-step {
  transform: translate3d(0, 0, 0) !important;
}

body.user-entry-page :is(
  .entry-top-nav-link,
  .entry-top-nav-toggle,
  button,
  input[type="button"],
  input[type="submit"],
  .button,
  .btn,
  .hero-link,
  .hero-link-secondary,
  .entry-url-action,
  .notice-link,
  .quick-btn,
  .send-btn,
  .shop-mini-action,
  .shop-next-card,
  .client-platform-card,
  .user-flow-step,
  .step-action
) {
  transition-property: transform, opacity !important;
  transition-duration: var(--apple-motion-hover) !important;
  transition-timing-function: var(--apple-motion-ease-out) !important;
}

body.user-entry-page :is(
  .entry-top-nav-link,
  .entry-top-nav-toggle,
  #openGradeToolBtn,
  #sendPointsBtn,
  #btn
) {
  min-height: 44px;
}

body.user-entry-page :is(
  .entry-top-nav-link,
  .entry-top-nav-toggle,
  button,
  input[type="button"],
  input[type="submit"],
  .button,
  .btn,
  .hero-link,
  .hero-link-secondary,
  .entry-url-action,
  .notice-link,
  .quick-btn,
  .send-btn,
  .shop-mini-action,
  .shop-next-card,
  .step-action
):not(:disabled):not([aria-disabled="true"]):active {
  transform: translate3d(0, 1px, 0) scale(.98) !important;
  transition-duration: var(--apple-motion-press) !important;
}

@media (hover: hover) and (pointer: fine) {
  body.user-entry-page :is(
    .entry-top-nav-link,
    .entry-top-nav-toggle,
    button,
    input[type="button"],
    input[type="submit"],
    .button,
    .btn,
    .hero-link,
    .hero-link-secondary,
    .entry-url-action,
    .notice-link,
    .quick-btn,
    .send-btn,
    .shop-mini-action,
    .shop-next-card,
    .client-platform-card,
    .gm2-service-card,
    .gm2-side-card,
    .shop-channel-card,
    .shop-flow-card,
    .temp-card-visual,
    .user-flow-step,
    .step-action
  ):not(:disabled):not([aria-disabled="true"]):hover {
    transform: translate3d(0, -2px, 0) !important;
  }
}

/* Stable keyboard focus is immediate: keyboard-triggered actions do not animate. */
body.user-entry-page :is(
  a,
  button,
  input,
  select,
  textarea,
  [role="button"]
):focus-visible {
  animation: none !important;
  outline: 2px solid transparent !important;
  outline-offset: 3px !important;
  box-shadow:
    0 0 0 3px var(--apple-motion-focus),
    0 0 0 6px var(--apple-motion-focus-soft) !important;
  transform: none !important;
}

body.user-entry-page #openGradeToolBtn:focus-visible,
body.user-entry-page #pointsSection .quick-btn:focus-visible,
html.tr-motion-ready body.user-entry-page.temp-redeem-wa #btn:focus-visible {
  animation: none !important;
  outline: 2px solid transparent !important;
  outline-offset: 3px !important;
  box-shadow:
    0 0 0 3px var(--apple-motion-focus),
    0 0 0 6px var(--apple-motion-focus-soft) !important;
  transform: none !important;
  transition: none !important;
}

/* Decorative and legacy pulse loops are intentionally removed. */
body.user-entry-page .ddtfx2-idle-breathe,
body.user-entry-page .gm2fx2-bind-pulse,
body.user-entry-page .gm2fx2-summary-pulse,
body.user-entry-page .tr2-value-pop,
body.user-entry-page .tr2-warn-appear,
body.user-entry-page .tr2-summary-flash,
body.user-entry-page .entry-kicker iconify-icon {
  animation: none !important;
}

/*
 * Final legacy-transition guard. Older linked themes may still declare paint
 * transitions; the public shell only permits compositor-safe properties.
 */
html body.user-entry-page.apple-nav-theme.black-gold-entry.op-entry-redesign,
html body.user-entry-page.apple-nav-theme.black-gold-entry.op-entry-redesign::before,
html body.user-entry-page.apple-nav-theme.black-gold-entry.op-entry-redesign::after,
html body.user-entry-page.apple-nav-theme.black-gold-entry.op-entry-redesign *,
html body.user-entry-page.apple-nav-theme.black-gold-entry.op-entry-redesign *::before,
html body.user-entry-page.apple-nav-theme.black-gold-entry.op-entry-redesign *::after {
  transition-property: transform, opacity !important;
}

html body.user-entry-page.op-entry-redesign.ddt-wa-theme.ddtfx-ready .ddt-feature-stats .is-online::after,
html body.user-entry-page.op-entry-redesign.ddt-wa-theme.ddtfx-ready .flash-primary-download.ddtfx2-idle-breathe,
html.motion-ready body.user-entry-page.op-entry-redesign.shop-wa-theme #openShopLinkBtn,
html body.user-entry-page.apple-nav-theme.black-gold-entry.op-entry-redesign.temp-redeem-wa .reward-preview-table {
  animation: none !important;
}

/*
 * The enhanced section rail changes width as a layout state, not as motion.
 * Keep only compositor-friendly movement.
 */
body.user-entry-page.apple-nav-theme.black-gold-entry.op-entry-redesign .entry-section-nav.is-enhanced {
  transition-property: transform !important;
  transition-duration: 200ms !important;
  transition-timing-function: var(--apple-motion-ease-standard) !important;
}

@media (forced-colors: active) {
  body.user-entry-page :focus-visible {
    outline-color: Highlight !important;
    box-shadow: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body.user-entry-page.apple-nav-theme.black-gold-entry.op-entry-redesign,
  html body.user-entry-page.apple-nav-theme.black-gold-entry.op-entry-redesign::before,
  html body.user-entry-page.apple-nav-theme.black-gold-entry.op-entry-redesign::after,
  html body.user-entry-page.apple-nav-theme.black-gold-entry.op-entry-redesign *,
  html body.user-entry-page.apple-nav-theme.black-gold-entry.op-entry-redesign *::before,
  html body.user-entry-page.apple-nav-theme.black-gold-entry.op-entry-redesign *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition-property: none !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }

  body.user-entry-page :is(
    .entry-top-nav-link,
    .entry-top-nav-toggle,
    button,
    input[type="button"],
    input[type="submit"],
    .button,
    .btn,
    .hero-link,
    .hero-link-secondary,
    .entry-url-action,
    .notice-link,
    .quick-btn,
    .send-btn,
    .shop-mini-action,
    .shop-next-card,
    .client-platform-card,
    .gm2-service-card,
    .gm2-side-card,
    .shop-channel-card,
    .shop-flow-card,
    .temp-card-visual,
    .user-flow-step,
    .step-action
  ) {
    transition-property: opacity !important;
    transition-duration: 80ms !important;
    transform: none !important;
  }

  body.user-entry-page.ddt-wa-theme.ddtfx-ready [data-ddtfx-reveal],
  body.user-entry-page.ddt-wa-theme.ddtfx-ready [data-ddtfx-stagger] > *,
  body.user-entry-page.gm2-titanium-surface .gm2-anim-reveal,
  body.user-entry-page.gm2-titanium-surface .gm2-anim-stagger > *,
  body.user-entry-page.shop-wa-theme .shop-anim-in,
  body.user-entry-page.shop-wa-theme .shop-anim-stagger > *,
  body.user-entry-page.money-wa-theme [data-anim-enter],
  body.user-entry-page.temp-redeem-wa .tr-anim-in,
  body.user-entry-page.temp-redeem-wa .tr-anim-stagger > *,
  body.user-entry-page.temp-redeem-wa .user-flow-map .user-flow-step {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
  }

  html body.user-entry-page.apple-nav-theme.black-gold-entry.op-entry-redesign .entry-section-nav.is-enhanced {
    transition-property: none !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
}
