/* R3.26 — three beats: respond / unfold / arrive.
 * Content is visible before JavaScript. No infinite or scroll-scrubbed motion.
 */
html[data-motion="r326"] {
  --motion-respond:180ms;
  --motion-unfold:320ms;
  --motion-arrive:620ms;
  --motion-ease:cubic-bezier(.22,1,.36,1);
  --motion-press:cubic-bezier(.2,.7,.3,1);
}

/* The hero controller still owns its entrance / Replay action. Its text must
   remain legible even if loading, scripting or an animation is interrupted. */
html[data-motion="r326"] body.homepage-remaster #hero [data-hero-copy],
html[data-motion="r326"] body.homepage-remaster #hero [data-hero-notes] {
  opacity:1!important;
}

@media (prefers-reduced-motion:no-preference) {
  html[data-motion="r326"] body :is(
    .button,.r6-button,.payment-button,.commerce-card-detail,
    .core-plan-entry__details,.creator-story__link,.sfw-studio-button,
    .freeze-menu-button,.locale-trigger,.sfw-close-control,
    .scene3-selector-control,.sfw-studio-filters button,
    .portrait-dialog-rail button,.house-view-card,.sfw-cat-send
  ) {
    transition:background-color var(--motion-respond) var(--motion-ease),
      border-color var(--motion-respond) var(--motion-ease),
      color var(--motion-respond) var(--motion-ease),
      box-shadow var(--motion-respond) var(--motion-ease),
      scale var(--motion-respond) var(--motion-press)!important;
  }
  html[data-motion="r326"] body :is(
    .button,.r6-button,.payment-button,.commerce-card-detail,
    .core-plan-entry__details,.creator-story__link,.sfw-studio-button,
    .freeze-menu-button,.locale-trigger,.sfw-close-control,
    .scene3-selector-control,.sfw-studio-filters button,
    .portrait-dialog-rail button,.house-view-card,.sfw-cat-send
  ):active:not(:disabled):not([aria-disabled="true"]) {
    scale:.985;
    transition-duration:90ms!important;
  }

  /* One entrance per overlay, retaining its native focus and history owner.
     Product detail's earlier nested entrance is disabled to avoid two layers
     moving at different speeds. Closing is immediate and never traps focus. */
  html[data-motion="r326"] body dialog[open]:is(
    .r3-product-dialog,.freeze-dialog,#portrait-dialog,.sfw-cat-panel,
    .tutorial-dialog,.commerce-lightbox
  ) {
    animation:sfw-r326-unfold var(--motion-unfold) var(--motion-ease);
  }
  html[data-motion="r326"] body dialog[open].freeze-drawer {
    animation:sfw-r326-drawer var(--motion-unfold) var(--motion-ease);
  }
  html[data-motion="r326"] body .r3-product-dialog #a3-product-detail {
    animation:none;
  }
  html[data-motion="r326"] body dialog[open]::backdrop {
    animation:sfw-r326-backdrop var(--motion-respond) ease-out;
  }
  html[data-motion="r326"] body :is(.locale-panel,.locale-menu):not([hidden]) {
    transform-origin:top right;
    animation:sfw-r326-unfold var(--motion-respond) var(--motion-ease);
  }
  html[data-motion="r326"] body :is(#faq,#published-help) details[open]>:not(summary) {
    animation:sfw-r326-answer var(--motion-unfold) var(--motion-ease);
  }
  html[data-motion="r326"] body :is(
    .atelier-wayfinder__arrow,.creator-story__link>span,
    .studio-collection-path__action>span,.house-thumb-copy>span,
    .exhibition-card-copy>span
  ) {
    transition:transform var(--motion-respond) var(--motion-ease)!important;
  }
}

