:root {
    --color-rgbOrig: 255, 168, 106;
    --color-rgb: 255, 168, 106;
    --color: rgb(var(--color-rgb));
    --color-bg: 34, 33, 41;
    --bg: rgb(var(--color-bg));
    --max-chars: 90;
    --max-width: calc(var(--max-chars) * var(--cw) + 2 * var(--2cw));
    --blur: 5px;
    --border: 1px solid var(--color);
    --glow: rgba(var(--color-rgb), 0.625);
    --hglow: rgba(var(--color-rgb), 0.3125);
    --underline: rgba(var(--color-rgb), 0.5);
    --underlineHover: rgba(var(--color-rgb), 0.75);

    --hch: 7px;
    --ch: 14px;
    --lh: 18px;

    --cw: 8px;
    --2cw: 16px;
    --3cw: 24px;
}
@font-face {
    font-family: "PageFont";
    src: url("fonts/gohufont-uni-14.woff2") format("woff2");
}
@font-face { 
    font-family: "PageFont";   
    src: url("fonts/gohufont-uni-14b.woff2") format("woff2"); 
    font-weight: bold;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
}
h1, h2, h3, h4, h5, h6, p, pre, code, li, ul, ol {
    font: inherit;
    margin: 0 0 var(--lh) 0;
    text-shadow: inherit;
    padding: 0;
    &:last-child:not(li:not(:last-child) > *) {
        margin-bottom: 0;
    }
}

li {
    margin: 0;
}

section h1, section h2 {
    font-weight: bold;
}

section h1::before { 
    content: "▓ " / ""; 
}
section h2::before { 
    content: "▒ " / ""; 
}
section h3::before { 
    content: "░ " / ""; 
}
section h4::before { 
    content: "░░ " / ""; 
}
section h5::before { 
    content: "░░░ " / ""; 
}
section h6::before { 
    content: "░░░░ " / ""; 
}

ol {
    padding-inline-start: var(--3cw);
}
li li { margin-bottom: 0; }

pre, blockquote {
    margin: 0 var(--cw) var(--lh) 0;
}

img, svg, video {
    max-width: 100%;
    height: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
    margin: 0 0 var(--lh) 0;
    border: 1px solid var(--color);
    position: relative;
    isolation: isolate;
}
table::before {
    content: "";
    position: absolute;
    inset: -3px -1px;
    border: var(--border);
    pointer-events: none;
    z-index: -1;
    box-shadow:
        0 0 var(--blur) var(--glow),
        inset 0 -6px 6px -6px var(--hglow);
}
th, td {
    padding: 0 var(--cw);
    text-align: left;
    vertical-align: top;
    border-right: 1px solid var(--color);
}
th:last-child, td:last-child { border-right: 0; }
tbody tr:nth-child(even) { background-color: rgba(var(--color-rgb), 0.075); }
th {
    font-weight: normal;
    background-color: rgba(var(--color-rgb), 0.15);
    border-bottom: 1px solid var(--color);
    vertical-align: middle;
}

dl { margin: 0 0 var(--lh) 0; }
dt { font-weight: bold; }
dd { margin: 0 0 0 var(--2cw); }

pre:has(> code:only-child) {
    background: rgba(var(--color-rgb), 0.075);
}

code {
    white-space: pre;
    background-color: rgba(var(--color-rgb), 0.15);
    padding-block: calc((var(--lh) - var(--ch)) / 2);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

pre > code:first-child {
    background: transparent
}

blockquote {  
    position: relative;
    white-space: wrap;
    padding-left: var(--2cw);
    overflow: hidden;
    &::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>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A";
        position: absolute;
        left: 0;
        top: -1px;
        white-space: pre;
        line-height: inherit;
        font: inherit;
        color: inherit;
        pointer-events: none;
        user-select: none;
    }
}

hr {
    border: 0;
    height: var(--lh);
    margin: 0 0 var(--lh) 0;
    overflow: hidden;
    white-space: nowrap;
    font: inherit;
    margin-top: var(--lh);
    color: inherit;
    &::before {
        content: "════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════";
        display: block;
    }
}

