/* Some good ideas here: https://bashooka.com/coding/overlay-menu-animation-examples/ */

:root {
  --menu-transition-time: 0.7s;
  --menu-bg-colour: #ef900c;
}
#menu .background {
  /* start position of the menu -- corners work well, also top: 50%; left: 50%; */
  top: 0;
  right: 0;
}

#menu .button {
  position: fixed;
  top: 0.5em;
  right: 0.5em;
  width: 2em;
  height: 2em;
  z-index: 999;
  cursor: pointer;
}

#menu .background {
  transform-origin: center center;
  transition: transform var(--menu-transition-time);
  will-change: transform;
  pointer-events: none;
  visibility: hidden;
  position: fixed;
  height: min(4vw, 4vh);
  width: min(4vw, 4vh);
  border-radius: 50%;
  background: var(--menu-bg-colour);
  cursor: pointer;
  z-index: 100;
  user-select: none;
}
#menu.been-activated .background {
  visibility: visible;
}

#menu.active .background {
  animation: var(--menu-transition-time) forwards menu-showing;
}
@keyframes menu-showing {
  0% {
    transform: scale(1);
    opacity: 0.0;
  }
  70% {
    opacity: 1.0;
  }
  100% {
    transform: scale(200);
  }
}
#menu:not(.active) .background {
  animation: var(--menu-transition-time) forwards menu-hiding;
}
@keyframes menu-hiding {
  0% {
    transform: scale(200);
  }
  30% {
    opacity: 1.0;
  }
  100% {
    transform: scale(1);
    opacity: 0.0;
  }
}
