/* css/nav.css — screen-change animations, all of them.
 *
 * Which one runs is decided by lib/ui/nav-transitions.mjs; app.js's
 * showScreen() marks BOTH screens with data-nav="<kind>" for --nav-ms and
 * keeps the outgoing one painted as .leaving (untappable), so they move
 * together. transform/opacity only — compositor work, no repaint per frame.
 */
:root {
  --nav-ms: 380ms;
  --nav-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.screen.leaving {
  display: flex;
  pointer-events: none;
}
.screen[data-nav] {
  animation-duration: var(--nav-ms);
  animation-timing-function: var(--nav-ease);
  animation-fill-mode: both;
}

/* forward: the new screen slides in from the right, over the old one, which
 * drifts a little to the left underneath. */
.screen.active[data-nav="forward"] {
  z-index: 2;
  animation-name: navInFromRight;
  box-shadow: -16px 0 32px rgba(0, 0, 0, 0.12);
}
.screen.leaving[data-nav="forward"] { z-index: 1; animation-name: navDriftLeft; }

/* back: the mirror — the old screen slides off to the right, uncovering the
 * one underneath as it drifts back into place. */
.screen.active[data-nav="back"] { z-index: 1; animation-name: navDriftBack; }
.screen.leaving[data-nav="back"] {
  z-index: 2;
  animation-name: navOutToRight;
  box-shadow: -16px 0 32px rgba(0, 0, 0, 0.12);
}

/* fade: a change of scene (to/from the splash) or the same frame with new
 * content (dish step <-> Kész). Nothing moves. */
.screen.active[data-nav="fade"] { z-index: 2; animation-name: navFadeIn; }
.screen.leaving[data-nav="fade"] { z-index: 1; }

/* zoom: welcome -> the menu opens up. */
.screen.active[data-nav="zoom"] { z-index: 2; animation-name: navZoomIn; }
.screen.leaving[data-nav="zoom"] { z-index: 1; }

@keyframes navInFromRight { from { transform: translateX(100%); } to { transform: none; } }
@keyframes navDriftLeft   { from { transform: none; } to { transform: translateX(-30%); } }
@keyframes navDriftBack   { from { transform: translateX(-30%); } to { transform: none; } }
@keyframes navOutToRight  { from { transform: none; } to { transform: translateX(100%); } }
@keyframes navFadeIn      { from { opacity: 0; } to { opacity: 1; } }
@keyframes navZoomIn      { from { transform: scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
