:root {
    --bg: hsl(44 100% 96%);
    --bg-accent: #f3f3f3;
    --bg-accent-stronger: rgba(0, 0, 0, 0.1);
    --font-color: black;
    --font-color-light: #333;
    --primary: hsl(209.29deg 100% 50%);
    --primary-accent: hsl(209.29deg 100% 60%);
    --primary-contrast: var(--bg);
    --secondary: hsl(4.11deg 89.62% 58%);
    --secondary-light: hsl(4.11deg 89.62% 68%);
    --secondary-contrast: white;
    --invert-filter: none; /* handy for icons */
}

@media print {
    /* ensure white background for print */
    :root {
        --bg: white;
    }
}

/* don't use dark mode for print */
@media screen {
    /* Dark mode */
    :root.dark-mode {
        --bg: hsl(20deg 4.23% 14%);
        --bg-accent: hsl(20deg 4.23% 24%);
        --bg-accent-stronger: hsl(20deg 4.23% 35%);
        --font-color: #f8f8f8;
        --font-color-light: #a3a3a3;
        --invert-filter: invert(1);
    }
}


@font-face {
    font-family: 'FuturaBT-Medium';
    src: url('/fonts/FuturaBT-Medium.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'JetBrainsMono';
    src: url('/fonts/JetBrainsMono-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

::selection {
    background: var(--primary);
    color: var(--primary-contrast);
}

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    line-height: 1.5em;
    background-color: var(--bg);
    background-image: url("/noise.png");
    background-repeat: repeat;
    color: var(--font-color);
    transition: background-color 0.25s;
}

@media print {
    background-image: none;
}

.main-column {
    margin: auto;
    max-width: 50em;
    padding: 0 1em 8em;
}

.main-column p {
    text-align: justify;
}

a.author {
    font-family: "FuturaBT-Medium", sans-serif;
    font-weight: bold;
    font-variant: petite-caps;
}

h1 {
    font-family: "FuturaBT-Medium", sans-serif;
    line-height: 1em;
    position: relative;
    color: var(--primary)
}

h2 {
    font-family: "FuturaBT-Medium", sans-serif;
    position: relative;
    color: var(--secondary);
}

@media (min-width: 56em) {
    h1:before {
        content: "#";
        font-family: "Consolas", monospace;
        position: absolute;
        left: -1em;
    }

    h2:before {
        content: "#";
        font-family: "Consolas", monospace;
        position: absolute;
        left: -1em;
    }
}

h1 {
    margin-block-start: 2em;
    margin-block-end: 1em;
}

/*For
<h2>Some smaller text above the header</h2>
<h1>Actual header text</h1>
*/
h2 + h1 {
    margin-block-start: 0;
}

h2:has(+h1) {
    margin-block-start: 8em;
    font-size: 1.2em;
    color: var(--primary);
}

/* Remove content */
h2:has(+h1):before {
    content: none;
}

h2 {
    margin-block-start: 1.5em;
    margin-block-end: 0.2em;
}

h3 {
    margin-block-end: 0.2em;
    font-variant: petite-caps;
}

pre {
    padding: 0.75em 1em;
    font-family: "JetBrainsMono", ui-monospace;
    background-color: black;
    color: white;
    border-radius: 1em;
}

code {
    padding: 0.1em 0.35em;
    font-family: "JetBrainsMono", ui-monospace;
    font-size: 1em;
    background-color: black;
    color: white;
    border-radius: 0.5em;
}
