*, html {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

:root {
    --p1: #26b3cc;
    --p2: #5566b4;
    --p3: #3e4d8d;

    --d0: #000000;
    --d1: #222222;
    --d2: #444444;
    --n0: #888888;
    --l2: #CCCCCC;
    --l1: #EEEEEE;
    --l0: #FFFFFF;

    --red: #d95f65;
    --green: #53c244;
    --yellow: #d9d329;
    --orange: #de9c18;

    --p-font: "Outfit", sans-serif;
    --d-font: "Rubik", sans-serif;
    font-family: var(--p-font);
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    display: flex; flex-direction: column;
}

.book-img {
    border: 1px solid var(--d0);
    border-radius: .25rem;
}

header {
    perspective: 100rem;
    display: flex;
    background-color: var(--p1);
    width: 100%;
    height: 50vh;
    justify-content: space-between; align-items: center;
     overflow: hidden;
    padding: 0 5rem;
    position: relative;
    box-shadow: 0 -.15rem 1rem var(--p2) inset, 0 .25rem .5rem var(--l2);

    @media (width <= 180ch) {
        flex-direction: column;
        height: 65vh;
        padding: 0;
    }

    .dec {
        position: absolute; bottom: 0; left: -25%;
        height: 1rem; width: 200%;
        display: flex;
        opacity: .75;
        -webkit-mask-image: linear-gradient(90deg,transparent 15%, black 45%, black 55%, transparent 85%);
        mask-image: linear-gradient(90deg,transparent 25%, black 50%);

        span {
            height: 100%;
            width: 100%;
            clip-path: polygon(5% 0%, 100% 0%, 95% 100%, 0% 100%);
            animation: cycle 2s infinite linear;
            /* margin-left: -5%; */
        }

        .c1 {background-color: var(--p2);}
        /* .c2 {background-color: var(--p3);} */
    }

    h1 {
        font-size: 7.5rem;
        font-weight: 900;
        line-height: 80%;
        color: var(--l0);
        font-family: var(--d-font);
        /* z-index: 20; */
        /* opacity: .75; */
        @media (width <= 180ch) {
            text-align: center;
            /*font-size: 8rem;*/
            padding: 0 3rem; padding-top: 3rem;
        }
        @media (width <= 125ch) {
            font-size: 5rem;
            padding: 0 5rem;padding-top: 5rem;
            /*max-width: 40rem;*/
        }
        @media (width <= 100ch) {
            font-size: 4rem;
            padding: 0 3rem; padding-top: 3rem;
            /*max-width: 40rem;*/
        }
    }

    .container {
        position: relative;
        display: flex; justify-content: center;
        width: 50%;
        height: 100%;

        .starburst {
            position: absolute;
            width: 125vmin; height: 125vmin;
            z-index: 8;
        }

        img {
            right: 25%;
            width: 45vmin;
            position: absolute;
            bottom: -100%;
            object-fit: contain;
            transition: .5s ease;
            box-shadow: 0rem 0 .5rem color-mix(in srgb, var(--d0) 35%, transparent);
            transform-origin: center;
            @media (width <= 180ch) {
                right: unset;
            }
            @media (width <= 125ch) {
                width: 50vw;
                bottom: -50vw;
                /*border-radius: 100%;*/
            }
            @media (width <= 100ch) {
                bottom: -35vw;
            }

            &.p1 {z-index: 16; translate: 0 -15%; rotate: 6deg; &:hover {scale: 1.05; rotate: 0deg; translate: 0 -20%;}}
            &.p2 {z-index: 14; translate: 35% 0; rotate: 9deg; &:hover {scale: 1.05; rotate: 8deg; translate: 40% 0;}}
            &.p3 {z-index: 12; translate: -35% 0; rotate: -12deg; &:hover {scale: 1.05; rotate: -4deg; translate: -40% 0;}}
        }
    }
}

@keyframes turn {
    0% {rotate: 0deg; scale: 1;}
    50% {scale: 1.25;}
    100% {rotate: 360deg; scale: 1;}
}

@keyframes cycle {
    0% {translate: 0;}
    100% {translate: 200%;}
}


main {
    display: flex; flex-direction: column;

    &:has(nav.sidebar) {
        flex-direction: row;
        align-items: flex-start;

        nav.sidebar {
            flex-direction: column;
            position: fixed;
            top: 0; bottom: 0;
            left: 0; height: 100%;
            z-index: 80;
            width: fit-content;
            padding: .5rem;
            flex-wrap: nowrap;
            flex-shrink: 0;
            /*background-color: var(--l2);*/

            a.back {
                stroke: var(--l1);
                width: 1.75rem; height: 1.75rem;
                border: 2px solid var(--l1);
                border-radius: 100%;
                display: flex; align-items: center;
                justify-content: center;
                padding: .25rem;
                transition: .25s ease;
                /*backdrop-filter: invert(1);*/

                &:hover {
                    padding: .1rem;
                    background-color: var(--l1);
                    stroke: var(--n0);
                }

                &.scrolled-past {
                    stroke: var(--d1);
                    border-color: var(--d1);
                }

               svg {
                   width: 100%;
                   stroke: inherit;
                   stroke-width: 3;
               }
            }
        }

        .main-track {
            display: flex; flex-direction: column;
            width: 100%;
        }
    }

    section {
        perspective: 100rem;
        width: 100%;
        height: fit-content;
        padding: 3rem;
        display: flex; flex-direction: column;
        gap: 2rem;
        @media (width <= 100ch) {
            padding: 2rem;
        }

        &:has(.split) {
            flex-direction: row;
            padding: 0;
            gap: 0;
            @media (width <= 125ch) {
                flex-direction: column;
            }

            .split {
                display: flex; flex-direction: column;
                padding: 3rem;
                width: 100%;
                gap: 2rem;
                @media (width <= 100ch) {
                    padding: 2rem;
                }
            }
        }

        h1 {font-weight: 800; font-size: 3rem;}
        h2 {
            font-weight: 700; font-size: 2rem;
            line-height: 97%;
            width: fit-content;
            &:has(.notif-counter) {
                display: flex; align-items: flex-start;
            }
        }

        .header {
            width: 100%;
            display: flex; justify-content: space-between;
            align-items: center;
        }

        .table-container {
            overflow: auto;
            width: 100%;
            flex-shrink: 0;
            table {
                tr {

                    td {
                        white-space: nowrap;
                        padding: .1rem .25rem;
                        font-size: .75rem;
                    }
                }
            }
        }
    }
}

.book-caro {
    display: flex; gap: 2rem;
    align-items: center;
    min-width: 0;
    width: 100%;
    flex-shrink: 1;
    @media (width <= 100ch) {
        max-width: 100%;
    }

    .book-track {
        display: flex;
        /*gap: 5rem;*/
        align-items: center;
        overflow: hidden;
        padding: 1rem 2rem;
        min-width: 0;
        -webkit-mask-image: linear-gradient(90deg,transparent 15%, black 45%, black 55%, transparent 85%);
        mask-image: linear-gradient(90deg,transparent 0%, black 5%, black 95%, transparent 100%);
        overflow-x: auto;

        .book {
            width: 15rem;
            align-items: center;
            transition: .25s ease;
            flex-shrink: 0;
            padding: 0 2rem;
            @media (width <= 100ch) {
                padding: 0 1.5rem;
                width: 14rem;
            }


            img {
                margin-bottom: .5rem;
                /*box-shadow: 0rem 0 .25rem color-mix(in srgb, var(--d0) 35%, transparent);*/
                /*transition: .25s ease;*/
                transform-style: preserve-3d;
                /*transform-origin: bottom;*/
                &:hover {
                    transform: rotateX(calc(var(--rotate-x)*1deg)) rotateY(calc(var(--rotate-y)*1deg));
                    box-shadow: calc(var(--rotate-y)*-.02rem) calc(var(--rotate-x)*.02rem) 0 var(--d1), calc(var(--rotate-y)*-.01rem) calc(var(--rotate-x)*.01rem) 0 var(--d1);
                    scale: 1.05;
                    /*transform: rotateX(12deg) rotateY(-8deg);
                    scale: 1.05;
                    box-shadow: .15rem .25rem 0 var(--d1);*/
                }
            }

            .title {
                font-size: 1.2rem;
                font-weight: 400;
                text-align: center;
                line-height: 97.5%;
            }

            .author {
                text-align: center;
                font-size: .9rem;
                font-weight: 300;
                line-height: 95%;
            }
        }

        &:has(.journal) {
            gap: 3rem;
            padding: 0 5rem 1rem 2rem;
        }

        .journal {
            aspect-ratio: 75 / 100;
            width: 15rem; height: auto;
            text-decoration: none;
            color: var(--d1);
            background-color: var(--l1);
            /*position: relative;*/
            border: 1px solid var(--d1);
            border-radius: .25rem;
            transition: all .5s ease;
            flex-shrink: 0;

            &:hover {
                .text-container .journal-dec {
                    width: 500%;
                    /*scale: 200;*/
                }
            }

            .tag-container {
                display: flex; flex-direction: row;
                gap: .5rem;
                position: absolute;
                top: .5rem; left: 100%;
                transition: rotate .5s ease;
                transform-origin: 0 100%;
                transform: rotate(90deg);

                span { /* i.e. tags */
                    padding: .25rem .5rem;
                    border-radius: .25rem .25rem 0 0;
                    background-color: var(--bgcolor);
                    font-size: .75rem; font-weight: 600;
                    color: var(--l1);
                    border: 1px solid var(--d1);
                    /*border-width: 1px 1px 0 1px;*/

                }
            }

            .text-container {
                padding: 1.25rem 1rem;
                height: 100%;
                display: flex; flex-direction: column;
                gap: .5rem; justify-content: space-between;
                overflow: hidden; position: relative;

                .journal-dec {
                    position: absolute;
                    background-color: var(--bgcolor);
                    border-radius: 100%;
                    right: -100%;
                    width: 250%; aspect-ratio: 1;
                    transition: .35s ease;
                    z-index: -1;
                }

                .title {
                    font-size: 1.2rem;
                    font-weight: 600;
                    line-height: 97%;
                }

                .author {
                    line-height: 97%;
                }
            }
        }
    }


    .left-button, .right-button {
        height: fit-content;
        border: none;
        background-color: transparent;
        font-family: var(--p-font);
        font-size: 4rem; font-weight: 200;
        margin-bottom: 2rem;
        cursor: pointer;
    }
}

.book {
    display: flex; flex-direction: column;
    align-items: center;
    img {
        min-width: 0; width: 100%;
        /* object-fit: none; */
    }
}

#journal-articles {
    box-shadow: 0 .25rem 1rem color-mix(in srgb, var(--d2) 25%, transparent);
    z-index: 3;
}

