/* mdpress theme — clean portal look: Inter, white/near-black, gold accent. */
@font-face { font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/inter-latin-wght-normal.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: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/inter-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,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: "Inter Variable"; font-style: italic; font-display: swap; font-weight: 100 900;
  src: url(fonts/inter-latin-wght-italic.woff2) format("woff2"); unicode-range: U+0000-00FF,U+2000-206F; }

:root {
  --bg: #ffffff; --fg: #0a0a0a; --card: #ffffff;
  --muted: #f5f5f5; --muted-fg: #525252; --border: #d4d4d4; --hairline: #e5e5e5;
  --primary: #ffcf20; --primary-fg: #0a0a0a; --ink: #9b6500; --ink-soft: #d59900;
  --note: #1f6feb; --tip: #1a7f37; --important: #8250df; --warning: #9a6700; --caution: #cf222e;
  --radius: .5rem; --radius-panel: .75rem;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / .07), 0 1px 2px -1px rgb(0 0 0 / .06);
  --font: "Inter Variable", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0a0a0a; --fg: #fafafa; --card: #0f0f0f; --muted: #1c1c1c; --muted-fg: #a1a1a1;
  --border: #262626; --hairline: #262626; --ink: #ffcf20; --ink-soft: #ffcf20;
  --note: #4493f8; --tip: #3fb950; --important: #ab7df8; --warning: #d29922; --caution: #f85149;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / .4); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0a0a0a; --fg: #fafafa; --card: #0f0f0f; --muted: #1c1c1c; --muted-fg: #a1a1a1;
  --border: #262626; --hairline: #262626; --ink: #ffcf20; --ink-soft: #ffcf20;
  --note: #4493f8; --tip: #3fb950; --important: #ab7df8; --warning: #d29922; --caution: #f85149;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / .4); color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 8rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 var(--font);
  letter-spacing: -.01em; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { letter-spacing: -.02em; font-weight: 600; line-height: 1.25; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .wrap { padding: 0 1.5rem; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header: two rows like a feedback portal — brand + actions, then nav pills */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--hairline);
  padding: .5rem 0; box-shadow: var(--shadow); }
.header-row { display: flex; height: 3rem; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; font-weight: 600; min-width: 0; }
.brand-mark { width: 2rem; height: 2rem; border-radius: .3rem; background: var(--primary); color: var(--primary-fg);
  display: grid; place-items: center; font-weight: 700; flex: none; }
.brand-mark img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; align-items: center; gap: .5rem; }
.nav { margin-top: .5rem; display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: .5rem .75rem; border-radius: .4rem; font-size: .875rem; font-weight: 500; color: var(--muted-fg);
  text-decoration: none; white-space: nowrap; transition: background .15s, color .15s; }
.nav a:hover { color: var(--fg); background: color-mix(in srgb, var(--muted) 60%, transparent); }
.nav a[aria-current="page"] { background: var(--muted); color: var(--fg); }

.btn { display: inline-flex; align-items: center; gap: .375rem; height: 2.25rem; padding: 0 .75rem; border-radius: var(--radius);
  font: 500 .875rem var(--font); text-decoration: none; border: 1px solid var(--border); background: var(--bg); color: var(--fg);
  cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--muted); }
