@font-face {
    font-family: "fsex300";
    font-display: block;
    src: url("media/FSEX300.ttf");
}

:root {
    color-scheme: only dark;
}

body {
    font-family: "fsex300";
    font-size: 22px;
    color: white;
    margin: 0px;

    display: flex;
    gap: 35px;

    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    padding: 10px;

    padding-top: 100px;
    padding-bottom: 200px;

    &::before {
        width: 10000vw;
        height: 10000vh;

        position: fixed;
        top: -10px;
        z-index: -20;

        background-image: url("media/cloudy.png");
        background-repeat: repeat;
        background-size: 500px;
        content: "";

        animation: animate_background 500s linear infinite;
    }

    &.blog {
        article {
            max-width: min(1000px, 95%);
        }

        section > * {
            align-items: flex-start;
            text-align: unset;
            padding: 10px;
        }

        p:first-child {
            margin-top: 0px;
        }

        p:last-child {
            margin-bottom: 0px;
        }
    }
}

a:not(:has(img)) {
    background-color: rgb(49 1 49);
    color: rgb(231 110 231);
    text-decoration: none;
    padding: 0 5px 0 5px;
}

code {
    font: unset;
    white-space: pre-wrap;
    display: block;
    padding: 10px;
    background-color: rgb(49 1 49);
    word-break: break-word;

    &[inline] {
        display: unset;
        padding: 3px;
        padding-top: 0px;
        padding-bottom: 0px;
    }
}

article {
    &:focus-within,
    &:hover {
        filter: grayscale(0%);
        scale: 1;
    }

    display: flex;
    flex-direction: column;

    overflow: hidden;
    padding: 10px;

    @media only screen and (min-width: 1335px) {
        transform: translateX(-10%) rotate(1deg);
    }

    max-width: min(750px, 95%);
    gap: 7px;

    animation:
        table_rotate 3s linear infinite alternate,
        table_hover 2s ease-in-out infinite alternate;
    animation-composition: add;

    &:nth-child(even) {
        @media only screen and (min-width: 1335px) {
            transform: translateX(10%) rotate(-1deg);
        }

        animation:
            table_rotate 3s linear infinite alternate-reverse,
            table_hover 2s ease-in-out infinite alternate-reverse;
    }

    scale: 0.99;
    filter: grayscale(60%);
    transition:
        filter 0.2s,
        scale 0.2s;

    /* border magic do not touch */
    background-image:
        linear-gradient(90deg, #ff00ff 50%, transparent 50%),
        linear-gradient(90deg, #ff00ff 50%, transparent 50%),
        linear-gradient(0deg, #ff00ff 50%, transparent 50%),
        linear-gradient(0deg, #ff00ff 50%, transparent 50%);
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
    background-size:
        15px 2px,
        15px 2px,
        2px 15px,
        2px 15px;
    background-position:
        left top,
        right bottom,
        left bottom,
        right top;
}

header {
    /* only chromium implements attr of type, love */

    &[reverse] > span {
        animation: animate_scroller 10s linear infinite reverse;

        @supports (animation: attr(speed type(<time>), 10s)) {
            animation: animate_scroller attr(speed type(<time>), 10s) linear
                infinite reverse;
        }
    }

    & span {
        &::before {
            content: attr(text) " " attr(text) " " attr(text) " " attr(text) " "
                attr(text) " " attr(text) " " attr(text) " " attr(text) " "
                attr(text) " " attr(text) " " attr(text) " " attr(text) " "
                attr(text) " " attr(text) " " attr(text) " " attr(text) " "
                attr(text) " " attr(text) " " attr(text) " " attr(text);
        }

        animation: animate_scroller 10s linear infinite;
        @supports (animation: attr(speed type(<time>), 10s)) {
            animation: animate_scroller attr(speed type(<time>), 10s) linear
                infinite;
        }

        padding-right: 10px;
    }

    background-color: rgba(139, 0, 139, 0.7);
    font-size: 20px;
    padding: 3px;

    display: inline-flex;
    white-space: nowrap;
    user-select: none;
    overflow: hidden;
}

section {
    & figure {
        & img {
            width: 95%;
        }

        user-select: none;
        font-size: unset;
        width: 15%;
    }

    & > * {
        width: 100%;
        box-sizing: border-box;

        background-color: rgba(128, 0, 128, 0.2);

        border-width: 2px;
        border-style: solid;
        border-color: rgba(128, 0, 128, 0.5);

        overflow: hidden;
        text-align: center;

        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;

        padding: 5px;
        margin: 0px;
        gap: 10px;
    }

    display: flex;
    gap: 7px;
}

#pronounce {
    background: linear-gradient(
        90deg,
        rgba(91, 206, 250, 1) 0%,
        rgba(245, 169, 184, 1) 25%,
        rgba(255, 255, 255, 1) 50%,
        rgba(245, 169, 184, 1) 75%,
        rgba(91, 206, 250, 1) 100%
    );

    background-clip: text;
    color: transparent;
}

#hood {
    width: 45%;
}

@media only screen and (max-width: 750px) {
    section {
        flex-direction: column;
        align-items: center;

        & figure {
            width: 20%;
        }
    }
}

@keyframes animate_background {
    from {
        transform: translate(0px, 0px);
    }
    to {
        transform: translate(-10000px, -10000px);
    }
}

@keyframes table_hover {
    from {
        transform: translateY(-2px);
    }
    to {
        transform: translateY(2px);
    }
}

@keyframes table_rotate {
    from {
        transform: rotate(-0.5deg);
    }
    to {
        transform: rotate(0.5deg);
    }
}

@keyframes animate_scroller {
    from {
        transform: translateX(0%);
    }
    to {
        transform: translateX(-100%);
    }
}
