
:root {
    --background-color: #ffffff;
    --color: #000000;
    --font-weight: 400;
    --font-size: 16px;
    --line-height: 1.5;
    --font-family: 'EB Garamond', serif;
    --text-underline-offset: 3px;
    --h1-color: #000000;
    --primary-background: #f0f0f0;
    --card-background-color: #ffffff;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #000000;
        --color: #ffffff;
        --primary-background: #1a1a1a;
        --card-background-color: #121212;
    }
}


body {
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    background-color: var(--background-color);
    color: var(--color);
    font-weight: var(--font-weight);
    font-size: var(--font-size);
    line-height: var(--line-height);
    font-family: var(--font-family);
    text-underline-offset: var(--text-underline-offset);
    text-rendering: optimizeLegibility;
    overflow-wrap: break-word;
    -moz-tab-size: 4;
    -o-tab-size: 4;
    tab-size: 4;
}

main {
    font-family: 'EB Garamond';

    strong {
        font-weight: 800;
    }

    h1 {
        font-family: 'Caesar Dressing';
    }
}

aside {

    h1 {
        font-weight: 400;
        margin-top: 4em;
        margin-bottom: 1.5em;
        font-size: 3.2em;
        line-height: 1;
    }

    h2 {
        font-style: italic;
        font-weight: 400;
        margin-top: 2.1em;
        margin-bottom: 1.4em;
        font-size: 2.2em;
        line-height: 1;
    }

    h3 {
        font-style: italic;
        font-weight: 400;
        font-size: 1.7em;
        margin-top: 2em;
        margin-bottom: 1.4em;
        line-height: 1;
    }


    p,
    dl,
    ol,
    ul {
        font-size: 1.4em;
        line-height: 2em;
    }

    p {
        margin-top: 1.4em;
        margin-bottom: 1.4em;
        padding-right: 0;
        vertical-align: baseline;
    }
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    width: 100%;
}

main {
    padding-left: 12.5%;

    width: 87.5%;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 1440px) {

    main,
    header {
        margin: 0;
    }
}

section>svg,
section>p {
    max-width: 660px;
    width: 80%;
}


@media (max-width: 760px) {
    main {
        width: 100%;
        padding-left: 2rem;
        padding-right: 2rem;
    }

    section>svg,
    section>p {
        width: 100%;
    }
}


html,
body {
    max-width: unset;
}

.root>*:not(header) {
    max-width: 1440px;
}

.root {
    height: 150vh;
    max-height: 100%;
    overflow-x: hidden;
    perspective: 1px;
    perspective-origin: center top;
    transform-style: preserve-3d;
}


header {
    display: flex;
    justify-content: left;
    margin-top: 2rem;

    height: 65vh;
    transform-origin: center top;
    transform: translateZ(-1px) scale(2);
}

@media print {
    header {
        display: none;
    }

    section:first-child::before {
        content: var(--title);
        color: var(--h1-color);
        margin-top: 10rem;
        margin-bottom: 5rem;
        max-width: 660px;
        width: 80%;
        font-size: 5rem;
        text-align: center;
        font-family: var(--font-family);
        font-weight: 100;
        display: block;
    }

    section {
        break-before: always;
    }

    html,
    body,
    .root {
        overflow: unset;
        height: unset;
        width: unset;
    }

}


header>* {
    height: 100%;
    position: relative;
    display: block;
    max-width: 1440px;
    width: 100%;

    display: flex;
    justify-content: center;

}

aside {
    position: absolute;
    top: 0;
    left: 0;
    border-bottom-right-radius: 50px;
    border: 1px solid var(--primary-background);
    border-top: none;
    border-left: none;
    padding: 8px 25px 25px 8px;
    background: var(--card-background-color) !important;
}


