/* AgentGuard motion system (design pass, Nov 27 2026). One small sheet, loaded after the Receipt sheets.
   Three durations, two curves, one stagger. Every page animation is built from these and nothing else.

   tick    120ms  a state flips in place: a cell seals, a tab changes, a refusal stamps
   step    240ms  one thing arrives: a block enters, a decision mark lands, a receipt row prints
   travel  480ms  a request crosses from the agent to the gate
   stagger  60ms  the gap between the rows of one receipt (capped at 12 rows)

   ease-out  arrive: anything that lands and stays (enter, land, print)
   ease-io   travel: anything that crosses from one place to another

   Rules the sheet keeps: transform and opacity only; nothing here changes a box's size, so layout never shifts;
   the shipped HTML is the last frame, so with no script or with prefers-reduced-motion the page is the still;
   a container plays once, when motion.js marks it .is-in (35% on screen), and again only from a Replay control. */
.ag-receipt{
  --ag-t-tick:120ms;
  --ag-t-step:240ms;
  --ag-t-travel:480ms;
  --ag-stagger:60ms;
  --ag-ease-out:cubic-bezier(.2,0,0,1);
  --ag-ease-io:cubic-bezier(.4,0,.2,1);
}

/* 1. Enter. A block rises 6px and fades in. Only inside a container motion.js has armed. */
.ag-receipt [data-ag-motion].is-armed .ag-enter{opacity:0;transform:translateY(6px)}
.ag-receipt [data-ag-motion].is-armed.is-in .ag-enter{opacity:1;transform:none;transition:opacity var(--ag-t-step) var(--ag-ease-out),transform var(--ag-t-step) var(--ag-ease-out);transition-delay:calc(var(--i,0) * var(--ag-stagger))}

/* 2. The three decision marks (owner decision 4) and the pending request. 14px, square, no gradient. */
.ag-receipt .ag-mark{position:relative;display:inline-block;flex:none;box-sizing:border-box;width:14px;height:14px;border:2px solid var(--ag-ink);background:transparent;vertical-align:-2px}
.ag-receipt .ag-mark--pending{border:1px dashed var(--ag-empty)}
.ag-receipt .ag-mark--allow{background:var(--ag-ink)}
.ag-receipt .ag-mark--held::after{content:"";position:absolute;left:0;top:0;bottom:0;width:50%;background:var(--ag-ink);transform-origin:left center}
.ag-receipt .ag-mark--refuse{border-color:var(--ag-stamp);background:var(--ag-stamp)}
.ag-receipt .ag-mark--lg{width:22px;height:22px;vertical-align:-4px}

/* 3. A decision lands. Allowed settles in one step. Held settles, then its half fills. Refused stamps in one tick. */
@keyframes ag-m-land{from{opacity:0;transform:scale(1.35)}to{opacity:1;transform:none}}
@keyframes ag-m-half{from{transform:scaleX(0)}to{transform:none}}
.ag-receipt .ag-mark.is-landing{animation:ag-m-land var(--ag-t-step) var(--ag-ease-out) both}
.ag-receipt .ag-mark--held.is-landing::after{animation:ag-m-half var(--ag-t-tick) var(--ag-ease-out) var(--ag-t-step) both}
.ag-receipt .ag-mark--refuse.is-landing{animation-duration:var(--ag-t-tick)}

/* 4. The refusal stamp (words in the display face, stamp red, tilted). Red is used for a refusal and nothing else. */
.ag-receipt .ag-stamp{display:inline-block;padding:2px 7px 1px;border:2px solid var(--ag-stamp);color:var(--ag-stamp);font:700 11px/1.2 var(--ag-display);letter-spacing:.14em;text-transform:uppercase;white-space:nowrap;transform:rotate(-7deg)}
@keyframes ag-m-stamp{from{opacity:0;transform:rotate(-7deg) scale(1.35)}to{opacity:1;transform:rotate(-7deg)}}
.ag-receipt .ag-stamp.is-landing{animation:ag-m-stamp var(--ag-t-tick) var(--ag-ease-out) both}

/* 5. A receipt prints: rows feed down one at a time, top to bottom. Put .ag-print on the list, .is-printing starts it. */
@keyframes ag-m-row{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
.ag-receipt .ag-print.is-printing>*{animation:ag-m-row var(--ag-t-step) var(--ag-ease-out) both;animation-delay:calc(var(--ag-print-wait,0ms) + var(--n,0) * var(--ag-stagger))}
.ag-receipt .ag-print>:nth-child(2){--n:1}.ag-receipt .ag-print>:nth-child(3){--n:2}.ag-receipt .ag-print>:nth-child(4){--n:3}
.ag-receipt .ag-print>:nth-child(5){--n:4}.ag-receipt .ag-print>:nth-child(6){--n:5}.ag-receipt .ag-print>:nth-child(7){--n:6}
.ag-receipt .ag-print>:nth-child(8){--n:7}.ag-receipt .ag-print>:nth-child(9){--n:8}.ag-receipt .ag-print>:nth-child(10){--n:9}
.ag-receipt .ag-print>:nth-child(11){--n:10}.ag-receipt .ag-print>:nth-child(n+12){--n:11}


/* 6. The still. With motion reduced nothing in this sheet moves: every element sits in its last frame. */
@media (prefers-reduced-motion:reduce){
  .ag-receipt [data-ag-motion] .ag-enter{opacity:1!important;transform:none!important;transition:none!important}
  .ag-receipt .ag-mark.is-landing,.ag-receipt .ag-mark--held.is-landing::after,.ag-receipt .ag-stamp.is-landing,.ag-receipt .ag-print.is-printing>*{animation:none!important}
}