#read-of-the-month {
    background-color: var(--p1);
    color: var(--l0);

    .container {
        display: flex; gap: 2rem;
        @media (width <= 30rem) {
            flex-direction: column;
        }

        .right {
            display: flex; flex-direction: column;
            justify-content: space-between;

            .text-container {
                gap: .35rem;
                display: flex; flex-direction: column;
                height: 16rem;
                overflow: hidden;
                -webkit-mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
                mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
                @media (width <= 100ch) {
                    height: 12rem;
                }


                .title {
                    font-size: 1.5rem;
                    font-weight: 700;
                    line-height: 95%;
                }

                .author {
                    font-size: 1.25rem;
                    font-weight: 400;
                    line-height: 95%;
                    margin-bottom: .75rem;
                }

                p {
                    font-size: 1.15rem;
                    font-weight: 300;
                    line-height: 110%;
                    margin-bottom: .75rem;
                    max-width: 50rem;
                    text-align: justify;
                    hyphens: auto;
                    overflow-wrap: break-word;
                    @media (width <= 180ch) {
                        font-size: 1rem;
                    }

                    @media (width <= 125ch) {
                        font-size: 1.15rem;
                    }
                }
            }

            .button-container {
                @media (width <= 30rem) {
                    margin-top: 1rem;
                }

                a {
                    text-decoration: none;
                    font-family: var(--p-font);
                    background-color: transparent;
                    color: var(--l1);
                    border: 1px solid var(--l1);
                    width: fit-content;
                    padding: .5rem 1rem;
                    border-radius: .25rem;
                    transition: .25s ease;
                    cursor: pointer;

                    &:hover {
                        background-color: var(--l1);
                        color: var(--p1);
                    }
                }

                .reaction {
                    cursor: pointer;
                    font-family: var(--p-font);
                    background-color: transparent;
                    border: none;
                    color: var(--l1);
                    padding: .5rem;
                    transition: .25s ease;
                    font-size: 1.25rem;
                    &:hover {
                        font-weight: 900;
                    }
                }
            }
        }


        .book-img {
            min-width: 0;
            height: 20rem;
            width: auto;
            flex-shrink: 0;

            @media (width <= 30rem) {
                height: auto;
                width: 80%;
            }

            &:hover {
                transform: rotateX(calc(var(--rotate-x)*1deg)) rotateY(calc(var(--rotate-y)*1deg));
                box-shadow: calc(var(--rotate-y)*-.02rem) calc(var(--rotate-x)*.02rem) 0 var(--d1), calc(var(--rotate-y)*-.01rem) calc(var(--rotate-x)*.01rem) 0 var(--d1);
                @media (width <= 30rem) {
                    scale: 1.05;
                }

                @media (prefers-reduced-motion: reduce) {
                    transform: none; box-shadow: none; scale: 1;
                }
            }
        }
    }
}



