/* The opening: the robot's face fills the screen, it steps back, waves, and the screen opens. */
#bot.intro,
#bot.opening {
  z-index: 60;
}
#bot.intro {
  pointer-events: auto;
  cursor: pointer;
}

#bot .door {
  position: absolute;
  top: 0;
  bottom: 0;
  display: none;
  width: 50.5%;
  background: #fff;
}
#bot .door:first-child {
  left: 0;
  border-right: 1px solid transparent;
}
#bot .door:nth-child(2) {
  right: 0;
  border-left: 1px solid transparent;
}
#bot.intro .door,
#bot.opening .door {
  display: block;
}
#bot.opening .door {
  border-color: #c9d8e6;
}
#bot.opening .door:first-child {
  animation: bot-door-left 0.95s cubic-bezier(0.7, 0, 0.2, 1) both;
}
#bot.opening .door:nth-child(2) {
  animation: bot-door-right 0.95s cubic-bezier(0.7, 0, 0.2, 1) both;
}

#bot.intro > .bot-stage > svg {
  opacity: 1;
  transition: none;
}
#bot.intro .ground {
  opacity: 0.09;
}

#bot.intro .bot-stage {
  animation: bot-recede 1.7s cubic-bezier(0.5, 0, 0.12, 1) 0.95s both;
}
#bot.intro .eye {
  animation: bot-wake 0.95s ease-out 0.15s both;
}
#bot.intro .smile {
  animation: bot-smile 0.5s ease-out 0.55s both;
}

#botSkip {
  position: absolute;
  bottom: clamp(16px, 4vh, 40px);
  inset-inline-end: clamp(16px, 4vw, 48px);
  padding: 10px 22px;
  border: 0;
  background: #f1f6fb;
  color: #12293f;
  font:
    500 1rem 'IBM Plex Sans Hebrew',
    'Arial Hebrew',
    sans-serif;
  cursor: pointer;
}
#botSkip:hover {
  background: #c9d8e6;
}

/* The wave, used at the opening and again when the robot is complete. */
#bot .wave {
  transform-origin: 186px 352px;
}
#bot .wave-fore {
  transform-origin: 160px 474px;
}
#bot.waving [data-part='armR'] .wave {
  animation: bot-arm-up 1.5s cubic-bezier(0.3, 0, 0.2, 1) both;
}
#bot.waving [data-part='armR'] .wave-fore {
  animation: bot-hand 1.5s ease-in-out both;
}

@keyframes bot-recede {
  from {
    transform: translateY(var(--bot-drop)) scale(var(--bot-close));
  }
  to {
    transform: none;
  }
}
@keyframes bot-wake {
  0%,
  20% {
    transform: scaleY(0.06);
  }
  45%,
  70% {
    transform: scaleY(1);
  }
  80% {
    transform: scaleY(0.06);
  }
  100% {
    transform: scaleY(1);
  }
}
@keyframes bot-smile {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes bot-door-left {
  to {
    transform: translateX(-101%);
  }
}
@keyframes bot-door-right {
  to {
    transform: translateX(101%);
  }
}
