/* motion_vt.css (motion review 2026-11-14, lane MOF). Load AFTER motion_present.css. Removing its one link line reverts it.
   Screen-to-screen View Transitions, entry and exit by @starting-style, and the end of replayed entrances. Pairs with views/ainx_motion.js
   (AinMotion.go, the ainx-re and ainx-enter classes). Durations and curves: compute_foundry/out/design_review/REFERENCE_MOTION_NOTES.md.
   RULE (fcp/tests_reduced_motion.py reads this file): every transition, animation, @keyframes, @starting-style and ::view-transition rule
   here stands inside the one "prefers-reduced-motion: no-preference" block, so a reader who asks for reduced motion gets a cut. Outside
   that block this file may only turn motion off. */

:root{
  --mv-enter:cubic-bezier(0,0,.38,.9);   /* something arrives: starts at speed, settles */
  --mv-exit:cubic-bezier(.2,0,1,.9);     /* something leaves: accelerates away */
  --mv-move:cubic-bezier(.2,0,.38,.9);   /* something stays and moves */
  --mv-fast:110ms;--mv-menu:150ms;--mv-panel:240ms;--mv-page:300ms;
}

/* A repaint of a screen that is already open replays no entrance: nothing entered. (The entrance itself is redesign.css, RU-377.) */
.ainx.ainx-re>div,.ainx.ainx-re>section,.ainx.ainx-re>footer,
.ainx.ainx-re .tbl tbody tr,.ainx.ainx-re .bar b,.ainx.ainx-re .mbar b,.ainx.ainx-re .cen i,.ainx.ainx-re .wseg.on,.ainx.ainx-re .col{animation:none}

/* Where the browser can run an entry transition, the commodity panel's hand-built keyframe fade steps aside for it (old path = fallback). */
@supports (transition-behavior:allow-discrete){
  .ainx [data-cmh-panel].ainx-enter{animation:none}
}

/* ---- stills (graphics review 2026-11-14): layout only, nothing here moves. They live in this file because redesign.css ends with its
   width queries and every rule after them must stay inside one (tests_p13_responsive). ---- */
/* graphics review 2026-11-14: with a producer card open the state head is one short band (the state and its two figures), never a clipped
   one; the card is the subject and takes the height */
.ainx [data-ainx-statehead][data-ainx-headmin]{grid-template-columns:clamp(150px,12vw,300px) minmax(0,1fr) !important;max-height:none !important;overflow:visible !important}
.ainx [data-ainx-statehead][data-ainx-headmin]>div:nth-child(n+3){display:none}
.ainx [data-ainx-statehead][data-ainx-headmin]>div{padding-top:10px !important;padding-bottom:10px !important}
.ainx [data-ainx-statehead][data-ainx-headmin]>div:nth-child(2) .eb{display:none}
.ainx [data-ainx-statehead][data-ainx-headmin]>div:nth-child(2) .kv{display:flex;flex-wrap:wrap;gap:4px 28px;align-items:baseline}
/* graphics review 2026-11-14: an opened firm uses the width it has (its label and value rows in two columns), not a 78 character strip */
.ainx [data-firm-detail]{max-width:none !important;columns:2 360px;column-gap:40px}
.ainx [data-firm-detail]>div{break-inside:avoid}

