/* Motion: only opacity and transform, short, and never sideways. Each rule answers "what just happened?".
   Nothing here delays a click or a key. All of it is off when the computer or the person asks for less
   motion (base.css), so every screen is complete without it. Durations and curves are in base.css. */

@media (prefers-reduced-motion: no-preference) {
  @keyframes fade-in { from { opacity: 0; } }
  @keyframes rise { from { opacity: 0; transform: translateY(2px); } }
  @keyframes sheet-up { from { transform: translateY(100%); } }
  @keyframes band-down { from { opacity: 0; transform: translateY(-100%); } }
  @keyframes swing { 0%, 100% { transform: rotate(0deg); } 30% { transform: rotate(12deg); } 62% { transform: rotate(-8deg); } }
  @keyframes draw { from { stroke-dashoffset: 34; } to { stroke-dashoffset: 0; } }
  @keyframes arrive { from { opacity: 0; transform: scale(0.8); } }
  @keyframes settle { from { background: var(--ok-bg); } }
  @keyframes progress { 0% { transform: scaleX(0); } 60% { transform: scaleX(0.8); } 100% { transform: scaleX(1); opacity: 0; } }

  /* A new screen, once its data is here, fades in over the last one. */
  .enter-fade > * { animation: fade-in var(--m1) var(--ease) both; }
  /* A file that has just arrived (an upload, something put back) settles into the list. */
  .row.landed { animation: settle 900ms var(--ease); }
  .row, .place, .tile, .rail a, .tabs a, .menu button, .pick button { transition: background var(--m1) var(--ease), color var(--m1) var(--ease), box-shadow var(--m1) var(--ease), border-color var(--m1) var(--ease); }
  .head.picked-now > .picked, .head.picked-now > .btn { animation: fade-in var(--m1) var(--ease) both; }
  .side.enter > * { animation: fade-in var(--m1) var(--ease) both; }
  .sheet { animation: sheet-up var(--m3) var(--ease) both; }
  .scrim { animation: fade-in var(--m2) var(--ease) both; }
  .dlg[open], .menu { animation: rise var(--m1) var(--ease) both; }
  .dlg[open]::backdrop { animation: fade-in var(--m1) var(--ease) both; }
  .viewer { animation: fade-in var(--m1) var(--ease) both; }
  .band:not([hidden]) { animation: band-down var(--m2) var(--ease) both; }
  .bell.rang .ic { animation: swing 480ms var(--ease); transform-origin: 50% 12%; }
  .ic.drawn { stroke-dasharray: 34; animation: draw var(--m3) var(--ease) both; }
  .here .avatar.new { animation: arrive var(--m2) var(--ease) both; }
  .ring .bar { transition: stroke-dashoffset var(--m2) linear; }
  .tray:not([hidden]) { animation: rise var(--m2) var(--ease) both; }
  .said:not([hidden]) { animation: fade-in var(--m1) var(--ease) both; }
  .waiting .top::after { animation: progress 1.4s var(--ease) infinite; }
}

/* While the next screen loads: a thin line under the top bar, and the last screen a little quieter. */
.top { position: relative; }
.waiting .top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--forest); transform-origin: left; }
.main[aria-busy="true"] { opacity: 0.7; transition: opacity var(--m1) var(--ease); }
