:root {
    color-scheme: dark;

    --light-bg: #FFFFFF;
    --light-fg: #000000;

    --dark-bg: #1C1B22;
    --dark-fg: #FBFBFE;

    --md-opacity: 60%;
}

body {
    background-color: light-dark(var(--light-bg), var(--dark-bg));
    color: light-dark(var(--light-fg), var(--dark-fg));

    font-size: 20px;
    line-height: 1.3;

    max-width: 1000px;

    margin: 1em 4em;
}

@media only screen and (max-width: 1000px) {
    body {
        margin: 1em 2em;
    }
}

@media only screen and (max-width: 600px) {
    body {
        font-size: 18px;
        line-height: 1.2;

        margin: 0.5em 1.5em;
    }
}

a {
    color: light-dark(#0000EE, #8C8CFF);
}

a:visited {
    color: light-dark(#551A8B, #FFADFF);
}

a:active {
    color: light-dark(#EE0000, #FA6464);
}

h1, h2 {
    font-family: sans-serif;
}


h1::before { content: '# ';  opacity: var(--md-opacity); }
h2::before { content: '## '; opacity: var(--md-opacity); }

strong {
    &::before, &::after { content: '**'; opacity: var(--md-opacity); }
}

a {
    white-space: nowrap;
    text-decoration: none;
}

a:hover {
    &, & code {
        text-decoration: underline;
    }
}

a:not(.anchor):not([data-footnote-ref]) {
    &::before { content: '['; opacity: var(--md-opacity); }
    &::after  { content: ']'; opacity: var(--md-opacity); }
}

a[data-footnote-ref] {
    &::before { content: '[^'; opacity: var(--md-opacity); }
    &::after  { content: ']';  opacity: var(--md-opacity); }
}

code {
    font-size: 1rem;
    display: inline-block;

    &::before, &::after { content: '`'; opacity: var(--md-opacity); }
}

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

ul li::before {
    content: '* ';
    font-family: monospace;
    opacity: var(--md-opacity);
}

section.footnotes li:target {
    animation-name: highlight;
    animation-duration: 2s;
}

@keyframes highlight {
    10%, 90% {
        background-color: light-dark(
            oklch(from var(--light-bg) calc(l - 0.1) c h),
            oklch(from var(--dark-bg) calc(l + 0.1) c h)
        );
    }

    100% {
        background-color: inherit;
    }
}
