/* NAV-E motion: small, slow and CSS-only (nothing extra to download).
   Anyone with Reduce Motion turned on gets the still version: everything sits inside this media query. */
@media (prefers-reduced-motion: no-preference) {

  /* ---- Buttons and controls ---- */
  .btn, .btn2, .result, .tabs a, .swap, .link {
    transition: transform .14s ease-out, box-shadow .14s ease-out, filter .14s ease-out;
    -webkit-tap-highlight-color: transparent;
  }
  .btn:active, .btn2:active { transform: translateY(2px) scale(.985); filter: brightness(.96); }
  .result:active { transform: scale(.985); }
  .tabs a:active { transform: scale(.94); }
  .swap:active { transform: rotate(180deg); transition-duration: .3s; }
  /* toggles: the knob slides with a small overshoot */
  .switch { transition: background-color .2s ease-out; }
  .switch::after { transition: left .32s cubic-bezier(.34, 1.56, .64, 1); }
  /* the orange scribble under the current tab draws itself in */
  .tabs a[aria-current] .mark path { stroke-dasharray: 46; animation: nave-draw .45s ease-out both; }

  /* ---- Screen entrances: blocks fade up into place, one after another ---- */
  #app > * > * { animation: nave-rise .42s cubic-bezier(.2, .7, .3, 1) both; }
  #app > * > :nth-child(1), #app > * > .sky { animation: none; }   /* the blue header and skyline stay put */
  #app > * > :nth-child(2) { animation-delay: .04s; }
  #app > * > :nth-child(3) { animation-delay: .10s; }
  #app > * > :nth-child(4) { animation-delay: .16s; }
  #app > * > :nth-child(n+5) { animation-delay: .22s; }
  .result { animation: nave-rise .4s cubic-bezier(.2, .7, .3, 1) both; }
  .result:nth-of-type(2) { animation-delay: .08s; } .result:nth-of-type(3) { animation-delay: .16s; }

  /* ---- Bay header weather ---- */
  .sky-boat { transform-box: fill-box; transform-origin: 50% 100%; animation: nave-bob 4.5s ease-in-out infinite; }
  .sky-waves { animation: nave-drift 7s ease-in-out infinite alternate; }
  .sky-clouds { animation: nave-drift-slow 16s ease-in-out infinite alternate; }
  .sky-rain { stroke-dasharray: 4 5; animation: nave-fall .9s linear infinite; }
  .sky-flood { transform-box: fill-box; animation: nave-ripple 5s ease-in-out infinite alternate; }
  .sky-sun { transform-box: fill-box; transform-origin: center; animation: nave-glow 6s ease-in-out infinite; }

  /* ---- Gator ---- */
  .panel .gator { transform-origin: 50% 100%; animation: nave-hop .7s cubic-bezier(.3, 1.4, .5, 1) .15s both; }
  .panel .gator.pose-checking { animation: nave-hop .7s cubic-bezier(.3, 1.4, .5, 1) .15s both, nave-sway 2.4s ease-in-out .9s infinite; }
  .panel .gator.pose-thumbs-up { transform-origin: 50% 80%; animation: nave-pop .55s cubic-bezier(.3, 1.6, .5, 1) .15s both; }
  .panel .gator.pose-closure, .panel .gator.pose-roadwork { animation: nave-hop .7s cubic-bezier(.3, 1.4, .5, 1) .15s both, nave-nod 3.2s ease-in-out 1s infinite; }
  .panel.wide .gator { animation: nave-rise .5s ease-out .1s both; }

  @keyframes nave-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  @keyframes nave-draw { from { stroke-dashoffset: 46; } to { stroke-dashoffset: 0; } }
  @keyframes nave-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-1.2px) rotate(-3deg); } }
  @keyframes nave-drift { from { transform: translateX(-5px); } to { transform: translateX(5px); } }
  @keyframes nave-drift-slow { from { transform: translateX(-7px); } to { transform: translateX(7px); } }
  @keyframes nave-fall { to { stroke-dashoffset: -9; } }
  @keyframes nave-ripple { from { transform: translateX(-4px) scaleY(1); } to { transform: translateX(4px) scaleY(1.08); } }
  @keyframes nave-glow { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.08); opacity: .88; } }
  @keyframes nave-hop { 0% { opacity: 0; transform: translateY(8px) scale(.96); } 60% { opacity: 1; transform: translateY(-3px); } 100% { transform: none; } }
  @keyframes nave-sway { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
  @keyframes nave-pop { 0% { opacity: 0; transform: scale(.8); } 70% { opacity: 1; transform: scale(1.05); } 100% { transform: none; } }
  @keyframes nave-nod { 0%, 70%, 100% { transform: rotate(0); } 80% { transform: rotate(-2deg); } 90% { transform: rotate(1deg); } }
}
