@font-face{font-family:"IBM Plex Mono";font-style:normal;font-display:swap;font-weight:400;src:url("/assets/fonts/files/IBMPlexMono-Regular.woff2") format("woff2")}@font-face{font-family:"IBM Plex Mono";font-style:normal;font-display:swap;font-weight:500;src:url("/assets/fonts/files/IBMPlexMono-Medium.woff2") format("woff2")}@font-face{font-family:"IBM Plex Mono";font-style:normal;font-display:swap;font-weight:700;src:url("/assets/fonts/files/IBMPlexMono-Bold.woff2") format("woff2")}@font-face{font-family:"Ioskeley Mono";font-style:normal;font-display:swap;font-weight:400;src:url("/assets/fonts/files/IoskeleyMono-Regular.woff2") format("woff2")}@font-face{font-family:"Ioskeley Mono";font-style:normal;font-display:swap;font-weight:700;src:url("/assets/fonts/files/IoskeleyMono-Bold.woff2") format("woff2")}:root{color-scheme:dark;--bg:#000;--surface:#111417;--line:#24272a;--text:#f3f4f6;--muted:#9ca3af;--accent:#fff;--max:760px;--font-ui:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,monospace}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font-ui);line-height:1.6}a{color:inherit;text-underline-offset:4px;text-decoration-color:#50545a}a:hover{color:#fff}.skip{position:absolute;left:-10000px}.skip:focus{left:16px;top:16px;background:#fff;color:#000;padding:8px;z-index:50}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* The homepage intentionally preserves the original small, section-based HTML portfolio. */
.home{min-height:100vh}.home :is(h1,h2,h3,strong,b),.subroute :is(h1,h2,h3,strong,b){font-weight:400}.home-nav{position:fixed;z-index:20;top:0;left:50%;transform:translateX(-50%);width:min(calc(100% - 64px),672px);min-height:var(--nav-height);padding:20px 8px 14px;display:flex;align-items:center;justify-content:space-between;background:rgba(0,0,0,.86);backdrop-filter:blur(8px)}.home-name{font-size:1.25rem;font-weight:400;text-decoration:none}.nav-links{display:flex;gap:24px}.nav-links a{font-weight:400;text-decoration:none;font-size:.95rem}.home-main{width:min(calc(100% - 64px),672px);margin:0 auto;padding-top:var(--nav-height)}.home-main,.home-footer{position:relative;z-index:1}.home-section{min-height:76vh;padding:48px 8px 72px}.home-section,.home-section:target~.home-section:last-of-type{display:none}.home-section:target,.home-section:last-of-type{display:block}.section-title{text-align:center;font-size:clamp(1.65rem,5vw,2.25rem);margin:24px 0 54px}.home-hero{display:flex;min-height:330px;align-items:center;justify-content:space-between;gap:32px}.home-hero h1{position:relative;font-size:clamp(2rem,6vw,2.55rem);line-height:1.15;letter-spacing:-.035em;margin:0 0 14px;white-space:nowrap}.home-hero h2{font-size:1.15rem;margin:0 0 10px}.home-hero p{margin:0}.profile-trigger{--profile-image:url("/static/avi.png");appearance:none;border:0;background:transparent;color:inherit;padding:0;border-radius:999px;cursor:default;touch-action:manipulation}.profile-trigger:focus-visible{outline:1px solid #d1d5db;outline-offset:7px}.profile-glitch{position:relative;display:block;width:176px;height:176px;border-radius:999px}.profile-glitch img{display:block;width:176px;height:176px;object-fit:cover;border-radius:inherit;filter:grayscale(1);-webkit-user-drag:none;user-select:none}.profile-glitch::before,.profile-glitch::after{content:"";position:absolute;inset:0;border-radius:inherit;background:var(--profile-image) center/cover no-repeat;opacity:0;pointer-events:none}.profile-trigger.is-switching .profile-glitch::before{opacity:.72;animation:profile-glitch-a .38s steps(2,end)}.profile-trigger.is-switching .profile-glitch::after{opacity:.58;animation:profile-glitch-b .38s steps(2,end)}.hackerman-rain{position:fixed;z-index:0;inset:0;width:100%;height:100%;pointer-events:none;opacity:.22}.home.hackerman,.home.hackerman *{font-family:"Ioskeley Mono",ui-monospace,SFMono-Regular,Menlo,monospace;text-transform:lowercase}.hackerman .home-nav{background:rgba(0,0,0,.78)}.hackerman .hero-greeting{font-family:inherit;text-shadow:1px 0 #999,-1px 0 #555}.hackerman .hero-greeting span::after{content:"_";display:inline-block;animation:terminal-cursor 1.05s steps(1,end) infinite}.hackerman .hero-greeting::before,.hackerman .hero-greeting::after{content:attr(data-text);position:absolute;inset:0;pointer-events:none;opacity:.55}.hackerman .hero-greeting::before{transform:translate(2px,-1px);clip-path:inset(12% 0 58% 0);animation:text-glitch-a 2.4s steps(2,end) infinite}.hackerman .hero-greeting::after{transform:translate(-2px,1px);clip-path:inset(62% 0 12% 0);animation:text-glitch-b 1.9s steps(2,end) infinite}.hackerman .hero-greeting.is-typing::before,.hackerman .hero-greeting.is-typing::after{animation:none;opacity:0}.socials{display:flex;gap:18px;padding:8px 0 30px}.socials a{font-size:.9rem}.featured-heading,.subhead{font-size:clamp(1.5rem,4vw,2.1rem);letter-spacing:-.025em;margin:24px 0}.featured{display:grid;grid-template-columns:repeat(3,1fr);gap:24px}.featured>a{min-height:180px;padding:16px;border-radius:8px;background:rgba(17,20,23,.8);display:flex;flex-direction:column;text-decoration:none;transition:transform .15s ease,background .15s ease}.featured>a:hover{background:#111417;transform:scale(1.01)}.featured strong{font-size:1rem;font-weight:400}.featured span{font-size:.84rem;color:#d1d5db;margin-top:18px}.featured i{font-style:normal;margin-top:auto;color:#f3f4f6}.plain-list{display:grid;gap:0}.plain-list article{padding:24px 0;border-bottom:1px solid var(--line)}.plain-list h2{font-size:1.3rem;margin:0 0 6px}.plain-list p{margin:0;color:#b5b8bd}.simple-list,.writing-list{padding-left:1.2rem}.simple-list li,.writing-list li{padding:7px 0}.writing-list span{color:#777;margin-left:8px}.home-footer{width:min(calc(100% - 64px),672px);min-height:72vh;margin:0 auto;padding:72px 8px;display:grid;grid-template-columns:1fr 1fr;gap:64px;align-content:center}.home-footer h2{font-size:1rem}.home-footer p{font-size:.9rem;color:#d1d5db}@keyframes profile-glitch-a{0%,100%{clip-path:inset(0);transform:translate(0)}25%{clip-path:inset(12% 0 62%);transform:translate(7px,-2px)}50%{clip-path:inset(48% 0 26%);transform:translate(-8px,2px)}75%{clip-path:inset(72% 0 8%);transform:translate(5px,1px)}}@keyframes profile-glitch-b{0%,100%{clip-path:inset(0);transform:translate(0)}30%{clip-path:inset(58% 0 18%);transform:translate(-6px,-1px)}65%{clip-path:inset(24% 0 52%);transform:translate(8px,2px)}}@keyframes text-glitch-a{0%,88%,100%{transform:translate(0);opacity:0}89%{transform:translate(3px,-1px);opacity:.55}92%{transform:translate(-2px,1px);opacity:.35}}@keyframes text-glitch-b{0%,74%,100%{transform:translate(0);opacity:0}75%{transform:translate(-3px,1px);opacity:.45}78%{transform:translate(2px,-1px);opacity:.3}}@keyframes terminal-cursor{0%,48%{opacity:1}49%,100%{opacity:0}}

:root{--nav-height:76px}
.home-section{scroll-margin-top:var(--nav-height)}
.nav-links a[aria-current]{text-decoration:underline;text-decoration-color:currentColor}
.home-hero .hero-bio{max-width:27rem;margin-top:18px;color:var(--muted);font-size:.9rem;line-height:1.6}
@media(max-width:760px){.socials{gap:8px;flex-wrap:wrap}.socials a,.home-footer a{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:8px}.home-footer a{justify-content:flex-start}}

/* Shared typography for documentation, books, and errors. */
.shell{width:min(calc(100% - 40px),var(--max));margin:auto}.subroute-main{padding:148px 0 32px}.shell h1,.shell h2,.shell h3{line-height:1.12;letter-spacing:-.035em}.shell h1{margin:.1em 0}.shell h2{margin:.2em 0 .65em}.shell h3{font-size:1.25rem;margin:.35em 0}.shell section{padding:72px 0;border-top:1px solid var(--line)}

/* Non-essay headings share the homepage greeting's visual ceiling. */
.home-hero h1,.shell h1{font-size:clamp(2rem,6vw,2.55rem)}.shell h2{font-size:clamp(1.5rem,4vw,2.1rem)}

.writing-rss{margin:24px 0 0 1.2rem;font-size:.78rem}.writing-rss a{color:#9ca3af;display:inline-flex;align-items:center;justify-content:center;min-width:24px;min-height:24px}

/* Essays follow Distill's publication grammar: Georgia title deck and reading column by default, and a wide annotation gutter. */
.article-page{min-height:100vh;background:#000;color:#f3f4f6;--font-article:Georgia,"Times New Roman",serif;font-family:var(--font-article);line-height:1.5;color-scheme:dark}.article-page a{text-decoration-color:#50545a}.article-page a:hover{color:#fff}.article-masthead{height:70px;background:#111417;color:#f3f4f6;border-bottom:1px solid #24272a}.article-masthead nav{width:min(calc(100% - 48px),1060px);height:100%;margin:auto;display:flex;align-items:center;justify-content:center}.article-return{display:grid;place-items:center;width:46px;height:46px;text-decoration:none}.article-return svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:1.55;stroke-linecap:round;stroke-linejoin:round}.article-return:hover svg{stroke:#fff}.article-title{width:min(calc(100% - 48px),704px);margin:0 auto;padding:68px 0 54px}.article-title h1{font-size:clamp(3rem,7vw,4.6rem);line-height:1.02;letter-spacing:-.045em;margin:0 0 .18em}.article-title>p:last-child{font-size:1.28rem;line-height:1.48;margin:0;color:#d1d5db}.article-byline{margin:0;background:#090a0b;border-top:1px solid #24272a;border-bottom:1px solid #24272a;padding:30px max(24px,calc((100% - 704px)/2));display:grid;grid-template-columns:repeat(3,1fr);gap:32px}.article-byline div{min-width:0}.article-byline dt{font-size:.62rem;color:#777;margin-bottom:7px}.article-byline dd{font-size:.78rem;margin:0;color:#d1d5db}.article-grid{width:min(calc(100% - 48px),1060px);margin:0 auto;display:grid;grid-template-columns:minmax(0,704px) minmax(180px,1fr);column-gap:72px;padding:70px 0 110px}.article-copy{grid-column:1;font-family:var(--font-article);font-size:1.12rem;line-height:1.72;color:#e5e7eb}.article-copy p{margin:0 0 1.55em}.article-copy .article-lead{font-size:1.22rem;line-height:1.62;color:#f3f4f6}.article-copy h2{font-size:1.85rem;letter-spacing:-.025em;line-height:1.2;margin:2.2em 0 .7em;color:#f3f4f6}.article-copy aside{float:right;width:210px;margin:.35em -282px 1.5em 48px;padding-top:10px;border-top:1px solid #50545a;color:#9ca3af;font-size:.78rem;line-height:1.55}.article-copy aside strong{display:block;color:#d1d5db;font-size:.66rem;letter-spacing:.08em;text-transform:uppercase;margin-bottom:6px}.article-copy blockquote{margin:0 0 2.2em;padding:0 0 0 24px;border-left:1px solid #50545a;color:#d1d5db;font-style:italic}.article-copy blockquote p{margin-bottom:.45em}.article-copy blockquote cite{font-size:.75rem;font-style:normal;color:#9ca3af}.article-copy ol{margin:0 0 2em;padding-left:1.4em}.article-copy li{margin:.42em 0}.article-copy .katex{font-size:1.05em}.article-footer{border-top:1px solid #24272a;background:#0d0f10;color:#9ca3af;padding:44px max(24px,calc((100% - 704px)/2));display:flex;justify-content:space-between;gap:30px;font-size:.75rem}.article-footer p{margin:0}

@media(max-width:760px){.home-nav,.home-main,.home-footer{width:min(calc(100% - 32px),672px)}.home-nav{align-items:flex-start}.nav-links{display:none;position:absolute;top:64px;left:0;right:0;padding:14px 8px 18px;background:#000;flex-direction:column;gap:12px}.home-section{padding-top:36px}.home-hero{min-height:360px;flex-direction:column-reverse;align-items:flex-start;justify-content:center}.home-hero h1{font-size:clamp(1.9rem,8vw,2.25rem);white-space:normal}.profile-glitch,.profile-glitch img{width:96px;height:96px}.featured{grid-template-columns:1fr}.featured>a{min-height:140px}.featured{grid-template-columns:1fr}.home-footer{grid-template-columns:1fr;gap:24px}.shell{width:min(calc(100% - 28px),var(--max))}.subroute-main{padding-top:124px}.article-masthead nav,.article-title,.article-grid{width:min(calc(100% - 32px),704px)}.article-title{padding:48px 0 38px}.article-title h1{font-size:2.8rem}.article-title>p:last-child{font-size:1.08rem}.article-byline{grid-template-columns:1fr 1fr;padding:24px 16px;gap:22px}.article-grid{display:block;padding:48px 0 72px}.article-copy{font-size:1.06rem}.article-copy .article-lead{font-size:1.13rem}.article-copy aside{float:none;width:auto;margin:36px 0;padding:14px 0;border-bottom:1px solid #50545a}.article-footer{display:block}.article-footer p+p{margin-top:12px}}@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.featured>a{transition:none}.profile-trigger.is-switching .profile-glitch::before,.profile-trigger.is-switching .profile-glitch::after,.hackerman .hero-greeting::before,.hackerman .hero-greeting::after{animation:none;display:none}.hackerman .hero-greeting span::after{animation:none}}

.home-nav.is-collapsed:not(:has(:focus-visible, [aria-expanded="true"])) { translate: 0 -100%; }
@media (prefers-reduced-motion: no-preference) { .home-nav.is-enhanced { transition: translate 160ms ease-out; } }
/* The mobile menu stays visible without JavaScript. */
.nav-toggle{display:none;appearance:none;background:transparent;color:inherit}
@media(max-width:760px){.home-nav:not(.is-enhanced) .nav-links{display:flex}.home-nav.is-enhanced .nav-toggle{display:block;border:1px solid #4b5563;border-radius:4px;padding:8px;cursor:pointer}.nav-toggle>span:not(.sr-only){display:block;width:16px;height:1px;margin:3px;background:currentColor}.nav-toggle:focus-visible{outline:2px solid #fff;outline-offset:3px}.home-nav.is-enhanced .nav-links{display:none}.home-nav.is-enhanced .nav-links.is-open{display:flex}}
/* Article-only reading controls; native disclosures also work without JavaScript. */
.article-page { --reader-paper: #111417; --reader-ink: #f3f4f6; --reader-muted: #b2b5ba; --reader-rule: #50545a; }
[data-reading-font="plex"] .article-page { --font-article: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
[data-reading-font="ioskeley"] .article-page { --font-article: "Ioskeley Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
[data-reading-font="plex"] .article-title h1, [data-reading-font="ioskeley"] .article-title h1 { letter-spacing: 0; }
.reader-settings { position: fixed; right: 24px; top: 15px; z-index: 30; color: var(--reader-muted); font-size: .8rem; }
.reader-settings summary, .article-contents summary { cursor: pointer; display: grid; place-items: center; width: 40px; height: 40px; list-style: none; border-radius: 4px; }
.reader-settings summary { margin-left: auto; }
.reader-settings summary::-webkit-details-marker, .article-contents summary::-webkit-details-marker { display: none; }
.reader-settings summary:hover, .article-contents summary:hover { color: var(--reader-ink); background: var(--reader-paper); }
.ui-icon, .article-contents summary svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.reader-settings[open] { background: var(--reader-paper); border-radius: 4px; }
.reader-settings div { padding: 4px; display: flex; flex-direction: column; gap: 4px; }
.icon-control { display: inline-grid; place-items: center; width: 40px; height: 40px; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 4px; cursor: pointer; }
.icon-control:hover { color: var(--reader-ink, var(--text)); }
.reader-settings button[aria-pressed="true"] { border-color: var(--reader-rule); font-weight: 700; }
#reader-font { font-family: var(--font-article); font-size: 15px; font-weight: 400; letter-spacing: 0; line-height: 1; }
.article-page :is(button, summary, a):focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.article-contents { align-self: start; color: var(--reader-muted); font-size: .8rem; margin-bottom: 24px; }
.article-contents .contents-minus, .article-contents[open] .contents-list { display: none; }
.article-contents[open] .contents-minus { display: initial; }
.article-contents nav { display: grid; gap: 12px; padding: 8px 12px 16px; max-height: 65vh; overflow-y: auto; }
.article-contents a { text-decoration: none; line-height: 1.45; }
.article-contents a:hover { text-decoration: underline; }
.article-copy h2 { scroll-margin-top: 80px; }
.article-byline dt { color: #9ca3af; }
.article-grid { display: block; max-width: 704px; }
.article-copy aside { float: none; width: auto; margin: 2em 0; }
@media(min-width:1100px) {
  .article-grid { display: grid; grid-template-columns: minmax(0,704px); }
  .article-copy { grid-row: 1; }
  .article-contents { position: sticky; top: 80px; grid-column: 1; grid-row: 1; width: 160px; margin-left: -192px; margin-bottom: 0; }
  .article-contents summary { margin-left: auto; }
}
@media(min-width:1600px) {
  .article-grid { max-width: 1060px; grid-template-columns: minmax(0,704px) minmax(180px,1fr); }
  .article-copy aside { float: right; width: 210px; margin: .35em -282px 1.5em 48px; }
}
html[data-reading-theme="light"] { color-scheme: light; background: #faf9f6; }
[data-reading-theme="light"] .article-page { --reader-paper: #f0efeb; --reader-ink: #292824; --reader-muted: #62605b; --reader-rule: #c3c1b9; background: #faf9f6; color: var(--reader-ink); color-scheme: light; }
[data-reading-theme="light"] :is(.article-masthead, .article-byline, .article-footer) { background: #f0efeb; color: #62605b; border-color: #d9d7cf; }
[data-reading-theme="light"] :is(.article-copy, .article-copy .article-lead, .article-copy h2, .article-return) { color: #292824; }
[data-reading-theme="light"] :is(.article-title>p:last-child, .article-byline dd, .article-copy aside, .article-copy aside strong, .article-copy blockquote, .article-copy blockquote cite, .article-byline dt) { color: #62605b; }
[data-reading-theme="light"] .article-page a { text-decoration-color: #8b9380; }
[data-reading-theme="light"] .article-page a:hover { color: #45613d; }
[data-reading-theme="light"] .article-return:hover svg { stroke: currentColor; }
[data-reading-zen="true"] :is(.article-masthead, .article-byline, .article-footer, .article-contents) { display: none; }
[data-reading-zen="true"] .article-grid { display: block; max-width: 704px; }
[data-reading-zen="true"] .article-copy aside { float: none; width: auto; margin: 2em 0; padding: 14px 0; }
[data-reading-zen="true"] .article-title { padding-top: 100px; }
@media(max-width:760px) { .reader-settings { right: 16px; } }
@media print { .reader-settings, .article-contents { display: none; } }
/* CV shares the portfolio column and section rhythm. */
.cv-intro{display:flex;align-items:center;gap:32px;margin-bottom:40px}
.cv-intro>p{margin:0;color:var(--muted)}
.cv-qr{flex:none;display:block}
.cv-qr:focus-visible{outline:2px solid currentColor;outline-offset:3px}
.cv-qr img{display:block;width:135px;height:135px;image-rendering:pixelated;filter:invert(1);opacity:.75}
.cv-section h2{font-size:clamp(1.5rem,4vw,2.1rem);letter-spacing:-.025em;margin:24px 0}
.cv-section h3{font-size:1.3rem;margin:0 0 6px}
.cv-job{padding:24px 0;border-bottom:1px solid var(--line)}
.cv-meta{font-size:.85rem;color:var(--muted)}
.cv-job-header{display:flex;justify-content:space-between;gap:24px}
.cv-job-header p{margin:0 0 6px}
.cv-dates{text-align:right;flex-shrink:0}
.cv-job ul{padding-left:1.2rem;margin:20px 0}
.cv-job li{margin:0 0 12px}
.cv-details>section{padding:12px 0 24px;border-bottom:1px solid var(--line)}
.cv-details p{margin:8px 0;color:var(--muted)}
.cv-details ul{padding-left:1.2rem}
.cv-skills dl{margin:0}
.cv-skills dl>div{padding:16px 0;border-bottom:1px solid var(--line)}
.cv-skills dd{margin:6px 0 0}
@media(max-width:760px){
.cv-intro{flex-direction:column;align-items:flex-start;gap:24px}
.cv-job-header{display:block}
.cv-dates{text-align:left;margin-top:12px}
}
@view-transition { navigation: auto; }

.home-main:has(#reading:target), .home-main.revealing-shelf { width: 100%; }
.revealing-shelf #reading { display: block; }
.revealing-shelf #index { display: none; }
.home-section.reading-section { padding: 0 0 72px; }
.reading-section [hidden] { display: none; }
.reading-tabs { text-align: center; }
.reading-section button, .reading-section input, .reading-section select, .reading-tabs button {
  font: inherit; color: inherit; background: transparent; border: 0;
}
.reading-section button, .reading-tabs button { cursor: pointer; }
.reading-section :focus-visible, .book-detail :focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.browsing-by-key :is(.shelf-window, .shelf-jacket):focus-visible { outline: none; }
.reading-tabs button {
  min-height: 44px; padding: 0 12px; color: var(--muted); font-size: 13px;
}
.reading-tabs [aria-selected="true"] {
  color: var(--text); text-decoration: underline; text-underline-offset: 8px;
}
.book-shelf {
  --book-height: clamp(318px, 34vw, 408px);
  --spine-width: clamp(43px, 5.1vw, 65px);
  --spine-gap: clamp(7px, 1.1vw, 14px);
}
.shelf-window { overflow-x: auto; padding: 22px 0; }
.shelf-rail { display: flex; width: max-content; align-items: center; gap: var(--spine-gap); }
.shelf-volume { flex: none; }
.shelf-spine { display: none; }
.shelf-jacket { display: block; }
.shelf-jacket img { height: min(32vw, 250px); width: auto; }
.book-shelf.interactive { margin-top: 18px; }
.book-shelf.interactive { container-type: inline-size; column-gap: var(--spine-gap); --pitch: clamp(128px, 15vw, 205px); }
.interactive .shelf-window {
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none; overflow-anchor: none;
}
.interactive .shelf-window::-webkit-scrollbar { display: none; }
.interactive .shelf-rail {
  gap: 0; padding-inline: calc((100cqw - var(--pitch)) / 2);
}
.interactive .shelf-volume {
  position: relative; width: var(--pitch); height: var(--book-height);
  scroll-snap-align: center;
}
.interactive .shelf-volume { --cloth: #35363c; --band: #c3a893; --letter: #f3f4f6; }
.shelf-volume[data-binding="slate"] { --cloth: #344249; --band: #afc2c8; }
.shelf-volume[data-binding="sand"] { --cloth: #d5c9ae; --band: #a78a66; --letter: #17191a; }
.shelf-volume[data-binding="violet"] { --cloth: #393746; --band: #bcb6c9; }
.shelf-volume[data-binding="grey"] { --cloth: #323433; --band: #b7bec2; }
.shelf-volume[data-binding="lemon"] { --cloth: #eee6ba; --band: #c6b562; --letter: #17191a; }
.shelf-volume[data-binding="copper"] { --cloth: #3d322a; --band: #c89c65; }
.shelf-volume[data-binding="paper"] { --cloth: #dfdfd8; --band: #91a2aa; --letter: #17191a; }
.shelf-volume[data-binding="olive"] { --cloth: #444333; --band: #d6d0ae; }
.shelf-volume[data-binding="plum"] { --cloth: #40363b; --band: #bcada9; }
.shelf-volume[data-binding="sage"] { --cloth: #3c4343; --band: #b4c1ba; }
.interactive .shelf-spine {
  display: block; position: absolute; left: calc(50% + var(--hinge)); top: 0; transform-origin: right center;
  transform: translateX(-100%) rotateY(calc(-1 * var(--angle))); width: var(--spine-width); height: var(--book-height); padding: 0;
  color: var(--letter); background: linear-gradient(90deg, #0003, transparent 14%, transparent 97%, #0004), var(--cloth);
  text-align: left; border-radius: 2px;
}
.shelf-spine::after {
  content: ""; position: absolute; inset: 0 auto 0 100%; width: calc(var(--spine-gap) * .72);
  background: var(--cloth); filter: brightness(.66);
  clip-path: polygon(0 0,100% 2%,100% 98%,0 100%);
}
.face-out ~ .shelf-volume .shelf-spine::after { inset: 0 100% 0 auto; transform: scaleX(-1); }
.shelf-spine:hover { filter: brightness(1.13); }
.spine-number {
  position: absolute; inset: 0 0 auto; height: 12.3%; display: grid; place-items: center;
  color: #17191a; background: var(--band); font-size: clamp(13px,1.3vw,17px);
}
.spine-title, .spine-author {
  position: absolute; writing-mode: vertical-rl; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.spine-title { top: 15%; right: 19%; max-height: 83%; font-size: clamp(12px,1.25vw,16px); }
.spine-author { bottom: 2%; left: 8%; max-height: 80%; font-size: clamp(9px,.8vw,11px); }
.interactive .shelf-jacket {
  position: absolute; left: calc(50% + var(--hinge)); top: 0; height: var(--book-height); padding: 0;
  transform-origin: left center; transform: rotateY(calc(90deg - var(--angle)));
}
.interactive .shelf-jacket img { height: 100%; width: auto; }
.reading-list a:hover > .row-title { text-decoration: underline; }
.reading-feed { width: min(calc(100% - 48px),1000px); margin-inline: auto; }
.reading-tools {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 38px;
}
.reading-section input, .reading-tools select { height: 44px; font-size: 14px; min-width: 0; }
.reading-tools select { background: var(--bg); }
.reading-section input::placeholder, .reading-tools select { color: var(--muted); opacity: 1; }
.reading-list { list-style: none; margin: 0; padding: 0; }
.reading-list li > * {
  display: grid; grid-template-columns: 17px minmax(0,1fr) auto 90px;
  gap: 10px; align-items: baseline; padding: 6px 0; font-size: 15px; text-decoration: none;
}
.row-title { overflow-wrap: anywhere; }
.reading-list small, .list-meta { color: var(--muted); font-size: 12px; text-align: right; }
.reading-list small { max-width: 34ch; overflow-wrap: anywhere; }
.reading-status { color: var(--muted); font-size: 14px; font-weight: normal; }
.reading-status:empty { display: none; }
.reading-search { display: inline-flex; align-items: center; min-width: 0; gap: 9px; color: var(--muted); }
.reading-search input { color: var(--text); width: 100%; }
.reading-search .ui-icon { flex: none; width: 15px; height: 15px; }
.feed-more { min-height: 1px; }
.feed-more, .home:has(#reading:target) .home-footer { overflow-anchor: none; }
.feed-more button { min-height: 44px; color: var(--muted); }
.feed-more.auto-load button:not(:focus-visible) { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; overflow: hidden; clip-path: inset(50%); }
.book-mark { width: 13px; height: 18px; justify-self: center; align-self: start; margin-top: 3px; object-fit: contain; }
span.book-mark { border: 1px solid var(--muted); border-left: 3px double var(--muted); border-radius: 1px 2px 2px 1px; }
.site-mark {
  position: relative; width: 17px; height: 17px; align-self: start; margin-top: 3px; overflow: hidden;
  display: grid; place-items: center; border-radius: 4px; background: #2a3033; font-size: 11px;
}
.site-mark img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #ebebea; }
@media (max-width:600px) {
  .book-shelf.interactive { margin-top: 6px; }
  .spine-title { right: 14%; }
  .reading-tools { margin-top: 22px; }
  .reading-list li > * { grid-template-columns: 17px minmax(0,1fr) auto; gap: 2px 10px; font-size: 14px; }
  .reading-list .row-title { grid-column: 2/-1; }
  .reading-list small { grid-column: 2; text-align: left; }
  .reading-list .list-meta { grid-column: 3; }
}
#books-panel:has(#reading-status option:checked:not([value="all"])) {
  .list-meta { display: none; }
  .reading-list li > * { grid-template-columns: 17px minmax(0,1fr) auto; }
  @media (max-width:600px) {
    .reading-list li > * { grid-template-columns: 17px minmax(0,1fr); }
  }
}
.book-cover{display:block;width:100%;height:auto;border-radius:1px 3px 3px 1px}
.face-out .book-cover, .book-heading .book-cover { view-transition-name: var(--cover-transition); }
.book-detail{max-width:672px;margin:auto}.book-back{display:inline-block;font-size:25px;text-decoration:none;margin-bottom:40px;padding:8px}
.book-heading{display:grid;grid-template-columns:170px 1fr;gap:40px;align-items:center}.book-heading .book-cover{box-shadow:8px 12px 25px #0007}
.book-heading h1{font-size:36px;line-height:1.12;margin:12px 0}.book-heading p{margin:10px 0}.book-author{color:var(--muted)}
.book-heading h1 a { text-decoration: none; }
.book-heading h1 a:hover { text-decoration: underline; }
.book-detail .reading-tabs { margin-top: 36px; }
.book-detail section { border-top: 1px solid var(--line); padding: 20px 0; }
.book-detail [role="tabpanel"] h2 { display: none; }
.book-detail h2 { font-size: 23px; font-weight: normal; margin: 0 0 20px; }
::view-transition-group(*){animation-duration:450ms}
@media (max-width:600px) {
  .book-heading { grid-template-columns: clamp(80px,24vw,110px) minmax(0,1fr); gap: clamp(12px,4vw,22px); }
  .book-heading h1 { font-size: clamp(20px,5.5vw,27px); overflow-wrap: anywhere; }
  .book-back { margin-bottom: 24px; }
}
@media(prefers-reduced-motion:reduce){::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation:none!important}}
#search-launch {
  position: fixed;
  z-index: 21;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--reader-muted, var(--muted));
  font: 12px/1.4 var(--font-ui), monospace;
  cursor: pointer;
}
#search-launch:hover { text-decoration: underline; text-underline-offset: 3px }
#search-launch .ui-icon { display: none }

#search-palette {
  --panel: #151517;
  --ink: #f5f5f6;
  --secondary: #a7a7ad;
  --rule: rgb(255 255 255 / 12%);
  --selection: rgb(255 255 255 / 9%);
  box-sizing: border-box;
  position: fixed;
  inset: 0 0 auto;
  margin: clamp(12px, 14dvh, 150px) auto 0;
  width: min(752px, calc(100% - 28px));
  max-height: min(560px, 77dvh);
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 24px;
  color-scheme: dark;
  background: radial-gradient(ellipse at 97% 90%, #222224, transparent 48%), var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 80px rgb(0 0 0 / 50%), inset 0 1px rgb(255 255 255 / 4%);
  font: 15px/1.4 system-ui, sans-serif;
}

#search-palette[open] { display: flex; flex-direction: column }
#search-palette::backdrop { background: rgb(0 0 0 / 55%); backdrop-filter: blur(5px) }
#search-launch .ui-icon, #search-palette .ui-icon {
  width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
#search-palette :focus-visible, #search-launch:focus-visible { outline: 2px solid currentColor; outline-offset: -2px }
#search-launch.returned-focus:focus-visible { outline: none }

#search-palette .search-input {
  display: flex; align-items: center; flex: none; gap: 12px;
  padding: 9px 12px 9px 19px; color: var(--secondary);
}
#search-palette .search-input:focus-within > svg { color: var(--ink) }
#search-palette input {
  flex: 1; min-width: 0; height: 44px; padding: 0;
  border: 0; border-radius: 0; background: transparent;
  color: var(--ink); font: inherit; font-size: 20px; letter-spacing: -.02em;
}
#search-palette input::placeholder { color: var(--secondary); opacity: 1 }
#search-palette input:focus-visible { outline: none }
#search-palette input::-webkit-search-cancel-button { appearance: none }
#search-palette button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer }
#search-palette kbd {
  display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 4px;
  border: 1px solid var(--rule); border-radius: 5px; color: var(--secondary);
  font: 12px/1 var(--font-ui), monospace;
}
#search-palette .search-dismiss:not(:focus-visible) {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%);
}
.search-results { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin }
#search-palette [role=status] {
  margin: 0; padding: 6px 20px 7px; color: var(--secondary); font-size: 12px; font-weight: 600;
}
#search-palette [role=status]:empty { display: none }
#search-palette ul { list-style: none; margin: 0; padding: 0 8px 6px }
#search-palette ul:empty { display: none }
#search-palette li { margin: 0; padding: 0 }
#search-palette li a {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 42px; box-sizing: border-box; padding: 6px 12px;
  border: 0; border-radius: 10px; text-decoration: none; color: inherit;
}
#search-palette li a:hover { background: rgb(255 255 255 / 5%) }
#search-palette li a.selected { background: var(--selection) }
.result-icon {
  display: grid; place-items: center; width: 24px; height: 24px;
  border-radius: 6px; color: #85c4ee; background: #233744;
}
#search-palette .result-icon svg { width: 16px; height: 16px }
[data-kind="Essay"] .result-icon { color: #ccbaf8; background: #383046 }
[data-kind="Book"] .result-icon { color: #edc498; background: #41352c }
.result-body { display: flex; align-items: baseline; gap: 10px; min-width: 0 }
#search-palette strong, .result-snippet {
  display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#search-palette strong { flex-shrink: 0; max-width: 75%; font-size: 15px; font-weight: 500 }
.result-snippet, #search-palette small { color: var(--secondary); font-size: 13px }
#search-palette a[data-kind="Essay"] .result-body { display: block }
#search-palette a[data-kind="Essay"] strong { max-width: 100% }
#search-palette a[data-kind="Essay"] .result-snippet { margin-top: 2px }
#search-palette a[data-kind="Essay"].selected .result-snippet {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal;
}
#search-palette mark { color: inherit; background: transparent; text-decoration: underline; text-decoration-color: var(--secondary); text-underline-offset: 2px }
#search-palette .search-actions {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 9px 7px 18px; border-top: 1px solid var(--rule); color: var(--secondary); font-size: 12px;
}
#search-palette .search-actions[hidden] { display: none }
#search-palette .search-actions button {
  display: inline-flex; gap: 12px; align-items: center; padding: 7px 10px 7px 13px;
  border: 1px solid var(--rule); border-radius: 18px; background: var(--selection); color: var(--ink); font-weight: 550;
}
#search-palette .search-actions button:hover { background: rgb(255 255 255 / 14%) }

@media (max-width: 560px), (hover: none) and (pointer: coarse) {
  #search-launch {
    display: grid; place-items: center; width: 44px; padding: 0;
    right: max(16px, env(safe-area-inset-right)); border-radius: 50%;
    background: var(--bg); color: var(--muted);
  }
  #search-launch span { display: none }
  #search-launch .ui-icon { display: block }
}
@media (max-width: 560px) {
  #search-palette { width: calc(100% - 16px); margin-top: max(8px, env(safe-area-inset-top)); max-height: calc(100dvh - 24px); border-radius: 18px }
  #search-palette .search-input { gap: 8px; padding-left: 14px }
  #search-palette input { font-size: 16px }
  #search-palette li a { gap: 9px; min-height: 48px; padding-inline: 8px }
  .result-body { display: block }
  #search-palette strong { max-width: 100% }
  #search-palette .search-actions button { min-height: 44px }
}
@media (forced-colors: active) {
  #search-palette input:focus-visible, #search-palette li a.selected { outline: 2px solid Highlight; outline-offset: -2px }
}
