
@font-face {
    font-family: 'Source Serif 4';
    font-style: normal;
    font-weight: 400 600;
    font-display: block;
    src: url('/assets/fonts/source-serif-4.woff2') format('woff2');
}

@font-face {
    font-family: 'Source Serif 4';
    font-style: italic;
    font-weight: 400;
    font-display: block;
    src: url('/assets/fonts/source-serif-4-italic.woff2') format('woff2');
}

* {
    margin: 0;
}

:root {
    --tc: #141414;
    --bc: #fefefe;
    --code-bc: #eeeeee;
    --code-tc: #000000;
    --hc: #3b5bdb;

    /* Syntax Highlighting - Light Theme */
    --syntax-keyword: #8736c9;
    --syntax-type: #008b94;
    --syntax-function: #007acc;
    --syntax-string: #c58600;
    --syntax-comment: #58658c;
    --syntax-number: #c95100;
    --syntax-punctuation: #8736c9;
    --syntax-variable: #000000;


    --font-main: 'Source Serif 4', 'Apple Garamond', Baskerville, serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --tc: #eeeeee;
        --bc: #000000;
        --code-bc: #141414;
        --code-tc: #fefefe;
        --hc: #8685ef;

        /* Syntax Highlighting - Dark Theme */
        --syntax-keyword: #9E8CFC;
        --syntax-type: #8AE8FF;
        --syntax-function: #7DB8FF;
        --syntax-string: #FFEF5C;
        --syntax-comment: #808080;
        --syntax-number: #FFCB47;
        --syntax-punctuation: #9E8CFC;
        --syntax-variable: #fefefe;
    }
}

body {
    font-family: var(--font-main);
    font-size: 18px;
    line-height: 1.45;
    color: var(--tc);
    background: var(--bc);
    max-width: 40em;
    margin: 0 auto;
    padding: 0 0.7em;
    text-align: left;
}

main {
    margin-bottom: 3rem;
}

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

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3,
h4,
h5,
h6,
header,
ul,
ol,
p,
code,
img,
pre {
    margin-bottom: 1rem;
}

h1 a.anchor, h2 a.anchor, h3 a.anchor, h4 a.anchor, h5 a.anchor, h6 a.anchor {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: bold;
    margin-right: 5px;
    text-decoration: none;
    opacity: 0;
    float: left;
    margin-left: -1em;
    line-height: 2rem;
}

h1 a.anchor, h2 a.anchor {
    margin-top: 0.2rem;
}

h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor {
    opacity: 1;
}

a.anchor:hover {
    text-decoration: underline;
}

a.anchor::before {
    content: "#";
}

ul {
    padding-left: 1em;
}


/* navigation */

section,
section:target~section:last-of-type {
    display: none;
}

section:target,
section:last-of-type {
    display: inherit;
    scroll-margin-top: 6em;
}

/* end navigation */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

header > a {
    font-size: 1.7em;
    font-weight: 700;
}

nav a {
    margin-left: 0.75em;
}

footer {
    text-align: center;
    margin-bottom: 3rem;
}

.signet-block {
    display: inline-block;
    text-align: center;
    line-height: 1;
}

.signet-block hr {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid var(--tc);
    opacity: 0.4;
}

.signet-block .signet {
    height: 2.75em;
    width: auto;
    display: block;
    margin: 0 auto 0;
    opacity: 0.9;
}

@media (prefers-color-scheme: light) {
    .signet-block .signet {
        filter: invert(1);
    }
}

.blogpost img {
    max-width: 75%;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

hr {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

code {
    word-break: break-word;
    background-color: var(--code-bc);
    color: var(--code-tc);
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

pre {
    display: block;
    background-color: var(--code-bc);
    border: 1px solid var(--tc);
    border-radius: 3px;
    padding: 1em;
    font-size: 0.9em;
    overflow: auto;
}

pre > code {
    padding: 0;
    background-color: transparent;
    color: var(--code-tc);
}

input,
textarea,
button {
    font-family: inherit;
    font-size: inherit;
}

.rss-icon {
    height: 0.8em;
    vertical-align: middle;
    margin-bottom: 0;
}

section#b li {
    display: flex;
}

.blog-date {
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    margin-right: 0.5em;
}

section#h h3 {
    margin-bottom: 0;
}

.blogpost li p:first-child {
    margin-bottom: 0;
}

.blogpost li p {
    margin-bottom: 1rem;
}

.blogtitle {
    margin-bottom: 0;
}

blockquote {
    margin: 1rem 0;
    padding: 0.1rem 0.8em;
    border-left: 4px solid var(--hc);
    font-style: italic;
}

blockquote p {
    margin: 0.5em 0;
}

table {
    border-collapse: collapse;
    margin-bottom: 1rem;
    width: 100%;
}

th, td {
    padding: 0.5em 1em;
    text-align: left;
    border-bottom: 1px solid color-mix(in srgb, var(--tc) 30%, transparent);
}

th {
    font-weight: 600;
    background: color-mix(in srgb, var(--tc) 8%, transparent);
    border-bottom: 2px solid color-mix(in srgb, var(--tc) 65%, transparent);
}

tr:last-child td {
    border-bottom: none;
}

.split-list li {
    display: flex;
    justify-content: space-between;
}

/* --- Syntax Highlighting --- */

pre code .comment,
pre code .punctuation.definition.comment {
    color: var(--syntax-comment);
    font-style: italic;
}

pre code .keyword,
pre code .storage.modifier,
pre code .storage.type.function {
    color: var(--syntax-keyword);
}

pre code .storage.type,
pre code .entity.name.type,
pre code .entity.name.struct {
    color: var(--syntax-type);
}

pre code .entity.name.function {
    color: var(--syntax-function);
}

pre code .string {
    color: var(--syntax-string);
}

pre code .constant.numeric,
pre code .constant.language {
    color: var(--syntax-number);
}

pre code .punctuation {
    color: var(--syntax-punctuation);
}

pre code .variable {
    color: var(--syntax-variable);
    font-style: italic;
}
