/* Explore, redesigned 17 November 2026. The boxed panel is gone: the desk is dimmed as if the lamp were lowered,
   and the pages of one subject are laid out along it. Subjects are written in the project hand, like the name on
   the desk. Everything else is quiet. Palette: night wood #1d150c, lamp cream #f3e7cf, candle amber #d9a55f. */
#explore{--cream:#f3e7cf;--dim:#bfb193;--faint:#f3e7cf2e;--amber:#d9a55f;--calm:cubic-bezier(.37,0,.63,1);--settle:cubic-bezier(.3,.05,.2,1);
 --sheet-h:clamp(220px,min(42svh,calc(100svh - 500px)),480px);
 position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background:none;color:var(--cream);overflow:hidden auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#f3e7cf40 transparent}
#explore::backdrop{background:radial-gradient(ellipse 85% 75% at 50% 46%,#2e2216d9 0,#1d150cf0 70%,#150f08f7 100%);backdrop-filter:blur(7px)}
#explore[open]{animation:explore-arrives .5s var(--calm) both}
#explore[open]::backdrop{animation:explore-veil .55s var(--calm) both}
#explore.is-leaving{animation:explore-leaves .26s var(--calm) both}
#explore.is-leaving::backdrop{animation:explore-veil-out .26s var(--calm) both}
@keyframes explore-arrives{from{opacity:0}to{opacity:1}}
@keyframes explore-leaves{from{opacity:1}to{opacity:0}}
@keyframes explore-veil{from{opacity:0}to{opacity:1}}
@keyframes explore-veil-out{from{opacity:1}to{opacity:0}}

#explore .explore-stage{position:relative;box-sizing:border-box;min-height:100%;max-width:1560px;margin:0 auto;padding:clamp(18px,3.2vh,40px) clamp(20px,4.4vw,72px) clamp(16px,2.6vh,30px);display:grid;grid-template-rows:auto auto auto 1fr auto;row-gap:clamp(14px,2.6vh,30px)}
/* The lamp: a low warm glow behind the pages. */
#explore .explore-stage:before{content:'';position:absolute;left:50%;top:54%;width:120%;height:70%;transform:translate(-50%,-50%);background:radial-gradient(closest-side,#e9b56b1f,#e9b56b00);pointer-events:none}

/* Top row: search, and the way back to the desk. */
#explore .explore-top{position:relative;display:flex;align-items:center;justify-content:space-between;gap:24px}
#explore #search-form{position:relative;display:flex;align-items:center;gap:12px;width:min(440px,100%);border-bottom:1px solid var(--faint);transition:border-color .3s var(--calm)}
#explore #search-form:focus-within{border-color:var(--amber)}
#explore #search-form svg{flex:none;width:19px;height:19px;fill:none;stroke:var(--dim);stroke-width:1.3}
#explore #query{flex:1;min-width:0;border:0;border-radius:0;outline:none;background:none;color:var(--cream);font:19px/1.4 var(--serif);padding:10px 0;caret-color:var(--amber)}
#explore #query::placeholder{color:var(--dim);font-style:italic;opacity:1}
#explore #query::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none;width:22px;height:22px;cursor:pointer;opacity:.6;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 6 12 12M18 6 6 18' fill='none' stroke='%23f3e7cf' stroke-width='1.4'/%3E%3C/svg%3E") center/17px no-repeat}
#explore #query::-webkit-search-cancel-button:hover{opacity:1}
#explore #explore-close{flex:none;display:grid;place-items:center;width:46px;height:46px;margin-right:-11px;border-radius:50%;color:var(--dim);transition:color .3s var(--calm),background-color .3s var(--calm)}
#explore #explore-close svg{width:22px;height:22px;stroke:currentColor;stroke-width:1.2;fill:none}
#explore #explore-close:hover{color:var(--cream);background:#f3e7cf14}

