* {
  box-sizing: border-box;
}

body {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  perspective: 1000px;
}

.book {
  position: relative;
  width: 400px;
  height: 600px;
  transition: 1s;
  transform-style: preserve-3d;
}

.book.flip {
  transform: rotateY(180deg);
}

.rotateLeft {
  transform: rotateY(45deg);
}

.rotateRight {
  transform: rotateY(-45deg);
}

.first-half,
.second-half {
  position: absolute;
  width: 50%;
  height: 100%;
  background-image: url("./imgs/front-cover-half-1.jpg");
  background-size: 100% 100%;
}

.second-half {
  left: 50%;
  background-image: url("./imgs/front-cover-half-2.jpg");
}

.front-cover:before,
.front-cover:after {
  content: "";
  position: absolute;
  background-image: url("./imgs/middle-cover.jpg");
  width: 65px;
  height: 100%;
  background-size: 100% 100%;
  transform-origin: left;
  transform: rotateY(90deg);
}

.front-cover:after {
  right: 0;
  background-image: url("./imgs/middle-cover-2.jpg");
  transform-origin: right;
  transform: rotateY(-90deg);
}

.back-cover {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: url("./imgs/back-cover.jpg");
  background-size: 100% 100%;
  transform: rotateY(180deg) translateZ(65px);
}
