/* Custom Properties */
:root {
  --background-color: rgb(6, 22, 38);
  --color: rgb(215, 222, 233);
  --title-bar-background: rgb(5, 18, 30);
  --header-color: rgb(45, 63, 82);
}

/* Default Styling */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;

  max-width: 38rem;
  width: 100vw;
  height: 100vh;

  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;

  margin: auto;

  background-color: var(--background-color);
  color: var(--color);

  overflow: hidden;
}

/* HEADER, DUCK PHRASE */
header {
  position: relative;
  top: 0;
  left: 0;
  margin-top: 2rem;
  width: 100vw;

  user-select: none;
}

header h1 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--header-color);
  text-align: center;
}

header #duck-phrase {
  font-size: 1.2rem;
  font-weight: 500;
  font-style: italic;
  text-shadow: 2px 2px 7px black;

  margin-top: 0.7rem;
  text-align: center;

  opacity: 0;
  animation: fade 5s ease-in;
}

header #duck-phrase.show-again {
  animation: showAgain 5s ease-in;
}

/* DUCK IMAGES */
main {
  width: 200px;
  height: 200px;

  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;

  user-select: none;
}

.imageContainer {
  width: 200px;
  height: 200px;
  position: relative;
}

img#duck-body {
  position: absolute;
  width: 100%;
  top: 56px;

  z-index: -2;

  animation: rotate 1.4s 1 ease, jump 0.3s 1 ease 1.4s,
    littleJump 5s infinite cubic-bezier(0.6, 0, 0, 0.9) 1.4s;
}

img#duck-eyes {
  position: absolute;
  width: 100%;
  top: 56px;

  z-index: -1;

  animation: rotate 1.4s 1 ease, jump 0.3s 1 ease 1.4s;
}

img#duck-eyelids-closed {
  position: absolute;
  width: 100%;

  top: 56px;

  z-index: 0;

  animation: rotate 1.4s 1 ease, jump 0.3s 1 ease 1.4s,
    hideShow 3s infinite cubic-bezier(1, 0, 0, 1),
    littleJump 5s infinite cubic-bezier(0.6, 0, 0, 0.9) 1.4s;
}

/* ANIMATIONS */
@keyframes hideShow {
  0% {
    opacity: 0;
  }
  90% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes breathing {
  0% {
    transform: skewX(0deg);
  }
  100% {
    transform: skewX(1deg);
  }
}

@keyframes littleJump {
  85% {
    top: 56px;
  }
  90% {
    top: 54px;
  }
  95% {
    top: 56px;
  }
}

@keyframes jump {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-16px);
  }
  100% {
    transform: translateY(0px);
  }
}

@keyframes fade {
  0% {
    opacity: 0;
  }
  30% {
    opacity: 0;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