.button-container {
    display: flex; gap: .5rem;

    button {
        padding: .5rem 1rem;
        font-family: var(--p-font);

    }
}

#read-of-last-month {
    background-color: var(--p2);
    color: var(--l1);

    .flip-container {
        display: flex;
        gap: 2rem;
        @media (width <= 200ch) {flex-direction: column;}
        @media (width <= 140ch) {flex-direction: row;}
        @media (width <= 125ch) {flex-direction: column;}

        a.button {
            display: flex; align-items: center; justify-content: center;
            /*height: 100%;*/
            border: 1px solid var(--l1);
            padding: 1rem;
            border-radius: .25rem;
            text-align: center;
            color: inherit;
            text-decoration: none;
        }

        .container {
            display: flex;
            gap: 2rem;
            justify-content: center;
            /*align-items: center;*/

            .book {
                display: flex;
                width: fit-content;
                gap: .25rem;
                color: inherit;
                text-decoration: none;

                @media (width <= 200ch) {&:nth-child(4) {display: none;}}
                @media (width <= 140ch) {&:nth-child(3) {display: none;}}


                @media (width <= 125ch) {
                    &:nth-child(2) {display: flex;}
                    &:nth-child(3) {display: flex;}
                }

                @media (width <= 100ch) {&:nth-child(3) {display: none;}}
                @media (width <= 75ch) {&:nth-child(2) {display: none;}}

                .month {
                    text-align: center;
                    font-weight: 900; font-size: .75rem;
                    width: 100%;
                    display: block;
                    border: 1px solid var(--l1);
                    padding: .25rem;
                    border-radius: .25rem;

                }

                .title {
                    font-weight: 700;
                    font-size: 1.15rem;
                    max-width: 15ch;
                    line-height: 95%;
                    text-align: center;

                }

                .author {
                    font-weight: 400;
                    text-align: center;
                    font-size: 1rem;
                    max-width: 15ch;
                    line-height: 98%;
                }

                img {
                    margin: .25rem 0;
                    height: 15rem; width: auto;
                    min-width: 0;
                    border: 1px solid var(--l1);
                    @media (width <= 200ch) {height: 12rem;}
                    @media (width <= 140ch) {height: 15rem;}

                    &:hover {
                        transform: rotateX(calc(var(--rotate-x)*1deg)) rotateY(calc(var(--rotate-y)*1deg));
                        box-shadow: calc(var(--rotate-y)*-.02rem) calc(var(--rotate-x)*.02rem) 0 var(--l1), calc(var(--rotate-y)*-.01rem) calc(var(--rotate-x)*.01rem) 0 var(--l1);
                        scale: 1.025;
                    }

                }
            }
        }
    }
}

