:root {
    color-scheme: light dark;
}

html {
    scroll-behavior: smooth;
}

body {
    --color: black;
    --color-inverted: white;
    background-color: var(--color-inverted);

    display: flex;
    flex-direction: column;
    margin: 0.3em;
    min-height: 97dvh;
    padding-left: 1em;
    padding-right: 1em;

    align-items: center;
    justify-content: left;

    line-height: 1.2;
}

header {
    width: 100%;
    max-width: 700px;
    padding: 0 1em;
    border-bottom: 1px solid var(--color);
    margin-bottom: 1rem;
}

header > h1 {
    font-style: italic;
    font-weight: normal;
    font-size: large;
}

header > h1 > a {
    color: unset;
}

header > h1 > a#blog_domain {
    text-decoration-line: underline;
}

header > h1 > a#blog_domain:hover {
    text-decoration: none;
}

header > h1 > a#apex_domain {
    text-decoration-line: underline;
    text-decoration-style: wavy;
}

header > h1 > a#apex_domain:hover {
    text-decoration: none;
}

nav > ul {
    padding: 0;
    list-style: none;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
}

nav > ul > li > a {
    display: block;
    margin-right: 0.4em;
    padding: 0.1em 0.9em;
    border: 1px solid;
}

footer {
    position: sticky;
    top: 100%;
    opacity: 0.5;
}

footer > p {
    margin: 0;
}

img {
    font-family: monospace;
    color: grey;
    text-align: left;
}

main {
    width: 100%;
    max-width: 700px;
    padding: 0 1em;
}

main p {
    text-align: justify;
}

main ul, main ol {
    padding-left: 1.1em;
}

p + ul {
    margin-top: -0.9em;
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

sup, sub {
    line-height: 0;
}

.frontmatter {
    opacity: 0.8;
    padding-left: 1em;
}

ol.posts {
    margin-top: 1ex;
    list-style: disc;
}

ol.posts > li {
    margin-bottom: 2ex;
}

.tags > ul {
    list-style: none;
    display: inline-flex;
    padding: 0;
    margin: 0;
}

.tags > ul :not(:last-child)::after {
    content: ", ";
}

.tags > ul :not(:first-child) {
    padding-left: 0.3em;
}

.tag {
    font-size: smaller;
    font-family: monospace;
    text-transform: lowercase;
    display: inline-block;
    border: 1px solid;
    padding: 0.1em 0.2em;
    color: var(--color);
    position: relative;
    top: -0.2ex;
}

.tag:hover, .tag:focus, .tag:active {
    text-decoration: none;
}

.inline-metadata {
    font-size: smaller;
    opacity: 0.8;
}

.title {
    font-style: italic
}

.handle {
    font-family: monospace;
}

.handle::before {
    content: "@";
    opacity: 0.8;
    font-style: normal;
    display: inline-block;
}

.help, .commit {
    cursor: help;
    text-decoration: none;
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-decoration-color: silver;
}

main :is(h1, h2) > a {
    color: unset;
    outline: none;
    cursor: alias;
    margin-left: -0.8em;
    padding-right: 0.3em;
}

main :is(h1, h2) > a:hover {
    text-decoration: none;
}

main :is(h1, h2) > a::before {
    content: "§";
    opacity: 0;
    transition: opacity 0.01s;
}

main :is(h1, h2):hover > a::before,
:is(h1, h2):focus > a::before {
    opacity: 0.3;
}

main :is(h1, h2) > a:hover::before {
    opacity: 0.4;
}

main :is(h1, h2) > a:focus::before,
main :is(h1, h2) > a:active::before {
    opacity: 0.5;
}

blockquote {
    opacity: 0.9;
    font-style: italic;
    padding-left: 1em;
    border-left: 3px solid #9993;
    margin-left: 1e;
}

q::before, blockquote > p::before {
    content: open-quote;
}

q::after, blockquote > p::after {
    content: close-quote;
}

blockquote::before {
    float: left;
}

blockquote::after {
    margin-left: -0.3em;
}

@supports not (hanging-punctuation: first) {
    blockquote::before {
        text-indent: -0.45em;
    }
}

:target {
    animation: highlight 3s ease;
}

@keyframes highlight {
    0% {
        color: gold;
    }
}

@media (prefers-color-scheme: dark) {
    body {
        --color: white;
        --color-inverted: #0d1117;
    }

    a {
        color: deepskyblue;
    }
}
