/* Page transition — a short fade as a page comes in.
   ==========================================================================
   Prototype scope, like app-header.css: this is the connected prototype's own
   polish, not a design-system decision, so it is not in ce-ui/. The system has
   no motion tokens at all — no duration, no easing — which is itself worth
   noting if motion becomes a real part of the system rather than a handful of
   one-off transitions.

   0.15s ease is not a new number: it is the duration already used by every
   other transition in this prototype (the timeline chevron's rotation, the
   order-detail item toggles, the timeline's summary/detail fade). Reusing it
   keeps the prototype to one motion speed rather than accumulating a second.

   WHY IT IS ON `.page` AND NOT ON `body`
   `.page` is the shell's per-screen scroll container, and the app puts more
   than one of them in a document: orders.html holds a list view and an order
   detail, products.html a list and a product detail, and each pair toggles with
   [hidden] rather than a navigation. Animating `.page` therefore covers both
   things a person would call "opening a page":

     1. A real document load (index -> orders, sidebar -> products). The .page
        renders for the first time and the animation runs.
     2. An in-page view swap (an order row -> that order). The incoming .page
        goes from display:none to displayed, and a CSS animation restarts when
        an element is newly rendered — so the same rule covers it with no JS,
        no class to add on click, and nothing for showDetail()/showList() to
        remember.

   Animating `body` would only ever do the first, and would fade the sidebar and
   global header along with it — chrome that is meant to feel continuous while
   you move around inside it.

   Opacity only. No translate: the shell's header and sidebar stay put, so a
   page sliding under fixed chrome reads as a bug rather than as motion. */

@keyframes app-page-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* `backwards`, not `both` (2026-09-02). Backwards is the half that matters: it
   applies the first keyframe before the animation starts, so there is no frame at
   full opacity ahead of the fade — the flicker the old comment here described.
   Forwards was the half that did damage. An animation with a forwards fill stays
   IN EFFECT after it finishes, and an in-effect animation of opacity keeps its
   element a stacking context permanently — so `.page` was one, and every `.menu`
   inside it was trapped at the page's level, painting under the Orders filter
   drawer no matter what z-index the menu carried. Forwards was buying nothing:
   the last keyframe is opacity: 1, which is the element's own resting value. */
.page,
.index {
  animation: app-page-in 0.15s ease backwards;
}

/* Motion is decoration here — the page is fully usable without it, so it is
   dropped outright rather than shortened. */
@media (prefers-reduced-motion: reduce) {
  .page,
  .index {
    animation: none;
  }
}
