/* sharpestats — site stylesheet */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --paper: #F4F5F2;
  --surface: #FBFBF9;
  --ink: #1A1C21;
  --muted: #5D616C;
  --rule: #D9DBD4;
  --grid: rgba(26, 28, 33, 0.045);
  --accent: #A8322B;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 680px;
  --topbar-h: 60px;

  /* syntax highlighting */
  --hl-comment: #6E727C;
  --hl-keyword: #A8322B;
  --hl-string: #2F6B3A;
  --hl-number: #8A4B08;
  --hl-name: #1F3A68;
  --hl-attr: #6B3FA0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #15171C; --surface: #1C1F25; --ink: #E6E5E0; --muted: #9A9EA8;
    --rule: #2D3139; --grid: rgba(230, 229, 224, 0.04); --accent: #F08A7E;
    --hl-comment: #8B909B; --hl-keyword: #F08A7E; --hl-string: #9BCB8F;
    --hl-number: #E8B26A; --hl-name: #92B2EC; --hl-attr: #C4A5F0;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #15171C; --surface: #1C1F25; --ink: #E6E5E0; --muted: #9A9EA8;
  --rule: #2D3139; --grid: rgba(230, 229, 224, 0.04); --accent: #F08A7E;
  --hl-comment: #8B909B; --hl-keyword: #F08A7E; --hl-string: #9BCB8F;
  --hl-number: #E8B26A; --hl-name: #92B2EC; --hl-attr: #C4A5F0;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 24px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; font-weight: 500; line-height: 1.15; margin: 0; }
p { margin: 0; }
button { font: inherit; }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.label { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 24px; }
.visually-hidden { position: absolute !important; 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; left: 16px; top: -100px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 3px; font-family: var(--mono); font-size: 13px; text-decoration: none; }
.skip-link:focus { top: 12px; }
@media (max-width: 600px) { .wrap { padding-inline: 16px; } body { font-size: 18px; } }

/* ---------- Top bar ---------- */
.topbar { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 10; padding-top: env(safe-area-inset-top, 0px); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--topbar-h); }
.wordmark { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.wordmark .stats { font-family: var(--mono); font-weight: 500; font-size: 18px; color: var(--accent); letter-spacing: 0; }
.wordmark svg { flex: none; color: var(--accent); }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { font-family: var(--mono); font-size: 13px; color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.icon-btn { background: none; border: 1px solid var(--rule); color: var(--muted); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; }
.icon-btn:hover { color: var(--ink); border-color: var(--muted); }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .icon-btn .i-moon { display: none; }
}
@media (max-width: 680px) { .nav a.hide-sm { display: none; } .nav { gap: 14px; } }
@media (max-width: 360px) { .wordmark svg { display: none; } }

/* ---------- Home: hero / page heads ---------- */
.hero, .page-head { border-bottom: 1px solid var(--rule); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px; }
.hero .wrap { padding-block: 72px 64px; }
.hero-text { display: grid; gap: 24px; }
.hero h1 { font-size: clamp(38px, 6vw, 64px); font-weight: 400; letter-spacing: -0.02em; max-width: 14ch; }
.hero h1 em { color: var(--accent); }
.hero .intro { max-width: 58ch; color: var(--muted); font-size: 20px; }
.hero .intro strong { color: var(--ink); font-weight: 500; }
@media (max-width: 600px) { .hero .wrap { padding-block: 44px 40px; } .hero .intro { font-size: 18px; } }

.page-head .wrap { padding-block: 56px 48px; display: grid; gap: 16px; }
.page-head h1 { font-size: clamp(36px, 5.2vw, 54px); letter-spacing: -0.02em; font-weight: 400; }
.page-head .dek { font-size: 22px; color: var(--muted); line-height: 1.45; max-width: 58ch; }
@media (max-width: 600px) { .page-head .wrap { padding-block: 40px 32px; } .page-head .dek { font-size: 19px; } }

/* ---------- Sections ---------- */
section.block { padding-block: 56px; border-bottom: 1px solid var(--rule); }
section.block:last-of-type { border-bottom: 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.block-head h2 { font-size: 30px; }
@media (max-width: 600px) { section.block { padding-block: 44px; } }

/* Featured cards */
.featured { display: grid; grid-template-columns: 1.55fr 1fr; gap: 32px; }
.featured .side { display: grid; gap: 32px; align-content: start; }
.card { display: grid; gap: 10px; text-decoration: none; color: inherit; align-content: start; }
.card .img { overflow: hidden; border-radius: 3px; background: var(--rule); }
.card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .4s ease; }
.card:hover img { transform: scale(1.02); }
.card:hover h3 { color: var(--accent); }
.card h3 { font-size: 23px; transition: color .15s; }
.card.lead h3 { font-size: 34px; letter-spacing: -0.01em; }
.card.lead img { aspect-ratio: 5 / 3; }
.card p.dek { color: var(--muted); font-size: 18px; }
.card .meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); }
.statline { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-top: 10px; border-top: 1px dashed var(--rule); color: var(--muted); }
.statline span b { color: var(--ink); font-weight: 500; }
@media (max-width: 820px) { .featured { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .card.lead h3 { font-size: 28px; } }

/* Research */
.papers { display: grid; }
.paper { display: grid; grid-template-columns: 64px 1fr auto; gap: 8px 24px; padding-block: 18px; border-top: 1px solid var(--rule); align-items: baseline; }
.paper:last-child { border-bottom: 1px solid var(--rule); }
.paper .yr { color: var(--muted); }
.paper h3 { font-size: 20px; }
.paper .authors { color: var(--muted); font-size: 16px; margin-top: 4px; }
.paper .authors b, .paper .authors strong { color: var(--ink); font-weight: 500; }
h3.label { font-weight: 400; line-height: 1.6; }
.research-projects { margin-top: 72px; }
.paper .venue { color: var(--muted); margin-top: 6px; }
.paper .links { display: flex; gap: 8px; }
.pill { font-family: var(--mono); font-size: 12px; text-decoration: none; border: 1px solid var(--rule); color: var(--ink); padding: 3px 10px; border-radius: 99px; white-space: nowrap; background: none; cursor: pointer; line-height: 1.6; display: inline-block; }
.pill:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 640px) { .paper { grid-template-columns: 1fr; } .paper .yr { order: -1; } }
.sub-head { margin: 44px 0 14px; }
.articles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 40px; }
.articles a { text-decoration: none; color: inherit; display: grid; gap: 4px; align-content: start; }
.articles a:hover .t { color: var(--accent); }
.articles .t { font-size: 19px; font-weight: 500; line-height: 1.3; }
.articles .d { color: var(--muted); font-size: 16px; }
@media (max-width: 720px) { .articles { grid-template-columns: 1fr; } }

