/* The archive shares its type, colour and motion with the chapters: Georgia/Songti, ivory on near-black, gold accents. */
:root{color-scheme:dark;--gold:#cfb47d;--ivory:#e9e3d4;--muted:#92928b}
*{box-sizing:border-box}
body{margin:0;overflow:hidden;background:#07090c;color:var(--ivory);font:14px/1.8 system-ui,-apple-system,sans-serif}
button,a{-webkit-tap-highlight-color:transparent}
button{color:inherit;background:none;border:0;cursor:pointer;font:inherit}
button:focus-visible,a:focus-visible{outline:1px solid var(--gold);outline-offset:6px}
canvas#world{position:fixed;inset:0;width:100%;height:100%;display:block}
.grain,.shade{pointer-events:none;position:fixed;inset:0}
.shade{background:linear-gradient(90deg,#05080bb5,transparent 46%),linear-gradient(0deg,#05080b99,transparent 28%)}
.grain{opacity:.03;z-index:9;background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E")}
header{position:fixed;top:30px;left:4%;right:4%;display:flex;justify-content:flex-end;z-index:10}
.top-right{display:flex;align-items:center;gap:25px;font-size:12px;color:#c0b9a8}
#sound{font-size:0;width:36px;height:36px;display:grid;place-items:center}
#sound i{position:relative;display:inline-block;font-size:18px;line-height:1;font-style:normal;color:var(--gold);transition:opacity .3s}
#sound i::after{content:'';position:absolute;left:-4px;right:-4px;top:50%;height:1.5px;background:currentColor;border-radius:1px;transform:rotate(-48deg) scaleX(0);transition:transform .35s cubic-bezier(.16,1,.3,1)}
#sound.muted i{opacity:.55}#sound.muted i::after{transform:rotate(-48deg) scaleX(1)}
main{position:fixed;top:11%;left:6%;z-index:3;pointer-events:none;transition:opacity 1.2s,transform 1.6s}
main.depart{opacity:0;transform:translateY(-14px)}
.eyebrow{font-size:10px;letter-spacing:4px;color:var(--gold)}
h1,h2{font-family:Georgia,'Songti SC','STSong',serif;font-weight:400}
h1{font-size:clamp(38px,4.4vw,68px);line-height:1.4;letter-spacing:5px;margin:22px 0 26px}
h1 span{color:var(--gold)}
.tap-hint{margin:0;font-size:11px;letter-spacing:4px;color:#b9a77e}
.tap-hint.reveal.in{animation:hint-breathe 3.6s 1.2s ease-in-out infinite}
@keyframes hint-breathe{0%,100%{opacity:.35}50%{opacity:.95}}
#place{position:fixed;left:5%;bottom:28px;font-size:10px;letter-spacing:3px;color:#8d8c82;pointer-events:none;transition:opacity 1s}
#loading{position:fixed;bottom:30px;right:5%;font-size:11px;color:var(--gold)}
/* Inside the reading room. */
body.inside #place{top:36px;bottom:auto;left:5%;font-size:11px;color:#b3a98c;transition:opacity 1s}
#alcove-nav{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);display:flex;gap:30px;z-index:7}
#alcove-nav button{white-space:nowrap;font-size:11px;letter-spacing:3px;color:#c9b88e;padding:8px 4px;opacity:.75;transition:opacity .3s}
#alcove-nav button:hover{opacity:1}
#hint{position:fixed;left:50%;bottom:70px;transform:translate(-50%,6px);font-size:11px;letter-spacing:3px;color:#cdbb90;opacity:0;pointer-events:none;transition:opacity 1.2s,transform 1.2s;text-align:center;width:max-content;max-width:90vw}
#hint.in{opacity:.9;transform:translate(-50%,0)}
#tip{position:fixed;left:0;top:0;z-index:8;pointer-events:none;padding:9px 13px;background:#0d1012e6;border:1px solid #a58e5c40;border-radius:3px;max-width:230px}
#tip b{display:block;font:15px/1.5 Georgia,'Songti SC',serif;font-weight:400;color:var(--ivory);letter-spacing:1px}
#tip span{display:block;font-size:10px;letter-spacing:1px;color:#a99d80}
#veil{position:fixed;inset:0;background:#050608;opacity:0;pointer-events:none;z-index:20}
.spot.labelled b{position:absolute;left:44px;top:50%;transform:translateY(-50%);white-space:nowrap;font:12px/1 Georgia,'Songti SC',serif;font-weight:400;letter-spacing:2px;color:#e6d3a6;text-shadow:0 0 8px #000,0 0 3px #000;opacity:.85;pointer-events:none}
/* The ring: the same opening circle the chapters use. */
.spot{position:fixed;left:0;top:0;z-index:6;width:46px;height:46px;margin:-23px 0 0 -23px;border-radius:50%;cursor:pointer}
.spot i{position:absolute;left:50%;top:50%;width:9px;height:9px;margin:-4.5px;border-radius:50%;background:#f1d9a4;box-shadow:0 0 12px #e8b86a,0 0 3px #fff8e6}
.spot::before,.spot::after{content:'';position:absolute;inset:8px;border:1px solid #e3c487;border-radius:50%;opacity:0;animation:spot-open 2.6s cubic-bezier(.2,.6,.3,1) infinite}
.spot::after{animation-delay:1.3s}
.spot:hover i{background:#fff4dc;box-shadow:0 0 18px #ffcf80,0 0 4px #fff}
@keyframes spot-open{0%{transform:scale(.25);opacity:0}18%{opacity:.95}100%{transform:scale(1.9);opacity:0}}
/* Arrival, one piece at a time. */
.reveal{opacity:0;transform:translateY(8px);transition:opacity 1.1s ease,transform 1.4s cubic-bezier(.16,1,.3,1)}
.reveal.in{opacity:1;transform:none}
#world.reveal{transform:none;transition:opacity 2s ease}
body.walking main .reveal.in{opacity:0;transition:opacity .8s}
body.entering #place{opacity:0}
/* Dialogs rise into place. */
dialog{width:560px;max-width:92vw;max-height:82vh;overflow:auto;background:#0f1416f2;color:#d4d2c3;border:1px solid #a58e5c44;border-radius:4px;padding:35px}
dialog::backdrop{background:#020607bb;backdrop-filter:blur(12px)}
dialog[open]{animation:sheet-in .62s cubic-bezier(.16,1,.3,1) both}
@keyframes sheet-in{from{opacity:0;transform:translateY(22px) scale(.96);filter:blur(8px)}to{opacity:1;transform:none;filter:none}}
dialog h2{font-size:30px;line-height:1.5;margin:10px 0}
dialog p{font-size:13px;color:#a9ada1}
dialog a{display:block;color:var(--gold);font-size:12px;text-decoration:none;margin:8px 0}
.close{float:right;color:#acac9c;font-size:12px}
.direction-list .dir{padding:14px 0;border-bottom:1px solid #b6ac8620}
.direction-list .go{display:block;text-align:left;color:#d8cdb2;font:17px/1.6 Georgia,'Songti SC',serif;letter-spacing:2px}
.direction-list .go:hover{color:var(--gold)}
.direction-list .go span{display:inline-block;width:42px;font-size:11px;color:#8d8a78;letter-spacing:1px}
.direction-list .go em{font-style:normal;font-size:11px;color:#8d8a78;margin-left:14px;letter-spacing:1px}
.direction-list small{display:flex;flex-wrap:wrap;gap:4px 14px;margin:6px 0 0 42px;font-size:11px;color:#8a897d}
.direction-list small i{font-style:normal}
.direction-list small a{display:inline;margin:0;font-size:11px}
/* The threshold before the threshold: sound may only begin after a touch. */
#gate{position:fixed;inset:0;z-index:40;background:#050608;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;cursor:pointer;transition:opacity 1.6s ease;outline:none}
#gate.gone{opacity:0;pointer-events:none}
#gate .g1{font:15px/1 Georgia,'Songti SC',serif;letter-spacing:8px;color:#cdbb90;opacity:0;animation:gate-in 1.6s .3s ease forwards}
#gate .g2{font-size:11px;letter-spacing:6px;color:#a99d80;opacity:0;animation:gate-in 1.6s 1.1s ease forwards,hint-breathe 3.6s 2.7s ease-in-out infinite}
#gate .g3{font-size:10px;letter-spacing:4px;color:#6f6a5c;opacity:0;animation:gate-in 1.6s 1.6s ease forwards}
@keyframes gate-in{to{opacity:1}}
/* Words from four centuries, one at a time, bottom left. */
#quote{position:fixed;left:5%;bottom:34px;margin:0;max-width:min(460px,40vw);z-index:4;pointer-events:none;opacity:0;transform:translateY(6px);transition:opacity 1.6s ease,transform 2s cubic-bezier(.16,1,.3,1);visibility:hidden}
body.inside #quote{visibility:visible}
body.at-cabinet #quote{bottom:78px}
#quote.in{opacity:1;transform:none}
#quote blockquote{margin:0;font:15px/1.95 Georgia,'Songti SC','STSong',serif;letter-spacing:1.5px;color:#e4dccb;text-shadow:0 0 12px #000,0 0 2px #000}
#quote .orig{margin:6px 0 0;font:italic 10.5px/1.6 Georgia,'Times New Roman',serif;letter-spacing:.3px;color:#958f80;text-shadow:0 0 8px #000}
#quote .orig:empty{display:none}
#quote figcaption{margin-top:8px;font-size:10px;letter-spacing:1.5px;color:#b3a27a;text-shadow:0 0 8px #000}
#quote figcaption .apoc{margin-left:8px;padding:0 6px;border:1px solid #b3a27a55;border-radius:2px;color:#9d927a;font-size:9px;letter-spacing:1px}
@media(max-width:700px){#quote{left:7%;right:7%;max-width:none;bottom:62px}#quote blockquote{font-size:13px;letter-spacing:1px}#quote .orig{display:none}}
/* The archive notebook, the same one the chapters keep. */
/* ---------- The archive: an old notebook that opens ---------- */
#about-dialog.book{width:760px;max-width:94vw;max-height:86vh;padding:0;border:0;background:#e7dfc9;color:#2b241b;box-shadow:0 30px 80px #000c,inset 0 0 120px #b9a77e55;overflow:hidden;border-radius:3px 6px 6px 3px}
#about-dialog.book[open]{animation:book-in .7s cubic-bezier(.16,1,.3,1) both}
@keyframes book-in{from{opacity:0;transform:perspective(1600px) rotateX(8deg) translateY(30px) scale(.94)}to{opacity:1;transform:none}}
#about-dialog.book::after{content:'';position:absolute;inset:0;z-index:5;pointer-events:none;transform-origin:left center;backface-visibility:hidden;background:radial-gradient(circle at 70% 40%,#3a2c21,#1d1510 70%);box-shadow:inset 0 0 0 10px #1a120d,inset 0 0 0 11px #a58e5c88,inset 0 0 60px #000a}
#about-dialog.book[open]::after{animation:cover-open 1.15s .12s cubic-bezier(.65,0,.25,1) forwards}
@keyframes cover-open{0%{transform:perspective(1800px) rotateY(0)}100%{transform:perspective(1800px) rotateY(-178deg);opacity:.0}}
#about-dialog.book .pages{max-height:86vh;overflow:auto;padding:46px 54px 40px 74px;background:repeating-linear-gradient(#e7dfc9 0 31px,#cfc3a6 31px 32px);background-attachment:local;position:relative}
#about-dialog.book .pages::before{content:'';position:absolute;left:52px;top:0;bottom:0;width:1px;background:#b8524a88}
#about-dialog.book .close{position:sticky;top:0;float:right;color:#6d5f48;z-index:2}
#about-dialog.book .eyebrow{color:#8a6a3a}
#about-dialog.book h2{color:#2b241b;font-size:32px;margin:6px 0 4px}
#about-dialog.book h3{font:400 17px/2 Georgia,'Songti SC',serif;letter-spacing:3px;color:#5a4426;margin:26px 0 2px;border-bottom:1px solid #b9a77e77}
#about-dialog.book p,#about-dialog.book li{font:14px/2 Georgia,'Songti SC','STSong',serif;color:#3a3125;letter-spacing:.3px}
#about-dialog.book ul{padding-left:18px;margin:4px 0}
#about-dialog.book a{color:#7a4f1f;display:block;margin:6px 0;font-size:13px}
#about-dialog.book hr{border-top:1px solid #b9a77e66}
#about-dialog.book .fine{color:#6d6150!important}
#about-dialog.book label{color:#3a3125}
#about-dialog.book .stamp{display:inline-block;margin-top:6px;padding:2px 10px;border:1px solid #9a3b30aa;color:#9a3b30;font-size:10px;letter-spacing:3px;transform:rotate(-2deg)}
@media(max-width:700px){#about-dialog.book .pages{padding:36px 22px 30px 40px}#about-dialog.book .pages::before{left:26px}}
@media(prefers-reduced-motion:reduce){dialog[open],#about-dialog.book[open],#about-dialog.book[open]::after{animation-duration:.01s;animation-delay:0s}}

/* Writing sits on the rules: everything in the notebook keeps a 32px rhythm. */
#about-dialog.book .pages{padding-top:64px;line-height:32px}
#about-dialog.book .pages>*{margin-top:0;margin-bottom:0}
#about-dialog.book h2{line-height:64px;font-size:30px}
#about-dialog.book .eyebrow{display:block;line-height:32px}
#about-dialog.book .stamp{line-height:20px;margin:6px 0 6px}
#about-dialog.book h3{line-height:31px;margin:32px 0 0;padding-top:0}
#about-dialog.book p,#about-dialog.book li{line-height:32px;margin:0 0 32px}
#about-dialog.book a{line-height:32px;margin:0}
#about-dialog.book label{display:block;line-height:32px;margin:0}
#about-dialog.book hr{height:32px;margin:0;border:0}
#about-dialog.book .close{line-height:32px;top:-32px}

/* ---------- The notebook, refined ---------- */
/* Sections breathe: one blank rule between them, none between paragraphs. */
#about-dialog.book p,#about-dialog.book li{margin:0}
#about-dialog.book h3{margin-top:32px;border-bottom:0;color:#6a4b22}
#about-dialog.book h3::after{content:'';display:block;width:42px;height:1px;background:#a8885588;margin-top:-1px}
#about-dialog.book .pages{background:
  linear-gradient(90deg,#00000022,transparent 26px),
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E"),
  repeating-linear-gradient(#e9e1cb 0 31px,#d3c7aa 31px 32px);background-attachment:local;scrollbar-width:thin;scrollbar-color:#a8885566 transparent}
#about-dialog.book h2{letter-spacing:4px}
#about-dialog.book .eyebrow{letter-spacing:4px}
#about-dialog.book b{font-weight:600;color:#4a3216}
/* A ribbon bookmark replaces the close text: pull it and the book closes. */
#about-dialog.book .ribbon{position:absolute;top:-2px;right:34px;z-index:7;width:30px;height:62px;padding:0;background:linear-gradient(90deg,#7a2620,#9a3329 45%,#7a2620);clip-path:polygon(0 0,100% 0,100% 100%,50% 82%,0 100%);box-shadow:0 2px 6px #0005;transition:height .35s cubic-bezier(.16,1,.3,1),filter .3s;float:none}
#about-dialog.book .ribbon:hover,#about-dialog.book .ribbon:focus-visible{height:74px;filter:brightness(1.12)}
#about-dialog.book .ribbon i{position:absolute;left:50%;top:26px;width:12px;height:12px;margin-left:-6px}
#about-dialog.book .ribbon i::before,#about-dialog.book .ribbon i::after{content:'';position:absolute;left:5px;top:-1px;width:1.4px;height:14px;background:#f1e3c6;border-radius:1px;transform:rotate(45deg)}
#about-dialog.book .ribbon i::after{transform:rotate(-45deg)}
#about-dialog.book .ribbon:focus-visible{outline:none}
/* Closing: the cover swings back over the page, then the book settles away. */
#about-dialog.book.closing::after{animation:cover-close .62s cubic-bezier(.55,0,.35,1) forwards}
#about-dialog.book.closing{animation:book-out .72s cubic-bezier(.4,0,.2,1) forwards}
@keyframes cover-close{0%{transform:perspective(1800px) rotateY(-178deg);opacity:0}35%{opacity:1}100%{transform:perspective(1800px) rotateY(0);opacity:1}}
@keyframes book-out{0%,62%{opacity:1;transform:none}100%{opacity:0;transform:perspective(1600px) rotateX(6deg) translateY(24px) scale(.95)}}
@media(prefers-reduced-motion:reduce){#about-dialog.book.closing,#about-dialog.book.closing::after{animation-duration:.01s}}
/* One blank rule before each new section; the margin line runs the whole page. */
#about-dialog.book .pages>h3{margin-top:32px}
#about-dialog.book .pages::before{display:none}
#about-dialog.book .pages{background:
  linear-gradient(90deg,#00000022,transparent 26px),
  linear-gradient(90deg,transparent 52px,#b8524a88 52px,#b8524a88 53px,transparent 53px),
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E"),
  repeating-linear-gradient(#e9e1cb 0 31px,#d3c7aa 31px 32px);background-attachment:local}
@media(max-width:700px){#about-dialog.book .pages{background:linear-gradient(90deg,#00000022,transparent 18px),linear-gradient(90deg,transparent 26px,#b8524a88 26px,#b8524a88 27px,transparent 27px),repeating-linear-gradient(#e9e1cb 0 31px,#d3c7aa 31px 32px);background-attachment:local}}

#catalogue .dir{margin:0}
#catalogue .dir b{display:block;font:400 15px/32px Georgia,'Songti SC',serif;letter-spacing:2px;color:#4a3216}
#catalogue .dir b em{font-style:normal;font-size:12px;color:#8a7458;margin-left:12px;letter-spacing:1px}
#catalogue .dir p{margin:0 0 32px!important;font-size:13px!important;color:#5a4e3c!important}
#catalogue .dir a{display:inline!important;font-size:13px!important;color:#7a4f1f;margin:0!important}
[hidden]{display:none!important}
@media(max-width:700px){header{top:20px}main{top:12%;left:7%}h1{font-size:34px}#place{font-size:9px}#alcove-nav{gap:16px;bottom:18px}#alcove-nav button{font-size:10px;letter-spacing:1px}#hint{bottom:58px;font-size:10px;letter-spacing:1px}body.inside #place{top:72px;left:7%;font-size:10px;max-width:86vw}}
@media(prefers-reduced-motion:reduce){.spot::before,.spot::after{animation:none;opacity:.6}}
