:root {
    color-scheme: light;
    --ink: #252820;
    --muted: #66685d;
    --line: #d8d9cd;
    --paper: #faf9f4;
    --reading-width: 720px;
    --sans: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { overflow-wrap: break-word; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 18px/1.7 Georgia, "Times New Roman", serif;
    -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 5px;
}
img, video { display: block; max-width: 100%; height: auto; }
iframe { max-width: 100%; border: 0; }
figure { margin: 0; }
figcaption {
    margin-top: 10px;
    color: var(--muted);
    font: 13px/1.55 var(--sans);
    text-align: center;
}
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { line-height: 1.25; }
h1 { font-size: clamp(32px, 5vw, 42px); font-weight: 400; }
h2 { font-size: 28px; font-weight: 400; }
h3 { font-size: 23px; font-weight: 400; }
h4 { font-size: 20px; }

.site-shell { width: min(100% - 44px, var(--reading-width)); margin: 60px auto 36px; }
.site-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 22px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.site-identity { min-width: 0; }
.site-title { margin: 0; font: 400 30px/1.1 Georgia, "Times New Roman", serif; letter-spacing: -1px; }
.site-header-home .site-title { font-size: clamp(44px, 7vw, 72px); letter-spacing: -2.5px; }
.site-title a { text-decoration: none; }
.site-byline { margin: 12px 0 0; color: var(--muted); font: 13px/1.4 var(--sans); }
.primary-nav { flex-shrink: 0; padding-bottom: 1px; }
.nav { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 0; margin: 0; list-style: none; }
.nav a { font: 14px/1.5 var(--sans); color: var(--muted); text-decoration: none; }
.nav a:hover, .nav-current a { color: var(--ink); text-decoration: underline; }
#tof-main { margin-top: 46px; }
#tof-main:focus { outline: none; }
.home-intro p { max-width: 580px; margin-bottom: 0; font-size: clamp(23px, 3vw, 29px); line-height: 1.4; }
.home-writing { margin-top: 62px; }
.section-label { margin-bottom: 24px; color: var(--muted); font: 500 11px/1.4 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; }
.post-card + .post-card { margin-top: 34px; padding-top: 34px; border-top: 1px solid var(--line); }
.post-card h2 { margin-bottom: 12px; font-size: 34px; font-weight: 400; letter-spacing: -0.6px; }
.post-card h2 a { text-decoration: none; }
.post-card h2 a:hover, .post-card h2 a:focus-visible { text-decoration: underline; }
.post-card-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font: 12px/1.5 var(--sans); }
.post-card .post-card-meta { margin-bottom: 12px; }
.post-card p { margin-bottom: 0; }
.archive-header { margin-bottom: 34px; }
.archive-header h1 { margin-bottom: 16px; }
.archive-header p { margin-bottom: 0; color: var(--muted); }
.article-header { margin-bottom: 32px; }
.single-article { max-width: 640px; margin-right: auto; margin-left: auto; }
.legacy-notice { margin-bottom: 40px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font: 14px/1.6 var(--sans); }
.legacy-notice .section-label { margin-bottom: 8px; }
.legacy-notice p:last-child { margin-bottom: 0; }
.article-header h1 { margin-bottom: 18px; }
.article-deck { margin-bottom: 18px; font-size: 20px; line-height: 1.55; }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; color: var(--muted); font: 13px/1.6 var(--sans); }
.feature-image { margin: 34px 0; }
.feature-image img { width: 100%; }
.site-footer { margin-top: 58px; padding-top: 22px; border-top: 1px solid var(--line); }
.site-footer:empty { display: none; }
.archive-link { margin-top: 34px; font: 14px/1.5 var(--sans); }
.pagination { display: flex; flex-wrap: wrap; gap: 14px 22px; margin-top: 40px; color: var(--muted); font: 13px/1.5 var(--sans); }
.skip-link { position: absolute; top: -100px; left: 20px; padding: 8px 12px; background: var(--paper); font: 14px/1.5 var(--sans); z-index: 10; }
.skip-link:focus { top: 8px; }

