/* Garage — motion (DESIGN.md 1.8, PLAN.md Batch 5 "tasteful motion"). CSS only, no animation library.
   Transform and opacity only, so lists stay at 60 fps; nothing here animates layout properties.
   Screen change, sheet, backdrop and toast live in base.css / components.css (already tokenised).
   `prefers-reduced-motion: reduce` switches every animation and transition off (base.css), so state is instant.
   Print stays static (print.css). */

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes bar-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes plate-flip {
  from { opacity: 0; transform: perspective(700px) rotateX(-62deg) translateY(-6px); }
  to { opacity: 1; transform: none; }
}
@keyframes tick {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* Card entrance: a short stagger when a screen opens (JS adds .is-entering on route change, not on every redraw). */
.screen.is-entering .card {
  animation: rise 0.28s ease both;
}
.screen.is-entering .card:nth-child(2) { animation-delay: 40ms; }
.screen.is-entering .card:nth-child(3) { animation-delay: 80ms; }
.screen.is-entering .card:nth-child(4) { animation-delay: 120ms; }
.screen.is-entering .card:nth-child(5) { animation-delay: 160ms; }
.screen.is-entering .card:nth-child(6) { animation-delay: 200ms; }
.screen.is-entering .card:nth-child(n + 7) { animation-delay: 240ms; }

/* Part-timer bars grow from the left to their value whenever they are drawn (screen opens, value changes). */
.bar > i {
  transform-origin: 0 50%;
  animation: bar-fill 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Qatar plate: a short flip when you move to a car. */
.screen.is-entering .hero-plate .qplate {
  transform-origin: 50% 0;
  animation: plate-flip 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Open-order day counter: ticks when the shown day number changes. */
.tick { animation: tick 0.35s ease both; }

/* Press feedback, same idea as the keypad (:active scale 0.96). */
.primary, .backup-btn, .btn-plus, .danger-btn, .ghost-btn, .ghost-wide, .icon-btn, .back, .cal-btn {
  transition: transform 0.15s ease;
}
.nav button { transition: background 0.2s, color 0.2s, padding 0.2s, transform 0.15s ease; }
.primary:active, .backup-btn:active, .btn-plus:active, .danger-btn:active, .ghost-btn:active, .ghost-wide:active,
.icon-btn:active, .back:active, .cal-btn:active, .nav button:active {
  transform: scale(0.96);
}
