* {
    margin: 0;
    box-sizing: border-box;
    font-family: monospace;
}

/* HTML content set up for sticky footer */

html {
    height: 100%;
    font-size: 16px;
    line-height: 20px;
}

body {
    height: 100%;
    color: #ccc;
    display: flex;
    flex-direction: column;
    background-color: #0b0b0f;
    justify-content: space-between;
}

footer {
    padding: 4px;
    line-height: 1;
}

/* Navigation */

#site_title {
    flex-grow: 1;
    color: #c04;
    font-size: 32px;
    text-decoration: none;
}

nav {
    gap: 16px;
    padding: 4px;
    display: flex;
    padding-right: 16px;
    align-items: center;
    background-color: #111;
}

@keyframes hueRotate {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(360deg);
    }
}

#logo {
    border-radius: 4px;
    animation: hueRotate 8s linear infinite;
}

nav * {
    display: block;
}

/* sitelen pona rendering for toki pona text */

@font-face {
    font-family: "LinjaPona";
    src: url("/fonts/linja-pona-4.9.otf");
    font-display: swap;
}

:is(.toki, .toki *) {
    font-family: "LinjaPona";
}

.toki {
    font-size: 24px;
}

/* Main Content */

canvas {
    width: 100%;
}

iframe {
    border-width: 0px;
}

main :is(img, svg, video, iframe, canvas) {
    display: block;
    border-radius: 8px;
}

code {
    color: #7c7c7c;
}

pre code {
    width: 100%;
    padding: 8px;
    color: #fc7;
    display: block;
    overflow: auto;
    min-height: 42px;
    border-width: 3px;
    border-style: solid;
    border-color: #333;
    background-color: #000;
}

main :is(p, label) {
    font-family: sans-serif;
}

.wrap {
    white-space: wrap;
}

.hide {
    display: none;
}

main h2 {
    margin-top: 24px;
}

main :is(h3, h4, div, img, svg, iframe, canvas) {
    margin-top: 16px;
}

main :is(p, pre code, select, button, input) {
    margin-top: 8px;
}

main li {
    margin-top: 6px;
}

/* Fit 80 character code blocks */

main {
    width: 100%;
    align-self: center;
    margin-block: 64px;
    padding-inline: 8px;
    overflow-wrap: break-word;
    max-width: calc(38px + 80ch);
}

/* Input styling */

*[contenteditable] {
    outline: none;
}

:is(button, select, input) {
    color: #7fc;
    border-radius: 4px;
    padding-block: 4px;
    border-style: none;
    padding-inline: 8px;
    background-color: #222;
}

button.active {
    color: #000;
    background-color: #7cf;
}

:is(button:hover, select:hover, input:hover) {
    color: #000;
    background-color: #fc7;
}

:is(button:active, select:active, input:hover) {
    color: #000;
    background-color: #c7f;
}

:is(a:link, a:link *) {
    color: #7fc;
}

:is(a:visited, a:visited *) {
    color: #c7f;
}

:is(a:hover, a:hover *) {
    color: #fc7;
}

:is(a:active, a:active *) {
    color: #7cf;
}
