@font-face { font-family: "Inter"; src: url("/theme/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #242f3f;
  --paper: #fff;
  --ink: #222;
  --muted: #8a8f96;
  --line: #e4e6e8;
}

* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.55 Inter, "Helvetica Neue", Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); min-height: 100vh; }
main { max-width: calc(520px + 2rem); margin: 0 auto; padding: 1rem; }
a { color: var(--ink); }

/* Inter dynamic tracking (rsms): a + b * e^(c * size), size in px. --fs must match the element's font-size */
body { --fs: 15; }
* { letter-spacing: calc(-0.0223em + 0.185em * exp(-0.1745 * var(--fs))); }
pre, pre *, code, .katex, .katex *, textarea { letter-spacing: 0; }

/* back link */
nav { max-width: calc(520px + 2rem); margin: 0 auto; padding: 1rem 1rem 0; }
nav a { --fs: 14; display: inline-block; font-size: 14px; font-weight: 600; color: #bbb; text-decoration: none; }
nav a:hover, nav a:focus-visible { color: #fff; }

/* post card */
.post { background: var(--paper); border-radius: 6px; overflow: hidden; margin: 0 0 0.75rem; box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 2px 0 rgba(0,0,0,0.3), 0 10px 24px rgba(0,0,0,0.35); }
.post-body { padding: 1rem 1rem 0.25rem; overflow-wrap: anywhere; }
.post-body > :first-child { margin-top: 0; }
.post-body > h1:first-child, .post-body > h2:first-child { margin-top: 0.5rem; }
/* date and tags: one row, same type */
.post-foot { --fs: 13.5; display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; padding: 0.25rem 1rem 1rem; font-size: 13.5px; }
.post-foot a { color: #9aa0a6; text-decoration: none; }
.post-foot a { font-weight: 500; }
.post-foot a:hover, .post-foot a:focus-visible { color: #6b7076; }

/* what posts are made of */
.post-body h1, .post-body h2, .post-body h3, .post-body h4 { --fs: 16; font-size: 1rem; line-height: 1.25; margin: 0.8rem 0 0.4rem; }
.post-body h1 { --fs: 18.4; font-size: 1.15rem; }
.post-body img, .post-body video, .post-body iframe { display: block; max-width: 100%; height: auto; margin: 0 0 0.75rem; }
.post-body iframe { width: 100%; border: 0; aspect-ratio: 16 / 9; }
.post-body iframe.youtube-video-4-3 { aspect-ratio: 4 / 3; }
.post-body blockquote { margin: 0 0 1rem; padding-left: 1rem; border-left: 3px solid var(--line); }
.post-body figure { margin: 0 0 1rem; }
.post-body figcaption { --fs: 12.8; font-size: 0.8rem; color: var(--muted); }
.post-body pre, .post-body code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.78rem; line-height: 1.35; }
.post-body pre { overflow-x: auto; background: #f5f6f7; padding: 0.5rem 0.65rem; border-radius: 3px; }
.post-body pre code { font-size: inherit; }
.post-body table { --fs: 14; border-collapse: collapse; width: 100%; margin: 0 0 1rem; font-size: 0.875rem; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 0.25rem 0.5rem; text-align: left; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.post-body mark { background: #ffc; }
.post-body .katex { font-size: 1.1em; }
.post-body .katex-display { overflow-x: auto; overflow-y: hidden; }

/* long posts on list pages: cut at 640px, Expand button (theme/expand.js) */
#posts .post:not(.open) .post-body { max-height: 640px; overflow: hidden; position: relative; }
.expand { --fs: 14; position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 11rem 0 1rem; border: 0; font: inherit; font-size: 14px; font-weight: 600; color: #9aa0a6; background: linear-gradient(rgba(255,255,255,0.00) 0%, rgba(255,255,255,0.00) 8%, rgba(255,255,255,0.03) 16%, rgba(255,255,255,0.09) 24%, rgba(255,255,255,0.19) 32%, rgba(255,255,255,0.33) 40%, rgba(255,255,255,0.50) 48%, rgba(255,255,255,0.68) 56%, rgba(255,255,255,0.84) 64%, rgba(255,255,255,0.96) 72%, rgba(255,255,255,1.00) 80%, #fff 80%); cursor: pointer; }
.expand:hover, .expand:focus-visible { color: #6b7076; }

/* infinite scroll trigger */
.sentinel { width: 100%; height: 1px; pointer-events: none; }

/* tag page heading and 404 */
.post-body > p:only-child { margin: 0 0 0.75rem; }
