:root {
    color-scheme: light;
    --bg: #fffbf4;
    --text: #1a1a1a;
    --text-muted: #7f7d7a;
    --text-dim: #bfbcb7;
    --accent: #ff9b00;
    --accent-visited: #865000;
    --code-bg: #fbf1c7;
    --border: #fbf1c7;
    --seperator: #656565;
}

:root[data-theme="light"] {
    color-scheme: light;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: black;
    --text: #e8e6e3;
    --text-muted: rgb(168, 168, 168);
    --text-dim: rgb(126, 126, 126);
    --code-bg: #282828;
    --border: #282828;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        color-scheme: dark;
        --bg: black;
        --text: #e8e6e3;
        --text-muted: rgb(168, 168, 168);
        --text-dim: rgb(126, 126, 126);
        --code-bg: #282828;
        --border: #282828;
    }
}

::-moz-selection {
    color: black;
    background: var(--accent);
}

::selection {
    color: black;
    background: var(--accent);
}

html {
    width: 100%;
    overflow-y: scroll;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-size: 1rem;
    font-family: monospace;
}

hr {
    border: 0;
    border-top: 1px solid var(--seperator);
}

.description {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.date {
    color: var(--text-dim);
    font-size: 0.8rem;
}

a:link {
    color: var(--accent);
}

a:visited {
    color: var(--accent-visited);
}

nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

nav > a:not(:last-child) {
    border-inline-end: 1px solid var(--seperator);
    padding-right: 0.5rem;
    margin-right: 0.5rem;
}

img {
    max-width: 100%;
}

video {
    max-width: 100%;
}

pre {
    padding: 1em;
    overflow: auto;
}

:not(pre) > code {
    padding: 0em 0.1em 0.05em 0.1em;
    background-color: var(--code-bg);
}

table,
td,
th {
    border-collapse: collapse;
}

td,
th {
    padding: 0.5em;
    border: 1px solid var(--border);
}

th {
    background-color: var(--code-bg);
}

/* Force code-block color-scheme to match manual toggle */
:root[data-theme="light"] pre,
:root[data-theme="light"] pre * {
    color-scheme: light !important;
}

:root[data-theme="dark"] pre,
:root[data-theme="dark"] pre * {
    color-scheme: dark !important;
}
