@charset "utf-8";

:root {
  --width: 640px;
}

html,
body {
  height: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: #ddd;
  background-image: radial-gradient(50% 80%, #fff 9%, #cbd5de 82%);
  background-repeat: no-repeat;
  background-size: 200%;
  background-position: center;
}

/* helper */

.h-container {
  max-width: var(--width);
  padding: 1rem;
  box-sizing: border-box;
}

.h-mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.h-gap-s {
  gap: 1rem;
}

.h-gap-m {
  gap: 2rem;
}

.h-gap-l {
  gap: 3rem;
}

.h-gap-xl {
  gap: 4rem;
}

.h-flex {
  display: flex;
}

.h-justify-between {
  justify-content: space-between;
}

.h-justify-center {
  justify-content: center;
}

.h-mt-1 {
  margin-top: 1rem;
}

.h-mt-2 {
  margin-top: 2rem;
}

/* layout */

.header {
  padding: 3rem 2rem;
  text-align: center;
  background-color: #e8eef4;
  border-bottom: solid 1px #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, .1) inset;
}

.header__title {
  font-size: 5rem;
  font-weight: 700;
  color: rgba(0, 0, 0, .4);
  text-shadow: 1px 1px #fff;
}

.section {
  color: rgba(0, 0, 0, .35);
  text-shadow: 1px 1px #fff;
  line-height: 1.7;
}

.section+.section {
  margin-top: 1.5rem;
}

.section__title {
  font-weight: 600;
  font-size: 1.5rem;
}

.flip {
  display: inline-block;
  position: relative;
  width: 120px;
  height: 100px;
  line-height: 100px;
  font-size: 66px;
  text-align: center;
  font-weight: 600;
  color: #4C6377;
  border-radius: 8px;
  box-shadow: 0 20px 30px -10px rgba(0, 0, 0, .1);
}

.flip::before {
  z-index: 2;
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: rgba(16, 21, 26, 0.05);
  box-shadow: 0 1px rgba(255, 255, 255, .3);
  content: "";
}

.flip__top,
.flip__bottom {
  position: absolute;
  left: 0;
  right: 0;
  overflow: hidden;
}

.flip__top {
  top: 0;
  bottom: 50%;
  background-image: linear-gradient(180deg, #eaeef2 10%, #fff 100%);
  border-radius: 10px 10px 0 0;
  box-shadow: 0 1px #fff inset;
}

.flip__bottom {
  top: 50%;
  bottom: 0;
  border-radius: 0 0 10px 10px;
  background-image: linear-gradient(180deg, #fff 100%, #eaeef2 10%);
  line-height: 0;
  box-shadow: 0 -1px rgba(76, 99, 119, 0.3) inset;
}

.flip__num--front .flip__top {
  transform: perspective(160px) rotateX(0deg);
  z-index: 1;
}

.flip__num--back .flip__bottom {
  transform: perspective(160px) rotateX(90deg);
}

.flip__num--front .flip__top {
  transform-origin: 50% 100%;
}

.flip__num--back .flip__bottom {
  transform-origin: 50% 0;
}

.flip-animation .flip__num--front .flip__top {
  animation-name: topToMiddle;
  animation-duration: .3s;
  animation-fill-mode: forwards;
  animation-timing-function: ease-in;
}

.flip-animation .flip__num--back .flip__bottom {
  animation-name: middleToBottom;
  animation-duration: .3s;
  animation-delay: .3s;
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
}

@keyframes topToMiddle {
  from {
    transform: perspective(160px) rotateX(0deg);
  }

  to {
    transform: perspective(160px) rotateX(-90deg);
  }
}

@keyframes middleToBottom {
  from {
    transform: perspective(160px) rotateX(90deg);
  }

  to {
    transform: perspective(160px) rotateX(0deg);
  }
}