/* Page-open intro: while the page loads normally underneath, the fialab logo appears in the middle
   of the screen and "lands" in its place in the header within 2s. Driven by js/intro.js.
   The layer is transparent (no backdrop). Safety net: if the script never runs, the flying logo
   fades out on its own after 3.5s. */
#fl-intro {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: transparent;
  pointer-events: none;
  animation: fl-intro-failsafe .5s ease 3.5s forwards;
}

#fl-intro img {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(60vw, 420px);
  height: auto;
  max-width: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transform-origin: 0 0;
  will-change: transform, opacity;
}

/* the real header logo stays hidden until the flying one has landed on it */
body:has(> #fl-intro:not(.is-done)) #header-outer #logo img {
  visibility: hidden;
}

#fl-intro.is-done {
  animation: none;
  opacity: 0;
  transition: opacity .45s ease;
}

@keyframes fl-intro-failsafe {
  to { opacity: 0; visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  #fl-intro { display: none; }
  body:has(> #fl-intro:not(.is-done)) #header-outer #logo img { visibility: visible; }
}