#read-of-last-month, #read-of-the-month {
    box-shadow: 0 .25rem 1rem color-mix(in srgb, var(--d1) 25%, transparent);
}


.tilt {
    transform-style: preserve-3d;
    transition: all .5s ease;
    &:hover {
        transition: scale .5s ease;
        @media (prefers-reduced-motion: reduce) {
            transform: none; box-shadow: none; scale: 1;
        }
    }
}


.book-list {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax(18rem, 1fr));
    gap: 2rem;

    .book {
        display: flex; flex-direction: row;
        align-items: flex-start;
        width: 100%;
        gap: .75rem;

        img {
            width: 45%;
            flex-shrink: 0;
        }

        .container {
            display: flex; flex-direction: column;
            gap: .5rem;

            span {
                line-height: 95%;
            }

            .title {font-size: 1.25rem;}
            .title-long {font-size: .75rem; line-height: 90%;}
            .author {font-size: 1rem;}
            .meta-data {font-size: .8rem;}
            .source {font-size: .5rem; word-break:break-all;}
        }
    }

    &.list {
        display: flex; flex-direction: column;
        .book {
            img {width: 4rem;}
            .container {
                display: grid;
                grid-template-rows: auto auto;
            }
        }
    }
}

.post-list {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax(18rem, 24rem));
    gap: 2rem;

    .tag {
        font-size: .8rem;
        padding: .25rem;
        border-radius: .25rem;
        width: fit-content;
        &.bookrec {--color: var(--orange);}
        &.month {--color: var(--l2);}

        background-color: var(--color);
        border-color: color-mix(in srgb, var(--color) 50%, #00000066);
        color: color-mix(in srgb, var(--color) 50%, black);
    }

    .post, button[command="show-modal"] {
        border: 1px solid var(--d1);
        border-radius: .25rem;
        padding: .5rem;
        min-height: 10rem;
        display: flex; flex-direction: column;
        justify-content: space-between;
        background-color: transparent;
        position: relative;

        .notif-counter {
            position:absolute;
            bottom: 100%; right: 1rem;
            border-radius: 100% 100% 0 0;
            border: 1px solid var(--d1);
            z-index: -1;
        }

        .text-container {
            h4 {
                display: flex; width: 100%;
                justify-content: space-between;
                font-size: 1.4rem;
                font-weight: 700;

                time {
                    font-size: .75rem;
                    font-weight: 300;
                    max-width: 8rem;
                }
            }
            h5 {
                display: flex; flex-wrap: wrap;
                gap: .5rem;
                font-size: 1.25rem;
                font-weight: 500;
            }
        }
        p {
            margin-top: .75rem;
            font-size: 1rem;
            font-weight: 300;
        }
    }

    button[command="show-modal"] {
        align-items: center; justify-content: center;
        font-size: 4rem;
        font-family: var(--p-font);
        line-height: 90%;
        font-weight: 400;
        cursor: pointer;
        transition: .35s ease;
        height: 100%;
        align-self: center;

        span {
            font-size: 1.5rem;
            font-weight: inherit;
            line-height: 90%;
        }

        &:hover {
            background-color: var(--green);
            color: color-mix(in srgb, var(--green) 60%, black);
            border-color: color-mix(in srgb, var(--green) 60%, black);
        }
    }
}