/* Prose and Ghost editor cards share the same reading measure. */
.gh-content { display: flow-root; }
.gh-content > * { margin: 0 0 1.45em; }
.gh-content > :last-child { margin-bottom: 0; }
.gh-content > h2, .gh-content > h3, .gh-content > h4 { margin-top: 1.8em; margin-bottom: 0.65em; }
.gh-content > :first-child { margin-top: 0; }
.gh-content ul, .gh-content ol { padding-left: 1.4em; }
.gh-content li + li { margin-top: 0.4em; }
.gh-content blockquote { margin-left: 0; padding-left: 22px; border-left: 2px solid var(--line); }
.gh-content blockquote p:last-child { margin-bottom: 0; }
.gh-content hr { margin: 38px auto; border: 0; border-top: 1px solid var(--line); }
.gh-content pre { padding: 18px; overflow-x: auto; background: #f5f5f2; font-size: 14px; line-height: 1.6; }
.gh-content code { font-size: 0.86em; }
.gh-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 16px; }
.gh-content th, .gh-content td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.gh-content .kg-card { margin-top: 32px; margin-bottom: 32px; }
.gh-content .kg-image { margin-right: auto; margin-left: auto; }
.kg-width-wide { width: min(960px, calc(100vw - 44px)); max-width: none; margin-left: calc((min(960px, 100vw - 44px) - 100%) / -2); }
.kg-width-full { width: 100vw; max-width: none; position: relative; left: 50%; margin-left: -50vw; }
.kg-width-wide img, .kg-width-full img { width: 100%; }
.kg-width-full figcaption { padding-right: 22px; padding-left: 22px; }
.kg-embed-card { text-align: center; }
.kg-embed-card iframe { max-width: 100%; }
.gh-content iframe[src*="youtube.com/embed/"],
.gh-content iframe[src*="youtube-nocookie.com/embed/"],
.gh-content iframe[src*="player.vimeo.com/video/"] {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}
.kg-gallery-container { display: flex; flex-direction: column; gap: 10px; }
.kg-gallery-row { display: flex; justify-content: center; gap: 10px; }
.kg-gallery-image { flex: 1 1 0%; min-width: 0; }
.kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; }
.kg-bookmark-card { font-family: var(--sans); }
.kg-bookmark-container { color: var(--ink); text-decoration: none; }
.kg-bookmark-content { min-width: 0; }
.kg-bookmark-title { font-weight: 600; }
.kg-bookmark-description, .kg-bookmark-metadata { color: var(--muted); }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.kg-bookmark-icon { display: inline-block; width: 20px; height: 20px; }
.kg-button-card .kg-btn { border-radius: 3px; font-family: var(--sans); }
.kg-callout-card, .kg-toggle-card { font-family: inherit; }

@media (max-width: 600px) {
    .site-shell { margin-top: 36px; }
    .site-header { display: block; padding-bottom: 24px; }
    .site-title { font-size: 28px; }
    .site-header-home .site-title { font-size: clamp(43px, 12vw, 62px); letter-spacing: -1.8px; }
    .primary-nav { margin-top: 22px; }
    #tof-main { margin-top: 38px; }
    .home-writing { margin-top: 40px; }
    .article-deck { font-size: 19px; }
    .site-footer { margin-top: 44px; }
    .kg-gallery-row { flex-wrap: wrap; }
    .kg-gallery-image { flex-basis: 100%; }
    .kg-gallery-image img { height: auto; }
}

@media print {
    body { font-size: 12pt; }
    .site-shell { width: 100%; margin: 0; }
    .primary-nav, .site-footer, .skip-link, .pagination { display: none; }
    .kg-width-wide, .kg-width-full { width: 100%; margin-left: 0; left: auto; }
    a { text-decoration: none; }
    figure, h1, h2, h3 { break-inside: avoid; }
}
