@import url(https://fonts.googleapis.com/css?family=Questrial);

body {
  font-family: "Questrial", sans-serif;
}

.outer {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 400px;
  width: 400px;
  margin-top: -200px;
  margin-left: -200px;
  background: #29434E;
  border-radius: 2px;
  box-shadow: 1px 2px 10px 0px rgba(0, 0, 0, 0.3);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

.circle, .circle-outer {
  position: absolute;
  width: 200px;
  height: 200px;
  top: 65px;
  left: 100px;
  background: #546E7A;
  border-radius: 50%;
}

.circle-outer {
  box-sizing: border-box;
  background: none;
  border: 4px solid #546E7A;
}

.icon {
  position: absolute;
  z-index: 2;
  top: 130px;
  left: 140px;
  transform: translate3d(0, 0, 0);
  fill: none;
  stroke-width: 2px;
  stroke: #ECEFF1;
  stroke-linecap: square;
  stroke-dasharray: 325 325;
}
.icon.mail {
  width: 120px;
  height: 70px;
  stroke-dashoffset: 0;
}
.icon.plane {
  width: 120px;
  height: 110px;
  stroke-dashoffset: 325;
}

#check-box {
  display: none;
}

.button {
  position: absolute;
  z-index: 10;
  width: 200px;
  height: 40px;
  top: 290px;
  left: 100px;
  background: #ECEFF1;
  color: #29434E;
  text-align: center;
  line-height: 40px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 20px;
  text-transform: uppercase;
  cursor: pointer;
}
.button.reset {
  opacity: 0;
  z-index: 5;
}
.button:hover {
  background: #00ACC1;
  color: #ECEFF1;
}

#check-box:checked ~ .button {
  animation: button 1.5s ease-in-out 1.7s;
  animation-fill-mode: both;
}

#check-box:checked ~ .reset {
  animation: reset 1s ease-in-out 3.7s;
  animation-fill-mode: both;
}

#check-box:checked ~ .circle, #check-box:checked ~ .circle-outer {
  animation: circle 1s ease-in-out;
  animation-fill-mode: both;
}

#check-box:checked ~ .circle-outer {
  animation: circle 0.8s ease-in-out 0.2s;
  animation-fill-mode: both;
}

#check-box:checked ~ .mail {
  stroke-dashoffset: 326;
  transition: stroke-dashoffset 1s ease-in-out;
}

#check-box:checked ~ .plane {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s ease-in-out 0.6s;
  animation: fly 2.4s ease-in-out;
  animation-fill-mode: both;
}

@keyframes button {
  0% {
    transform: scale(1);
  }
  30% {
    background: #00ACC1;
    color: transparent;
    width: 200px;
    left: 100px;
  }
  50%, 60% {
    width: 40px;
    left: 180px;
    transform: scale(1);
  }
  70% {
    transform: scale(1.1);
  }
  100% {
    width: 40px;
    left: 180px;
    background: #5DDEF4;
    color: transparent;
    transform: scale(0);
  }
}
@keyframes reset {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes circle {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  20% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(0);
  }
}
@keyframes fly {
  0%, 50% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  60% {
    transform: translate3d(-10px, 5px, 0) scale(1.05);
  }
  70% {
    opacity: 1;
  }
  85% {
    opacity: 0;
  }
  100% {
    transform: translate3d(300px, -150px, 0) scale(0.4);
    opacity: 0;
  }
}
