@font-face {
    font-family: "Inter";
    src: url(../fonts/Inter_Variable.ttf);
}

@font-face {
    font-family: "RobotoSlab";
    src: url(../fonts/RobotoSlab_Variable.ttf);
}

body {
    --bg0_5: #101010;
    --bg: #181818;
    --bg1_5: #202020;
    --bg2: #404040;
    --fg: #eeeeee;
    --box-shadow: 0 0 0.7em 0.7em #101010;
    --margin: 4rem;
    --margin-ft: 20vw;

    position: relative;
    margin: 0;
    width: 100%;
    overflow-x: hidden;

    background: var(--bg);
    color: var(--fg);
    font-family: "Inter", sans-serif;
    font-size: 12pt;
    font-weight: 500;
}
@media (max-width: 768pt) {
    body {
        --margin: 1rem;
    }
}

/* icon links */
a.icon {
    height: 1.5em;
}
a.icon > img {
    height: 1.5em;
    filter: invert(1);
}

/* header and footer */
header, footer {
    width: 100%;
    padding: 1em;
    box-sizing: border-box;

    box-shadow: var(--box-shadow);
    border-bottom: 1px solid var(--bg1_5);
}
header {
    display: flex;
    flex-direction: row;
    align-items: center;
}

header > a,
header > a:visited {
    margin-right: 1em;

    text-decoration: none;
    color: var(--fg);
}
header > a > abbr {
    text-decoration: none;
}
header > a:nth-child(1) {
    padding-right: 1em;
    border-right: 1px solid var(--bg2);
}

/* fancy abbreviations */
#abbr-host {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;

    pointer-events: none;
}
.fancy-abbr {
    position: absolute;
    padding: 0.2em 0.5em;

    opacity: 0;
    background: var(--fg);
    color: var(--bg);
    border-radius: 1em;
    transition: top 0.1s ease,
                left 0.1s ease,
                opacity 0.1s ease;

    pointer-events: none;
}

/* fancy abbreviations */
main abbr {
    position: relative;
    text-decoration: underline;
}
/* main abbr::before {
    content: "";
    display: inline-block;
    width: 0.7em;
    height: 0.7em;

    background: url(../icons/bard-line.svg);
    opacity: 0.5;
} */
main abbr::after {
    content: "?";
    display: inline-block;
    opacity: 0.5;
    font-size: 0.9em;
    position: relative;
    top: -0.2em;
}
main a,
main a:visited {
    /* text-decoration: none; */
    color: var(--fg);
}
main a:not(.img)::after {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    position: relative;
    top: 0;
    right: 0;

    background: url(../icons/arrow-right-up-line.svg);
    filter: brightness(50%);
    transition: top 0.2s, right 0.2s;
}
main a:hover::after {
    top: -0.1em;
    right: -0.1em;
}

/* article */
main {
    overflow: auto;
    padding: var(--margin);
}
main h1 {
    width: fit-content;
    margin: 0 calc(var(--margin) * 2);

    font-family: Inter;
    font-size: 3em;
    font-weight: 800;
    color: var(--fg);
}
main #article-meta {
    margin-left: calc(var(--margin) * 2);
}
@media (max-width: 768pt) {
    main h1 {
        margin: 0 var(--margin);
    }
    main #article-meta {
        margin-left: var(--margin);
    }
}
main h2 {
    width: fit-content;
    margin: var(--margin) var(--margin) 0 var(--margin);

    font-family: Inter;
    font-size: 2em;
    font-weight: 800;
    color: var(--fg);
}
main h2::before {
    font-family: monospace;
    font-size: 0.5em;
    font-weight: 300;
    display: inline-block;
    width: var(--margin);
    content: var(--heading-nr);
}
@media (max-width: 768pt) {
    main h2::before {
        display: none;
    }
}
main p,
main ul {
    width: 40em;
    margin: 1em 0 1em calc(var(--margin) * 2);

    font-family: RobotoSlab;
    font-size: 1.2em;
    font-weight: 350;
}
@media (max-width: 768pt) {
    main p,
    main ul {
        width: auto;
        margin: 1em var(--margin);
    }
}
main ul li::marker {
    content: "– ";
}
main figure {
    font-size: 1.2em;
    width: 40em;
    margin: 2em 0 2em calc(var(--margin) * 2);
    display: flex;
    flex-direction: column;
    align-items: center;
}
@media (max-width: 768pt) {
    main figure {
        width: auto;
        margin: 2em var(--margin);
    }
}
main figure figcaption {
    font-family: RobotoSlab;
    font-weight: 400;
    margin-top: 1em;
    text-align: center;
}
main figure img,
main figure video,
main figure iframe {
    max-width: 40em;
    max-height: 20em;
}
@media (max-width: 768pt) {
    main figure img,
    main figure video,
    main figure iframe {
        max-width: 80vw;
        max-height: 50vh;
    }
}
main figure img {
    text-indent: -100%;
    overflow: hidden;
}
main figure code {
    white-space: pre-wrap;
    font-size: 0.8em;
    width: 46.5rem;
    background: var(--bg0_5);
    padding: 1em;
    border-radius: 1em;
}
@media (max-width: 768pt) {
    main figure code {
        max-width: 80vw;
        overflow-x: scroll;
    }
}
main figure code .kw { color: #bb80b3; }
main figure code .sym { color: #82aaff; }
main figure code .var { color: #f07178; }
main figure code .num { color: #ffcb6b; }
main figure code .str { color: #c3e88d; }
main figure code .cmt { color: #767676; }

/* table of contents */
#toc {
    position: fixed;
    top: calc(var(--margin) * 2);
    right: calc(var(--margin) * 2);
}
@media (max-width: 1050pt) {
    #toc {
        display: none;
    }
}
#toc h2 {
    font-size: 1.2em;
    margin: 0;
}
#toc ul {
    width: auto;
    margin: 0;
}
#toc a::after {
    display: none;
}

/* footer */
footer {
    border-top: 1px solid var(--bg1_5);
}
footer ul {
    list-style: none;
    opacity: 0.5;
}
footer a,
footer a:visited {
    color: var(--fg);
}
