/* Short, finite motion for the real brand controls. No scroll listeners or hidden content. */
body.front-v2.zc25-brand {
  --z4-quick: 135ms;
  --z4-panel: 210ms;
  --z4-out: cubic-bezier(.18,.7,.24,1);
  --z4-hover-shadow: 0 9px 23px -14px #174c9e47, 0 2px 5px #174c9e0b;
}
html[data-theme="dark"] body.front-v2.zc25-brand {
  --z4-hover-shadow: 0 10px 23px -14px #000a, 0 0 0 1px #7baaff28;
}

@keyframes z4-arrive {
  from { opacity: .88; translate: 0 5px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes z4-panel-in {
  from { opacity: .75; translate: 0 7px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes z4-filter-in {
  from { opacity: .83; translate: 0 13px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes z4-shade-in { from { opacity: .45; } to { opacity: 1; } }
@keyframes z4-drawer-in { from { translate: -16px 0; } to { translate: 0 0; } }

/* The legacy front-v2 sheet intentionally suppresses all motion using !important.
   Re-enable only these explicit elements and only with the user's motion preference. */
@media (prefers-reduced-motion: no-preference) {
  body.front-v2.zc25-brand #mainContent :is(.zc25-welcome,.zc25-r3-context) {
    animation: z4-arrive var(--z4-panel) var(--z4-out) both!important;
  }
  body.front-v2.zc25-brand #mainContent .zc25-home [data-z25-feed-panel]:not([hidden]) {
    animation: z4-arrive var(--z4-panel) var(--z4-out) both!important;
  }
  body.front-v2.zc25-brand :is(#zp9-preview-dialog[open],#shareModal.open) {
    animation: z4-panel-in var(--z4-panel) var(--z4-out) both!important;
  }
  body.front-v2.zc25-brand .zc25-filter-dialog[open] {
    animation: z4-filter-in var(--z4-panel) var(--z4-out) both!important;
  }
  body.front-v2.zc25-brand :is(#zp9-preview-dialog,.zc25-filter-dialog)[open]::backdrop,
  body.front-v2.zc25-brand.zc25-nav-open .zc25-drawer-backdrop {
    animation: z4-shade-in var(--z4-panel) ease-out both!important;
  }
  body.front-v2.zc25-brand.zc25-nav-open .zc25-sidebar {animation:z4-drawer-in var(--z4-panel) var(--z4-out) both!important;}
  body.front-v2.zc25-brand .nav-more:is(:hover,:focus-within) .nav-more-dropdown {
    animation: z4-panel-in var(--z4-quick) var(--z4-out) both!important;
  }
  body.front-v2.zc25-brand .nav-more-btn>svg,
  body.front-v2.zc25-brand .zc25-r3-related>svg {
    transition: rotate var(--z4-quick) var(--z4-out), translate var(--z4-quick) var(--z4-out)!important;
  }
  body.front-v2.zc25-brand .nav-more:is(:hover,:focus-within) .nav-more-btn>svg { rotate: 180deg; }
  body.front-v2.zc25-brand .zc25-r3-related:is(:hover,:focus-visible)>svg { translate: 3px 0; }
  body.front-v2.zc25-brand #mainContent :is(.zc25-tool-card,.qd-card,.zs-tool-card,.z6-d-tool,.zc25-scenes>a),
  body.front-v2.zc25-brand #mainContent #zp9-library .zp9-card,
  body.front-v2.zc25-brand #mainContent .art-grid .art-card {
    transition: translate var(--z4-panel) var(--z4-out), border-color var(--z4-quick) ease-out,
                box-shadow var(--z4-panel) var(--z4-out), background-color var(--z4-quick) ease-out!important;
  }
  body.front-v2.zc25-brand :is(.zc25-feed-tabs button,.zc25-search-types button,.zc25-filter-open,.z6-card-action,.zp9-card-actions button,.zc25-r3-related) {
    transition: background-color var(--z4-quick) ease-out, border-color var(--z4-quick) ease-out,
                color var(--z4-quick) ease-out, translate var(--z4-quick) var(--z4-out)!important;
  }
  body.front-v2.zc25-brand :is(.zc25-feed-tabs button,.zc25-search-types button,.zc25-filter-open,.z6-card-action,.zp9-card-actions button):active:not(:disabled) { translate: 0 1px; }
}

@media (hover:hover) and (pointer:fine) {
  body.front-v2.zc25-brand #mainContent :is(.zc25-tool-card,.qd-card,.zs-tool-card,.z6-d-tool,.zc25-scenes>a):hover,
  body.front-v2.zc25-brand #mainContent #zp9-library .zp9-card:hover,
  body.front-v2.zc25-brand #mainContent .art-grid .art-card:hover {
    box-shadow: var(--z4-hover-shadow);
  }
}
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion: no-preference) {
  body.front-v2.zc25-brand #mainContent :is(.zc25-tool-card,.qd-card,.zs-tool-card,.z6-d-tool,.zc25-scenes>a):hover,
  body.front-v2.zc25-brand #mainContent #zp9-library .zp9-card:hover,
  body.front-v2.zc25-brand #mainContent .art-grid .art-card:hover { translate: 0 -2px; }
}

/* On phones the drawer's shade is cheap to composite; scroll, focus and close stay native. */
@media (max-width:1279px) {
  body.front-v2.zc25-brand.zc25-nav-open .zc25-drawer-backdrop { backdrop-filter:none; }
}
@media (prefers-reduced-motion: reduce) {
  body.front-v2.zc25-brand :is(.zc25-sidebar,.zc25-drawer-backdrop,.nav-more-dropdown,#zp9-preview-dialog,#shareModal,.zc25-filter-dialog) {
    animation:none!important; transition:none!important;
  }
  body.front-v2.zc25-brand :is(#zp9-preview-dialog,.zc25-filter-dialog)::backdrop { animation:none!important; }
}
