@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

html {
    cursor: url('images/cursor.png'), auto;
}

:root {
    --width: 720px;
    --font-main: "VT323", monospace;
    --font-secondary: "VT323", monospace;
    --font-scale: 1.4em;
    --background-color: #302413;
    --heading-color: #000000;
    --heading-background: #ffcc00;
    --text-color: #ffcc00;
    --link-color: #ffcc00;
    --visited-color: #ffcc00;
    --code-background-color: #000000;
    --code-color: #ffcc00;
    --blockquote-color: #ffcc00;
}

body {
    font-family: var(--font-secondary);
    font-size: var(--font-scale);
    margin: auto;
    padding: 20px 0px;
    max-width: var(--width);
    text-align: left;
    background-color: var(--background-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    color: var(--text-color);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-main);
    color: var(--heading-color);
    padding: 0.1em 0.6em;
    background: var(--heading-background);
    font-weight: 400;
    margin: 1em 0em;
}

h1 {
    font-size: 1.6em;
}

.post h1 {
    font-size: 1.4em;
}

h2 {
    font-size: 1.5em;
}

h3 {
    font-size: 1.4em;
}

h4 {
    font-size: 1.3em;
}

h5 {
    font-size: 1.2em;
}

h6 {
    font-size: 1.1em;
}

a {
    color: var(--link-color);
    cursor: url('images/cursor-hover.png') 6 0, pointer;
    text-decoration: underline;
}

a:hover {
    color: #000000 !important;
    background-color: var(--link-color);
    text-decoration: underline;
}

nav {
    background: #000000;
}

nav p {
    margin-top: 0px;
    margin-bottom: 0px;
}

nav a {
    color: #ffcc00;
    margin-right: 0px;
    padding: 6px 0.8em;
    display: inline-block;
}

nav a:hover {

    background: #ffcc00;
}

button {
    margin: 0;
    cursor: url('images/cursor-hover.png') 6 0, pointer;
}

main {
    border: 1px solid var(--text-color);
    padding: 10px 20px;
    margin: 20px 0px;
}

main {
    line-height: 1.6;
}

table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

table.narrow {
    width: 80%;
}

table td,
table th {
    overflow-wrap: break-word;
}

hr {
    border: 0;
    border-top: 1px dashed;
    color: #b89b27;
}

img {
    max-width: 100%;
}

code {
    font-family: monospace;
    padding: 2px;
    background-color: var(--code-background-color);
    color: var(--code-color);
    border-radius: 0px;
}

blockquote {
    border-left: 1px solid #999;
    color: var(--blockquote-color);
    padding-left: 20px;
    font-style: italic;
}

footer {
    text-align: center;
    color: var(--heading-color);
    padding: 0.2em 0.4em !important;
    background: var(--heading-background);
    font-size: 0.8em;
}

footer a {
    color: var(--heading-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.title:hover {
    text-decoration: line-through;
}

.title {
    text-decoration: none;
}

.title h1 {
    font-size: 1.8em;
    margin-top: 0px;
    margin-bottom: 0px;
    padding: 0em 0.4em !important;
}

p.indent {
    padding-left: 2em;
}

.tight {
    line-height: 0.9em;
}

.right {
    text-align: right;
}

tr.dos-right {
    text-align: right;
    padding-right: 3em;
}

.ascii {
    font-family: var(--font-main);
    overflow-x: auto;
    white-space: pre;
    margin: 1em 0;
    font-size: 0.6em;
    line-height: 0.6em;
}

/* CRT screen effect — adapted from https://aleclownes.com/2017/02/01/crt-display.html */
@keyframes flicker {
    0% {
        opacity: 0;
    }

    38% {
        opacity: 0;
    }

    39% {
        opacity: 0.4;
    }

    40% {
        opacity: 0;
    }

    74% {
        opacity: 0;
    }

    75% {
        opacity: 0.5;
    }

    76% {
        opacity: 0.1;
    }

    77% {
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

@keyframes textShadow {
    0% {
        text-shadow: 0.4px 0 1px rgba(0, 30, 255, 0.5), -0.4px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    25% {
        text-shadow: 3px 0 1px rgba(0, 30, 255, 0.5), -3px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    50% {
        text-shadow: 0.6px 0 1px rgba(0, 30, 255, 0.5), -0.6px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    100% {
        text-shadow: 1.6px 0 1px rgba(0, 30, 255, 0.5), -1.6px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
}

.crt a:hover {
    animation: textShadow 0.4s 1 forwards;
}

.crt::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    z-index: 2;
    pointer-events: none;
}

.crt::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    animation: flicker 16s infinite;
}

@media (prefers-reduced-motion: reduce) {
    .crt a:hover {
        animation: none;
    }

    .crt::before,
    .crt::after {
        animation: none;
        content: none;
    }
}

/* image reveal triggers */
a.reveal-trigger {
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

.reveal-container {
    padding: 10px 0px;
    margin: 10px 0px;
}

.reveal-loading {
    font-family: var(--font-main);
    font-size: 1em;
    color: var(--text-color);
    white-space: pre-wrap;
    margin: 0;
}

.reveal-container img {
    display: block;
    max-width: 100%;
    margin: 0.5em 0;
}

.reveal-close {
    display: block;
    font-family: var(--font-main);
    color: var(--text-color);
    text-decoration: none;
    cursor: url('images/cursor-hover.png') 6 0, pointer;
}

.reveal-close:hover {
    color: #000000;
    background-color: var(--link-color);
}

.reveal-close::after {
    content: "_";
    animation: blink-cursor 1s steps(1) infinite;
}

@keyframes blink-cursor {
    50% {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal-close::after {
        animation: none;
    }
}

/* generic typewriter effect */
.typewriter-cursor {
    animation: blink-cursor 1s steps(1) infinite;
}

@media (prefers-reduced-motion: reduce) {
    .typewriter-cursor {
        animation: none;
    }
}