body {
    background: black;
    color: #ddd;
    font-family: Consolas, monospace, monospace;
    font-size: 16px;
    margin-inline: max(1ch, 50% - 80ch / 2);
    line-height: 1.2;
}

::selection {
    color: #000;
    background: #0ff;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: white;
    margin-top: 2em;
    margin-bottom: 1em;
    font-size: 16px;
    font-weight: 1100;
    line-height: 1.2;
}


h1::before { color: #fff; content: "# "; }
h2::before { color: #ccc; content: "## "; }
h3::before { color: #999; content: "### "; }
h4::before { color: #999; content: "#### "; }
h5::before { color: #999; content: "##### "; }
h6::before { color: #999; content: "###### "; }


ul {
    list-style-type: none;
    padding: 0;
    padding-left: 1ch;
}

ul > li::before {
    content: " - ";
}

ol {
    padding: 0;
    padding-left: 4ch;
}


a {
    white-space: nowrap;
    color: #f0f;
}

a:hover {
    color: #000;
    background: #f0f;
}

a.wrap {
    white-space: normal;
}

.nowrap {
    white-space: nowrap;
}

a.id-link {
    text-decoration: none;
    color: inherit;
    white-space: normal;
}

h1 > a.id-link,
h2 > a.id-link,
h3 > a.id-link,
h4 > a.id-link,
h5 > a.id-link,
h6 > a.id-link {
    max-width: fit-content;
}

h1 > a.id-link:hover,
h2 > a.id-link:hover,
h3 > a.id-link:hover,
h4 > a.id-link:hover,
h5 > a.id-link:hover,
h6 > a.id-link:hover {
    background-color: white;
    color: black;
    max-width: fit-content;
}

strong::before {
    content: "**"
}

strong::after {
    content: "**"
}

strong {
    color: white;
}

a:target {
    background: #00f;
}




code {
    display: inline-block;
    color: #0f0;
    border: solid #777;
    border-width: 1px;
    font-family: Consolas, monospace, monospace;
    font-size: 16px;
    margin: -1px;
    max-width: round(min(100%, 80ch), 1ch);
    overflow-x: clip;
}

code::selection {
    color: #000;
    background: #0f0;
}

code.block {
    white-space: pre;
    overflow-x: auto;
    overflow-y: none;
}

aside > p {
    position: relative;
    color: #0ff;
    padding-left: 2ch;
}

/* this shouldn't work but it unfortunately does */
aside > p::before {
    content: "> \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > \A > ";
    white-space: pre;
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 100%;
    line-height: 1.2;
    pointer-events: none;
    overflow: clip;
}

header {
    width: round(min(100%, 80ch), 1ch);
}

header::before {
    display: block;
    content: "================================================================================";
    color: #777;
    overflow: hidden;
}

header::after {
    display: block;
    content: "================================================================================";
    color: #777;
    overflow: hidden;
}

header a {
    text-decoration: none;
}

.menu {
    position: relative;
}

.menu > a::before {
    white-space: pre;
    content: " ";
}

.menu > a::after {
    white-space: pre;
    content: " ";
}

.menu-content {
    display: none;
    position: absolute;
    top: 100%;
    margin-top: -1px;
    left: 0;
    background-color: #444;
    z-index: 1;
}

.menu-content a {
    display: block;
    color: white;
}

.menu-content a:hover {
    color: black;
    background: #ff0;
}

.menu-content a::before {
    white-space: pre;
    content: " ";
}

.menu-content a::after {
    white-space: pre;
    content: " ";
}

.menu > a:hover + .menu-content,
.menu-content:hover {
    display: block;
}

.menu-user {
    float: right;
    margin-right: 1ch;
}

.comment::before {
    content: "\/* ";
    white-space: nowrap;
}

.comment::after {
    content: "\ */";
    white-space: nowrap;
}

.comment {
    color: #777777;
}

.error {
    color: #f00;
}

.input-wrapper {
    display: inline-block;
}

.input-wrapper::before {
    content: "[";
    color: #ff0;
}
.input-wrapper::after {
    content: "]";
    color: #ff0;
}

.input-wrapper:focus-within::before,
.input-wrapper:focus-within::after {
    color: #0ff;
}

input[type="text"], input[type="password"] {
    padding: 0;
    outline: 0 none;
    border: 0 none;
    color: #ddd;
    background: transparent;
    font-family: Consolas, monospace, monospace;
    font-size: 16px;
    line-height: 1.2;
}

input:invalid {
    color: #f00;
}

button {
    border: 0 none;
    background: none;
    color: #ff0;
    font-family: Consolas, monospace, monospace;
    font-size: 16px;
    line-height: 1.2;
    padding: 0;
}

button::before {
    content: "[";
}
button::after {
    content: "]";
}

button:hover {
    color: #000;
    background: #ff0;
    cursor: pointer;
}

.user-link {
    color: #0ff;
}

.user-link:hover {
    color: #000;
    background: #0ff;
}

textarea {
    padding: 0;
    outline: 0 none;
    border: 0 none;
    color: #ddd;
    background: none;
    font-family: Consolas, monospace, monospace;
    font-size: 16px;
    line-height: 1.2;
    width: 100%;
    resize: vertical;
}

.textarea-wrapper {
    width: round(min(100%, 80ch), 1ch);
}

.textarea-wrapper::before {
    display: block;
    overflow: hidden;
    content: "--------------------------------------------------------------------------------";
    color: #ff0;
}
.textarea-wrapper::after {
    display: block;
    overflow: hidden;
    content: "--------------------------------------------------------------------------------";
    color: #ff0;
}

.textarea-wrapper:focus-within::before,
.textarea-wrapper:focus-within::after {
    color: #0ff;
}

.user-comment-header:target {
    background: #00f;
}

.user-comment-content {
    color: #ff0;
    margin-bottom: 1em;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;

    max-height: 20em;
    padding-top: 4px;
    padding-bottom: 4px;
    overflow-y: auto;
}