ul {
    list-style: "* ";
    padding: 0 0 0 var(--2cw);
}
small {
    font-size: inherit;
    font-weight: normal;
    color: rgba(var(--color-rgb), 0.75);
    text-shadow: 0 0 var(--blur) rgba(var(--color-rgb), 0.3);
}
a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--underline);
}
a:hover { 
    text-decoration: underline;
    text-decoration-color: var(--underlineHover);
}

body {
    position: relative;
    overflow-x: clip;
    background-color: var(--bg);
    background-image: radial-gradient(rgba(var(--color-rgb), 0.125), var(--bg) 100%);
    background-attachment: fixed;
    color: var(--color);
    font: var(--ch)/var(--lh) "PageFont", Inconsolata, monospace;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: none;
    text-shadow: 0 0 var(--blur) var(--glow);
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='1' height='2' shape-rendering='crispEdges'><rect width='1' height='1' fill='rgba(0,0,0,0.15)'/></svg>");
    background-size: 1px 2px;
    background-repeat: repeat;
    image-rendering: pixelated;
}
::selection {
    background: rgba(var(--color-rgb), 0.85);
    color: rgba(var(--color-bg), 0.75);
    text-shadow: inset 0 0 2px var(--glow);
}
.cursor {
    color: var(--underline);
    animation: blink 2s steps(1) 5;
}
@keyframes blink {
    0%  { opacity: 0%; }
    50% { opacity: 100%; }
}

body > header, article {
    max-width: var(--max-width);
    margin-inline: auto;
}
body > header {
    margin-block: var(--lh);
}

body>header>h1 a, body>nav a, article>header>h2 a {
    text-decoration: none;
    &:hover {
        text-decoration: underline;
        text-decoration-color: var(--underlineHover);
    }
}

body > nav {
    position: absolute;
    top: 0;
    right: max(var(--2cw), calc((100% - var(--max-width)) / 2));
    white-space: nowrap;
}
.link { padding-left: var(--cw); }

article {
    position: relative;
    isolation: isolate;
    overflow-wrap: break-word;
    border-top: var(--border);
    border-bottom: var(--border);
    padding: var(--lh) var(--2cw);
    margin: var(--lh) auto;
    box-shadow: inset 0 0 var(--blur) var(--hglow);
}
article::before {
    content: "";
    position: absolute;
    inset: -3px 0px;
    z-index: -1;
    border: var(--border);
    pointer-events: none;
    box-shadow:
        0 0 var(--blur) var(--glow),
        inset 0 -6px 6px -6px var(--hglow);
}
article > header {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: var(--cw);
    margin: 0;
}
article > header > h2 {
    text-transform: uppercase;
    &::before { content: "░▒▓█ " / ""; }
}
article > header > p {
    text-align: right;
    white-space: nowrap;
    align-self: baseline;
}
article > header time::after,
article > nav > ul > li > h3 > a > time::after {
    content: "▐" / "";
}
article > section, article > nav {
    text-align: justify;
}
article > nav > ul > li > h3 > a {
    display: flex;
    justify-content: space-between;
    gap: var(--2cw);
}

article > nav > ul > li > h3 > a > time {
    margin-left: auto;
    white-space: nowrap;
}

button, .button, input, select {
    font: inherit;
    font-weight: bold;
    text-shadow: inherit;
    border: var(--border);
    padding: 0.3em 0.5em;
}
button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: var(--cw);
    background: rgba(var(--color-rgb), 0.85);
    color: rgba(var(--color-bg), 0.85);
    text-shadow: none;
    cursor: pointer;
    box-shadow:
        0 0 var(--blur) var(--glow),
        4px 4px 0 0 var(--underline);
}
button:hover, .button:hover { background: rgba(var(--color-rgb), 0.95); }
button:active, .button:active {
    transform: translate(1px, 1px);
    box-shadow:
        0 0 var(--blur) var(--glow),
        3px 3px 0 0 var(--underline);
}
input, select {
    font-weight: inherit;
    color: inherit;
    background: transparent;
    margin-top: 0;
}
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input:focus, select:focus {
    outline: none;
    box-shadow: 0 0 var(--blur) var(--glow);
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--cw);
    margin-top: var(--lh);
}
