.dark {
    --bg50: #101010;
    --bg100: #1a1a1a;
    --bg150: #252525;
    --bg175: #2a2a2a;
    --bg200: #2d2d2d;
    --bg300: #303030;
    --bg400: #404040;
    --bg500: #545454;
    --bg700: #a0a0a0;

    --bg-checked: #dddddd;

    --error: #cc3232;

    --t100: #dddddd;
    --t300: #a1a1a1;
    --t600: #555555;

    --heavy-shadow: 0px 0px 10px 4px #0004;
    --soft-shadow: 0px 0px 5px 2px #0002;
    --input-shadow: 0px 0px 3px 1px #0001;
    /* --input-shadow: 0px 0px 3px 1px none; */

    --scroll-bar-color: #54545488;

    color: var(--t100);
}

html,
body {
    position: relative;
    width: 100%;
    height: 100%;
    background: #252525;

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

body {
    margin: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,
        Cantarell, "Helvetica Neue", sans-serif;

    --tooltip-background: #444;
}

a {
    color: rgb(0, 100, 200);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:visited {
    color: rgb(0, 80, 160);
}

code,
pre {
    font-family: var(--font-monospace);
    padding: 0em 1em;
    margin: 0em;
    tab-size: 4ch;
}

kbd {
    border: 1px solid var(--bg400);
    border-radius: 4px;
    padding: 0.2em 0.5em;
    font-family: var(--font-monospace);
    font-size: 0.8em;
    height: 1.2em;
    user-select: none;

    
    white-space: pre;
}

/* utility */

.flex-break {
    flex-basis: 100%;
    height: 0;
}

/* details & summary */

summary {
    list-style: none;
}
summary::-webkit-details-marker {
    display: none;
}

details summary {
    cursor: pointer;
    user-select: none;
    display: block;
    border-bottom: 1px solid var(--bg150);
}

details summary::before {
    content: "";
    background-color: var(--t100);
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z"></path></svg>');
    mask-size: cover;
    display: inline-block;
    width: 0.7em;
    height: 0.7em;
    margin: 0em 0.1em;
    transition: transform 0.1s ease-in-out;
}

details[open] summary::before {
    /* content:"🡑";  */
    transform: rotate(90deg);
}

/* tooltip */

[data-tooltip] {
    position: relative;
}
[data-tooltip]:after {
    line-height: 1;
    font-size: 0.9em;
    pointer-events: none;
    position: absolute;
    box-sizing: border-box;
    display: none;
    opacity: 0;
}
[data-tooltip]:after {
    content: attr(data-tooltip);
    text-align: center;
    min-width: 4em;
    max-width: 30em;
    width: max-content;
    padding: 4px 12px;
    background: var(--tooltip-background);
    color: #ffffff;
    z-index: 99;

    white-space: pre-wrap;
}
[data-tooltip]:hover:after {
    display: block;
    opacity: 1;
}

[data-tooltip]:not([data-flow])::after,
[data-tooltip][data-flow="top"]::after {
    bottom: calc(100% + 5px);
}
[tooltip]:not([data-flow])::after,
[data-tooltip][data-flow="top"]::after {
    left: 50%;
    -webkit-transform: translate(-50%, -4px);
    transform: translate(-50%, -4px);
}

[data-tooltip][data-flow="bottom"]::after {
    top: calc(100% + 5px);
}
[data-tooltip][data-flow="bottom"]::after {
    left: 50%;
    -webkit-transform: translate(-50%, 8px);
    transform: translate(-50%, 8px);
}
[data-tooltip][data-flow="left"]::after {
    top: 50%;
    right: calc(100% + 5px);
    -webkit-transform: translate(-8px, -50%);
    transform: translate(-8px, -50%);
}
[data-tooltip][data-flow="right"]::after {
    top: calc(50% + 1.5em);
    left: calc(100% + 5px);
    -webkit-transform: translate(8px, -50%);
    transform: translate(8px, -50%);
    text-align: left;
}
[data-tooltip=""]::after {
    display: none !important;
}


* {
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-bar-color) transparent;
}

::-webkit-scrollbar {
    width: 7px;
    height: 7px;
    background: var(--bg150);
}

::-webkit-scrollbar-thumb {
    background: #7a7a7b;
}
::-webkit-scrollbar-thumb:hover {
    background: #676768;
}

/* * {
    scrollbar-width: none;
}

::-webkit-scrollbar {
    width: 0px;
    height: 0px;
} */

#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: 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 scale {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.2);
    }
    100% {
        transform: scale(1);
    }
}
