:root {
    font-family: "MS Shell Dlg 2", Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    font-weight: 400;

    color-scheme: dark;
    color: rgba(255, 255, 255, 0.87);
    background-color: #242424;

    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;

    --font-monospace: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
}

body {
    margin: 0;
    display: grid;
    place-items: center;
    min-width: 320px;
    min-height: 100vh;
}

a {
    font-weight: 500;
    color: #646cff;
    text-decoration: inherit;
}

a:hover {
    color: #535bf2;
}

/* tooltip */


*[data-tooltip] {
    position: relative;

    &:hover::after {
        content: attr(data-tooltip);
        position: absolute;
        top: 0;
        left: calc(100% + 0.5em);

        color: var(--t400);
        background-color: var(--g200);
        border: 1px solid var(--g50);
        padding: 0.125em 0.5ch;

        animation: tooltip-appear 400ms;
    }
}

@keyframes tooltip-appear {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* loading */

#title {
    position: absolute;
    display: flex;
    inset: 0;
    z-index: 10000;

    flex-direction: column;
    place-items: center;
    place-content: center;

    background: inherit;
    font-size: 2rem;

    pointer-events: none;

    transition:
        background 0.5s ease-in-out 0s,
        visibility 0s ease-in-out 0.75s;
}

.loaded #title {
    background: transparent;
    visibility: collapse;

    & h1 {
        transition: all 0.5s;
        opacity: 0;
    }
}

#title .loader {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 8rem;
    height: 8rem;
    gap: 0.25rem;

    transition: all 0.75s;
    .loaded & {
        width: 18rem;
        height: 18rem;
    }

    & * {
        background: currentColor;
        animation-name: title-tile-scale;
        animation-duration: 1.5s;
        animation-iteration-count: infinite;
        animation-timing-function: ease-out;

        --stagger: 0.1s;

        &:nth-child(1) {
            animation-delay: calc(var(--stagger) * 0);
        }
        &:nth-child(2) {
            animation-delay: calc(var(--stagger) * 1);
        }
        &:nth-child(3) {
            animation-delay: calc(var(--stagger) * 2);
        }
        &:nth-child(4) {
            animation-delay: calc(var(--stagger) * 1);
        }
        &:nth-child(5) {
            animation-delay: calc(var(--stagger) * 2);
        }
        &:nth-child(6) {
            animation-delay: calc(var(--stagger) * 3);
        }
        &:nth-child(7) {
            animation-delay: calc(var(--stagger) * 2);
        }
        &:nth-child(8) {
            animation-delay: calc(var(--stagger) * 3);
        }
        &:nth-child(9) {
            animation-delay: calc(var(--stagger) * 4);
        }

        transition: scale 0.5s ease-in;
        .loaded & {
            scale: 0;
        }
    }
}

@keyframes title-tile-scale {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.2);
    }
    100% {
        transform: scale(1);
    }
}
