@font-face {
    font-family: "Site Sans";
    src: url("/fonts/site-sans.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --motion-duration: 550ms;
    --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --paper: #ffffff;
    --ink: #09090b;
    --body: #27272a;
    --secondary: #71717a;
    --rule: #e4e4e7;
    --muted: #f4f4f5;
    --sans: "Site Sans", Arial, sans-serif;
    --serif: var(--sans);
    --mono: "SFMono-Regular", Consolas, monospace;
    --bg: var(--paper);
    --fg: var(--ink);
    --fg-strong: var(--ink);
    --fg-body: var(--body);
    --fg-soft: var(--secondary);
    --fg-muted: var(--secondary);
    --fg-faint: var(--secondary);
    --line: var(--rule);
    --line-soft: var(--rule);
}

* { box-sizing: border-box; }
html { font-size: 14px; color-scheme: light; }
body.site {
    min-width: 280px;
    margin: 0;
    background: var(--paper);
    color: var(--body);
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
.site * { font-size: 1rem; }
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font: inherit;
    line-height: inherit;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
strong, b { font-weight: 500; }
small, sup, sub, code, pre { font-size: inherit; }
code, pre { font-family: inherit; }
a { color: var(--ink); text-underline-offset: 0.2em; text-decoration-color: var(--rule); text-decoration-thickness: 1px; transition: color var(--motion-duration) var(--motion-ease), text-decoration-color var(--motion-duration) var(--motion-ease), background-color var(--motion-duration) var(--motion-ease); }
a:visited { color: var(--ink); }
a:hover { text-decoration-color: var(--ink); }
button:focus-visible, a:focus-visible, [role="tabpanel"]:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 4px;
}
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; }
::selection { color: var(--paper); background: var(--ink); }
.sr-only, .reading-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.skip-link {
    position: absolute;
    top: -100px;
    left: 20px;
    background: var(--paper);
}
.skip-link:focus { top: 12px; }

.site-shell { width: min(calc(100% - 48px), 640px); margin: 80px auto 72px; }
.site-header { margin-bottom: 32px; }
.site-name { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 400; text-decoration: none; }
.site-name span { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em; transition: text-decoration-color var(--motion-duration) var(--motion-ease); }
.site-name:hover span { text-decoration-color: var(--secondary); }
.site-header .dot-pattern circle { transition: transform 700ms var(--motion-ease) var(--dot-delay, 0ms), opacity 500ms var(--motion-ease); }
.dot-pattern { display: block; flex: 0 0 auto; width: 22px; height: 22px; color: currentColor; }
.site-ornament { display: flex; align-items: center; justify-content: flex-end; margin-top: 48px; color: var(--secondary); }
.site-ornament .dot-pattern--trail { width: 20px; height: 20px; }

