/* ============================================================
   ZIMPACT AWARDS — Single-Page Application layer (css/app.css)

   Load AFTER css/main.css.
   This file only manages the "one page at a time" behaviour:

   • Every page of the app is a <section class="view"> inside
     <main id="app">. Only the view marked .is-active is shown.
   • .is-active  — the incoming view (runs the enter animation)
   • .is-leaving — the outgoing view (runs the exit animation);
     it is temporarily positioned above the incoming view so the
     swap reads as a clean crossfade without layout jumps.

   All theme tokens (.gold, fonts, surfaces) live in main.css.
   ============================================================ */

/* ---- View visibility ------------------------------------ */
.view {
  display: none; /* one page at a time */
}

/* Keep the outgoing view on screen long enough to animate.   */
.main,
#app {
  position: relative; /* anchor for the floating leaving view */
}

.view.is-active,
.view.is-leaving {
  display: block;
}

.view.is-active {
  animation: ziaViewIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.view.is-leaving {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 40;
  pointer-events: none; /* never block the arriving view */
  animation: ziaViewOut 0.18s ease both;
}

@keyframes ziaViewIn {
  from { opacity: 0; transform: translateY(18px); filter: blur(3px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

@keyframes ziaViewOut {
  from { opacity: 1; transform: translateY(0);    filter: blur(0); }
  to   { opacity: 0; transform: translateY(-10px); filter: blur(3px); }
}

/* Views are not focus-targets; the router keeps the heading   */
/* focusable for keyboard users but never draws the ring.      */
.view h1:focus {
  outline: none;
}

/* ---- SPA nav states --------------------------------------- */
/* Desktop links already have `.nav-link.active` styling in     */
/* main.css (gold underline). The mobile menu has none, so give */
/* the active item a gold tint there.                           */
.mm-link.active {
  color: var(--gold-bright, #fce23a);
}

/* ---- Reduced motion --------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .view.is-active,
  .view.is-leaving {
    animation: none;
  }
}

/* ---- JS-required fallback (no-JS users) -------------------- */
/* Without JavaScript nothing can switch views, so only the     */
/* home view can ever be reached. Shown via <noscript>.         */
@supports (display: none) {
  #app.noscript .view:not(#view-home) { display: none; }
}