:root {
    color-scheme: light dark;
    --background: #ffffff;
    --text: #202124;
    --muted: #687078;
    --line: #e2e5e8;
    --link: #075c9e;
    --link-hover: #003f70;
    --code: #f5f6f7;
    --focus: #c96a00;
    --width: 44rem;
}

* {
    box-sizing: border-box;
}

html {
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1.03rem;
    line-height: 1.65;
}

a {
    color: var(--link);
    text-decoration-thickness: 0.07em;
    text-underline-offset: 0.16em;
}

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

a:focus-visible {
    outline: 0.16rem solid var(--focus);
    outline-offset: 0.18rem;
}

.skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1;
    padding: 0.4rem 0.65rem;
    transform: translateY(-200%);
    background: var(--text);
    color: var(--background);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-nav,
.page-shell {
    width: min(calc(100% - 2.5rem), var(--width));
    margin-inline: auto;
}

.site-nav {
    display: flex;
    padding-top: 1.5rem;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.site-name {
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 650;
    text-decoration: none;
}

.site-links {
    display: flex;
    gap: 1.2rem;
}

.site-links a {
    padding-block: 0.35rem;
    color: var(--muted);
    font-size: 0.88rem;
    text-decoration: none;
}

.site-links a:hover,
.site-links a[aria-current="page"] {
    color: var(--text);
}

.site-links a[aria-current="page"] {
    text-decoration: underline;
    text-underline-offset: 0.3rem;
}

.page-shell {
    padding: clamp(3.5rem, 8vw, 5.5rem) 0 6rem;
}

h1,
h2,
h3 {
    color: var(--text);
    line-height: 1.2;
}

h1 {
    max-width: 24ch;
    margin: 0 0 1.5rem;
    font-size: clamp(2rem, 7vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.035em;
}

h2 {
    margin: 3.2rem 0 1rem;
    font-size: 1.35rem;
    font-weight: 650;
    letter-spacing: -0.015em;
}

h3 {
    margin: 2.4rem 0 0.8rem;
    font-size: 1.1rem;
}

p,
ul,
ol,
pre,
blockquote {
    margin: 1.1rem 0;
}

ul,
ol {
    padding-left: 1.35rem;
}

li + li {
    margin-top: 0.55rem;
}

strong {
    font-weight: 650;
}

.home .page-shell > p:first-of-type {
    max-width: 40rem;
    color: var(--muted);
    font-size: 1.12rem;
}

.home .page-shell > ul {
    padding: 0;
    list-style: none;
}

.home .page-shell > ul li {
    margin: 1rem 0;
}

.about .page-shell > p:first-of-type {
    float: right;
    width: min(28%, 11rem);
    margin: 0 0 1.5rem 2rem;
}

.about .page-shell > p:first-of-type img {
    display: block;
    width: 100% !important;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: 50% 45%;
}

.about h2 {
    clear: both;
}

.article-header {
    margin-bottom: 3rem;
}

.article-header h1 {
    margin-bottom: 0.8rem;
}

.article-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

code,
kbd,
samp {
    background: var(--code);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.88em;
}

code {
    padding: 0.1em 0.25em;
}

pre {
    padding: 1rem;
    overflow-x: auto;
    background: var(--code);
    line-height: 1.5;
    tab-size: 4;
}

pre code {
    padding: 0;
    background: transparent;
    font-size: 0.82rem;
}

div.sourceCode {
    margin: 1.4rem 0;
}

div.sourceCode pre {
    margin: 0;
}

math[display="inline"] {
    white-space: nowrap;
}

p > math[display="block"] {
    display: block;
    width: calc(100% + 0.6rem);
    margin: 1.5rem -0.3rem;
    padding: 0.65rem 0.3rem;
    overflow-x: auto;
    overflow-y: hidden;
    font-family: "STIX Two Math", "Cambria Math", "Latin Modern Math", serif;
    font-size: 1.08em;
    text-align: center;
    scrollbar-width: thin;
}

blockquote {
    margin-left: 0;
    padding-left: 1rem;
    border-left: 2px solid var(--line);
    color: var(--muted);
}

@media (max-width: 38rem) {
    body {
        font-size: 1rem;
    }

    .site-nav,
    .page-shell {
        width: min(calc(100% - 2rem), var(--width));
    }

    .site-nav {
        align-items: flex-start;
        gap: 1rem;
    }

    .site-links {
        gap: 0.8rem;
    }

    .page-shell {
        padding-top: 3.25rem;
    }

    .about .page-shell > p:first-of-type {
        float: none;
        width: min(55%, 11rem);
        margin: 0 0 1.5rem;
    }

    p > math[display="block"] {
        font-size: 0.96em;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: #141516;
        --text: #e7e9eb;
        --muted: #a7adb3;
        --line: #34383b;
        --link: #75b7e8;
        --link-hover: #acd5f3;
        --code: #202326;
        --focus: #f2a33a;
    }

    img {
        filter: brightness(0.9);
    }
}

@media print {
    :root {
        --background: #ffffff;
        --text: #000000;
        --muted: #333333;
    }

    .site-header,
    .skip-link {
        display: none;
    }

    .page-shell {
        width: 100%;
        padding: 0;
    }

    pre,
    p > math[display="block"] {
        break-inside: avoid;
    }
}