.tab-set, .tab-panels, .tab-panel { min-width: 0; }
.tab-list { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 0 0 28px; padding: 0; }
.tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin: 0;
    padding: 3px 0;
    border: 0;
    border-radius: 0;
    color: var(--secondary);
    background: transparent;
    font: inherit;
    font-weight: 400;
    line-height: 1.5;
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--motion-duration) var(--motion-ease), background-color var(--motion-duration) var(--motion-ease), border-color var(--motion-duration) var(--motion-ease), text-decoration-color var(--motion-duration) var(--motion-ease);
}
.tab:hover { color: var(--ink); }
.work-tabs .tab { text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1px; text-underline-offset: 7px; }
.work-tabs .tab:hover { text-decoration-color: var(--secondary); }
.tab[aria-selected="true"] {
    color: var(--ink);
    text-decoration-line: underline;
    text-decoration-color: var(--ink);
    text-decoration-thickness: 1px;
    text-underline-offset: 7px;
}
.home-tabs > .tab-list, .site-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    gap: 3px;
    margin: 0 0 34px;
    padding: 4px;
    border-radius: 8px;
    background: var(--muted);
}
.home-tabs > .tab-list > .tab, .site-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 36px;
    padding: 5px 13px;
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--secondary);
    background: transparent;
    font-weight: 400;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--motion-duration) var(--motion-ease), background-color var(--motion-duration) var(--motion-ease), border-color var(--motion-duration) var(--motion-ease), text-decoration-color var(--motion-duration) var(--motion-ease);
}
.home-tabs > .tab-list > .tab:hover, .site-nav a:hover { color: var(--ink); background: #eaeaec; }
.home-tabs > .tab-list > .tab[aria-selected="true"], .site-nav a[aria-current="page"] {
    border-color: var(--rule);
    color: var(--ink);
    background: var(--paper);
    box-shadow: 0 1px 2px #00000008;
    text-decoration: none;
}
.home-tabs > .tab-list > .tab:focus-visible, .site-nav a:focus-visible { outline-offset: 2px; }
.tab-panel { margin: 0; padding: 0; }
.work-tabs .tab-list { gap: 24px; margin-bottom: 26px; }
.work-heading { margin-bottom: 24px; }
.work-heading h1, .work-heading h2 { color: var(--ink); font-weight: 400; }

.project-list, .story-list, .link-list { margin: 0; padding: 0; list-style: none; }
.project { margin-bottom: 24px; }
.project:last-child { margin-bottom: 0; }
.project dt { font-weight: 400; }
.project dt a { display: inline; text-decoration: underline; text-decoration-color: transparent; }
.project dt a:hover { text-decoration-color: var(--secondary); }
.project dd { margin: 2px 0 0; color: var(--secondary); }
.story { margin-bottom: 28px; }
.story:last-child { margin-bottom: 0; }
.story-top { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.story-title { color: var(--ink); font-weight: 400; text-decoration: underline; text-decoration-color: transparent; }
.story-title:hover { text-decoration-color: var(--secondary); }
.story-date { flex-shrink: 0; color: var(--secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.story-description { margin: 3px 0 0; color: var(--secondary); }
.book-note { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--rule); }
.book-note p { margin: 0 0 6px; color: var(--secondary); }
.book-note p:first-child { color: var(--ink); }
.book-note p:last-child { margin-bottom: 0; }
.links-page, .links-heading, .page-index { margin: 0; padding: 0; }
.links-heading, .page-index > h1 { margin-bottom: 24px; }
.link-list > li { margin-bottom: 18px; }
.link-list > li:last-child { margin-bottom: 0; }
.link-list > li > a { text-decoration: underline; text-decoration-color: transparent; }
.link-list > li > a:hover { text-decoration-color: var(--secondary); }
.site-directory { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 28px; }

.document-surface, .paper, .document-content, .prose { min-width: 0; margin: 0; padding: 0; }
.document-heading { margin: 0 0 28px; }
.document-heading h1 { margin-bottom: 4px; color: var(--ink); font-weight: 400; }
.document-heading time, .document-heading > p { color: var(--secondary); font-variant-numeric: tabular-nums; }
.document-heading > p { margin: 3px 0 0; }
.back-link { margin: 32px 0 0; }
.prose > :first-child { margin-top: 0; }
.prose p, .about-copy p { margin: 0 0 1.25em; }
.prose > :last-child, .about-copy > :last-child { margin-bottom: 0; }
.prose h2, .prose h3, .prose h4 { margin: 2em 0 1em; color: var(--ink); font-weight: 400; }
.prose a { overflow-wrap: anywhere; }
.prose img { display: block; max-width: 100%; height: auto; margin: 1.5em auto; }
.prose pre { max-width: 100%; margin: 1.5em 0; padding: 0; overflow-x: auto; font: inherit; line-height: 1.65; white-space: pre; }
.prose code { padding: 0; font: inherit; }
.prose pre code { white-space: inherit; }
.prose blockquote { margin: 1.5em 0; padding-left: 20px; border-left: 1px solid var(--rule); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 1em 0 1.5em; padding-left: 1.25em; }
.prose li { margin-bottom: 0.4em; }
.prose table { width: 100%; max-width: 100%; border-collapse: collapse; }
.prose th, .prose td { padding: 8px; vertical-align: top; overflow-wrap: anywhere; }
.prose th { font-weight: 400; text-align: left; }
.prose hr { margin: 2em 0; border: 0; border-top: 1px solid var(--rule); }
.paper .marginnote, .paper .margin-note {
    position: static;
    float: none;
    display: block;
    width: auto;
    max-width: 100%;
    margin: 1.5em 0;
    padding: 0 0 0 20px;
    border-left: 1px solid var(--rule);
    background: transparent;
}
.marginnote-label { display: block; margin-bottom: 6px; color: var(--secondary); }
.marginnote-copy > :last-child { margin-bottom: 0; }
.about-content, .about-copy { margin: 0; padding: 0; }

.reading-intro { margin: 0 0 24px; color: var(--secondary); font-style: normal; }
.reading-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.reading-table th:first-child, .reading-table td:first-child { width: 55px; }
.reading-table th:nth-child(2), .reading-table td:nth-child(2) { width: 42%; }
.paper .read-book td, .prose .read-book td, .read-book td {
    padding: 20px 10px;
    border-bottom: 1px solid var(--rule);
    vertical-align: top;
}
.paper .read-book:first-child td, .prose .read-book:first-child td, .read-book:first-child td { padding-top: 0; }
.paper .read-book td:first-child, .prose .read-book td:first-child, .read-book td:first-child { padding-left: 0; }
.paper .read-book td:last-child, .prose .read-book td:last-child, .read-book td:last-child { padding-right: 0; }
.paper .read-book:last-child td, .prose .read-book:last-child td, .read-book:last-child td { border-bottom: 0; }
.read-book-cover-link { display: block; width: 40px; line-height: 0; text-decoration: none; }
.paper .prose .read-book-cover, .prose .read-book-cover, .read-book-cover {
    display: block;
    width: 40px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    height: auto;
    margin: 0;
    border: 0;
}
.read-book-title { display: block; color: var(--ink); font-weight: 400; line-height: 1.65; text-decoration: underline; text-decoration-color: transparent; }
.read-book-title:hover { text-decoration-color: var(--secondary); }
.read-book-author { display: block; margin-top: 3px; color: var(--secondary); line-height: 1.65; }
.read-book-summary { color: var(--body); font-style: normal; line-height: 1.65; }
.read-book-summary p { margin: 0; }

@media (max-width: 700px) {
    .site-shell { margin-top: 48px; margin-bottom: 48px; }
}

@media (max-width: 540px) {
    .site-shell { width: calc(100% - 40px); margin-top: 32px; }
    .site-header { margin-bottom: 28px; }
    .home-tabs > .tab-list, .site-nav { gap: 2px; margin-bottom: 30px; }
    .home-tabs > .tab-list > .tab, .site-nav a { padding-left: 9px; padding-right: 9px; }
    .work-tabs .tab-list { margin-bottom: 24px; }
    .site-ornament { margin-top: 40px; }
    .story-top { display: block; }
    .story-date { display: block; margin-top: 2px; }
    .reading-table, .reading-table tbody { display: block; }
    .read-book { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0 14px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
    .read-book:first-child { padding-top: 0; }
    .read-book:last-child { border-bottom: 0; }
    .paper .read-book td, .prose .read-book td, .read-book td,
    .paper .read-book:first-child td, .prose .read-book:first-child td, .read-book:first-child td {
        display: block;
        width: auto;
        padding: 0;
        border: 0;
    }
    .read-book-cover-cell { grid-row: 1 / span 2; }
    .read-book-summary-cell { margin-top: 10px; }
}

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

@media print {
    .site-shell { width: auto; max-width: none; margin: 0; }
    .site-header, .site-nav, .tab-list, .skip-link, .site-ornament { display: none !important; }
    .tab-panel, .paper, .document-surface { margin: 0; padding: 0; }
    .prose pre { white-space: pre-wrap; }
    .project, .story, .read-book { break-inside: avoid; }
}

.prose pre, .prose code { font-family: var(--mono); }
.no-script-nav { display: flex; flex-wrap: wrap; gap: 16px; max-width: 680px; margin: 32px auto; padding: 0 20px; }

.dated-list { margin: 0; padding: 0; list-style: none; }
.dated-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.dated-list li:first-child { padding-top: 0; }
.dated-list li:last-child { border-bottom: 0; }
.dated-list a { text-decoration: underline; text-decoration-color: transparent; }
.dated-list a:hover { text-decoration-color: var(--secondary); }
.dated-list time { color: var(--secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 540px) {
    .work-tabs .tab-list { gap: 16px; }
    .dated-list li { gap: 12px; }
}
@media print {
    :root { --paper: #ffffff; --ink: #000000; --body: #000000; --secondary: #595959; --rule: #d1d1d1; }
}

.dot-field { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; color: var(--secondary); opacity: 0.85; transition: opacity 900ms var(--motion-ease); }
.dot-field[data-paused="true"] { opacity: 0.075; }
.site-shell { position: relative; z-index: 1; }
#home-panel { min-height: max(260px, calc(100svh - 290px)); }
body:has(.dot-field) .site-ornament { display: none; }
@media print { .dot-field { display: none; } #home-panel { min-height: 0; } }
.dot-field canvas, .dot-field-fallback { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.dot-field canvas { visibility: hidden; }
.dot-field[data-ready] canvas { visibility: visible; }
.dot-field[data-ready] .dot-field-fallback { display: none; }
@media (max-width: 540px) {
    .home-tabs > .tab-list > .tab, .site-nav a { padding-left: 7px; padding-right: 7px; }
}
@media (max-width: 360px) {
    .home-tabs > .tab-list, .site-nav { gap: 0; padding: 3px; }
    .home-tabs > .tab-list > .tab, .site-nav a { padding-left: 5px; padding-right: 5px; }
}

/* Home opens with the same dot field, filling before the interface appears. */
body:has(.dot-field) .site-shell { transition: opacity 650ms var(--motion-ease), visibility 650ms; }
.site-loading .site-shell, .site-loading .skip-link { opacity: 0; visibility: hidden; pointer-events: none; }
.site-loading { overflow: hidden; }
.site-loading .dot-field-fallback { visibility: hidden; }
@media (prefers-reduced-motion: reduce), print {
    .site-loading .site-shell, .site-loading .skip-link { opacity: 1; visibility: visible; pointer-events: auto; }
}

.site .shape-readout {
    position: relative;
    margin: 0;
    pointer-events: none;
    white-space: pre;
    color: #a1a1aa;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    line-height: 1.6;
    letter-spacing: 0;
}
@media print { .shape-readout { display: none; } }
