/* Comfortable type, consistent cards and progressive reading tools. */
:root{--reading-size:20px;--code-bg:#f1f4fa;--code-key:#6741a5;--code-string:#126045;--code-number:#99430c;--code-comment:#586778}
html[data-theme="light"]{--muted:#5f6b7e;--soft:#657186}
.feed-heading .tiny-label,.mini-heading .tiny-label,.feature-bottom .tiny-label,.subpage-meta span{font-size:12px}
.reading-tools,.reading-resume{width:min(1200px,calc(100% - 48px))}.reading-focused .reading-tools,.reading-focused .reading-resume{max-width:880px}
html[data-theme] .article-body pre,html[data-theme] .article-body .code-block pre{background:var(--code-bg);color:var(--text)}
html[data-theme="dark"] .reading-tools button[aria-pressed="true"]{color:#17203a}
@media(max-width:700px){.feature-tile .feature-bottom{padding:0}.feature-tile .feature-tag{top:auto;left:auto}.reading-tools,.reading-resume{width:calc(100% - 24px)}}
html[data-theme="dark"]{--code-bg:#161e2a;--code-key:#cfb1ff;--code-string:#8fdab2;--code-number:#ffc18b;--code-comment:#a8b7c9}
.tiny-label,.section-kicker,.card-original,.new-badge,.cover-eyebrow,.cover-sequence,.profile-hello,.profile-stats span,.footer-bottom,.subpage-meta,.article-meta,.card-bottom,.sidebar-recent time,.cover-topic small,.toc-label{font-size:12px;line-height:1.6}
.welcome-tile{min-height:230px;height:auto;padding:28px 26px 42px}
.welcome-copy,html[data-theme="dark"] .welcome-copy{max-width:83%}
.welcome-copy h1{font-size:clamp(27px,2.3vw,36px);line-height:1.4;letter-spacing:0;overflow-wrap:anywhere}
.welcome-copy .tiny-label{font-size:12px}
.interest-art{opacity:.5;right:-80px;pointer-events:none}
.mosaic-left{grid-template-rows:auto auto}
.shortcut-row{gap:8px}.shortcut{background:var(--surface);color:var(--text);border:1px solid var(--line);padding:13px 14px}
.shortcut>span:first-child{font-size:18px}.shortcut small{font-size:12px;white-space:normal;color:var(--muted);opacity:1}.shortcut-symbol{color:var(--accent);opacity:.09}
.feature-tile{min-height:280px}.feature-bottom h2{line-height:1.4;overflow-wrap:anywhere}.feature-tag{font-size:13px}
.profile-panel{background:var(--surface);color:var(--text);border:1px solid var(--line)}
.profile-panel>p,.profile-name span,.profile-hello,.profile-stats span{color:var(--muted)}
.profile-stats,.profile-link{border-color:var(--line)}.profile-link{color:var(--accent)}
.rss-invitation{display:flex;flex-direction:column;gap:5px;border-top:1px solid var(--line);margin-top:16px;padding-top:16px;font-size:15px}.rss-invitation span{font-size:13px;color:var(--muted)}
.post-cover,.library-page-grid .post-cover,.related-grid .post-cover{height:auto;aspect-ratio:16/9}
.post-card-content{display:flex;flex-direction:column;flex:1}.card-title,.post-card-featured .card-title{font-size:24px;line-height:1.45;letter-spacing:0;overflow-wrap:anywhere}.card-excerpt{font-size:16px;line-height:1.75}.card-bottom{margin-top:auto;color:var(--muted);gap:10px;flex-wrap:wrap}
.post-cover .cover-topic{font-size:23px}.post-cover .cover-art{opacity:.25}
.header-actions>a,.header-actions>button{width:40px;height:40px;min-width:40px;display:grid;place-items:center;padding:0;line-height:1}
.header-actions svg{width:22px;height:22px}
.library-toolbar{flex-wrap:wrap}.search-controls{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;font-size:15px}.search-controls label{display:flex;align-items:center;gap:10px}
.search-controls select,.search-controls button,.reading-tools button,.reading-resume button,.code-tools button{font:inherit;color:var(--text);background:var(--surface);border:1px solid var(--line);border-radius:8px;min-height:40px;padding:6px 12px;cursor:pointer}
.search-match{display:block;font-size:15px;color:var(--muted);margin:0 0 18px;line-height:1.7}.post-card mark{background:#ffe4a2;color:#492e00;border-radius:3px;padding:0 2px}
html[data-theme="dark"] .post-card mark{background:#665322;color:#fff2c3}
.article-body{font-size:var(--reading-size);line-height:1.95}.article-body .article-section p,.article-body .article-section li{font-size:1em;line-height:1.95}
.article-body .article-section :is(p,ul,ol,li,blockquote,td,th,dt,dd){font-size:var(--reading-size)}
.article-body>.article-opening{font-size:var(--reading-size)}
.article-section{scroll-margin-top:165px}.article-body .article-section h2{font-size:1.45em;line-height:1.5}
.reading-tools{display:flex;gap:12px;align-items:center;flex-wrap:wrap;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:12px 16px;margin:0 auto 20px;font-size:15px;position:sticky;top:85px;z-index:12}
.reading-tools[hidden],.reading-resume[hidden],.chapter-check[hidden]{display:none}
.reading-size{display:flex;gap:4px}.reading-tools button[aria-pressed="true"]{background:var(--accent);color:#fff;border-color:var(--accent)}.reading-status{font-size:13px;color:var(--muted)}
.reading-resume{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:16px;border:1px solid var(--line);border-radius:12px;margin-bottom:20px;font-size:15px;background:var(--surface)}
.reading-focused .article-cover,.reading-focused .article-toc,.reading-focused .related-section{display:none}.reading-focused .article-layout{grid-template-columns:minmax(0,1fr);max-width:880px;margin-inline:auto}.reading-focused .mobile-toc{display:block}.reading-focused .article-intro{max-width:880px;margin-inline:auto}
.chapter-check{display:flex;align-items:center;gap:8px;font-size:14px;min-height:40px;cursor:pointer}.chapter-check input{width:18px;height:18px;accent-color:var(--accent)}
.series-membership{border:1px solid var(--line);background:var(--bg);border-radius:12px;padding:20px;margin:0 0 26px}.series-membership h2{font-size:22px!important;margin:8px 0 14px!important}.series-membership details{font-size:16px;margin-top:16px}.series-membership summary{cursor:pointer;min-height:40px}.series-membership a[aria-current]{color:var(--accent);font-weight:bold}.series-route+.series-route{border-top:1px solid var(--line);margin-top:18px;padding-top:18px}
.series-neighbors{display:grid;grid-template-columns:1fr 1fr;gap:16px;font-size:16px}.series-neighbors>a{display:flex;flex-direction:column;line-height:1.6}.series-neighbors small,.series-neighbors>span{color:var(--muted);font-size:13px}
.learning-path{list-style:none;padding:0;counter-reset:none}.learning-path li{display:flex;gap:20px;border:1px solid var(--line);border-radius:14px;padding:24px;margin:16px 0;background:var(--surface)}.learning-path li>div{min-width:0}.chapter-number{font-size:25px;color:var(--accent);line-height:1.4}.learning-path li a{font-size:22px}.learning-path li p{font-size:16px}.learning-path small,.local-progress-note,.series-overview{color:var(--muted);font-size:14px}
.math-formula{overflow-wrap:normal}.math-block{display:block;overflow-x:auto;max-width:100%;padding:8px 0}.katex-display{margin:.5em 0}.katex{font-size:1.12em}.katex-error{color:#b42318!important}
.code-block{margin:1.4em 0;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--code-bg)}.code-tools{display:flex;align-items:center;gap:12px;justify-content:space-between;padding:8px 14px;border-bottom:1px solid var(--line);font-size:13px;color:var(--muted)}.code-status{margin-left:auto}.code-tools button{min-height:36px;font-size:14px}.article-body .code-block pre{margin:0;border:0;border-radius:0;background:transparent;padding:18px;white-space:pre;overflow:auto}.article-body pre>code{font-size:1em;line-height:1.8;background:transparent}.article-body pre{font-size:.85em;background:var(--code-bg);color:var(--text)}
.hljs-keyword,.hljs-selector-tag,.hljs-title,.hljs-built_in{color:var(--code-key)}.hljs-string,.hljs-attr,.hljs-template-tag{color:var(--code-string)}.hljs-number,.hljs-literal,.hljs-symbol{color:var(--code-number)}.hljs-comment,.hljs-quote{color:var(--code-comment)}
a:focus-visible,button:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--accent);outline-offset:4px}
@media(max-width:1000px){.welcome-copy,html[data-theme="dark"] .welcome-copy{max-width:100%}.interest-art{opacity:.16;right:-130px}.shortcut small{display:none}.profile-panel{grid-row:auto}}
@media(max-width:700px){.home-mosaic{gap:12px;margin-bottom:18px}.mosaic-left{grid-template-rows:auto auto}.welcome-tile{padding:20px 20px 30px;min-height:180px}.welcome-copy h1{font-size:clamp(23px,6.7vw,29px);margin:10px 0;line-height:1.45}.welcome-copy p{font-size:14px}.welcome-link{bottom:10px;font-size:12px}.welcome-copy .tiny-label{font-size:12px}.interest-art{right:-115px;opacity:.1}.shortcut{min-height:46px;padding:10px}.shortcut>span:first-child{font-size:16px}.feature-tile{height:190px;min-height:190px}.feature-bottom{padding:20px}.feature-bottom h2{font-size:24px;line-height:1.4}.feature-tag{top:18px;left:20px}.feature-bottom .tiny-label{display:none}.header-actions>a,.header-actions>button{width:40px;height:44px;min-width:40px}.header-actions .random-post{display:grid}.header-actions{gap:0}.header-actions svg{width:20px;height:20px}.brand>span{font-size:19px}.brand small{font-size:11px}.site-header .brand{gap:6px}.brand-logo{width:32px;height:32px}.site-header .nav-center{width:auto;flex:1;min-width:42px}.reading-tools{top:72px;padding:10px;gap:8px}.reading-tools>span:first-child{display:none}.reading-tools .chapter-check{font-size:13px}.reading-status:empty{display:none}.reading-tools button{padding:5px 10px}.article-body{padding:24px 18px}.series-membership{padding:16px}.series-neighbors{gap:12px}.card-title,.post-card-featured .card-title{font-size:23px}.card-bottom{font-size:13px}.post-cover,.library-page-grid .post-cover,.related-grid .post-cover{height:auto;aspect-ratio:16/9}.learning-path li{padding:18px;gap:14px}.feature-page>img{max-height:260px;object-fit:cover}.search-controls{gap:10px;font-size:14px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}.shortcut,.interest-art{transition:none!important}}
@media(max-width:700px){.site-header.is-scrolled .nav-center>.nav-links{visibility:visible;opacity:1;transform:none;pointer-events:auto}.site-header.is-scrolled .nav-center>.scroll-motto{display:none;visibility:hidden;pointer-events:none}.article-section{scroll-margin-top:210px}}
