@font-face {
    font-family: "Source Serif 4";
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url("/fonts/source-serif-4-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Source Serif 4";
    font-style: italic;
    font-weight: 200 900;
    font-display: swap;
    src: url("/fonts/source-serif-4-latin-italic.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/ibm-plex-mono-400-italic.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/fonts/ibm-plex-mono-500.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root,
[data-theme="light"] {
    color-scheme: light;
    --bg: #f7f4ed;
    --ink: #1a1a1a;
    --muted: #5c564c;
    --accent: #0d6e86;
    --hash: #3d93ab;
    --rule: #e4dccf;
    --code-bg: #efeae1;
    --focus: #0d6e86;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #1c1b19;
    --ink: #f4f0e6;
    --muted: #b7b0a4;
    --accent: #8fd4ea;
    --hash: #5ebbd4;
    --rule: #34322c;
    --code-bg: #28261f;
    --focus: #8fd4ea;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: "Source Serif 4", "Iowan Old Style", Palatino, "Palatino Linotype", "Times New Roman", serif;
    font-size: 1.125rem;
    line-height: 1.65;
    font-optical-sizing: auto;
    font-synthesis-weight: none;
    text-rendering: optimizeLegibility;
}

::selection {
    background: #d7f3f8;
    color: #1a1a1a;
}

[data-theme="dark"] ::selection {
    background: #1d4d5c;
    color: #f4f0e6;
}

.page {
    --pad: 1.5rem;
    width: min(100%, calc(42rem + (var(--pad) * 2)));
    margin: 0 auto;
    padding: 0.45rem var(--pad) 4.5rem;
}

.skip {
    position: absolute;
    left: 0.75rem;
    top: 0.45rem;
    z-index: 5;
    transform: translateY(-160%);
    padding: 0.3rem 0.55rem;
    background: var(--bg);
    color: var(--ink);
    border: 1px solid var(--rule);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.8rem;
    text-decoration: none;
}

.skip:focus {
    transform: none;
}

.toolbar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
    margin: 0 calc(var(--pad) * -1) 1.15rem;
    padding: 0.6rem var(--pad) 0.4rem;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(8px);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.toolbar button {
    margin: 0;
    padding: 0.28rem 0.5rem;
    border: 1px solid var(--rule);
    border-radius: 2px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.72rem;
    line-height: 1.2;
    letter-spacing: 0.01em;
    cursor: pointer;
}

.toolbar button:hover {
    color: var(--ink);
    border-color: var(--muted);
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.site-header {
    margin: 0.35rem 0 1.85rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--rule);
}

.site-header h1 {
    margin: 0;
    font-size: clamp(2.35rem, 6vw, 3.15rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.05;
}

.role {
    margin: 0.4rem 0 0;
    font-size: 1.35rem;
    font-weight: 480;
    line-height: 1.25;
}

.tagline {
    margin: 0.55rem 0 0;
    color: var(--muted);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.78rem;
    line-height: 1.45;
}

.links {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.55rem;
    margin-top: 1.05rem;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.82rem;
    line-height: 1.45;
}

.links a {
    color: var(--accent);
    text-decoration: none;
}

.links a:hover {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.dot {
    color: var(--hash);
}

.kicker {
    margin: 0.2rem 0 1.1rem;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.8rem;
}

.kicker a {
    color: var(--muted);
    text-decoration: none;
}

.kicker a:hover {
    color: var(--accent);
}

.markdown a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
}

.markdown a:hover {
    text-decoration-thickness: 2px;
}

.markdown h2,
.markdown h3,
.markdown h4,
.markdown h1 {
    font-weight: 600;
    line-height: 1.25;
    text-wrap: balance;
    scroll-margin-top: 2.6rem;
}

.markdown h1 {
    margin: 0 0 1rem;
    font-size: clamp(1.85rem, 4vw, 2.35rem);
    letter-spacing: -0.02em;
}

.markdown h2 {
    margin: 0 0 0.85rem;
    font-size: 1.45rem;
}

.markdown h3 {
    margin: 0 0 0.2rem;
    font-size: 1.16rem;
}

.markdown h3 code {
    margin-left: 0.4rem;
    padding: 0;
    background: none;
    color: var(--muted);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.68em;
    font-weight: 400;
    letter-spacing: 0.04em;
    vertical-align: 0.15em;
}

.markdown h4 {
    margin: 1.2rem 0 0.35rem;
    font-size: 1.05rem;
}

.markdown h1 a,
.markdown h2 a,
.markdown h3 a,
.markdown h4 a {
    color: inherit;
    text-decoration-color: var(--accent);
}

.md-hash::before {
    margin-right: 0.45rem;
    color: var(--hash);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.78em;
    font-weight: 400;
}

.resume h2 > .md-hash::before { content: "#"; }
.resume h3 > .md-hash::before { content: "##"; }
.resume h4 > .md-hash::before { content: "###"; }

.doc h1 > .md-hash::before { content: "#"; }
.doc h2 > .md-hash::before { content: "##"; }
.doc h3 > .md-hash::before { content: "###"; }
.doc h4 > .md-hash::before { content: "####"; }

.resume-section + .resume-section {
    margin-top: 1.85rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
}

.entry + .entry {
    margin-top: 1.55rem;
}

.markdown p {
    margin: 0.7rem 0;
    text-wrap: pretty;
}

.markdown p.meta {
    margin: 0.15rem 0 0.8rem;
    color: var(--muted);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.8rem;
    line-height: 1.5;
}

.markdown p.meta code {
    padding: 0;
    background: transparent;
    color: inherit;
    font-size: 1em;
}

.skills p {
    margin-top: 0.15rem;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.92rem;
    line-height: 1.7;
}

.skills p + p {
    margin-top: 0.35rem;
}

.markdown ul,
.markdown ol {
    margin: 0.45rem 0 0.2rem;
    padding-left: 0;
}

.markdown ul {
    list-style: none;
}

.markdown ul li {
    position: relative;
    margin: 0.55rem 0;
    padding-left: 1.15rem;
}

.markdown ul li::before {
    content: "-";
    position: absolute;
    left: 0;
    color: var(--hash);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.92em;
}

.markdown ol {
    padding-left: 1.3rem;
}

.markdown li p {
    margin: 0.25rem 0;
}

.markdown strong {
    font-weight: 650;
}

.markdown code {
    padding: 0.05em 0.28em;
    border-radius: 2px;
    background: var(--code-bg);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.84em;
}

.markdown pre {
    overflow-x: auto;
    margin: 1rem 0;
    padding: 0.8rem 1rem;
    border: 1px solid var(--rule);
    background: var(--code-bg);
    font-size: 0.82rem;
    line-height: 1.5;
}

.markdown pre code {
    padding: 0;
    background: transparent;
    font-size: inherit;
}

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

.markdown img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 1rem 0 0.35rem;
    border: 1px solid var(--rule);
}

.markdown p > em:only-child {
    display: block;
    margin-top: -0.15rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.markdown hr {
    margin: 1.6rem 0;
    border: 0;
    border-top: 1px solid var(--rule);
}

@media (max-width: 640px) {
    body {
        font-size: 1.05rem;
    }

    .page {
        --pad: 1.1rem;
        padding-bottom: 3rem;
    }

    .role {
        font-size: 1.18rem;
    }

    .markdown h2 {
        font-size: 1.32rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

@media print {
    :root,
    [data-theme="light"],
    [data-theme="dark"] {
        color-scheme: light;
        --bg: #fff;
        --ink: #000;
        --muted: #222;
        --accent: #000;
        --hash: #333;
        --rule: #bbb;
        --code-bg: transparent;
        --focus: #000;
    }

    html,
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 10.5pt;
        line-height: 1.45;
    }

    .page {
        width: auto;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .chrome,
    .skip,
    .toolbar {
        display: none !important;
    }

    .site-header {
        margin-bottom: 0.9rem;
        padding-bottom: 0.7rem;
        border-bottom-color: #000;
    }

    .site-header h1 {
        font-size: 22pt;
    }

    .role {
        font-size: 13pt;
    }

    .tagline,
    .links,
    .markdown p.meta,
    .skills p,
    .md-hash::before,
    .markdown ul li::before {
        font-family: "IBM Plex Mono", ui-monospace, monospace;
    }

    .links {
        display: block;
        margin-top: 0.45rem;
    }

    .links a {
        display: block;
        color: #000;
        text-decoration: none;
    }

    .dot {
        display: none;
    }

    .markdown a,
    .links a {
        color: #000;
        text-decoration: underline;
        text-decoration-color: #000;
        overflow-wrap: anywhere;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-family: "IBM Plex Mono", ui-monospace, monospace;
        font-size: 0.78em;
        font-weight: 400;
        word-break: normal;
    }

    .markdown a[href^="http"]::after {
        content: "\A(" attr(href) ")";
        white-space: pre-wrap;
        line-height: 1.35;
    }

    .resume-section + .resume-section {
        border-top-color: #000;
    }

    .entry,
    .markdown img,
    .markdown pre,
    .markdown blockquote {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    h1, h2, h3, h4 {
        break-after: avoid;
        page-break-after: avoid;
    }

    p, li {
        orphans: 3;
        widows: 3;
    }

    .markdown img {
        border-color: #ccc;
    }

    .markdown code {
        border: 0;
        background: transparent;
    }

    .page::after {
        content: "noahosterhout.com";
        display: block;
        margin-top: 1.4rem;
        color: #222;
        font-family: "IBM Plex Mono", ui-monospace, monospace;
        font-size: 9pt;
    }

    @page {
        size: letter;
        margin: 0.7in;
    }
}
