/*
 * Motion (2026-11-12): short, quiet animations so the pages feel smooth
 * without slowing anyone down. Everything is 100-200 ms, eases out, and
 * stops entirely for "reduce motion" (style.css turns every animation and
 * transition off under prefers-reduced-motion).
 *
 * The page entrance animates transform only while it runs (fill: backwards),
 * so nothing is left transformed afterwards -- a transform left on a parent
 * would trap fixed pop-ups and sticky headers inside it.
 */
:root {
    --motion-fast: 120ms;
    --motion-base: 170ms;
    --motion-ease: cubic-bezier(.2, .7, .3, 1);
}

/* Page content arrives with a short fade and lift. */
@keyframes qa-page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.main-content > :not(.modal):not(script):not(style) {
    animation: qa-page-in var(--motion-base) var(--motion-ease) backwards;
}

/* Bootstrap pop-ups: quicker than its default and with a slight zoom. */
.modal.fade { transition: opacity var(--motion-fast) linear; }
.modal.fade .modal-dialog { transition: transform var(--motion-base) var(--motion-ease); transform: translateY(8px) scale(.98); }
.modal.show .modal-dialog { transform: none; }
/* Buttons in a pop-up do not grow on hover (style.css .btn:hover) -- the jump
   made their text flicker as the pointer crossed them (2026-11-16). */
.modal .btn:hover { transform: none; }
.modal-backdrop.fade { transition: opacity var(--motion-fast) linear; }

/* The accreditation and Archive pop-ups. */
/* `translate` and `scale` (not `transform`) so the animation adds to where the
   pop-up is placed -- centred on a computer, a bottom sheet on a phone --
   instead of replacing it (on a phone it slid in from the wrong place, 2026-11-12). */
@keyframes qa-pop-in { from { opacity: 0; translate: 0 8px; scale: .98; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes qa-fade-in { from { opacity: 0; } to { opacity: 1; } }
.acc-modal.is-open .acc-modal-box { animation: qa-pop-in var(--motion-base) var(--motion-ease); }
.acc-modal.is-open .acc-modal-backdrop { animation: qa-fade-in var(--motion-fast) linear; }

/* Menus open with a quick drop. */
/* `translate`, not `transform`: Bootstrap places a menu with an inline
   transform, and animating `transform` replaced it, so a menu (the Repository's
   row actions, 2026-11-12) first showed at the top of the screen, then jumped
   into place. */
@keyframes qa-menu-in { from { opacity: 0; translate: 0 -4px; } to { opacity: 1; translate: 0 0; } }
.dropdown-menu.show, .acc-menu:not([hidden]) { animation: qa-menu-in var(--motion-fast) var(--motion-ease); }

/* Opened groups and folders: their rows fade in. */
@keyframes qa-row-in { from { opacity: 0; } to { opacity: 1; } }
.rd-group.is-open .rd-child { animation: qa-row-in var(--motion-fast) linear; }
details[open] > :not(summary) { animation: qa-row-in var(--motion-fast) linear; }

/* Buttons, links, cards and rows answer the pointer smoothly. */
.btn, .act, .acc-tool, .nav-link, .sidebar a, .card, .group-card, .arc-row, .list-group-item {
    transition: background-color var(--motion-fast) ease, border-color var(--motion-fast) ease,
                color var(--motion-fast) ease, box-shadow var(--motion-fast) ease, transform var(--motion-fast) ease;
}
.btn:active:not(:disabled), .act:active, .acc-tool:active { transform: scale(.97); }
a.card:hover, a.group-card:hover { transform: translateY(-1px); }

/* Tabs and accordions. */
.tab-pane.fade { transition: opacity var(--motion-fast) linear; }
.collapsing { transition-duration: var(--motion-base); }
