/* Logo flash shown on every page change.
   - Arriving at a page (button, Back, Forward, refresh): the overlay starts solid,
     the logo flashes, then the overlay fades away. Pure CSS, so it plays even
     before any JavaScript runs.
   - Leaving with a button: transition.js adds .leave so the overlay fades in first. */
#flash{
  position:fixed;inset:0;z-index:10;
  background:#faf9f6;               /* off-white so the black logo always shows */
  display:flex;align-items:center;justify-content:center;
  pointer-events:none;              /* clicks go straight through to the page underneath */
  animation:flash-enter 1.2s ease forwards;
}
#flash img{width:min(70vw,500px);height:auto;animation:logo-flash 1.2s linear forwards}

@keyframes flash-enter{
  0%,75%{opacity:1;visibility:visible}
  100%{opacity:0;visibility:hidden}
}
@keyframes logo-flash{
  0%{opacity:1} 15%{opacity:0} 30%{opacity:1} 45%{opacity:0} 60%{opacity:1} 100%{opacity:1}
}

#flash.leave{animation:flash-leave .35s ease forwards}
#flash.leave img{animation:none;opacity:1}
@keyframes flash-leave{
  0%{opacity:0;visibility:visible}
  100%{opacity:1;visibility:visible}
}

@media (prefers-reduced-motion:reduce){
  #flash,#flash img{animation-duration:.5s}
}
