@import url('https://fonts.googleapis.com/css?family=Open+Sans|Nova+Mono');
@import url("https://fonts.googleapis.com/css?family=Roboto+Mono&display=swap");
:root {
  --font-header: 'Nova Mono', monospace;
  --font-text: 'Open Sans', sans-serif;
  --color-theme: hsl(0, 0%, calc((100 - var(--light, 95)) * 1%));
  --color-bg: #282B24;

  --animation-sentence: 'You know you\'re supposed to leave, right?';
  --animation-duration: 40s;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  width: 100%;
  font-family: var(--font-text);
  color: hsl(0, 0%, calc((100 - var(--light, 95)) * 1%));
  background: hsl(0, 0%, calc(var(--light) * 1%));
  overflow: hidden;
}
.container {
  text-align: center;
  margin: 1rem 0.5rem 0;
}
.container h1 {
  font-family: 'Roboto Mono', monospace;
  font-size: 6rem;
	text-transform: uppercase;
	align-self: end;
	text-align: center;
}
.container p {
  font-weight: bold;
  font-size: 3rem;
  margin: 0rem 0 3rem;
  text-align: center;
}
svg.keyhole {
  height: 82px;
  width: 82px;
  opacity: 0;
  visibility: hidden;
  /* define an animation for the keyhole, to introduce it
  paused by default, run with a timeout in JavaScript
  */
  animation: showKey 0.5s 0.5s paused ease-out forwards;
}
svg.key {
  height: 164px;
  width: 164px;
  position: absolute;
  opacity: 0;
  top:1px;
  visibility: hidden;
  /* define an animation for the keyhole, to introduce it
  paused by default, run with a timeout in JavaScript
  */
  animation: showKey 0.5s 0.5s paused ease-out forwards;
}
.ghost {
  /* border: 1px solid tomato; */
  position: absolute;
  bottom: 5px;
  left: calc(50% - 100px);
  width: 200px;
  height: 200px;
  /* have the ghost move to the right and to the left of the screen, turning to its central position and repeating the animation twice */
  animation: hoverGhost calc(var(--animation-duration)/2) ease-in-out 2;

}
.bird {
  /* border: 1px solid tomato; */
  position: absolute;
  bottom: 100px;
  left: calc(50% - 100px);
  width: 100px;
  height: 100px;
  /* have the ghost move to the right and to the left of the screen, turning to its central position and repeating the animation twice */
  animation: hoverGhost calc(var(--animation-duration)/2) ease-in-out 2;

}
.bird2 {
  /* border: 1px solid tomato; */
  position: absolute;
  left: calc(50% - 100px);
  width: 100px;
  height: 100px;
  bottom: 30%;
  /* have the ghost move to the right and to the left of the screen, turning to its central position and repeating the animation twice */
 animation: hoverGhost calc(var(--animation-duration)/2) ease-in-out 2;
}
/* introduce text through a pseudo element, connected to the animated div */


/* define the keyframe animations
- hoverghost to have the ghost move right, left and then back to its default position
- showKey to introduce into view the key (and keyhole) svg
- showText, showNewText, showFinalText to show the different strings (the implementation is quite quirky and primed for optimization)
 */
@keyframes hoverGhost {
  25% {
    transform: translateX(20vw);
  }
  75% {
    transform: translateX(-20vw);
  }
}

@keyframes showKey {
  to {
    opacity: 1;
    visibility: visible;
  }
}


/* alter the text changing the value of the custom property, weary of changing its value when the pseudo element is hidden and changing its value in the last keyframe (as the animation gives this value as per the "forwards" value of the fill-mode property)  */
@keyframes showText {
  2% {
    opacity: 1;
    visibility: visible;
  }
  98% {

    opacity: 1;
    visibility: visible;
  }
  99% {
    --animation-sentence: 'You know you\'re supposed to leave, right?';
    opacity: 0;
    visibility: hidden;
  }
  100% {
    --animation-sentence: 'What number will be open in the next draw?...';
  }
}
@keyframes showNewText {
  2% {
    --animation-sentence: 'What number will be open in the next draw?...';
    opacity: 1;
    visibility: visible;
  }
  98% {

    opacity: 1;
    visibility: visible;
  }
  99% {
    --animation-sentence: 'What number will be open in the next draw?...';
    opacity: 0;
    visibility: hidden;
  }
  100% {
    --animation-sentence: 'Okay, you seem to care about this. Here\'s a key just for you';
  }
}
@keyframes showFinalText {
  2% {
    opacity: 1;
    visibility: visible;
  }
  98% {
    opacity: 1;
    visibility: visible;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }

}

#app {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.iOtDzm {
    display: flex;
    -webkit-box-align: center;
    align-items: center;
    -webkit-box-pack: center;
    justify-content: center;
}
.kfZKbw {
    display: inline-grid;
    gap: 0px 1rem;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
}


@media only screen and (max-width: 500px) {
.bird2 {
  /* border: 1px solid tomato; */
  position: absolute;
  left: calc(50% - 100px);
  width: 100px;
  height: 100px;
  bottom: 20%;
  /* have the ghost move to the right and to the left of the screen, turning to its central position and repeating the animation twice */
 animation: hoverGhost calc(var(--animation-duration)/2) ease-in-out 2;
}
}