/* Subjects, in the project hand. The chosen one is underlined as with a pen. */
#explore #explore-subjects{position:relative;display:flex;flex-wrap:nowrap;align-items:baseline;gap:0 clamp(16px,2vw,36px);margin:0 calc(clamp(20px,4.4vw,72px) * -1);padding:0 clamp(20px,4.4vw,72px);overflow:auto hidden;scrollbar-width:none}
#explore #explore-subjects::-webkit-scrollbar{display:none}
#explore #explore-subjects button{position:relative;padding:8px 0 13px;min-height:44px;font:clamp(24px,2vw,30px)/1 Vinci,var(--serif);color:var(--dim);white-space:nowrap;transition:color .35s var(--calm)}
#explore #explore-subjects button:hover{color:var(--cream)}
#explore #explore-subjects button[aria-selected=true]{color:var(--cream)}
#explore #explore-subjects button:after{content:'';position:absolute;left:-2px;right:-2px;bottom:3px;height:7px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 7' preserveAspectRatio='none'%3E%3Cpath d='M1 4.6C28 2.2 52 5.4 82 3.6s62-2 86-.4 22 1.6 31 .5' fill='none' stroke='%23d9a55f' stroke-width='1.5' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") 0 0/100% 100% no-repeat;clip-path:inset(0 100% 0 0);transition:clip-path .5s var(--settle)}
#explore #explore-subjects button[aria-selected=true]:after{clip-path:inset(0)}
/* Every notebook and codex held, in plain type beneath the subjects. */
#explore #explore-notebooks{position:relative;display:flex;flex-wrap:wrap;align-items:baseline;gap:0 clamp(14px,1.4vw,22px);margin-top:calc(clamp(14px,2.6vh,30px) * -.45);padding-top:10px;border-top:1px solid var(--faint)}
#explore #explore-notebooks button{position:relative;padding:5px 0 7px;min-height:32px;font:15px/1.3 var(--serif);color:var(--dim);white-space:nowrap;transition:color .35s var(--calm)}
#explore #explore-notebooks button:hover,#explore #explore-notebooks button[aria-selected=true]{color:var(--cream)}
#explore #explore-notebooks button:after{content:'';position:absolute;left:0;right:0;bottom:5px;height:1px;background:var(--amber);transform:scaleX(0);transform-origin:0 50%;transition:transform .45s var(--settle)}
#explore #explore-notebooks button[aria-selected=true]:after{transform:scaleX(1)}

/* The pages of the chosen subject, laid along the desk. */
#explore #explore-pages{position:relative;display:flex;flex-direction:column;justify-content:center;min-width:0;outline:none}
#explore .shelf{display:flex;align-items:flex-end;gap:clamp(26px,3.2vw,54px);list-style:none;margin:0 calc(clamp(20px,4.4vw,72px) * -1);padding:26px clamp(20px,4.4vw,72px) 8px;overflow:auto hidden;scroll-padding-left:clamp(20px,4.4vw,72px);scrollbar-width:none;overscroll-behavior-x:contain;transition:opacity .16s var(--calm)}
#explore .shelf::-webkit-scrollbar{display:none}
#explore .shelf.is-changing{opacity:0}
#explore .sheet{flex:none;margin:0;padding:0}
#explore .sheet a{display:block;text-decoration:none;color:inherit;outline:none}
#explore .sheet{--sheet-w:min(calc(var(--sheet-h) * var(--fit,1) * var(--ratio,.72)),calc(100vw - clamp(20px,4.4vw,72px) * 2 - 8px))}
#explore .sheet-art{display:block;width:var(--sheet-w);aspect-ratio:var(--ratio,.72);transform:rotate(var(--tilt,0deg));transform-origin:50% 60%;transition:transform .5s var(--settle),filter .5s var(--settle);filter:drop-shadow(1px 3px 3px #00000059) drop-shadow(8px 16px 18px #0000004d)}
#explore .sheet-art svg{display:block;width:100%;height:100%;overflow:hidden;background:#cbbd9f2b}
#explore .sheet-art image{opacity:0;transition:opacity .45s var(--calm)}
#explore .sheet-art.is-loaded image{opacity:1}
#explore .sheet a:hover .sheet-art,#explore .sheet a:focus-visible .sheet-art{transform:translateY(-9px) rotate(0deg);filter:drop-shadow(2px 6px 6px #0000005e) drop-shadow(14px 30px 30px #0000005c) brightness(1.05)}
#explore .sheet a:focus-visible .sheet-art{outline:2px solid var(--amber);outline-offset:6px}
#explore .sheet-title{display:block;box-sizing:border-box;width:var(--sheet-w);min-height:2.7em;margin-top:22px;font:17px/1.35 var(--serif);letter-spacing:-.005em;color:var(--dim);text-wrap:balance;transition:color .35s var(--calm)}
#explore .sheet a:hover .sheet-title,#explore .sheet a:focus-visible .sheet-title{color:var(--cream)}
/* Sheets held as photographs only say so; everything else can be read in English. */
#explore .sheet-note{display:block;margin-top:3px;font:italic 14px/1.3 var(--serif);color:#a39679}
#explore .sheet:has(.sheet-note) .sheet-title{min-height:0}
/* A notebook held as photographs: smaller sheets (their gallery previews are small), labelled by folio. */
#explore .shelf.is-catalogue{--sheet-h:clamp(200px,min(34svh,calc(100svh - 520px)),330px);gap:clamp(18px,2vw,30px)}
#explore .shelf.is-catalogue .sheet-art{width:auto;height:var(--sheet-h);aspect-ratio:auto;min-width:calc(var(--sheet-h) * .5)}
#explore .shelf.is-catalogue .sheet-art img{display:block;height:100%;width:auto;background:#cbbd9f2b}
#explore .shelf.is-catalogue .sheet-title{width:auto;min-height:0;margin-top:14px;font-size:15px}
/* One arrival: the first sheets of a subject are laid down in turn. */
#explore .shelf.is-arriving .sheet{animation:sheet-set .6s var(--settle) both;animation-delay:calc(var(--i,0) * 55ms)}
@keyframes sheet-set{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}