nav {
    padding: 1rem;
    width: 100%;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;

    .container {
        display: flex; gap: 1.5rem;

        a, button {
            text-decoration: none;
            font-size: .8rem;
            font-family: var(--p-font);
            padding: .5rem 1rem;
            background-color: transparent;
            border: 1px solid var(--d2);
            color: var(--d2);
            border-radius: .25rem;
            transition: .25s ease;
            cursor: pointer;
            &:hover {
                color: var(--d0);
                border-color: var(--d0);
            }
        }
    }
}

.starburst {
    background: repeating-conic-gradient(var(--p1) 0deg 15deg, var(--p2) 15deg 30deg);
    mask-image: radial-gradient(closest-side, black 50%, transparent 100%);
    -webkit-mask-image: radial-gradient(closest-side, black 50%, transparent 100%);
    animation: turn 30s linear infinite;
    opacity: .5;
    @media (prefers-reduced-motion: reduce) {
        animation: none;
    }
}

.botm {
    display: flex; flex-direction: column;
    align-items: center;
    overflow: hidden;
    position: relative;
    perspective: 100rem;
    color: var(--d1);
    background-color: var(--l1);
    width: 100%;

    &#current-month {
        color: var(--l0);
        background-color: var(--p1);

        .book {height: 30rem; @media (width <= 100ch) {height: auto; width: 70%;}}
        .container .text-container {
            h2 {font-size: 2rem; @media (width <= 125ch) {font-size: 1.75rem;}}
            h3 {font-size: 1.5rem; @media (width <= 125ch) {font-size: 1.3rem;}}
            p {font-size: 1.1rem; @media (width <= 125ch) {font-size: 1rem;}}
        }
    }

    .container {
        display: flex;
        align-items: center; justify-content: center;
        gap: 3rem;
        max-width: 70rem;
        @media (width <= 100ch) {
            flex-direction: column;
        }

        .book {
            height: 22.5rem;
            flex-shrink: 0;
            position: relative;
            display: flex;
            align-items: center; justify-content: center;
            @media (width <= 100ch) {
                height: auto;
                width: 70%;
            }

            img {
                min-height: 0;
                height: 100%;
                border-radius: .25rem;
                border: 2px solid var(--d0);
                &:hover {
                    transform: rotateX(calc(var(--rotate-x)*1deg)) rotateY(calc(var(--rotate-y)*1deg));
                    box-shadow: calc(var(--rotate-y)*-.02rem) calc(var(--rotate-x)*.02rem) 0 var(--d1), calc(var(--rotate-y)*-.01rem) calc(var(--rotate-x)*.01rem) 0 var(--d1);
                    scale: 1.1;
                }
            }

            .starburst {
                position: absolute;
                width: 60vw;
                height: 60vw;
                z-index: -1;
            }
        }

        .text-container {
            display: flex; flex-direction: column;
            gap: .25rem;
            max-width: 45rem;

            h2 {
                font-size: 1.75rem;
                font-weight: 700;
                @media (width <= 125ch) {
                    font-size: 1.5rem;
                }
            }
            h3 {
                font-size: 1.3rem;
                font-weight: 500;
                margin-bottom: .75rem;
                @media (width <= 125ch) {
                    font-size: 1.1rem;
                }
            }
            p {
                font-size: 1rem;
                font-weight: 300;
                margin-bottom: .5rem;
                @media (width <= 125ch) {
                    font-size: 0.9rem;
                }
            }
        }
    }
    .header {
        max-width: 70rem;
        h1 {text-align: center; line-height: 95%;}

        @media (width <= 100ch) {
            gap: .5rem;
            flex-direction: column;
        }
    }
}