@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  /* Lift the print, never its cropped image. Existing source geometry stays
     intact and touch devices have no sticky hover or pointer-follow effects. */
  html[data-motion="r326"] body :is(
    .oct-directory-art,.showroom-art,.r3-portrait-frame,
    .studio-collection-path__visual,.house-feature__visual
  ) {
    transition:translate var(--motion-unfold) var(--motion-ease),
      box-shadow var(--motion-unfold) var(--motion-ease),
      border-color var(--motion-respond) var(--motion-ease)!important;
  }
  /* Portrait links already lift in the gallery stylesheet. Retain that owner
     instead of translating their inner image frame a second time. */
  html[data-motion="r326"] body.character-showcase .exhibition-card>a {
    transition:transform var(--motion-unfold) var(--motion-ease),
      box-shadow var(--motion-unfold) var(--motion-ease),
      border-color var(--motion-respond) var(--motion-ease)!important;
  }
  html[data-motion="r326"] body :is(
    [data-r6-family]:hover .oct-directory-art,
    .showroom-sale-card:hover .showroom-art,
    .studio-collection-path:hover .studio-collection-path__visual
  ) {
    translate:0 -3px;
  }
  /* Treat a directory card as one printed object. Its fitted artwork keeps
     its own crop while the complete card lifts and gently enlarges. */
  html[data-motion="r326"] body .r320-directory-grid>[data-r6-family] {
    position:relative;
    transform-origin:center;
    transition:translate 280ms var(--motion-ease),scale 280ms var(--motion-ease),
      box-shadow 280ms var(--motion-ease),border-color 180ms ease!important;
  }
  html[data-motion="r326"] body .r320-directory-grid>[data-r6-family]:hover {
    z-index:2;
    translate:0 -5px;
    scale:1.015;
    box-shadow:0 4px 0 #e8b5cb,0 16px 28px #27272720;
  }
  html[data-motion="r326"] body .r320-directory-grid>[data-r6-family]:hover .oct-directory-art {
    translate:none;
  }
  html[data-motion="r326"] body #categories .portrait-card__image {
    transition:scale 280ms var(--motion-ease),box-shadow 280ms var(--motion-ease)!important;
  }
  html[data-motion="r326"] body #categories .portrait-card:hover .portrait-card__image {
    scale:1.035;
    box-shadow:0 8px 24px #00000036;
  }
  html[data-motion="r326"] body :is(
    .atelier-wayfinder>a:hover .atelier-wayfinder__arrow,
    .creator-story__link:hover>span,
    .studio-collection-path:hover .studio-collection-path__action>span,
    .house-view-card:hover .house-thumb-copy>span,
    .exhibition-card>a:hover .exhibition-card-copy>span
  ) {
    transform:translateX(3px);
  }
}

@keyframes sfw-r326-unfold {
  from { opacity:.88; translate:0 8px; }
  to { opacity:1; translate:0 0; }
}
@keyframes sfw-r326-drawer {
  from { opacity:.92; translate:-18px 0; }
  to { opacity:1; translate:0 0; }
}
@keyframes sfw-r326-backdrop {
  from { opacity:0; }
  to { opacity:1; }
}
@keyframes sfw-r326-answer {
  from { opacity:.8; translate:0 4px; }
  to { opacity:1; translate:0 0; }
}

@media (prefers-reduced-motion:reduce) {
  html[data-motion="r326"], html[data-motion="r326"] body {
    scroll-behavior:auto!important;
  }
  html[data-motion="r326"] body :is(
    .button,.r6-button,.payment-button,.commerce-card-detail,
    .core-plan-entry__details,.creator-story__link,.sfw-studio-button,
    .freeze-menu-button,.locale-trigger,.sfw-close-control,
    .scene3-selector-control,.sfw-studio-filters button,
    .portrait-dialog-rail button,.house-view-card,.sfw-cat-send,
    .oct-directory-art,.showroom-art,.r3-portrait-frame,
    .studio-collection-path__visual,.house-feature__visual,
    .atelier-wayfinder__arrow,.creator-story__link>span,
    .studio-collection-path__action>span,.house-thumb-copy>span,
    .exhibition-card-copy>span,.locale-panel,.locale-menu,dialog[open],
    .r320-directory-grid>[data-r6-family],#categories .portrait-card__image
  ) {
    animation:none!important;
    transition:none!important;
    translate:none!important;
    scale:none!important;
  }
  html[data-motion="r326"] body :is(#faq,#published-help) details[open]>:not(summary) {
    animation:none!important;
  }
  html[data-motion="r326"] body dialog[open]::backdrop {
    animation:none!important;
  }
}

/* A cold image still needs decoding before it can safely carry fitted copy.
   Keep the current scene present and make that bounded wait visible. */
html[data-motion="r326"] body #categories[data-art-loading="true"] #category-panel::after {
  content:"Preparing scene…";
  position:absolute;
  top:12px;
  right:12px;
  z-index:6;
  padding:9px 13px;
  border:1px solid #e1b4c9;
  border-radius:9px;
  background:#fff7fb;
  color:#424242;
  box-shadow:0 3px 0 #b7809b;
  font:600 12px/1.4 var(--font-body,system-ui);
  pointer-events:none;
}
html[data-motion="r326"] body .r320-directory-grid>[data-r6-family]:focus-within {
  outline:2px solid #747474;
  outline-offset:5px;
}
