:root {
    --bg25: repeating-conic-gradient(var(--text) 0% 25%, transparent 0% 100%) 1px 0.5px / 2px 2px;
    --bg50: repeating-conic-gradient(var(--text) 0% 25%, transparent 0% 50%, var(--text) 0% 75%, transparent 0% 100%)
        1px 0.5px / 2px 2px;
    --bg75: repeating-conic-gradient(transparent 0% 25%, var(--text) 0% 100%) 1px 0.5px / 2px 2px;
    --bg25-i: repeating-conic-gradient(var(--bg) 0% 25%, transparent 0% 100%) 1px 0.5px / 2px 2px;
    --bg50-i: repeating-conic-gradient(var(--bg) 0% 25%, transparent 0% 50%, var(--bg) 0% 75%, transparent 0% 100%) 1px
        0.5px / 2px 2px;
    --bg75-i: repeating-conic-gradient(transparent 0% 25%, var(--bg) 0% 100%) 1px 0.5px / 2px 2px;
}

::selection {
    color: var(--text);
    background-color: var(--middle);
}

#block_tab_start,
#block_tab_end {
    position: absolute;
    top: 0;
}

#main_scale {
    inset: 0;
    overflow: scroll;
    scrollbar-width: none;
    -ms-overflow-style: none;
    height: 100vh;
    height: 100dvh;
    padding-bottom: 10rem;
}
#main_scale::-webkit-scrollbar {
    display: none;
}

main {
    min-width: 100vw;
    width: fit-content;
    padding: 4rem 4ch 0 4ch;
}

header nav {
    width: 100vw;
    padding: 1rem 4ch 0 4ch;
    background-color: var(--bg);
    z-index: 100;
    position: fixed;
    top: 0;
}

header #keyboard_section {
    width: 100%;
    padding: 0.25rem 4ch 1rem 4ch;
    background-color: var(--bg);
    z-index: 100;
    position: fixed;
    bottom: 0;
}

@media (max-width: 1000px) {
    main {
        padding: 4rem 2ch 0 2ch;
    }
    header nav {
        padding: 1rem 2ch 0 2ch;
    }
    header #keyboard_section {
        padding: 0.25rem 2ch 1rem 2ch;
    }
}

header #keyboard_section,
header nav {
    overflow-y: scroll;
    -ms-overflow-style: none; /* Internet Explorer 10+ */
    scrollbar-width: none; /* Firefox */
}
header #keyboard_section::-webkit-scrollbar,
header nav::-webkit-scrollbar {
    display: none;
}

#keyboard_section.hidden {
    display: none;
}

#nav_form {
    display: flex;
    gap: 4ch;
    font-size: 0.75rem;
    line-height: 1rem;
    width: max-content;
}

#section_container {
    inset: 1rem 2rem;
}

p,
a,
figcaption,
button {
    font-size: 0.75rem;
    line-height: 1rem;
    max-width: var(--max-width);
    width: fit-content;
    vertical-align: top;
    color: inherit;
}

a,
.button_link,
button {
    text-decoration: underline;
    text-decoration-skip-ink: none;
    text-underline-offset: 0.24ch;
    cursor: pointer;
}
a:focus,
.button_link:focus {
    text-decoration: none;
}

i {
    font-style: normal;
    font-variation-settings:
        "wght" 400,
        "ital" 1;
}

h1 {
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: normal;
    width: fit-content;
}

#change_setting p {
    padding: 0 1ch;
    background-color: var(--bg);
}

.faded {
    opacity: 0.33;
}

#mobile {
    visibility: hidden;
}

:focus {
    text-decoration: none;
    color: var(--bg);
    background-color: var(--text);
    outline: none;
}

form input[type="radio"],
input[type="file"] {
    -webkit-appearance: none;
    appearance: none;
    background-color: var(--text);
    color: var(--text);
    border: none;
    width: 0;
    height: 0;
    opacity: 0;
    display: block;
}
form input[type="radio"] + label {
    cursor: pointer;
    display: inline-block;
}
form input[type="radio"]:focus:checked + label {
    background-color: var(--text);
    color: var(--bg);
}
form input[type="radio"]:checked + label {
    background: var(--bg25);
}
form input[type="radio"]:hover + label,
form input[type="radio"]:checked:hover + label {
    background: var(--bg75);
    color: var(--bg);
}
form input[type="radio"]:focus:hover + label {
    background: var(--text);
}
form input[type="radio"]:focus + label:active,
form input[type="radio"]:checked + label:active,
form input[type="radio"] + label:active {
    background: var(--bg50);
    color: var(--bg);
}

ul li,
ol li {
    font-size: 0.75rem;
    line-height: 1rem;
    margin-left: 2ch;
    max-width: 54ch;
    width: fit-content;
}

ul {
    list-style-type: none;
    max-width: max-content;
}

ol li::before {
    display: none;
}

ul li::before {
    content: "• ";
    position: absolute;
    margin-left: -2ch;
}

ul li:focus::before {
    background-color: transparent;
    color: var(--text);
}

#page_animation {
    width: 200vw;
    height: 200vh;
    height: 200dvh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99;
    background-color: var(--bg);
    pointer-events: none;
}

#page_animation.page_animation {
    animation: 440ms steps(10, jump-start) forwards page_animation;
}

@keyframes page_animation {
    0% {
        transform: translateY(0vh);
    }
    99.9% {
        visibility: visible;
    }
    100% {
        visibility: hidden;
        transform: translateY(200vh);
    }
}

#focus_check {
    position: absolute;
}

#footer_hint_mobile {
    display: none;
}

#section_container section {
    display: none;
}
#section_container section.visible {
    display: block;
}

.shake:focus,
.shake,
input:focus + .shake {
    animation: 200ms steps(1, jump-start) shake;
}
.shake_left:focus,
.shake_left,
input:focus + .shake_left {
    animation: 125ms steps(1, jump-start) shake_left;
}
.shake_right:focus,
.shake_right,
input:focus + .shake_right {
    animation: 125ms steps(1, jump-start) shake_right;
}
.shake_up:focus,
.shake_up,
input:focus + .shake_up {
    animation: 125ms steps(1, jump-start) shake_up;
}
.shake_down:focus,
.shake_down,
input:focus + .shake_down {
    animation: 125ms steps(1, jump-start) shake_down;
}

@keyframes shake {
    0% {
        transform: translate(0);
    }
    33% {
        transform: translate(0.125rem, 0.125rem);
    }
    67% {
        transform: translate(-0.125rem, -0.125rem);
    }
    100% {
        transform: translate(0);
    }
}
@keyframes shake_left {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-0.25rem);
    }
    100% {
        transform: translateX(0);
    }
}
@keyframes shake_right {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(0.25rem);
    }
    100% {
        transform: translateX(0);
    }
}
@keyframes shake_up {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-0.25rem);
    }
    100% {
        transform: translateY(0);
    }
}
@keyframes shake_down {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(0.25rem);
    }
    100% {
        transform: translateY(0);
    }
}

.nav_button {
    text-decoration: underline;
}
.nav_button:focus {
    text-decoration: none;
}