@media (prefers-reduced-motion: no-preference){

  /* ---- screen change: the old screen leaves fast, the new one arrives, and the map, the title and the headline figure travel ---- */
  /* the names (set while ainx_motion.js holds its class on <html>, and only where one element would carry the name) */
  html.ainx-vt-map :is([data-ainx-nscene3d],[data-ainx-sscene3d],[data-ainx-scene3d],[data-ainx-acscene]){view-transition-name:ainx-map}
  html.ainx-vt-hero :is([data-ainx-hero],[data-ainx-earlyhero]){view-transition-name:ainx-hero}
  ::view-transition-group(*){animation-duration:var(--mv-page);animation-timing-function:var(--mv-move)}
  /* lane OP3 (motion judges, c1: both screens readable at once mid crossfade): the old screen leaves in 110 ms, the new one enters after it */
  ::view-transition-old(root){animation-duration:110ms;animation-timing-function:var(--mv-exit)}
  ::view-transition-new(root){animation-duration:240ms;animation-delay:40ms;animation-fill-mode:both;animation-timing-function:var(--mv-enter)}
  ::view-transition-old(ainx-map),::view-transition-new(ainx-map){animation-duration:var(--mv-page);height:100%;object-fit:cover;object-position:50% 50%;overflow:clip}
  ::view-transition-old(ainx-hero),::view-transition-new(ainx-hero){height:100%;width:auto;object-fit:contain;object-position:0 50%}
  ::view-transition-old(ainx-hero){animation-duration:var(--mv-fast)}
  ::view-transition-new(ainx-hero){animation-duration:200ms}

  /* ---- entry: a panel, popover or drawer that was not there before (ainx-enter is set by ainx_motion.js before the first paint) ---- */
  @supports (transition-behavior:allow-discrete){
    .ainx-enter{
      transition:opacity var(--mv-panel) var(--mv-enter),translate var(--mv-panel) var(--mv-enter);
    }
    @starting-style{
      .ainx-enter{opacity:0;translate:0 6px}
    }
    /* menus and popovers: shorter, and they drop from their button */
    .ainx-enter[data-cb-pop],.ainx-enter[data-ainx-keynotes]{transition-duration:var(--mv-menu)}
    @starting-style{
      .ainx-enter[data-cb-pop]{opacity:0;translate:0 -4px}
      .ainx-enter[data-ainx-keynotes]{opacity:0;translate:0 4px}
    }
    /* OPE: an overlay (Data as of, Model cards, the audit log, the committee page) dims in and its card rises 8 px from where it lands;
       the how-AIN-built-this popover fades in beside its figure. Entry only: the close is a cut, faster than the entry by having no length. */
    .pp-ov{transition:opacity var(--mv-menu) var(--mv-enter)}
    .pp-ov .pp-ov-card{transition:opacity var(--mv-panel) var(--mv-enter),translate var(--mv-panel) var(--mv-enter)}
    .pp-how{transition:opacity var(--mv-menu) var(--mv-enter),translate var(--mv-menu) var(--mv-enter)}
    @starting-style{
      .pp-ov{opacity:0}
      .pp-ov .pp-ov-card{opacity:0;translate:0 8px}
      .pp-how{opacity:0;translate:0 4px}
    }
    /* OPE (ban list 16): the copy of a screen that leaves, on the path without View Transitions, fades out in 160 ms on the exit curve
       instead of holding for 240 ms and fading over 600 ms; the leaving screen never sits as a pale veil over the one that arrived */
    @keyframes ainx-ghost-out-fast{from{opacity:1}to{opacity:0}}
    .ainx-ghost{animation:ainx-ghost-out-fast 160ms var(--mv-exit) both !important}
    /* a drawer slides from its own edge */
    @starting-style{
      .ainx [data-cmh-panel].ainx-enter{opacity:0;translate:24px 0}
    }

    /* ---- entry AND exit for things shown and hidden by display (the table of the map): the exit finishes before display goes ---- */
    [data-ainx-maptable]{
      transition:opacity var(--mv-menu) var(--mv-enter),translate var(--mv-menu) var(--mv-enter),display var(--mv-fast) allow-discrete;
    }
    [data-ainx-maptable][style*="display: none"],[data-ainx-maptable][style*="display:none"]{opacity:0;translate:0 4px;transition-duration:var(--mv-fast);transition-timing-function:var(--mv-exit)}
    @starting-style{
      [data-ainx-maptable]{opacity:0;translate:0 4px}
    }
  }
}