.projects { display: grid; }
.project { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; padding-block: 16px; border-top: 1px solid var(--rule); align-items: baseline; }
.project:last-child { border-bottom: 1px solid var(--rule); }
.project .t { font-size: 19px; font-weight: 500; line-height: 1.3; color: var(--ink); text-decoration: none; }
.project a.t:hover { color: var(--accent); }
.project .d { color: var(--muted); font-size: 16px; margin-top: 4px; }
.project .links { display: flex; gap: 8px; }
.project .posts { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 16px; }
.project .posts a { color: var(--ink); text-decoration: none; }
.project .posts a:hover { color: var(--accent); }
.project .posts .mono { color: var(--muted); margin-right: 10px; }
@media (max-width: 640px) { .project { grid-template-columns: 1fr; } }

/* Writing log */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button { font-family: var(--mono); font-size: 12px; background: none; border: 1px solid var(--rule); color: var(--muted); padding: 4px 12px; border-radius: 99px; cursor: pointer; }
.filters button:hover { color: var(--ink); border-color: var(--muted); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.log { width: 100%; border-collapse: collapse; }
.log td { padding: 12px 0; border-top: 1px solid var(--rule); vertical-align: baseline; }
.log tr:last-child td { border-bottom: 1px solid var(--rule); }
.log .d { width: 120px; color: var(--muted); white-space: nowrap; }
.log .c, .log .r { color: var(--muted); text-align: right; white-space: nowrap; padding-left: 16px; }
.log a { color: var(--ink); text-decoration: none; font-size: 19px; }
.log a:hover { color: var(--accent); }
.log tr[hidden] { display: none; }
@media (max-width: 640px) { .log .c { display: none; } .log .d { width: 92px; } .log a { font-size: 18px; } }

/* About */
.about { display: grid; grid-template-columns: 140px 1fr; gap: 32px; align-items: start; }
.about img { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; filter: grayscale(0.15); }
.about p + p { margin-top: 14px; }
.about .role { font-size: 24px; line-height: 1.35; }
.about .contact { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
@media (max-width: 600px) { .about { grid-template-columns: 1fr; gap: 20px; } .about img { width: 96px; height: 96px; } .about .role { font-size: 21px; } }
.about-page { padding-block: 56px 72px; }
.about-page .about { grid-template-columns: 200px minmax(0, var(--measure)); gap: 48px; }
.about-page .about img { width: 200px; height: 200px; }
@media (max-width: 760px) { .about-page .about { grid-template-columns: 1fr; gap: 24px; } .about-page .about img { width: 120px; height: 120px; } }

/* Generic page body */
.page-body { padding-block: 48px 72px; }
.page-body .prose { max-width: var(--measure); }

/* Tags */
.tag-cloud { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 40px; }
.tag-cloud a { font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1px solid var(--rule); padding: 2px 10px; border-radius: 99px; text-decoration: none; }
.tag-cloud a:hover { color: var(--accent); border-color: var(--accent); }
.tag-group { padding-block: 20px; border-top: 1px solid var(--rule); scroll-margin-top: calc(var(--topbar-h) + 16px); }
.tag-group h2 { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--accent); margin-bottom: 8px; }
.tag-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tag-group a { color: var(--ink); text-decoration: none; }
.tag-group a:hover { color: var(--accent); }
.tag-group .mono { color: var(--muted); margin-right: 12px; }

/* 404 */
.notfound { padding-block: 72px 96px; display: grid; gap: 20px; justify-items: start; }
.notfound h1 { font-size: clamp(36px, 5.2vw, 54px); font-weight: 400; letter-spacing: -0.02em; }
.notfound p { color: var(--muted); font-size: 20px; }
.notfound img { max-width: min(480px, 100%); border-radius: 3px; border: 1px solid var(--rule); }

/* Footer */
.site-footer { padding-block: 40px 48px; }
.site-footer .wrap > div { border-top: 1px solid var(--rule); padding-top: 28px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: baseline; }
.site-footer .links { display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: baseline; }
.site-footer .links a { font-family: var(--mono); font-size: 13px; color: var(--muted); text-decoration: none; }
.site-footer .links a:hover { color: var(--accent); }
.site-footer .email { color: var(--muted); }
.site-footer .copy { color: var(--muted); }

/* ---------- Post ---------- */
.post-head { padding-block: 48px 32px; }
.post-head .inner { max-width: calc(var(--measure) + 48px); margin: 0 auto; display: grid; gap: 16px; }
.post-head .back { font-family: var(--mono); font-size: 13px; color: var(--muted); text-decoration: none; justify-self: start; }
.post-head .back:hover { color: var(--accent); }
.post-head h1 { font-size: clamp(36px, 5.2vw, 54px); letter-spacing: -0.02em; font-weight: 400; }
.post-head .dek { font-size: 22px; color: var(--muted); line-height: 1.45; }
.post-head .meta { display: flex; gap: 8px 16px; flex-wrap: wrap; color: var(--muted); }
.post-head .meta .cat { color: var(--accent); text-decoration: none; }
.post-head .meta .cat:hover { text-decoration: underline; }
@media (max-width: 600px) { .post-head { padding-block: 32px 24px; } .post-head .inner { max-width: none; } .post-head .dek { font-size: 19px; } }
.cover { max-width: 1040px; margin: 0 auto; padding-inline: 24px; }
.cover img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: 3px; display: block; background: var(--rule); }
@media (max-width: 600px) { .cover { padding-inline: 16px; } .cover img { aspect-ratio: 16 / 9; } }

