
.book {
    transform-style: preserve-3d;
    position: relative;
    height: 400px;
    cursor: pointer;
    backface-visibility: visible;
}

.front, .back, .page1, .page2, .page3, .page4, .page5, .page6 {
    transform-style: preserve-3d;
    position: absolute;
    width: 400px;
    height: 100%;
    top: 0;
    left: 0;
    transform-origin: left center;
    transition: transform .5s ease-in-out, box-shadow .35s ease-in-out;
}

.front, .back {
    background: #448c74;
}

.front, .page1, .page3, .page5 {
    border-bottom-right-radius: .5em;
    border-top-right-radius: .5em;
}

.back, .page2, .page4, .page6 {
    border-bottom-right-radius: .5em;
    border-top-right-radius: .5em;
}

.front {
    animation: rotate_front 1.3s linear;
    animation-play-state: paused;
    animation-delay: calc(var(--scroll) * -1.3s);
    animation-fill-mode: forwards;
}

.page1 {
    background: #efefef;
    animation: rotate_page1 1.3s linear;
    animation-play-state: paused;
    animation-delay: calc(var(--scroll) * -1.3s);
    animation-fill-mode: forwards;
}

.page2 {
    background: #efefef;
    animation: rotate_page2 1.3s linear;
    animation-play-state: paused;
    animation-delay: calc(var(--scroll) * -1.3s);
    animation-fill-mode: forwards;
}

.page3 {
    background: #f5f5f5;
    animation: rotate_page3 1.3s linear;
    animation-play-state: paused;
    animation-delay: calc(var(--scroll) * -1.3s);
    animation-fill-mode: forwards;
}

.page4 {
    background: #f5f5f5;
    animation: rotate_page4 1.3s linear;
    animation-play-state: paused;
    animation-delay: calc(var(--scroll) * -1.3s);
    animation-fill-mode: forwards;
}

.page5 {
    padding: 1rem;
    background: #fafafa;
    animation: rotate_page5 1.3s linear;
    animation-play-state: paused;
    animation-delay: calc(var(--scroll) * -1.3s);
    animation-fill-mode: forwards;
}


.page6 {
    background: #fdfdfd;
    animation: rotate_page6 1.3s linear;
    animation-play-state: paused;
    animation-delay: calc(var(--scroll) * -1.3s);
    animation-fill-mode: forwards;
}

.back {
    background: #fdfdfd;
    animation: rotate_back 1.3s linear;
    animation-play-state: paused;
    animation-delay: calc(var(--scroll) * -1.3s);
    animation-fill-mode: forwards;
}

.fade-in-section {
    opacity: 0;
    transform: translateY(20vh);
    visibility: hidden;
    transition: opacity 0.6s ease-out, transform 1.2s ease-out;
    will-change: opacity, visibility;
}

.fade-in-section.active {
    opacity: 1;
    transform: none;
    visibility: visible;
}


:root {
    --scroll: 0;
}


@keyframes rotate_front {
    to {
        transform: rotateY(-160deg) scale(1.1);
        box-shadow: 0 1em 3em 0 rgba(0, 0, 0, .2);

    }
}

@keyframes rotate_page1 {
    to {
        transform: rotateY(-150deg) scale(1.1);
        box-shadow: 0 1em 3em 0 rgba(0, 0, 0, .2);
    }
}

@keyframes rotate_page2 {
    to {
        transform: rotateY(-30deg) scale(1.1);
        box-shadow: 0 1em 3em 0 rgba(0, 0, 0, .2);
    }
}

@keyframes rotate_page3 {
    to {
        transform: rotateY(-140deg) scale(1.1);
        box-shadow: 0 1em 3em 0 rgba(0, 0, 0, .2);
    }
}

@keyframes rotate_page4 {
    to {
        transform: rotateY(-40deg) scale(1.1);
        box-shadow: 0 1em 3em 0 rgba(0, 0, 0, .2);
    }
}

@keyframes rotate_page5 {
    to {
        transform: rotateY(-130deg) scale(1.1);
        box-shadow: 0 1em 3em 0 rgba(0, 0, 0, .2);
    }
}

@keyframes rotate_page6 {
    to {
        transform: rotateY(-50deg) scale(1.1);
        box-shadow: 0 1em 3em 0 rgba(0, 0, 0, .2);
    }
}

@keyframes rotate_back {
    to {
        transform: rotateY(-20deg) scale(1.1);
    }
}


.page-loading {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-transition: all .4s .2s ease-in-out;
    transition: all .4s .2s ease-in-out;
    background-color: #fff;
    opacity: 0;
    visibility: hidden;
    z-index: 9999;
}

.dark-mode .page-loading {
    background-color: #121519;
}

.page-loading.active {
    opacity: 1;
    visibility: visible;
}

.page-loading-inner {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    text-align: center;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
    -webkit-transition: opacity .2s ease-in-out;
    transition: opacity .2s ease-in-out;
    opacity: 0;
}

.page-loading.active > .page-loading-inner {
    opacity: 1;
}

.page-loading-inner > span {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: normal;
    color: #6f788b;
}

.dark-mode .page-loading-inner > span {
    color: #fff;
    opacity: .6;
}

.page-spinner {
    display: inline-block;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: .75rem;
    vertical-align: text-bottom;
    background-color: #d7dde2;
    border-radius: 50%;
    opacity: 0;
    -webkit-animation: spinner .75s linear infinite;
    animation: spinner .75s linear infinite;
}

.dark-mode .page-spinner {
    background-color: rgba(255, 255, 255, .25);
}

@-webkit-keyframes spinner {
    0% {
        -webkit-transform: scale(0);
        transform: scale(0);
    }
    50% {
        opacity: 1;
        -webkit-transform: none;
        transform: none;
    }
}

@keyframes spinner {
    0% {
        -webkit-transform: scale(0);
        transform: scale(0);
    }
    50% {
        opacity: 1;
        -webkit-transform: none;
        transform: none;
    }
}
