:root {
    --color-bg: #171313;
    --color-bg-translucent: #171313d0;
    --color-bg-contrast: #110f0f;
    --color-link: #f2a524;
    --color-link-desat: #f0bb61;
    --color-highlight: #a15422;
    --color-fg: #fcfbfb;
    --color-fg-mid: #999;
}

@media (prefers-color-scheme: light) {
    :root {
        --color-bg: #fbf6f4;
        --color-bg-translucent: #fbf6f4d0;
        --color-bg-contrast: #fff8f4;
        --color-link: #9d411d;
        --color-link-desat: #93471a;
        --color-highlight: #d79469;
        --color-fg: #533131;
        --color-fg-mid: #888282;
    }
}

body {
    background-color: var(--color-bg);
    color: var(--color-fg);
    padding-left: 120px;
    padding-top: 100px;
    padding-right: 60px;
}
@media (max-width: 740px) {
    body {
        padding-left: 60px;
        padding-right: 30px;
        padding-top: 50px;
    }
}
@media (max-width: 650px) {
    body {
        padding-left: 30px;
        padding-right: 15px;
        padding-top: 30px;
        margin: 0;
    }
}

svg#logo {
    position: absolute;
    top: 56px;
    left: 24px;
    width: 800px;
    height: 80px;
}
@media (max-width: 740px) {
    svg#logo {
        left: 12px;
        top: 56px;
        width: 600px;
        height: 60px;
    }
}
@media (max-width: 650px) {
    svg#logo {
        left: 12px;
        top: 48px;
        width: 400px;
        height: 40px;
    }
}
@media (max-width: 430px) {
    svg#logo {
        left: 12px;
        top: 18px;
        width: 320px;
        height: 32px;
    }
}
svg#logo #stop938 {
    stop-color: #c0c0d1;
}
svg#logo #stop940 {
    stop-color: #fcfbfb;
}
svg#logo #logorect1 {
    stroke: #574c60;
}
svg#logo #logorect2 {
    stroke: #312b36;
}
@media (prefers-color-scheme: light) {
    svg#logo #stop938 {
        stop-color: #30302e;
    }
    svg#logo #stop940 {
        stop-color: #030404;
    }
    svg#logo #logorect1 {
        stroke: #a893b9;
    }
    svg#logo #logorect2 {
        stroke: #c2aad6;
    }
}

article {
    position: relative;
    max-width: 500px;
}
@media (max-width: 650px) {
    article {
        max-width: 450px;
    }
}
@media (max-width: 405px) {
    article {
        max-width: 345px;
    }
}

@media (max-width: 650px) {
    ul {
        padding-left: 20px;
    }
}

div.annotation-pane {
    position: absolute;
    top: 0;
    left: 600px;
    width: calc(min(500px, 100vw - 780px));
    height: 100%;
}
@media (max-width: 980px) {
    div.annotation-pane {
        left: 550px;
        width: calc(100vw - 720px);
    }
}

header nav > a {
    position: fixed;
    top: 14px;
    right: 4px;
    text-align: center;
    background-color: var(--color-bg-translucent);
    border-radius: 12px;
    padding: 8px;
}
header nav > a img {
    width: 64px;
    filter: brightness(80%);
}
header nav > a img:hover {
    filter: brightness(100%);
}
header nav > a label {
    display: block;
}
header nav ul {
    position: fixed;
    top: 117px;
    right: 8px;
    width: 320px;
    background-color: var(--color-bg-contrast);
    visibility: hidden;
    transition: opacity 0.3s;
    opacity: 0;
    margin: 0;
    padding: 16px 32px;
    box-shadow: rgba(0, 0, 0, 0.1) -10px 10px 13px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}
header nav ul li {
    list-style: none;
    width: 48%;
    text-align: center;
}
header nav ul li.heading {
    width: 100%;
}
header nav ul li.heading h3 {
    margin: 16px 0 0 0;
}
header nav ul li.icon {
    display: inline-block;
    width: 24%;
}
header nav > a:hover + ul,
header nav > a:focus + ul,
header nav ul:hover,
header nav:focus-within > ul {
    visibility: visible;
    opacity: 1;
}
@media (max-width: 740px) {
    header nav > a img {
        width: 48px;
    }
    header nav ul {
        top: 101px;
    }
}
@media (max-width: 650px) {
    header nav > a img {
        width: 32px;
    }
    header nav ul {
        top: 85px;
    }
}