.post-grid { display: grid; grid-template-columns: 1fr minmax(0, var(--measure)) 1fr; gap: 0 48px; padding-block: 48px 72px; max-width: 1360px; margin: 0 auto; padding-inline: 24px; }
.toc { grid-column: 1; grid-row: 1; justify-self: end; width: 200px; }
.toc nav { display: grid; gap: 2px; margin-top: 10px; }
.toc details { position: sticky; top: calc(var(--topbar-h) + 28px); max-height: calc(100vh - var(--topbar-h) - 56px); overflow-y: auto; }
.toc a { font-family: var(--mono); font-size: 12.5px; color: var(--muted); text-decoration: none; padding: 4px 0 4px 12px; border-left: 1px solid var(--rule); line-height: 1.4; }
.toc a.sub { padding-left: 24px; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--accent); border-left: 2px solid var(--accent); padding-left: 11px; }
.toc a.sub.active { padding-left: 23px; }
.toc details summary { list-style: none; cursor: pointer; }
.toc details summary::-webkit-details-marker { display: none; }
article.prose { grid-column: 2; grid-row: 1; min-width: 0; }
.post-foot { grid-column: 2; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rule); display: grid; gap: 24px; min-width: 0; }
@media (min-width: 1240px) {
  .toc details summary { pointer-events: none; }
}
@media (max-width: 1239px) {
  .post-grid { grid-template-columns: minmax(0, var(--measure)); justify-content: center; }
  .toc { grid-column: 1; grid-row: auto; justify-self: stretch; width: auto; margin-bottom: 32px; border: 1px solid var(--rule); border-radius: 3px; background: var(--surface); }
  .toc details { position: static; max-height: none; overflow: visible; }
  .toc summary { padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; }
  .toc summary::after { content: "+"; font-size: 16px; line-height: 1; color: var(--muted); }
  .toc details[open] summary::after { content: "\2212"; }
  .toc nav { margin: 0; padding: 0 16px 14px; }
  article.prose, .post-foot { grid-column: 1; grid-row: auto; }
}
@media (max-width: 600px) { .post-grid { padding-inline: 16px; padding-block: 32px 56px; } }