footer {
    display: flex;
    justify-content: space-between;
    background-color: var(--d1);
    color: var(--n0);
    padding: 2rem;

    .left, .right {
        display: flex;
        gap: 1rem;
        align-items: center;
    }

    .left {

        nav {
            padding: 0;
            display: flex; gap: 1rem;

            @media (width <= 120ch) {
                flex-direction: column;
                gap: .25rem;
            }

            a {
                height: fit-content;
                color: inherit;
                font-weight: 300;
                cursor: pointer;
                transition: .25s ease;
            }
        }
    }

    .right {

        a {
            fill: var(--n0);
            cursor: pointer;

            svg {
                width: 2rem; height: 2rem;
                fill: inherit;
                transition: .25s ease;
            }
        }
    }

    a:hover {
        color: var(--l2) !important;
        fill: var(--l2) !important;
    }
}

#loading-screen {
    position: fixed;
    top: 0; left: 0; height: 100vh; width: 100%;
    background-color: var(--p1);
    z-index: 100;
    transition: .5s ease;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 1rem;

    .spinner {
        background-color: var(--l1);
        width: 10vmin; height: 10vmin;
        border-radius: 100%;
        position: relative;
        display: flex; align-items: center; justify-content: center;
        overflow: hidden;
        opacity: .75;

        &::after, &::before {
            content: '';
            position: absolute;
        }

        &::before {
            width: 25%;
            height: 50%;
            top: 0;
            background-color: var(--p2);
            /*border-radius: 50%;*/
            animation: spin 2s linear infinite;
            transform-origin: bottom;

        }
        &::after {
            width: 90%;
            height: 90%;
            background-color: var(--p1);
            border-radius: 100%;
        }
    }
}

@keyframes spin {
    0% {rotate: 0;}
    100% {rotate: 360deg;}
}

dialog {
    margin: auto;
    padding: 2rem;
    border: var(--n0) 1px solid;
    border-radius: .25rem;

    &::backdrop {
        backdrop-filter: blur(.5rem);
    }

    .button-container {
        display: flex;
        position: absolute;
        right: 1rem; top: 1rem;
        gap: .25rem;

        button {
            font-weight: 500;
            width: 2rem; height: 2rem;
            display: flex; align-items: center; justify-content: center;
            border: 1px solid var(--l2);
            font-family: var(--p-font);
            color: var(--l2);
            transition: .25s ease;
            cursor: pointer;
            background-color: transparent;
            border-radius: .25rem;
            &:hover {color: var(--d2); border-color: var(--d2);}
        }
    }


}
form {
    display: flex; flex-direction: column;
    width: fit-content;

    h2 {
        margin-bottom: .5rem;
    }

    .double {
        gap: .25rem 1rem;
        display: grid; grid-auto-flow: column;
        grid-template-columns: auto auto;
        grid-template-rows: auto auto;
        width: fit-content;

        &.onelayer {
            display: flex;
            width: 100%;
            justify-content: space-between;
        }
    }

    .expanding-form-section {
        display: flex; flex-direction: column;
        gap: .5rem;
        margin-bottom: .5rem;

        .removeable-input {
            display: flex; gap: .5rem;
            align-items: center;

            input, button {margin: 0;}
            input[type='checkbox'] {
                width: fit-content;
            }

            /*input[type="checkbox"]:checked ~.default-value {
                width: fit-content;
            }*/
            input:read-only {
                background-color: #bf2652AA;
            }


            .warning {
                display: none;
                width: 0;
                flex-shrink: 0;
                overflow: hidden;
                white-space: nowrap;
                transition: .25s ease allow-discrete;
                interpolate-size: allow-keywords;
                font-family: var(--p-font);
                cursor: help;
                padding: 0 .5rem;
                align-self: stretch;
                align-items: center;
                font-size: 1.25rem;
                background-color: #cc971d55;
                color: #cc971d;
                border-radius: .25rem;
            }

            &:has(input.is-duplicate) .warning {
                display: flex; width: fit-content;
                @starting-style {
                    width: 0;
                }
            }

            .default-value {
                width: fit-content;
                flex-shrink: 0;
                overflow: hidden;
                white-space: nowrap;
                transition: .25s ease allow-discrete;
                interpolate-size: allow-keywords;
                font-family: var(--p-font);
            }
        }
    }

    label {
        margin-bottom: .25rem;
        font-size: .8rem;
    }


    input, select, button, textarea {
        margin-bottom: .75rem;
        padding: .5rem;
        transition: .25s ease;
        width: 100%;
        border: 1px solid var(--n0);
        border-radius: .25rem;
        font-family: var(--p-font);
        outline: none;

        &::placeholder {
            color: var(--n0);
            transition: inherit;
        }

        &:hover {
            border-color: var(--d1);
            color: var(--d1);
        }

        &:focus {
            border-color: var(--d1);

            &::placeholder {
                opacity: .5;
            }
        }

        &#title-long {min-width: 20rem;}
    }

    button {
        width: fit-content;
        align-self: flex-end;
        padding: .5rem 1rem;
        cursor: pointer;
        background-color: transparent;
        color: var(--d2);

        &:hover {
            background-color: var(--l1);
        }
    }

    .expanding-form-section:has(.is-duplicate) ~ .double .form-submit,
    .expanding-form-section:has(.is-duplicate) ~ .form-submit  {
        cursor: not-allowed;
        pointer-events: none;
        user-select: none;
        opacity: .8;
        background-color: #cc971d55;
        color: #cc971d;
        border-color: #cc971d;
    }

    button[type='submit'] {

    }
}

