:root {
    color-scheme: light;
    --paper: #f8f8f6;
    --ink: #11110f;
    --muted: #5f605c;
    --rule: #9b9c96;
    --accent: #0645ad;
    --measure: 41rem;
    --font: "Helvetica Neue", Arial, Helvetica, sans-serif;
}
* {
    box-sizing: border-box;
}

html {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    font-kerning: normal;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

body {
    min-height: 100dvh;
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.55;
}

.site-shell {
    width: min(calc(100% - 2.5rem), var(--measure));
    margin: 0 auto;
    padding: 4.5rem 0 3rem;
}

.article-page {
    --measure: 60ch;
}

.site-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.45rem 0 0.7rem;
    border-top: 3px solid var(--ink);
    border-bottom: 1px solid var(--rule);
}

.site-name {
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: none;
}

nav {
    display: flex;
    gap: 0.9rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

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

nav a:hover,
nav a[aria-current="page"] {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

main {
    padding-top: 1.5rem;
}

h1,
h2,
h3,
p,
ul,
ol {
    margin-top: 0;
}

h1 {
    max-width: 22ch;
    margin-bottom: 0.65rem;
    font-size: clamp(1.55rem, 5vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.12;
    text-wrap: balance;
}

h2 {
    margin: 2.25rem 0 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    line-height: 1.4;
    text-transform: uppercase;
}

h3 {
    margin: 1.75rem 0 0.65rem;
    font-size: 1rem;
    line-height: 1.4;
}

p {
    margin-bottom: 0.75rem;
}

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

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

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

.home-intro {
    max-width: 38rem;
}

.home-intro h1 {
    font-size: 1.35rem;
    letter-spacing: -0.01em;
}

.prose {
    max-width: 62ch;
}

.prose p,
.article-body p {
    text-wrap: pretty;
}

.home-section {
    margin-top: 2.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--ink);
}

.section-heading-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.section-heading-row h2 {
    margin: 0;
}

.section-heading-row > a {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.75rem;
}

.page-header {
    margin-bottom: 1.4rem;
}

.page-header h1 {
    margin-bottom: 0;
}

.page-kicker {
    margin-bottom: 0.45rem;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-kicker a {
    color: inherit;
}

.writing-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rule);
}

.writing-list li {
    padding: 0.8rem 0 0.85rem;
    border-bottom: 1px dotted var(--rule);
}

.writing-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 1rem;
}

.writing-row > a {
    color: var(--ink);
    font-weight: 700;
}

.writing-row time,
.article-header time {
    color: var(--muted);
    font-size: 0.69rem;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    letter-spacing: 0.055em;
    white-space: nowrap;
}

.writing-list li > p {
    margin: 0.3rem 0 0;
    color: var(--muted);
    font-size: 0.91rem;
    line-height: 1.45;
}

.article-header {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--ink);
}

.article-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.55rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.article-meta a {
    color: var(--muted);
}

.article-header h1 {
    margin-bottom: 0;
}

.article-body {
    padding-top: 1.5rem;
    font-size: 1rem;
    line-height: 1.5rem;
}

.article-body p {
    margin-bottom: 0;
    overflow-wrap: break-word;
    text-align: left;
    text-wrap: pretty;
    hyphens: auto;
    hyphenate-limit-chars: 7 3 3;
}

.article-body p + p {
    margin-top: 0.75rem;
}

.article-body h2 {
    margin: 3rem 0 1.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--ink);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.5rem;
    text-transform: none;
    text-wrap: balance;
}

.article-body ul,
.article-body ol,
.prose ul,
.prose ol {
    padding-left: 1.25rem;
}

.article-body li,
.prose li {
    margin-bottom: 0.35rem;
}

.article-body blockquote {
    margin: 1.5rem 0;
    padding-left: 1rem;
    border-left: 3px solid var(--ink);
}

.article-body code,
.article-body pre {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.88em;
}

.article-body img,
.prose img,
.article-body video,
.prose video {
    display: block;
    width: 100%;
    height: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--rule);
}

.article-body figure,
.prose figure {
    margin: 1.5rem 0;
}

.article-body figure img,
.prose figure img,
.article-body figure video,
.prose figure video {
    margin: 0;
}

.article-body figcaption,
.prose figcaption {
    margin-top: 0.45rem;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.35;
}

.media-embed {
    aspect-ratio: 16 / 9;
    margin: 1.5rem 0;
}

.media-embed iframe {
    width: 100%;
    height: 100%;
    border: 1px solid var(--rule);
}

.article-body pre {
    max-width: 100%;
    padding: 0.9rem;
    overflow-x: auto;
    border: 1px solid var(--rule);
}

.project-summary-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rule);
}

.project-summary-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px dotted var(--rule);
}

.project-summary-list a,
.work-heading > a {
    color: var(--ink);
    font-weight: 700;
}

.work-duration {
    color: var(--muted);
    font-size: 0.69rem;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    letter-spacing: 0.055em;
    white-space: nowrap;
}

.work-list {
    margin: 1.5rem 0 0;
    padding: 0;
    border-top: 1px solid var(--rule);
    list-style: none;
}

.work-collection + .work-collection {
    margin-top: 2.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--ink);
}

.work-collection > h2 {
    margin-top: 1.75rem;
}

.work-collection + .work-collection > h2 {
    margin-top: 0;
}

.experiment-list {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--rule);
    list-style: none;
}

.experiment-list li {
    padding: 0.8rem 0 0.85rem;
    border-bottom: 1px dotted var(--rule);
}

.experiment-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 1rem;
}

.experiment-row > a {
    color: var(--ink);
    font-weight: 700;
}

.experiment-meta {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    color: var(--muted);
    font-size: 0.69rem;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    white-space: nowrap;
}

.experiment-list li > p {
    margin: 0.3rem 0 0;
    color: var(--muted);
    font-size: 0.91rem;
    line-height: 1.45;
}

.collection-empty {
    margin: 0;
    color: var(--muted);
    font-size: 0.91rem;
}

.work-item {
    padding: 0.8rem 0 0.85rem;
    border-bottom: 1px dotted var(--rule);
}

.work-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 1rem;
}

.work-item > p {
    margin: 0.3rem 0 0;
    color: var(--muted);
    font-size: 0.91rem;
    line-height: 1.45;
}

.work-item img,
.work-item video {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 0.8rem;
    border: 1px solid var(--rule);
}

.projects-copy ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.projects-copy li {
    padding: 0.65rem 0;
    border-bottom: 1px dotted var(--rule);
}

.projects-copy li:first-child {
    border-top: 1px solid var(--rule);
}

.books-copy ul {
    columns: 2;
    column-gap: 2rem;
}

.books-copy li {
    break-inside: avoid;
}

.site-footer {
    display: flex;
    gap: 0.75rem;
    margin-top: 3.25rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--rule);
    font-size: 0.72rem;
}

.site-footer a {
    color: var(--muted);
}

@media (max-width: 600px) {
    .site-shell {
        width: min(calc(100% - 2rem), var(--measure));
        padding-top: 2rem;
    }

    .site-header {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    nav {
        justify-content: space-between;
        gap: 0.55rem;
    }

    .writing-row {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }

    .experiment-row {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }

    .project-summary-list li,
    .work-heading {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }

    .experiment-meta {
        grid-row: 1;
        justify-content: space-between;
    }

    .writing-row time {
        grid-row: 1;
        color: var(--muted);
    }

    .books-copy ul {
        columns: 1;
    }
}