p {
    width: 100%;
}
p:target,
li:target {
    border: 2px solid var(--color-highlight);
    border-radius: 4px;
}

p,
ul,
ol {
    font-family: "Inter Tight", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 13pt;
    line-height: 23pt;
}

p.feed-link img {
    vertical-align: middle;
    padding-right: 8px;
}

li {
    margin-bottom: 16px;
}

p.subtitle {
    font-size: 12pt;
    font-style: italic;
    color: var(--color-fg-mid);
    margin-bottom: 12px;
}

p.image-caption {
    font-size: 12pt;
    font-style: italic;
    font-weight: 200;
    text-align: center;
}

code {
    font-family: "Fira Code", monospace;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 12pt;
}
pre {
    background-color: rgba(128, 128, 128, 0.1);
    font-family: "Fira Code", monospace;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 12pt;
    overflow-x: scroll;
}

strong {
    font-weight: 600;
}

h1 {
    font-family: "Jomolhari", serif;
    font-weight: 800;
    font-style: normal;
    font-size: 36pt;
    margin-bottom: 12px;
    max-width: 800px;
    line-height: 64px;
}
@media (max-width: 650px) {
    h1 {
        font-size: 28pt;
        line-height: 48px;
    }
}

div.top-spacer {
    height: 146px;
}
@media (max-height: 450px) {
    div.top-spacer {
        height: 46px;
    }
}

div.title-underline {
    position: relative;
    padding-bottom: 12px;
    margin-bottom: 64px;
}
div.title-underline::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 300px;
    height: 1px;
    background-color: var(--color-highlight);
}

h2 {
    font-family: "Jomolhari", serif;
    font-weight: 400;
    font-style: normal;
    font-size: 20pt;
}
h3 {
    font-family: "Jomolhari", serif;
    font-weight: 400;
    font-style: normal;
    font-size: 16pt;
}

a {
    color: var(--color-link);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

blockquote {
    position: relative;
    margin-bottom: 26px;
}
blockquote::before {
    content: "“";
    position: absolute;
    left: -24px;
    font-size: 26pt;
    top: -4px;
}
blockquote::after {
    content: "”";
    position: absolute;
    right: 0px;
    font-size: 26pt;
    bottom: -28px;
}

blockquote p {
    font-style: italic;
    font-weight: 200;
}

img,
video {
    max-width: 1000px;
}
@media (max-width: 1240px) {
    img,
    video {
        max-width: calc(100vw - 240px);
    }
}
img.article-width,
video.article-width {
    width: 100%;
}
img.article-centered,
video.article-centered {
    margin: 0 auto;
    display: block;
}
@media (max-width: 740px) {
    img,
    video {
        max-width: 100%;
    }
}

div.footnote::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 300px;
    height: 1px;
    background-color: var(--color-highlight);
}

div.footnote {
    position: relative;
    padding-top: 20px;
    margin-top: 64px;
    padding-left: 0;
}
div.footnote hr {
    display: none;
}
div.footnote ol {
    padding-left: 0;
    margin: 0;
}
div.footnote li {
    list-style-type: none;
    margin: 0;
}
div.annotation-pane p {
    padding: 4px;
}
div.annotation-pane p,
div.footnote p {
    margin: 0;
    overflow: hidden;
    font-size: 14px;
    font-weight: 300;
    box-sizing: border-box;
}
div.annotation-pane .footnote-backref {
    display: none;
}
div.annotation-pane p img,
div.footnote p img {
    max-width: 250px;
    display: block;
}

ul.post-list {
    padding: 0;
}
ul.post-list li {
    list-style: none;
    border-bottom: 2px solid var(--color-highlight);
    padding-bottom: 24px;
    padding-top: 16px;
}
ul.post-list li a {
    color: var(--color-link-desat);
}

div.copyright {
    font-size: 12pt;
    color: var(--color-fg-mid);
    margin-top: 64px;
    font-style: italic;
}

/* Progress bar */

header {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1;
    width: 100%;
}
.progress-container {
    width: 100%;
    height: 8px;
    background: var(--color-bg);
}
.progress-bar {
    height: 4px;
    background: var(--color-highlight);
    width: 0%;
}