section:has(#book-recommendations) {
    @media (width <= 150ch) {
        flex-direction: column;
    }
}

#book-recommendations {
    background-color: var(--l1);
    width: fit-content;

    @media (width <= 150ch) {
        width: 100%;
    }

    .container {
        width: 40%;
        display: flex;
        font-size:  1.25rem;
        justify-content: center;
        width: fit-content;
        gap: 2rem;
        min-height: 15rem;
        color: var(--d0);

        @media (width <= 150ch) {
            width: 100%;
        }

        @media (width <= 120ch) {
            flex-direction: column;
            align-items: center;
        }

        form {
            min-width: 25rem;
            flex-shrink: 0;

            @media (width <= 120ch) {
                width: 100%;
                min-width: 0;
            }
        }

        p {
            max-width: 40rem;
            line-height: 150%;
            color: inherit;
        }

        a {
            border: 1px solid var(--d1);
            padding: 1rem;
            height: fit-content; width: fit-content;
            border-radius: .25rem;
            cursor: pointer;
            text-decoration: none;
            color: inherit;
        }
    }
}

#login {
    display: flex; flex-direction: row;
    height: 100%;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-wrap: nowrap;
    gap: 0;

    .back {
        position: absolute;
        top: 1rem; left: 1rem;
        text-decoration: none;
        font-size: 1.5rem;
        font-weight: 900;
    }

    form {
        padding: 5rem;
        flex-shrink: 0;
        min-width: 40%;
    }

    .dec {
        height: 100%;
        width: 100%;
        /*background-color: var(--p1);*/
        background: radial-gradient(circle at center, var(--p2) 0.2rem, transparent 0), linear-gradient(var(--p1));
        background-size: 5rem 5rem;
        perspective: 100rem;
        overflow: hidden;
        display: flex; align-items: center; justify-content: center;

        @media (width <= 120ch) {
            display: none;
        }

        .starburst {
            position: absolute;
            height: 100%; aspect-ratio: 1;
        }

        .spin-container {
            display: flex; align-items: center; justify-content: center;
            position: relative;
            width: 100%; height: 100%;
                transform-style: preserve-3d;

            #book1, #book2 {
                position: absolute;
                width: 75%;
                max-width: 45vh;
                border: 2px solid var(--d1);
                backface-visibility: hidden;
                /*aspect-ratio: 7 / 10;*/
                transform-origin: center center;
                /*translate: 0 0 -.25rem;*/
            }

            #book1 {
                transform: rotateY(0deg) translateZ(1px);
                animation: book-rotate-front 3s infinite linear;
            }
            #book2 {
                transform: rotateY(180deg) translateZ(1px);
                animation: book-rotate-back 3s infinite linear;
            }
        }
    }
}