/* Beneath the pages: a scale with one mark per page (those in view stand taller), the count, and two turns. */
#explore .shelf-foot{display:flex;align-items:center;gap:22px;margin-top:clamp(8px,1.6vh,18px);min-height:46px}
#explore #shelf-scale{display:flex;align-items:flex-end;gap:5px;height:16px}
#explore #shelf-scale i{display:block;width:1px;height:8px;background:var(--cream);opacity:.28;transition:height .3s var(--calm),opacity .3s var(--calm)}
#explore #shelf-scale i.in{height:16px;opacity:.85}
#explore #shelf-count{margin:0;font:italic 15px/1.4 var(--serif);color:var(--dim)}
#explore .shelf-turn{display:flex;gap:6px;margin-left:auto}
#explore .shelf-turn button{display:grid;place-items:center;width:46px;height:46px;border-radius:50%;color:var(--cream);transition:color .3s var(--calm),opacity .3s var(--calm)}
#explore .shelf-turn button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.2}
#explore .shelf-turn button:is(:hover,:active,:focus-visible):enabled{color:var(--amber)}
#explore .shelf-turn button:disabled{opacity:.22;background:none}

/* Search results: each passage beside the page it is written on. */
#explore #results{min-width:0;max-width:820px;padding-bottom:10px}
#explore #results[hidden],#explore #explore-pages[hidden]{display:none}
#explore #result-status{margin:0 0 6px;font:italic 16px/1.5 var(--serif);color:var(--dim)}
#explore #result-list{list-style:none;margin:0;padding:0}
#explore #result-list li{margin:0;padding:0;border-top:1px solid var(--faint)}
#explore #result-list li:first-child{border-top:0}
#explore .result{display:grid;grid-template-columns:78px minmax(0,1fr);gap:26px;align-items:start;padding:22px 0;text-decoration:none;color:inherit;outline:none}
#explore .result-art{display:block;width:78px;aspect-ratio:var(--aspect,.72);filter:drop-shadow(1px 3px 3px #00000059) drop-shadow(5px 9px 10px #00000040);transition:transform .45s var(--settle)}
#explore .result-art svg{display:block;width:100%;height:100%;background:#cbbd9f2b}
#explore .result-art image{opacity:0;transition:opacity .45s var(--calm)}#explore .result-art.is-loaded image{opacity:1}
#explore .result:hover .result-art,#explore .result:focus-visible .result-art{transform:translateY(-4px)}
#explore .result-title{display:block;font:23px/1.25 var(--serif);letter-spacing:-.015em;color:var(--cream)}
#explore .result-title span{background:linear-gradient(var(--amber),var(--amber)) 0 100%/0 1px no-repeat;transition:background-size .45s var(--settle)}
#explore .result:hover .result-title span,#explore .result:focus-visible .result-title span{background-size:100% 1px}
#explore .result-where{display:block;margin-top:5px;font:italic 15px/1.4 var(--serif);color:var(--dim)}
#explore .result-quote{display:block;margin-top:10px;font:17px/1.6 var(--serif);color:#e4d8be;max-width:66ch}
#explore .result-note{display:block;margin-top:8px;font:italic 15px/1.4 var(--serif);color:var(--dim)}
#explore mark{background:#d9a55f47;color:var(--cream);border-radius:2px;padding:0 .1em}
#explore #more-results{margin:8px 0 0 104px;padding:10px 0;min-height:44px;font:17px/1.4 var(--serif);color:var(--cream);text-decoration:underline;text-decoration-color:var(--amber);text-underline-offset:6px;text-decoration-thickness:1px}