/* Prose */
.prose { overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.1em; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { scroll-margin-top: calc(var(--topbar-h) + 28px); }
.prose h2 { font-size: 30px; margin-top: 2em; }
.prose h3 { font-size: 27px; margin-top: 1.9em; }
.prose h4 { font-size: 22px; margin-top: 1.7em; }
.prose h5, .prose h6 { font-size: 19px; font-weight: 600; margin-top: 1.5em; }
.prose > h2:first-child, .prose > h3:first-child, .prose > h4:first-child { margin-top: 0; }
.prose p, .prose li { hyphens: manual; }
.prose strong, .prose b { font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; margin-bottom: 0; }
.prose li + li { margin-top: 0.3em; }
.prose li > ul, .prose li > ol { margin-top: 0.3em; }
.prose p a, .prose li a, .prose td a, .prose figcaption a { text-decoration: underline; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2.2em; }
.prose blockquote { margin-inline: 0; padding: 2px 0 2px 20px; border-left: 2px solid var(--accent); color: var(--muted); }
.prose blockquote > * + * { margin-top: 0.8em; }
.prose blockquote ol, .prose blockquote ul { padding-left: 1.3em; }
.prose code { font-family: var(--mono); font-size: 0.8em; background: var(--surface); border: 1px solid var(--rule); border-radius: 3px; padding: 1px 5px; }
.prose pre, .prose div.highlight { overflow-x: auto; }
.prose pre { font-family: var(--mono); font-size: 14px; line-height: 1.55; background: var(--surface); border: 1px solid var(--rule); border-radius: 3px; padding: 14px 16px; margin-bottom: 0; }
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose div.highlight pre, .prose figure.highlight pre { margin: 0; }
.prose figure.highlight { margin: 1.1em 0 0; }
.prose iframe { border: 0; }
.prose sup, .prose sub { line-height: 0; }

/* Math: wide display equations scroll in their own box */
mjx-container[display="true"] { display: block; overflow-x: auto; overflow-y: hidden; max-width: 100%; min-width: 0 !important; padding-block: 4px; }
mjx-container { max-width: 100%; }
.math { overflow-x: auto; overflow-y: hidden; padding-block: 4px; }

/* Images & figures in articles (charts are white PNGs: keep a white matte in both themes) */
.prose img { max-width: 100%; height: auto; border-radius: 3px; background: #fff; padding: 12px; border: 1px solid var(--rule); }
.prose img.center, .prose p > img:only-child, .prose figure img { display: block; margin-inline: auto; }
.prose .js-zoom { cursor: zoom-in; }
.prose { counter-reset: fig; }
.prose figure { margin: 2em 0 0; }
.prose figure + * { margin-top: 2em; }
.prose figure a { display: block; }
figcaption { margin-top: 10px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); line-height: 1.55; }
figcaption b { color: var(--ink); font-weight: 500; }
.prose figure:not(.highlight) figcaption::before { counter-increment: fig; content: "Fig. " counter(fig) "  "; color: var(--ink); font-weight: 500; white-space: pre; }

/* Legacy helpers used by older posts */
.center { display: block; margin-left: auto; margin-right: auto; }
.center-table, div.center_markdown_table + table { margin-left: auto; margin-right: auto; }
.center-table td, .center-table tr { text-align: center; vertical-align: middle; }
.imgrow { display: flex; flex-wrap: wrap; gap: 0; border-radius: 3px; padding: 4px; }
.imgrow .imgcolumn { flex: 1 1 180px; padding: 1%; min-width: 0; }
.imgrow .imgcolumn img { padding: 4px; border: 0; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.prose table { border-collapse: collapse; font-family: var(--mono); font-size: 13.5px; line-height: 1.45; font-variant-numeric: tabular-nums; margin-inline: auto; max-width: 100%; }
.prose .table-wrap > table { max-width: none; }
.prose th, .prose td { padding: 7px 12px; border-bottom: 1px solid var(--rule); text-align: inherit; vertical-align: baseline; }
.prose thead th, .prose thead td { border-bottom: 1px solid var(--ink); font-weight: 500; color: var(--ink); }
.prose tbody tr:last-child td { border-bottom-color: var(--muted); }
.prose .dt-col { text-align: center; }

/* DataTables (table.dt): drop the plugin chrome, keep sorting */
.dataTables_wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table.dt { margin-inline: auto; }
table.dt thead th { cursor: pointer; position: relative; padding-right: 24px; white-space: nowrap; user-select: none; }
table.dt thead th.sorting::after,
table.dt thead th.sorting_asc::after,
table.dt thead th.sorting_desc::after { position: absolute; right: 8px; font-size: 10px; color: var(--muted); }
table.dt thead th.sorting::after { content: "\2195"; opacity: .6; }
table.dt thead th.sorting_asc::after { content: "\25B2"; color: var(--accent); }
table.dt thead th.sorting_desc::after { content: "\25BC"; color: var(--accent); }
table.dt thead th:focus-visible { outline-offset: -2px; }
table.dt tbody tr:hover td { background: var(--surface); }
table.dt td.sorting_1 { color: var(--ink); background: color-mix(in srgb, var(--surface) 60%, transparent); }

/* Footnotes / sidenotes */
.prose sup[role="doc-noteref"] a, .prose a.footnote { font-family: var(--mono); font-size: 11px; color: var(--accent); text-decoration: none; margin-left: 1px; }
.footnotes { margin-top: 3em; padding-top: 16px; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.footnotes ol { padding-left: 1.6em; }
.footnotes li + li { margin-top: 0.5em; }
.footnotes p { margin: 0; }
.footnotes a.reversefootnote { text-decoration: none; }
.sidenote { display: none; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; color: var(--muted); text-align: left; font-weight: 400; font-style: normal; }
.sidenote .n { color: var(--accent); margin-right: 4px; }
.sidenote a { overflow-wrap: anywhere; }
@media (min-width: 1240px) {
  .sidenote { display: block; float: right; clear: right; width: 220px; margin: 4px -268px 12px 0; position: relative; }
  .has-sidenotes .footnotes, .has-sidenotes .fn-heading { display: none; }
}

/* Post footer */
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tags a { font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1px solid var(--rule); padding: 2px 10px; border-radius: 99px; text-decoration: none; }
.tags a:hover { color: var(--accent); border-color: var(--accent); }
.share { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.share .lbl { color: var(--muted); margin-right: 4px; }
.nextprev { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.nextprev a { text-decoration: none; color: inherit; display: grid; gap: 4px; align-content: start; }
.nextprev a:hover .t { color: var(--accent); }
.nextprev .t { font-size: 19px; font-weight: 500; line-height: 1.3; }
.nextprev .r { text-align: right; grid-column: 2; }
@media (max-width: 480px) { .nextprev { grid-template-columns: 1fr; } .nextprev .r { grid-column: 1; } }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(10, 11, 14, 0.86); display: grid; place-items: center; padding: 24px; z-index: 50; cursor: zoom-out; border: 0; margin: 0; width: 100%; height: 100%; max-width: none; max-height: none; }
.lightbox img { max-width: min(1400px, 100%); max-height: 90vh; background: #fff; padding: 16px; border-radius: 3px; }
.lightbox:focus { outline: none; }

/* Syntax highlighting (rouge) */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cp, .highlight .ch, .highlight .cpf { color: var(--hl-comment); font-style: italic; }
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt, .highlight .ow, .highlight .o { color: var(--hl-keyword); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr, .highlight .ss, .highlight .dl { color: var(--hl-string); }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .il, .highlight .mb, .highlight .mx { color: var(--hl-number); }
.highlight .nf, .highlight .fm, .highlight .nc, .highlight .nn, .highlight .nb, .highlight .bp, .highlight .nd { color: var(--hl-name); }
.highlight .na, .highlight .nt, .highlight .nv, .highlight .vi, .highlight .vg, .highlight .vc { color: var(--hl-attr); }
.highlight .gd { color: var(--hl-keyword); }
.highlight .gi { color: var(--hl-string); }
.highlight .err { color: inherit; background: none; }

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

@media print {
  .topbar, .site-footer, .toc, .share, .nextprev { display: none !important; }
  body { background: #fff; color: #000; }
}
.see-all { margin-top: 16px; }