.btn-primary { background: var(--primary); color: var(--primary-fg); border-color: transparent; }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 85%, #000); }
.btn-icon { width: 2.25rem; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
.btn svg { width: 1rem; height: 1rem; flex: none; }
:focus-visible { outline: 2px solid var(--muted-fg); outline-offset: 2px; }

/* Page header */
main { padding: 2rem 0 4rem; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.page-head h1 { margin: 0; font-size: 1.5rem; font-weight: 700; }
.page-head p { margin: .125rem 0 0; font-size: .8125rem; color: var(--muted-fg); }
.search { width: 100%; max-width: 20rem; height: 2.25rem; padding: 0 .75rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--fg); font: .875rem var(--font); }

/* Tag pills */
.pills { display: flex; flex-wrap: wrap; gap: .375rem; margin-bottom: 2rem; align-items: center; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: .25rem .75rem; font-size: .75rem;
  font-weight: 500; text-decoration: none; background: var(--muted); color: var(--muted-fg); }
.pill:hover { color: var(--fg); }
.pill[aria-current="page"] { background: var(--fg); color: var(--bg); }
.tag { display: inline-flex; border-radius: 999px; padding: .125rem .5rem; font-size: .75rem; font-weight: 500;
  text-decoration: none; background: color-mix(in srgb, var(--tc) 12%, transparent); color: var(--tc); }
.tags { display: flex; flex-wrap: wrap; gap: .375rem; margin-bottom: .5rem; }

/* Article list: date rail + entry, divided rows */
.entries > .entry { display: flex; gap: 2rem; padding: 2.5rem 0; border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.entries > .entry:first-child { border-top: 0; padding-top: 0; }
.rail { display: none; width: 10rem; flex: none; padding-top: .25rem; font-size: .875rem; color: var(--muted-fg); }
.mobile-date { display: block; font-size: .875rem; color: var(--muted-fg); margin-bottom: 1rem; }
@media (min-width: 768px) { .rail { display: block; } .mobile-date { display: none; } }
@media (min-width: 1024px) { .entries > .entry, .article-grid { gap: 4rem; } }
.entry-body { flex: 1; min-width: 0; }
.entry h2 { margin: 0; font-size: 1.5rem; font-weight: 700; }
.entry h2 a { text-decoration: none; transition: color .15s; }
.entry h2 a:hover { color: var(--ink); }
.entry .summary { margin: .75rem 0 0; color: var(--muted-fg); }
.entry .cover { display: block; margin-top: 1.25rem; }
.read-more { display: inline-flex; margin-top: 1rem; font-size: .875rem; font-weight: 500; color: var(--ink); text-decoration: none; }
.read-more:hover { text-decoration: underline; }
.empty { padding: 4rem 0; text-align: center; color: var(--muted-fg); }

/* Article page */
.back { display: inline-flex; align-items: center; gap: .25rem; font-size: .875rem; color: var(--muted-fg);
  text-decoration: none; margin-bottom: 2rem; }
.back:hover { color: var(--fg); }
.article-grid { display: flex; gap: 2rem; }
.article-grid .rail { width: 12rem; }
.rail-sticky { position: sticky; top: 8.5rem; }
.meta-line { display: block; margin-bottom: .25rem; }
.toc { margin-top: 1.5rem; font-size: .8125rem; }
.toc-title { font-weight: 600; color: var(--fg); margin-bottom: .5rem; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: .3rem 0; }
.toc li.l3 { padding-left: .75rem; }
.toc a { color: var(--muted-fg); text-decoration: none; }
.toc a:hover, .toc a.active { color: var(--fg); }
.toc a.active { font-weight: 500; }
details.toc-mobile { margin: 0 0 1.5rem; border: 1px solid var(--hairline); border-radius: var(--radius); padding: .5rem .75rem; font-size: .875rem; }
details.toc-mobile summary { cursor: pointer; font-weight: 500; }
@media (min-width: 768px) { details.toc-mobile { display: none; } }
.article { flex: 1; min-width: 0; max-width: 46rem; }
.article > h1 { margin: 0; font-size: 1.875rem; font-weight: 700; line-height: 1.2; }
@media (min-width: 640px) { .article > h1 { font-size: 2.25rem; } }
.article .lede { color: var(--muted-fg); font-size: 1.125rem; margin: .75rem 0 0; }
.cover img, img.cover { display: block; width: 100%; aspect-ratio: 2/1; object-fit: cover; border-radius: var(--radius-panel);
  border: 1px solid color-mix(in srgb, var(--border) 40%, transparent); }
.article .cover { margin-top: 1.5rem; }
.byline { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; font-size: .875rem; color: var(--muted-fg); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--hairline); }
.pager a { display: block; padding: .75rem 1rem; border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  border-radius: var(--radius); text-decoration: none; font-weight: 500; font-size: .9375rem; transition: border-color .15s, background .15s; }
.pager a:hover { border-color: var(--border); background: color-mix(in srgb, var(--muted) 40%, transparent); }
.pager small { display: block; color: var(--muted-fg); font-weight: 400; font-size: .75rem; }
.pager .next { text-align: right; grid-column: 2; }

/* Prose */
.prose { margin-top: 1.75rem; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table, .prose .markdown-alert { margin: 1.15em 0; }
.prose h2 { font-size: 1.5rem; margin: 2.25em 0 .75em; }
.prose h3 { font-size: 1.25rem; margin: 1.75em 0 .5em; }
.prose h4 { font-size: 1rem; margin: 1.5em 0 .5em; }
.prose a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--ink-soft); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.prose a:hover { color: var(--ink); }
.prose .header-anchor { margin-left: .4rem; color: var(--muted-fg); opacity: 0; text-decoration: none; font-weight: 400; }
.prose :is(h2,h3,h4):hover .header-anchor { opacity: .6; }
.prose ul, .prose ol { padding-left: 1.5rem; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--muted-fg); }
.prose ul.contains-task-list { list-style: none; padding-left: .25rem; }
.prose .task-list-item-checkbox { margin: 0 .5rem 0 0; accent-color: var(--primary); vertical-align: -.1em; }
.prose blockquote { margin-left: 0; padding-left: 1rem; border-left: 4px solid var(--border); color: var(--muted-fg); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.prose img { border-radius: var(--radius); }
.prose code { font-family: var(--mono); font-size: .875em; background: var(--muted); padding: .125rem .3rem; border-radius: .25rem; }
.prose pre { position: relative; background: var(--muted); border-radius: var(--radius); padding: 1rem; overflow-x: auto;
  font-size: .875rem; line-height: 1.6; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.code-lang { position: absolute; top: .4rem; right: 3rem; font: 500 .6875rem var(--font); color: var(--muted-fg); text-transform: uppercase; }
.copy { position: absolute; top: .3rem; right: .3rem; height: 1.75rem; padding: 0 .5rem; font: 500 .75rem var(--font);
  border: 1px solid var(--border); border-radius: .375rem; background: var(--bg); color: var(--muted-fg); cursor: pointer; opacity: 0; transition: opacity .15s; }
.prose pre:hover .copy, .copy:focus-visible { opacity: 1; }
@media (hover: none) { .copy { opacity: 1; } }
.table-wrap { overflow-x: auto; margin: 1.15em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: .9375rem; margin: 0; }
.prose th, .prose td { border: 1px solid var(--border); padding: .5rem .75rem; text-align: left; }
.prose th { background: color-mix(in srgb, var(--muted) 60%, transparent); font-weight: 600; }
.prose sup { font-size: .75em; }
.prose .footnotes { font-size: .875rem; color: var(--muted-fg); }
.prose .footnotes-sep { margin: 3rem 0 1rem; }
.markdown-alert { padding: .5rem 1rem; border-left: 4px solid var(--ac); border-radius: 0 var(--radius) var(--radius) 0;
  background: color-mix(in srgb, var(--ac) 7%, transparent); }
.markdown-alert > p { margin: .5em 0; }
.markdown-alert-title { font-weight: 600; color: var(--ac); }
.markdown-alert-note { --ac: var(--note); } .markdown-alert-tip { --ac: var(--tip); }
.markdown-alert-important { --ac: var(--important); } .markdown-alert-warning { --ac: var(--warning); }
.markdown-alert-caution { --ac: var(--caution); }

/* Syntax highlighting (Pygments classes) */
.hl .c, .hl .c1, .hl .cm, .hl .ch, .hl .cs, .hl .cp { color: #6e7781; font-style: italic; }
.hl .k, .hl .kd, .hl .kn, .hl .kr, .hl .kc, .hl .kt, .hl .ow { color: #cf222e; }
.hl .s, .hl .s1, .hl .s2, .hl .sb, .hl .sd, .hl .se, .hl .sh, .hl .si, .hl .sx, .hl .sr, .hl .ss { color: #0a3069; }
.hl .m, .hl .mi, .hl .mf, .hl .mh, .hl .il, .hl .no, .hl .bp { color: #0550ae; }
.hl .nf, .hl .fm, .hl .nc, .hl .nd { color: #8250df; }
.hl .nt, .hl .nb { color: #116329; } .hl .na, .hl .nv, .hl .vi { color: #953800; }
.hl .gd { color: #82071e; background: #ffebe9; } .hl .gi { color: #116329; background: #dafbe1; }
:root[data-theme="dark"] .hl { --dk: 1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hl :is(.c,.c1,.cm,.ch,.cs,.cp) { color: #8b949e; }
  :root:not([data-theme="light"]) .hl :is(.k,.kd,.kn,.kr,.kc,.kt,.ow) { color: #ff7b72; }
  :root:not([data-theme="light"]) .hl :is(.s,.s1,.s2,.sb,.sd,.se,.sh,.si,.sx,.sr,.ss) { color: #a5d6ff; }
  :root:not([data-theme="light"]) .hl :is(.m,.mi,.mf,.mh,.il,.no,.bp) { color: #79c0ff; }
  :root:not([data-theme="light"]) .hl :is(.nf,.fm,.nc,.nd) { color: #d2a8ff; }
  :root:not([data-theme="light"]) .hl :is(.nt,.nb) { color: #7ee787; }
  :root:not([data-theme="light"]) .hl :is(.na,.nv,.vi) { color: #ffa657; }
  :root:not([data-theme="light"]) .hl :is(.gd) { color: #ffdcd7; background: #67060c; }
  :root:not([data-theme="light"]) .hl :is(.gi) { color: #aff5b4; background: #033a16; } }
:root[data-theme="dark"] .hl :is(.c,.c1,.cm,.ch,.cs,.cp) { color: #8b949e; }
:root[data-theme="dark"] .hl :is(.k,.kd,.kn,.kr,.kc,.kt,.ow) { color: #ff7b72; }
:root[data-theme="dark"] .hl :is(.s,.s1,.s2,.sb,.sd,.se,.sh,.si,.sx,.sr,.ss) { color: #a5d6ff; }
:root[data-theme="dark"] .hl :is(.m,.mi,.mf,.mh,.il,.no,.bp) { color: #79c0ff; }
:root[data-theme="dark"] .hl :is(.nf,.fm,.nc,.nd) { color: #d2a8ff; }
:root[data-theme="dark"] .hl :is(.nt,.nb) { color: #7ee787; }
:root[data-theme="dark"] .hl :is(.na,.nv,.vi) { color: #ffa657; }
:root[data-theme="dark"] .hl :is(.gd) { color: #ffdcd7; background: #67060c; }
:root[data-theme="dark"] .hl :is(.gi) { color: #aff5b4; background: #033a16; }

/* Footer */
.site-footer { border-top: 1px solid var(--hairline); padding: 2rem 0; font-size: .8125rem; color: var(--muted-fg); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }
.site-footer a { color: inherit; text-decoration: none; } .site-footer a:hover { color: var(--fg); }
.site-footer nav { display: flex; gap: 1rem; }

@media (max-width: 639px) { .page-head { flex-direction: column; } .search { max-width: none; } .hide-sm { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .site-header, .site-footer, .rail, .pager, .copy, .back, details.toc-mobile { display: none !important; } }