/* Front side animation */
@keyframes book-rotate-front {
  0% { transform: rotateY(0deg) translateZ(1px); }
  100% { transform: rotateY(360deg) translateZ(1px);}
}

/* Back side animation (starts rotated at 180deg) */
@keyframes book-rotate-back {
  0% { transform: rotateY(180deg) translateZ(1px); }
  100% { transform: rotateY(540deg) translateZ(1px); }
}

.alert {
    justify-content: space-between;
    position: absolute;
    z-index: 99;
    top: 1rem;
    padding: 1rem;
    width: 50%;
    max-width: 40rem;
    &.green{--color: var(--green);}
    &.red{--color: var(--red);}
    &.yellow{--color: var(--yellow);}

    background-color: var(--color);

    border: 1px solid color-mix(in srgb, var(--color) 65%, black);
    color: color-mix(in srgb, var(--color) 65%, black);

    &:open {
        display: flex;
    }

    button[command='close'] {
        border: inherit;
        background-color: inherit;
        color: inherit;
        width: 1.5rem; aspect-ratio: 1;
        border-radius: .25rem;
        cursor: pointer;
        outline: none;
    }

    &::backdrop {
        display: none;
    }
}

.inline-form {
    display: flex; flex-direction: row;
    gap: .25rem;
    margin-top: .5rem;
    flex-shrink: 0;
    justify-self: flex-end;
    align-self: flex-end;
    padding: 0;

    button {
        box-sizing: border-box;
        display: flex;
        flex-shrink: 0;
        padding: .25rem;
        width: 2rem; height: 2rem;
        margin: 0;

        stroke: var(--d1);

        &.delete:hover {
            background-color: var(--red);
            stroke: color-mix(in srgb, var(--red) 60%, black);
            border-color: color-mix(in srgb, var(--red) 60%, black);
        }

        &.read:hover {
            background-color: var(--yellow);
            stroke: color-mix(in srgb, var(--yellow) 60%, black);
            border-color: color-mix(in srgb, var(--yellow) 60%, black);
        }


        svg {
            width: 100%; height: 100%;
            stroke: inherit;
            min-width: 0; min-height: 0;
            stroke-width: 2;
        }
    }
}

.notif-counter {
    display: inline-block;
    background-color: var(--red);
    color: var(--l1);
    border-radius: 100%;
    aspect-ratio: 1;
    font-size: .5rem; font-weight: 500;
    width: .9rem; height: .9rem;
    text-align: center;
    line-height: .9rem; vertical-align: center;

}

#rec-special {
    display: flex;
    align-items: center;
    width: fit-content;
    text-align: center;
    justify-content: center;
    padding: 3rem 8rem;
    background-color: var(--l1);
    /*z-index: 7;*/
    box-shadow: 0 .25rem .5rem color-mix(in srgb, var(--d2) 25%, transparent) inset;
    position: relative;

    @media (width <= 180ch) {
        display: none;
    }

    div {
        display: flex; flex-direction: column;
        gap: 2rem;
        border: 2px solid var(--d1);
        padding: 2rem;
        border-radius: .25rem;
        align-items: center;
        box-shadow: 1rem 1rem .5rem color-mix(in srgb, var(--d2) 25%, transparent) ;
        transition: .5s ease;
        width: fit-content;
        position: relative;
        background-color: var(--l1);
        transform-style: preserve-3d;

        &:hover {
            rotate: -9deg;
            box-shadow: .83rem 1.14rem .5rem color-mix(in srgb, var(--d2) 25%, transparent) ;
            /*box-shadow: 1rem 2rem 1rem color-mix(in srgb, var(--d2) 25%, transparent) ;*/
        }

        &::before {
            transition: inherit;
            position: absolute;
            content: '';
            width: 99%; height: 99%;
            top: 0; left: 0;
            border: 2px solid var(--d1);
            border-radius: inherit;
            background-color: var(--l1);
            z-index: -1;
            transform: translateZ(-.5rem);
        }

        &:hover::before {
            rotate: 9deg;
        }
    }


    h3 {
        font-size: 2rem;
        line-height: 95%;
    }
    p {
        font-size: 1.25rem;
    }
    a {
        border: var(--d1) 1px solid;
        color: var(--d1);
        padding: .5rem;
        text-decoration: none;
        border-radius: .25rem;
        transition: .25s ease;
        width: fit-content;

        &:hover {
            background-color: var(--l2);
            color: var(--d1 );
        }
    }
}
