/* ==========================================================================
   venillalemon.github.io — stylesheet for the exported posts in /files/
   One palette, shared with assets/css/site.css:
     bg · panel · ink · soft · faint · line · accent · accent-bg · code-bg
   ========================================================================== */

:root{
  --bg:#F6F1E7;      /* page          */
  --panel:#FFFCF6;   /* cards         */
  --ink:#1E1B16;     /* body text     */
  --soft:#5C574D;    /* secondary     */
  --faint:#8B857A;   /* labels, meta  */
  --line:#DFD7C7;    /* borders, rules*/
  --accent:#1C6B5B;  /* links, marks  */
  --accent-bg:#E1EFEA;
  --code-bg:#EFE9DB;
  --shadow:0 1px 2px rgba(60,50,35,.05), 0 8px 24px -12px rgba(60,50,35,.16);
  --serif:'Iowan Old Style','Palatino Linotype',Palatino,Georgia,'Times New Roman',serif;
  --mono:ui-monospace,'SF Mono',Menlo,Consolas,monospace;
  --math:'STIX Two Math','Latin Modern Math','Cambria Math','Times New Roman',serif;
}
@media (prefers-color-scheme:dark){ :root{ --bg:#16130F;--panel:#1F1B16;--ink:#EDE8DF;--soft:#A8A093;--faint:#7A7368;--line:#332D24;--accent:#5FCBB0;--accent-bg:#12241F;--code-bg:#100E0B;--shadow:0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.7); } }
:root[data-theme="light"]{ --bg:#F6F1E7;--panel:#FFFCF6;--ink:#1E1B16;--soft:#5C574D;--faint:#8B857A;--line:#DFD7C7;--accent:#1C6B5B;--accent-bg:#E1EFEA;--code-bg:#EFE9DB;--shadow:0 1px 2px rgba(60,50,35,.05), 0 8px 24px -12px rgba(60,50,35,.16); }
:root[data-theme="dark"]{ --bg:#16130F;--panel:#1F1B16;--ink:#EDE8DF;--soft:#A8A093;--faint:#7A7368;--line:#332D24;--accent:#5FCBB0;--accent-bg:#12241F;--code-bg:#100E0B;--shadow:0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.7); }
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;background:var(--bg);color:var(--ink);
  font-family:var(--serif);font-size:17px;line-height:1.66;
  -webkit-font-smoothing:antialiased;
  display:flex;flex-direction:column;min-height:100vh;
}
.col{max-width:770px;margin:0 auto;padding:0 18px;width:100%}
math{font-family:var(--math)}

/* --------------------------------------------------------------- masthead */
.site-head{
  border-bottom:1px solid var(--line);background:var(--bg);
  position:sticky;top:0;z-index:40;backdrop-filter:saturate(180%) blur(8px);
}
.site-head::after{
  content:"";display:block;height:2px;
  background:linear-gradient(90deg,var(--accent),transparent);
  opacity:.85;
}
.site-head__bar{display:flex;align-items:center;gap:18px;min-height:56px;flex-wrap:wrap}
.brand{
  font-family:var(--mono);font-size:13px;letter-spacing:.14em;text-transform:uppercase;
  font-weight:600;color:var(--ink);text-decoration:none;white-space:nowrap;
}
.brand:hover{color:var(--accent)}
.site-nav{display:flex;gap:16px;margin-left:auto;flex-wrap:wrap;align-items:center}
.site-nav a{
  font-family:var(--mono);font-size:12px;letter-spacing:.09em;text-transform:uppercase;
  color:var(--soft);text-decoration:none;padding:3px 0;border-bottom:1.5px solid transparent;
  transition:color .15s ease,border-color .15s ease;
}
.site-nav a:hover{color:var(--accent);border-bottom-color:var(--accent)}
.theme-toggle{
  font-family:var(--mono);font-size:12px;line-height:1;cursor:pointer;
  background:var(--panel);color:var(--soft);border:1px solid var(--line);
  border-radius:999px;padding:6px 11px;transition:all .15s ease;
}
.theme-toggle:hover{color:var(--accent);border-color:var(--accent)}

/* ---------------------------------------------------------- post header */
.site-main{flex:1 0 auto;padding:clamp(26px,4vw,52px) 0 88px}
.post-head{margin:0 0 26px}
.post-head .eyebrow{
  font-family:var(--mono);font-size:12px;letter-spacing:.16em;text-transform:uppercase;
  color:var(--accent);margin:0 0 12px;
}
.post-head h1{
  font-weight:600;font-size:clamp(28px,5vw,42px);line-height:1.1;letter-spacing:-.01em;
  margin:0 0 14px;text-wrap:balance;
}
.post-head .rule{
  height:2px;border:0;margin:0;
  background:linear-gradient(90deg,var(--accent),transparent);
}

/* ------------------------------------------------------------------- prose */
.prose{font-size:17px}
.prose p{margin:13px 0}
.prose a{color:var(--accent);text-decoration:none;border-bottom:1px solid color-mix(in srgb,var(--accent) 35%,transparent)}
.prose a:hover{border-bottom-color:var(--accent);background:var(--accent-bg)}
.prose h1{font-weight:600;font-size:30px;line-height:1.15;letter-spacing:-.01em;margin:40px 0 10px;text-wrap:balance}
.prose h2{
  font-weight:600;font-size:25px;line-height:1.18;letter-spacing:-.01em;
  margin:44px 0 6px;text-wrap:balance;padding-top:20px;border-top:2px solid var(--line);
}
.prose h3{font-weight:600;font-size:20px;line-height:1.25;margin:28px 0 4px}
.prose h4,.prose h5,.prose h6{
  font-family:var(--mono);font-size:12.5px;letter-spacing:.07em;text-transform:uppercase;
  color:var(--faint);font-weight:600;margin:26px 0 8px;
}
.prose ul,.prose ol{margin:12px 0;padding-left:24px}
.prose li{margin:5px 0}
.prose li::marker{color:var(--accent)}
.prose blockquote{
  margin:16px 0;padding:6px 18px;background:var(--accent-bg);border-radius:8px;color:var(--soft);
  border-left:3px solid var(--accent);
}
.prose blockquote p{margin:8px 0}
.prose del{color:var(--faint);text-decoration-color:var(--faint)}
.prose dl{margin:14px 0}
.prose dt{font-weight:600;margin-top:10px}
.prose dd{margin:2px 0 0 22px;color:var(--soft)}
.prose hr{border:0;border-top:1px solid var(--line);margin:34px 0}
.prose img{max-width:100%;height:auto;border-radius:8px;display:block;margin:16px auto;
  background:var(--panel);border:1px solid var(--line)}
.prose figure{margin:18px 0}
.prose figcaption{font-family:var(--mono);font-size:11.5px;color:var(--faint);text-align:center;margin-top:6px}
.prose code{font-family:var(--mono);font-size:.87em;background:var(--code-bg);padding:1.5px 5px;border-radius:4px;color:var(--ink)}
.prose pre{
  background:var(--code-bg);color:var(--ink);border:1px solid var(--line);border-radius:8px;
  padding:15px 17px;margin:14px 0;overflow-x:auto;font-family:var(--mono);font-size:13.5px;
  line-height:1.6;white-space:pre;
}
.prose pre code{background:none;padding:0;font-size:inherit;white-space:pre}
.prose table{border-collapse:collapse;font-size:14.5px;margin:16px 0;display:block;overflow-x:auto;max-width:100%}
.prose th,.prose td{border:1px solid var(--line);padding:6px 11px;text-align:left;white-space:normal}
.prose th{font-family:var(--mono);font-size:12px;letter-spacing:.05em;text-transform:uppercase;color:var(--faint);font-weight:600;background:var(--code-bg)}
.prose tr:nth-child(even) td{background:color-mix(in srgb,var(--code-bg) 45%,transparent)}

/* ------------------------------------------------------------------- math */
.katex-display{overflow-x:auto;overflow-y:hidden;padding:6px 0;margin:14px 0}
.katex{font-size:1.03em}
.equation-container,.equation{overflow-x:auto}

/* ------------------------------------- syntax highlighting (highlight.js) */
.hljs-comment,.hljs-quote{color:var(--faint);font-style:italic}
.hljs-keyword,.hljs-selector-tag,.hljs-built_in,.hljs-name,.hljs-type,.hljs-literal{color:var(--accent);font-weight:600}
.hljs-string,.hljs-attr,.hljs-symbol,.hljs-number,.hljs-meta,.hljs-title,.hljs-section{color:var(--soft)}
.hljs-emphasis{font-style:italic}
.hljs-strong{font-weight:700}

/* ------------------------------------------ syntax highlighting (pygments) */
.highlight pre{margin:0;border:0;background:none;padding:0}
.highlight .c,.highlight .c1,.highlight .cm,.highlight .ch,.highlight .cs,
.highlight .cp,.highlight .cpf{color:var(--faint);font-style:italic}
.highlight .k,.highlight .kc,.highlight .kd,.highlight .kn,.highlight .kp,
.highlight .kr,.highlight .kt,.highlight .ow,.highlight .bp,
.highlight .nb{color:var(--accent);font-weight:600}
.highlight .s,.highlight .s1,.highlight .s2,.highlight .sa,.highlight .sb,
.highlight .sc,.highlight .sd,.highlight .se,.highlight .sh,.highlight .si,
.highlight .sr,.highlight .ss,.highlight .sx,
.highlight .m,.highlight .mb,.highlight .mf,.highlight .mh,.highlight .mi,
.highlight .mo,.highlight .il{color:var(--soft)}
.highlight .nc,.highlight .nd,.highlight .nf,.highlight .ne,.highlight .nn,
.highlight .fm{color:var(--ink);font-weight:600}
.highlight .err{color:inherit}

/* ------------------------------------- markup from VS Code markdown export */
.prose[data-src="vscode"] > :first-child{margin-top:0}
.prose .task-list-item{list-style-type:none}
.prose .task-list-item-checkbox{
  margin:0 7px 0 -20px;vertical-align:baseline;pointer-events:none;accent-color:var(--accent);
}
.markdown-alert{
  padding:6px 18px;margin:16px 0;border-radius:6px;background:var(--panel);
  border:1px solid var(--line);border-left:4px solid var(--accent);
}
.markdown-alert .markdown-alert-title{
  font-family:var(--mono);font-size:11.5px;letter-spacing:.09em;text-transform:uppercase;
  font-weight:600;display:flex;align-items:center;gap:6px;color:var(--accent);
}
.markdown-alert>:first-child{margin-top:0}
.markdown-alert>:last-child{margin-bottom:0}
.markdown-alert .octicon{fill:currentColor;vertical-align:text-bottom}

/* embedded PDF reader (posts that are just a paper) */
.prose .pdfview{
  height:clamp(420px,84vh,1000px);margin:20px 0;background:var(--panel);
  border:1px solid var(--line);border-radius:8px;overflow:hidden;
}
.prose .pdfview object,.prose .pdfview iframe{display:block;width:100%;height:100%;border:0}
.prose .pdfnote{font-family:var(--mono);font-size:12px;color:var(--faint);letter-spacing:.03em}
@media (max-width:640px){ .prose .pdfview{height:clamp(360px,70vh,700px)} }

/* transcribed theorem / lemma / proof blocks (see the Gaussian-sampling note) */
.prose .thm{
  background:var(--panel);border:1px solid var(--line);border-left:3px solid var(--accent);
  border-radius:8px;padding:2px 20px 12px;margin:20px 0;
}
.prose .thm-h{
  font-family:var(--mono);font-size:11.5px;letter-spacing:.09em;text-transform:uppercase;
  font-weight:600;color:var(--accent);margin:14px 0 2px;
}
.prose .thm p{margin:9px 0}
.prose .thm ol{margin:8px 0}
.prose .thm .katex-display{margin:10px 0}

/* collapsible proofs: click the label to unfold */
.prose details.proof > summary{
  font-family:var(--mono);font-size:11.5px;letter-spacing:.09em;text-transform:uppercase;
  font-weight:600;color:var(--accent);cursor:pointer;list-style:none;padding:11px 0;
  transition:color .15s ease;
}
.prose details.proof > summary::-webkit-details-marker{display:none}
.prose details.proof > summary::before{content:"\25B8\00a0"}
.prose details.proof[open] > summary::before{content:"\25BE\00a0"}
.prose details.proof > summary:hover{color:var(--ink)}
.prose details.proof p{margin:9px 0}
/* standalone: its own panel, like a theorem block */
.prose details.proof.standalone{
  background:var(--panel);border:1px solid var(--line);border-left:3px solid var(--accent);
  border-radius:8px;padding:2px 20px;margin:20px 0;
}
.prose details.proof.standalone[open]{padding-bottom:12px}
/* nested inside a theorem block: just a divider, no second panel */
.prose .thm details.proof{border-top:1px solid var(--line);margin:12px 0 2px}
.prose .thm details.proof[open]{padding-bottom:4px}

/* ---------------------------------------- markup from Notion HTML export */
.prose.notion{white-space:pre-wrap}
.prose.notion .page-body > div{white-space:pre-wrap}
.prose.notion pre,.prose.notion code{white-space:pre}
.prose.notion header,.prose.notion .page-description:empty{display:none}
.prose.notion .page-body > div[style*="display:contents"]{display:contents}
/* the post header already draws a rule; don't stack a second one on the
   opening heading (a split-out lecture starts straight on its <h2>) */
.prose.notion .page-body > div:first-child h2{border-top:0;padding-top:0;margin-top:6px}
.prose.notion p,.prose.notion .text{margin:13px 0}
.prose.notion ul.bulleted-list,.prose.notion ol.numbered-list{margin:10px 0;padding-left:24px}
.prose.notion ul.bulleted-list{list-style:disc}
.prose.notion .column-list{display:flex;gap:22px;flex-wrap:wrap;margin:16px 0}
.prose.notion .column{flex:1 1 260px;min-width:0}
.prose.notion figure{margin:18px 0;white-space:normal}
.prose.notion figure.image img{max-width:100%;height:auto;border-radius:8px}
.prose.notion .rule{border:0;border-top:1px solid var(--line);margin:30px 0;height:0}
.prose.notion .equation-container,.prose.notion .equation{margin:14px 0;white-space:normal}
.prose.notion .notion-text-equation-token{white-space:normal}
.prose.notion blockquote{white-space:pre-wrap}
.prose.notion .callout{
  display:flex;gap:12px;background:var(--accent-bg);border-radius:8px;padding:12px 16px;margin:16px 0;
}
.prose.notion .code,.prose.notion pre.code{
  background:var(--code-bg);border:1px solid var(--line);border-radius:8px;
  padding:15px 17px;margin:14px 0;overflow-x:auto;font-family:var(--mono);font-size:13.5px;
}
.prose.notion .indented{margin-left:22px;padding-left:12px;border-left:1px solid var(--line)}
.prose.notion .cjk_fallback{font-family:var(--serif)}
.prose.notion table{white-space:normal}

/* --------------------------------------------------------------- site foot */
.site-foot{
  border-top:1px solid var(--line);padding:22px 0 40px;
  font-family:var(--mono);font-size:11.5px;color:var(--faint);line-height:1.8;
}
.site-foot a{color:var(--faint);text-decoration:none;border-bottom:1px solid var(--line)}
.site-foot a:hover{color:var(--accent);border-bottom-color:var(--accent)}
.site-foot__links{display:flex;gap:14px;flex-wrap:wrap;margin:0 0 6px}