@media (max-width: 1100px) {
    aside {
        position: static;
        border-radius: 0;
        border: none;
        border-top: 1px solid var(--primary-background);
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

@media print {
    aside {
        display: none;
    }
}



main {
    transform: translateZ(0);
    background: var(--background-color);

    box-shadow: 0 -5px 5px 5px var(--background-color);
    border-radius: 0.5rem;
}

section {
    margin-top: 4rem;
}

section:first-of-type {
    margin-top: 0px;
}

h1 {
    margin-top: 0px;
}


.overview {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    text-align: center;
}

@media print {
    .overview {
        display: none;
    }
}


.overview>span {
    white-space: nowrap;
    text-align: center;
    padding: 0 4px;
}


.overview>* {
    background: var(--card-background-color) !important;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid var(--primary-background);
    border-bottom: 1px solid var(--primary-background);
}


.overview>*:first-child {
    border-top-left-radius: 50px;
    border-bottom-left-radius: 50px;
    border-left: 1px solid var(--primary-background);
    padding-left: 25px;
}

.overview>*:last-child {
    border-top-right-radius: 50px;
    border-bottom-right-radius: 50px;
    border-right: 1px solid var(--primary-background);
    padding-right: 25px;
}



.btn {
    position: relative;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    -webkit-transition: all 1s ease-in-out;
    margin: 1rem 0px;
    z-index: -1;
}

@media print {
    .btn {
        display: none;
    }
}


.btn>* {
    background: var(--card-background-color) !important;
    padding: 0px 15px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid var(--primary-background);
    border-bottom: 1px solid var(--primary-background);
}

.btn svg {
    padding: 8px;
    width: 48px;
}

.btn>*:first-child {
    border-top-left-radius: 50px;
    border-bottom-left-radius: 50px;
    border-left: 1px solid var(--primary-background);
}

.btn>*:last-child {
    border-top-right-radius: 50px;
    border-bottom-right-radius: 50px;
    border-right: 1px solid var(--primary-background);
}


.btn a:hover {
    color: var(--primary);

}

@media (max-width: 760px) {
    .btn {
        width: 100%;
    }
}



/* Book */

@property --book-open {
    syntax: "<angle>";
    inherits: true;
    initial-value: 0deg;
}

@property --book-thickness {
    syntax: "<length>";
    inherits: true;
    initial-value: 0;
}

body,
html {
    margin: 0;
    padding: 0;
}

* {
    transform-style: preserve-3d;
    box-sizing: border-box;
    ;
}

:root {
    --cover-ratio: 0.75;
    --book-height: 300px;


    --book-rotateX: -30deg;
    --book-rotateY: 30deg;
    --book-rotateZ: -10deg;


    --book-rotateHover: 0deg;

    --book-perspective: 3000px;

    --pages: 400;
    --book-transitionDuration: .5s ease;
    --book-radius: 3px;
    --book-pagesOffset: 3px;
    --book-bgColor: #01060f;

    --book-page-color: #fff9e7;
    --book-page-color-shadow: #e0dbcc;

    /* --book-open: 0deg; */
}


*:has(>.book) {
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: var(--book-perspective);
}

@keyframes open {
    0% {
        --book-open: 0deg;
        transform: rotateX(0deg) rotateY(-30deg) rotateZ(0deg);
    }

    100% {
        --book-open: 45deg;
        transform: rotateX(10deg) rotateY(380deg) rotateZ(40deg);
    }

}

* {
    transition-duration: 1.5s;
    transition-timing-function: ease;
}




.book {
    width: var(--book-width);
    height: var(--book-height);
    position: relative;
    transform-style: preserve-3d;
    transition-property: transform, --book-open, --book-width, --book-thickness, --book-height, width, height;
    transition-duration: 1.5s;
    transition-timing-function: ease;
    /* animation: 5s ease 0s infinite open alternate; */

    --book-width: calc(var(--book-height) * var(--cover-ratio));
    --book-page-height: calc(var(--book-height) - var(--book-pagesOffset) * 2);
    --book-page-width: calc(var(--book-width) - var(--book-pagesOffset));
    --book-thickness: calc(var(--book-height) / 6 / 400 * var(--pages));

    * {
        transition-duration: 1.5s;
        transition-timing-function: ease;
    }




    .back {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        transition-property: width, height, transfrorm;


        &>img {
            transition: none;
            width: 100%;
            height: 100%;
            object-fit: fill;
            transform: rotateY(180deg);
        }

        &::after {
            position: absolute;
            content: ' ';
            top: var(--book-pagesOffset);
            left: 0;
            width: calc(100% - var(--book-pagesOffset) * 2);
            height: calc(100% - var(--book-pagesOffset) * 2);

            background-color: var(--book-page-color);
            transform: translateZ(1px);
            transition-property: width, height, transfrorm;

        }
    }

    .spine {
        position: absolute;
        top: 0;
        left: 0;
        width: var(--book-thickness);
        height: 100%;

        transition-property: height, transfrorm;

        background-color: #000;
        transform-origin: left center;
        transform: rotateY(calc(-90deg + var(--book-open) / -2));

        &>img {
            width: 100%;
            height: 100%;
            object-fit: fill;
        }

        &::after {
            position: absolute;
            content: ' ';
            top: var(--book-pagesOffset);
            left: 0px;
            width: calc(var(--book-thickness));
            height: calc(100% - var(--book-pagesOffset) * 2);

            background-color: var(--book-page-color-shadow);
            transform: translateZ(-1px);
            transition-property: width, height, transfrorm;

        }
    }

    .front {
        position: absolute;
        top: 0;
        left: var(--book-thickness);
        width: var(--book-width);
        height: var(--book-height);

        transition-property: width, height, transfrorm;

        background-color: #000;
        transform-origin: left center;
        transform: rotateY(calc(90deg - var(--book-open) / 2));

        &>img {
            width: 100%;
            height: 100%;
            object-fit: fill;
            position: absolute;
            top: 0;
            left: 0;
        }



        &::after {
            position: absolute;
            content: ' ';
            top: var(--book-pagesOffset);
            left: 0px;
            width: calc(100% - var(--book-pagesOffset) * 2);
            height: calc(100% - var(--book-pagesOffset) * 2);

            background-color: var(--book-page-color);
            transform: translateZ(-1px);
            transition-property: width, height, transfrorm;

        }
    }

    .effect {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;

        &::before {
            content: ' ';
            width: 90%;
            height: 100%;
            position: absolute;
            border-radius: 3px;
            background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 100%);
            top: 0;
            right: 0;
            opacity: .1;
            transition: all .5s ease;
            -webkit-transition: all .5s ease;
        }

        &::after {
            content: ' ';
            top: 0;
            left: 0;
            position: absolute;
            width: 20px;
            height: 100%;
            margin-left: 10px;
            border-left: 2px solid #00000010;
            background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
            transition: all .5s ease;
        }
    }


    .page {
        position: absolute;
        top: var(--book-pagesOffset);
        left: 0;
        width: calc(var(--book-page-width) - 1px);
        height: var(--book-page-height);
        background-color: var(--book-page-color);
        background: radial-gradient(circle at 0% 50%, var(--book-page-color-shadow) 0%, var(--book-page-color) 60%);

        transition-property: width, height, transfrorm;

        transform-origin: left center;
        transform: translateZ(-1px) rotateY(90deg) translateZ(calc((var(--book-thickness) - 2px) / (var(--visible-pages) - 1) * var(--page-index) + 1px)) rotateY(calc(var(--book-open) / 2 - var(--book-open) / (var(--visible-pages) + 1) * (var(--page-index) + 1)));

        transform-style: flat;

        &::after {
            height: 100%;
            width: calc(100% - 2px);
            content: ' ';
            display: block;
            box-shadow: 1px 0 2px 0px rgba(102, 102, 102, 0.41);
            opacity: 0.1;



        }
    }

}