@font-face {
  font-family: Lato;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/Lato-Regular-LatinExt.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Lato;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/Lato-Regular-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: Lato;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/Lato-Bold-LatinExt.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Lato;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/Lato-Bold-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;
}

:root {
  color-scheme: light;
  --ink: #191919;
  --muted: #62676d;
  --line: #b8b8b8;
  --soft-line: #e2e4e6;
  --link: #2d5f92;
  --link-hover: #19466f;
  --date: #bf864a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 16px/1.55 Georgia, "Songti SC", serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
button { font: inherit; }
.skip-link { position: absolute; top: -4rem; left: 1rem; background: #fff; padding: .45rem .7rem; z-index: 10; }
.skip-link:focus { top: 1rem; }
.page { width: min(800px, calc(100% - 40px)); margin: 0 auto; }
.home-page { width: min(740px, calc(100% - 40px)); }

.home-header { padding-top: 34px; }
.home-header h1 { margin: 0 0 17px; font-size: 32px; font-weight: 500; line-height: 1.2; text-align: center; letter-spacing: -.025em; }
.intro { width: 100%; line-height: 1.4; letter-spacing: .2px; }
.intro p { margin: 0 0 13px; }
.intro strong { font-weight: 650; }
.contact-links { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0 7px; margin: 12px 0 38px; }
.contact-links span { color: var(--muted); }
.content-section { border-top: 1px solid var(--line); padding: 22px 0 0; margin: 0 0 18px; }
.content-section h2 { margin: 0 0 14px; font-size: 21px; font-weight: 500; line-height: 1.25; letter-spacing: -.02em; }
.content-section p { margin: 0 0 10px; }
.news-list { margin: 0 0 2px; padding-left: 20px; }
.news-list li { margin: 3px 0; padding-left: 0; }
.news-date { color: var(--date); font-size: 15px; font-weight: 600; white-space: nowrap; }
.writing-list, .archive-list { list-style: none; padding: 0; margin: 0; }
.writing-entry { display: grid; grid-template-columns: 115px minmax(0, 1fr) auto; gap: 11px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--soft-line); }
.writing-entry .date { color: var(--date); font-size: 15px; font-weight: 600; }
.writing-entry a { font-size: 14px; font-weight: 600; }
.writing-entry .category { letter-spacing: .15px; }
.category { color: var(--muted); font-size: 13px; white-space: nowrap; }
.tag { color: #7a8188; font-size: 12px; white-space: nowrap; }
.pinned-label { color: var(--date); font-size: 11px; font-weight: 600; vertical-align: .13em; }
.all-link { margin: 13px 0 0 !important; text-align: right; }
.muted { color: var(--muted); }
.site-footer { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding: 18px 0 38px; margin-top: 25px; color: var(--muted); font-size: 12px; line-height: 1.4; }

.interior-header { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; padding: 33px 0 17px; border-bottom: 1px solid var(--line); }
.site-name { color: var(--ink); font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.site-name:hover { color: var(--link); }
.interior-header nav { display: flex; gap: 9px; color: var(--muted); font-size: 14px; }
.interior-header nav [aria-current] { color: var(--ink); font-weight: 600; }
.archive-main { padding: 24px 8px 4px; }
.archive-main > h1 { margin: 0 0 18px; font-size: 27px; line-height: 1.2; font-weight: 500; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 15px; }
.filter-button { border: 1px solid #d7dce0; border-radius: 4px; background: #fff; color: var(--link); padding: 4px 8px; cursor: pointer; font-size: 13px; font-weight: 700; line-height: 1.25; }
.filter-button span { color: var(--muted); margin-left: 3px; }
.filter-button:hover { border-color: var(--link); }
.filter-button.is-active { color: #fff; background: var(--link); border-color: var(--link); }
.filter-button.is-active span { color: #e3edf6; }
.result-count { color: var(--muted); font-size: 12px; margin: 0 0 4px; }
.archive-entry { display: grid; grid-template-columns: 135px minmax(0, 1fr); gap: 13px; padding: 17px 0; border-top: 1px solid var(--soft-line); }
.archive-entry[hidden] { display: none; }
.archive-date { color: var(--date); font-size: 13px; font-weight: 600; padding-top: 3px; }
.archive-copy h2 { margin: 0 0 4px; font-size: 17px; line-height: 1.35; font-weight: 600; }
.archive-copy p { margin: 0 0 6px; color: #41474d; font-size: 15px; line-height: 1.5; }
.archive-tags { display: flex; flex-wrap: wrap; gap: 5px 10px; align-items: baseline; }

.article-main { max-width: 760px; margin: 0 auto; padding: 23px 4px 0; }
.back-link { display: inline-block; font-size: 13px; margin-bottom: 20px; }
.article-header { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 24px; }
.article-header h1 { margin: 0 0 9px; font-size: clamp(26px, 4vw, 34px); font-weight: 600; line-height: 1.25; letter-spacing: -.025em; overflow-wrap: anywhere; }
.article-summary { color: #41474d; margin: 0 0 12px; font-size: 16px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; margin: 0; }
.article-toc { border: 1px solid var(--soft-line); background: #fafafa; padding: 10px 15px; margin: 0 0 25px; }
.article-toc summary { display: block; list-style: none; color: var(--link); font-size: 14px; font-weight: 600; cursor: pointer; }
.article-toc summary::marker { content: ''; }
.article-toc summary::-webkit-details-marker { display: none; }
.article-toc ol { margin: 12px 0 0; padding-left: 19px; columns: 2; column-gap: 26px; font-size: 13px; }
.article-toc li { break-inside: avoid; margin: 3px 0; }
.article-toc .subheading { margin-left: 10px; }
.article-toc-toggle { display: none; }
/* Use the desktop margin for a sticky outline without moving the reading column. */
@media (min-width: 1200px) {
  .article-toc-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    margin: -2px 0 0 12px;
    padding: 4px;
    vertical-align: middle;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #454e57;
    cursor: pointer;
  }
  .article-toc-toggle:hover, .article-toc-toggle[aria-expanded="true"] { color: var(--link-hover); background: #f4f6f8; }
  .article-toc-toggle::after {
    content: attr(data-tooltip);
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(3px);
    padding: 6px 9px;
    border-radius: 5px;
    background: #303942;
    color: #fff;
    font: 12px/1.4 system-ui, sans-serif;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
  }
  .article-toc-toggle:hover::after, .article-toc-toggle:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%);
    transition-delay: .15s;
  }
  .article-toc.is-animating ol { overflow: hidden; pointer-events: none; }
  .article-toc.has-icon-toggle:not([open]) { display: none; }
  .article-main > article {
    --article-header-gap: 16px;
    --outline-heading-height: 32px;
    --outline-body-gap: 56px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .article-header { grid-column: 1; grid-row: 1; margin-bottom: var(--article-header-gap); }
  .article-body { grid-column: 1; grid-row: 2; }
  .article-toc {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    position: sticky;
    top: 24px;
    width: min(240px, calc((100vw - 760px) / 2 - var(--outline-body-gap) - 16px));
    transform: translateX(calc(-100% - var(--outline-body-gap)));
    /* Lift the summary so both header rules share the same baseline. */
    margin: calc(-1 * (var(--article-header-gap) + var(--outline-heading-height))) 0 0;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .article-toc summary {
    height: var(--outline-heading-height);
    line-height: 21px;
    padding: 0 0 10px;
    border-bottom: 1px solid transparent;
    color: var(--ink);
  }
  .article-toc[open] summary { border-bottom-color: var(--line); }
  .article-toc ol {
    /* A constrained multicol list creates extra columns even with column-count: 1. */
    columns: auto;
    list-style: none;
    margin-top: 12px;
    padding: 3px 6px 8px 3px;
    max-height: var(--outline-list-height, calc(100dvh - 100px));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }
  .article-toc ol::-webkit-scrollbar { display: none; }
  .article-toc li { margin: 0; break-inside: auto; }
  .article-toc li:not(.subheading) { margin-top: 12px; }
  .article-toc li:first-child { margin-top: 0; }
  .article-toc .subheading { margin-left: 12px; }
  .article-toc a {
    display: block;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.55;
    color: #454e57;
    overflow-wrap: anywhere;
    white-space: normal;
    text-decoration: none;
  }
  .article-toc li:not(.subheading) > a { font-weight: 700; }
  .article-toc .subheading > a { color: var(--muted); }
  .article-toc a:hover { color: var(--link-hover); background: #f4f6f8; }
  .article-toc a[aria-current="location"] { color: var(--link-hover); background: #edf3f8; font-weight: 700; }
  .article-toc a:focus-visible { outline-offset: -2px; }
  .article-body :is(h2, h3)[id] { scroll-margin-top: 28px; }
  .article-body > :first-child { margin-top: 0; }
}
.article-body { min-width: 0; font-size: 17px; line-height: 1.7; overflow-wrap: break-word; }
.article-body h2 { margin: 2.1em 0 .75em; padding-bottom: .25em; border-bottom: 1px solid var(--soft-line); font-size: 24px; line-height: 1.35; font-weight: 600; }
.article-body h3 { margin: 1.75em 0 .6em; font-size: 19px; line-height: 1.4; }
.article-body h4 { margin: 1.6em 0 .6em; font-size: 16px; }
.article-body p, .article-body ul, .article-body ol, .article-body blockquote { margin: 0 0 1.1em; }
.article-body ul, .article-body ol { padding-left: 1.5em; }
.article-body li { margin: .25em 0; }
.article-body li > ul, .article-body li > ol { margin-top: .35em; }
.article-body blockquote { border-left: 3px solid #c4d2df; padding: .15em 0 .15em 1em; color: #505c66; }
.article-body img { display: block; max-width: 100%; height: auto; margin: 1.4em auto; }
.article-body a { text-decoration: underline; text-underline-offset: 2px; }
.article-body pre { overflow-x: auto; background: #f5f6f7; border: 1px solid #e7e9ea; padding: 14px 16px; border-radius: 4px; font-size: 13px; line-height: 1.5; tab-size: 2; }
.article-body code { font: .88em/1.45 SFMono-Regular, Consolas, "Liberation Mono", monospace; background: #f2f4f5; padding: .13em .28em; border-radius: 3px; }
.article-body pre code { background: transparent; padding: 0; font-size: inherit; }
.article-body table { display: block; width: max-content; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.5em auto; font-size: 14px; }
.article-body th, .article-body td { border: 1px solid #d7dce0; padding: 6px 10px; }
.article-body th { background: #f5f6f7; text-align: left; }
.article-body hr { border: 0; border-top: 1px solid var(--soft-line); margin: 2em 0; }
.article-body .MathJax, .article-body mjx-container { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
.article-end { margin: 45px 0 20px; border-top: 1px solid var(--line); padding-top: 17px; }

@media (max-width: 650px) {
  body { font-size: 16px; }
  .page { width: min(100% - 30px, 800px); }
  .home-page { font-size: 16px; }
  .home-header { padding-top: 25px; }
  .home-header h1 { font-size: 29px; margin-bottom: 20px; }
  .contact-links { margin-bottom: 30px; }
  .content-section { padding: 20px 0 0; }
  .content-section h2 { font-size: 21px; }
  .writing-entry { grid-template-columns: 1fr auto; gap: 1px 8px; }
  .writing-entry .date { grid-column: 1 / -1; }
  .writing-entry .category { grid-column: 2; grid-row: 2; }
  .site-footer { flex-direction: column; gap: 6px; padding-left: 0; padding-right: 0; }
  .interior-header { padding-top: 22px; }
  .archive-main { padding-left: 0; padding-right: 0; }
  .archive-entry { grid-template-columns: 1fr; gap: 3px; padding: 15px 0; }
  .archive-date { padding: 0; }
  .article-main { padding-left: 0; padding-right: 0; }
  .article-body { font-size: 16px; }
  .article-body h2 { font-size: 21px; }
  .article-toc ol { columns: 1; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