/* Foot: where reading was left, and the two reference pages. */
#explore .explore-foot{position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:6px 30px;padding-top:14px;border-top:1px solid var(--faint);font:15px/1.5 var(--serif);color:var(--dim)}
#explore .explore-foot a{padding:6px 0;text-decoration:none;color:inherit;transition:color .3s var(--calm)}
#explore .explore-foot a:hover,#explore .explore-foot a:focus-visible{color:var(--cream)}
#explore #explore-resume{margin-right:auto;color:var(--cream)}
#explore #explore-resume[hidden]{display:none}
#explore #explore-resume[hidden]+a{margin-left:auto}
#explore button:focus-visible:not(.shelf-turn button),#explore .explore-foot a:focus-visible,#explore .result:focus-visible{outline:2px solid var(--amber);outline-offset:4px}

@media(max-width:760px){
 #explore{--sheet-h:clamp(220px,calc(100svh - 460px),430px)}
 #explore .explore-stage{row-gap:14px}
 /* Subjects run in one line that scrolls sideways. */
 #explore #explore-subjects{gap:0 26px;-webkit-mask-image:linear-gradient(90deg,transparent,#000 20px,#000 calc(100% - 34px),transparent);mask-image:linear-gradient(90deg,transparent,#000 20px,#000 calc(100% - 34px),transparent)}
 #explore #explore-subjects button{font-size:29px}
 #explore #explore-notebooks{flex-wrap:nowrap;margin-left:-20px;margin-right:-20px;padding-left:20px;padding-right:20px;overflow:auto hidden;scrollbar-width:none}#explore #explore-notebooks::-webkit-scrollbar{display:none}
 #explore .sheet-title{font-size:16px;margin-top:18px}
 #explore #shelf-scale{gap:4px}
 #explore .result{grid-template-columns:60px minmax(0,1fr);gap:18px;padding:18px 0}#explore .result-art{width:60px}
 #explore .result-title{font-size:21px}#explore #more-results{margin-left:78px}
 #explore #query{font-size:18px}
}
@media(max-width:420px){#explore #shelf-scale{display:none}}
@media(prefers-reduced-motion:reduce){#explore[open],#explore[open]::backdrop,#explore.is-leaving,#explore.is-leaving::backdrop,#explore .shelf.is-arriving .sheet{animation:none!important}#explore *,#explore *:after{transition:none!important}#explore::backdrop{backdrop-filter:none}}
/* The Explore page fills its subject row by script. The row keeps its height from the first paint, so the pages
   beneath it never move when the subjects arrive (the buttons are 44px at least, or their line and padding). */
.explore-page #explore #explore-subjects{min-height:max(44px,calc(clamp(24px,2vw,30px) + 21px))}
@media(max-width:760px){.explore-page #explore #explore-subjects{min-height:50px}}
/* The foot beneath the shelf holds nothing until pages are laid; until then it takes no room, so it is not seen to move. */
.explore-page #explore .explore-results:not(.is-browsing) .shelf-foot{display:none}
