@font-face{font-family:Letters Display;src:url('./fonts/CormorantGaramond.ttf') format('truetype');font-weight:400;font-display:swap}
@font-face{font-family:Letters Display;src:url('./fonts/CormorantGaramond-Medium.ttf') format('truetype');font-weight:500;font-display:swap}
@font-face{font-family:Letters Display;src:url('./fonts/CormorantGaramond-Semibold.ttf') format('truetype');font-weight:600;font-display:swap}
@font-face{font-family:Letters Text;src:url('./fonts/EBGaramond.ttf') format('truetype');font-weight:400 800;font-display:swap}
@font-face{font-family:Letters Text;src:url('./fonts/EBGaramond-Italic.ttf') format('truetype');font-style:italic;font-weight:400 800;font-display:swap}
:root{font-family:Inter,Arial,sans-serif;color:#f7f5ed;background:#182522;color-scheme:light;letter-spacing:0;--text-scale:1;--ink:#192a2b;--accent:#d5dce0;--title:#f4f0e7;--display:'Letters Display',Georgia,serif}
*{box-sizing:border-box;letter-spacing:0}body{margin:0;overflow:hidden}button,a,input,select{-webkit-tap-highlight-color:transparent}button,select{font:inherit;cursor:pointer;color:inherit}button{border:0;background:none}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:5px}[hidden]{display:none!important}button:disabled{opacity:.24;cursor:default}a{color:inherit;text-decoration:none}svg{width:25px;height:25px;flex-shrink:0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
body[data-chapter=dunhuang]{--ink:#2d282c;--accent:#eac79f;--title:#f7ddae}
body[data-chapter=xian]{--ink:#242a2d;--accent:#eca89c;--title:#f1f0e8}
body[data-chapter=hangzhou]{--ink:#20352f;--accent:#b3dfcc;--title:#d8f0e1}
body[data-chapter=quanzhou]{--ink:#25323c;--accent:#b4d7df;--title:#e1edf0}
body[data-chapter=epilogue]{--ink:#33332f;--accent:#e5d7bc;--title:#f8eddb}
#living,#scene-canvas{position:absolute;inset:0;width:100%;height:100%;height:100dvh}#scene-canvas{overflow:hidden;background:#d1dad6}#scene-canvas canvas{display:block;width:100%;height:100%;touch-action:none;user-select:none}
#living::after{content:'';position:absolute;inset:0;z-index:1;pointer-events:none;background:linear-gradient(180deg,#111c24e8 0%,#111c24c9 16%,#111c2400 38%,#111c2400 48%,#111c24e8 77%,#111c24f5 100%);opacity:0;transition:opacity .55s}
body[data-presentation=reading] #living::after{opacity:1}
.icon-button{width:56px;height:56px;flex:0 0 56px;display:grid;place-items:center;border-radius:50%;position:relative;transition:color .2s,background .2s,opacity .2s}.icon-button:hover{background:#ffffff12;color:var(--accent)}
.edge-control{background:#172726bf;color:#f3f5ed;box-shadow:0 1px 0 #ffffff26 inset;backdrop-filter:blur(5px)}.edge-control:hover,.edge-control[aria-expanded=true]{background:#172726ee;color:var(--accent)}
#tools-toggle{position:fixed;right:24px;top:24px;z-index:7}#experience-controls{position:fixed;left:28px;bottom:24px;z-index:6;display:flex;gap:10px}
.scene-header{position:fixed;right:92px;top:24px;z-index:6;visibility:hidden;opacity:0;transform:translateX(10px);transition:opacity .24s,transform .3s,visibility .3s;pointer-events:none}.scene-header .book-name{display:none}.scene-header nav{display:flex;gap:4px;padding:0 5px;background:#172726e8;border-radius:4px;box-shadow:0 1px 0 #ffffff24 inset}.scene-header .icon-button{color:#f1f2e9}.scene-header .icon-button:hover{color:var(--accent)}
body[data-tools=open] .scene-header{visibility:visible;opacity:1;transform:none;pointer-events:auto}
.scene-heading{position:fixed;left:48px;top:36px;max-width:min(760px,calc(100% - 150px));z-index:2;visibility:hidden;opacity:0;transform:translateY(7px);pointer-events:none;transition:opacity .4s,transform .6s,visibility .4s;color:var(--title)}
.scene-heading p{font:400 16px/1.4 Inter,Arial,sans-serif;color:var(--accent);margin:0 0 7px}.scene-heading h1{font:500 calc(36px * var(--text-scale))/1.1 var(--display);margin:0;text-wrap:balance;overflow-wrap:anywhere}.chapter-mark{display:block;width:48px;height:1px;background:var(--accent);margin-top:18px;transform-origin:left}
body[data-presentation=reading] .scene-heading{visibility:visible;opacity:1;transform:none}
body[data-chapter=dunhuang] .scene-heading h1{background:linear-gradient(105deg,#f1ad9b 3%,#efd2a0 42%,#a8d9d9 85%);background-clip:text;-webkit-background-clip:text;color:transparent}
body[data-chapter=xian] .scene-heading h1{font-weight:600}body[data-chapter=xian] .chapter-mark{width:14px;height:14px;background:#b75a4e;border:1px solid #e7b7a7}
body[data-chapter=hangzhou] .scene-heading h1{font-family:'Letters Text',Georgia,serif;font-style:italic;font-weight:400}body[data-chapter=hangzhou] .chapter-mark{width:70px;opacity:.65}
body[data-chapter=quanzhou] .chapter-mark{height:4px;background:none;border-top:1px solid var(--accent);border-bottom:1px solid #d28d78;width:42px}
body[data-chapter=epilogue] .scene-heading h1{font-style:normal;font-weight:400}
.scene-footer{position:fixed;left:48px;right:48px;bottom:108px;z-index:3;display:grid;grid-template-columns:minmax(0,720px) minmax(240px,360px);justify-content:space-between;align-items:end;gap:44px;max-height:47dvh;overflow:auto;color:#f7f5ed;visibility:hidden;opacity:0;transform:translateY(12px);pointer-events:none;transition:opacity .35s,transform .5s,visibility .35s}
body[data-presentation=reading] .scene-footer{visibility:visible;opacity:1;transform:none;pointer-events:auto}
#story-copy{min-width:0}.scene-footer p{font:400 calc(28px * var(--text-scale))/1.4 'Letters Text',Georgia,serif;margin:0;text-wrap:pretty}.story-line,.dialogue{display:block}.speaker{font:500 16px/1.45 Inter,Arial,sans-serif;display:block;color:var(--accent);margin:0 0 8px}.dialogue{font-style:italic}.cultural-note{display:block;font:18px/1.5 'Letters Text',Georgia,serif;color:#dce2dc}
.reading-progress{display:flex;gap:8px;align-items:center;margin-top:12px;height:56px}.reading-progress .icon-button{background:none;color:var(--accent)}#passage-marks{display:flex;gap:7px;align-items:center;max-width:240px;flex-wrap:wrap}#passage-marks span{width:5px;height:5px;border-radius:50%;background:#e3e6df5e;transition:width .3s,background .3s}#passage-marks .current{width:20px;border-radius:2px;background:var(--accent)}
.story-paths{display:flex;flex-direction:column;gap:14px;align-self:end}#story-props{display:flex;flex-direction:column;gap:4px}#story-props:empty{display:none}.prop-command,.scene-command{font:400 18px/1.4 Inter,Arial,sans-serif;min-height:56px;padding:10px 0;display:flex;align-items:center;gap:14px;text-align:left}.prop-command{border-bottom:1px solid #d9e2d837}.prop-command svg{width:20px;height:20px;color:var(--accent)}.prop-command:hover,.scene-command:hover{color:var(--accent)}.scene-command{justify-content:space-between;color:var(--accent);border-top:1px solid #d9e2d83b}.scene-command span{max-width:290px}.scene-command svg{width:28px;height:28px}
#interaction-dock{position:fixed;inset:0;z-index:3;pointer-events:none;visibility:hidden;opacity:0;transition:opacity .3s,visibility .3s}body[data-presentation=objects] #interaction-dock{visibility:visible;opacity:1}#object-actions{position:absolute;inset:0;pointer-events:none}
.material-action{position:absolute;display:flex;gap:12px;align-items:center;min-height:56px;max-width:330px;padding:8px 18px 8px 12px;border-radius:3px;background:#182827ed;color:#f4f2e7;box-shadow:0 1px 0 #ffffff37 inset;pointer-events:auto;text-align:left;font:400 18px/1.35 Inter,Arial,sans-serif;transform:translateY(5px);transition:transform .3s,color .2s,background .2s}.material-action svg{color:var(--accent);width:25px;height:25px}.material-action::before{content:'';position:absolute;width:1px;height:19px;background:#f8f4d8b3;left:27px;bottom:100%;pointer-events:none}.material-action span{overflow-wrap:anywhere}.material-action:hover{background:#0e1f20;color:var(--accent)}.material-action[aria-pressed=true]{box-shadow:0 1px 0 var(--accent) inset}body[data-presentation=objects] .material-action{transform:none}
#object-whisper{position:fixed;z-index:3;pointer-events:none;font:italic 22px/1.35 'Letters Text',Georgia,serif;color:#fffbea;background:#172726e8;padding:9px 18px;border-radius:3px;max-width:330px;transition:opacity .3s}#object-whisper.fading{opacity:0}
.object-touch{position:absolute;z-index:2;min-width:56px;min-height:56px;touch-action:none;padding:0;background:none;color:#fffbeb}.object-touch svg{position:absolute;left:58%;top:40%;width:28px;height:28px;opacity:0}.object-touch:focus-visible svg{opacity:1;filter:drop-shadow(0 1px 3px #172726)}
.object-cue{display:none!important}.portal-command{position:fixed;right:28px;bottom:24px;left:auto!important;top:auto!important;z-index:6;display:flex;gap:14px;align-items:center;padding:0 0 0 18px;min-height:56px;font:18px/1.35 Inter,Arial,sans-serif;background:#172726eb;color:#f8f4e9;visibility:hidden;opacity:0;transition:opacity .4s,visibility .4s}.portal-arrow{width:56px;height:56px;display:grid;place-items:center;color:var(--accent)}body[data-presentation=reading] .portal-command,body[data-presentation=objects] .portal-command{visibility:visible;opacity:1}
.engaged .scene-heading,.engaged .scene-footer,.engaged #object-whisper{opacity:0;pointer-events:none}.engaged #living::after{opacity:0}.engaged .edge-control{opacity:.15}.engaged .scene-header{opacity:0;pointer-events:none}
body[data-scene=opening] #experience-controls,body[data-scene=portal] #experience-controls{visibility:hidden}body[data-scene=opening] .scene-heading,body[data-scene=portal] .scene-heading{visibility:hidden}
#loading{position:fixed;inset:0;display:grid;align-content:center;justify-items:center;gap:22px;background:#263d3c;z-index:12;color:#eef2e8;padding:24px;text-align:center}#loading p{font:400 36px/1.3 var(--display);margin:0}#loading-label{font:18px/1.5 Inter,Arial,sans-serif!important;color:#dce6df}.loading-track{height:1px;background:#ffffff30;width:200px;overflow:hidden}#loading-progress{height:100%;width:0;background:#cddbd1;transition:width .2s}#retry,#retry-scene{padding:14px 22px;min-height:56px;font-size:18px;border:1px solid currentColor}#scene-busy{position:fixed;top:30px;left:30px;z-index:8;background:#1b2a2ade;color:#f4f5eb;padding:12px 18px;font:18px/1.4 Inter,Arial,sans-serif}#scene-error{position:fixed;inset:30% 10% auto;z-index:10;padding:24px;background:#253d3a;color:#f6f5ed;font-size:22px}#control-tooltip{position:fixed;z-index:20;max-width:290px;font:18px/1.4 Inter,Arial,sans-serif;padding:9px 14px;background:#152525f2;color:#f8f6eb;border-radius:3px;pointer-events:none}
dialog{width:min(820px,90vw);max-height:86dvh;overflow:auto;border:1px solid #b9c4b8;border-radius:3px;padding:32px;background:#eff1e8;color:#253b35;box-shadow:0 14px 80px #10252566;font-size:18px}dialog::backdrop{background:#142525b8;backdrop-filter:blur(3px)}.menu-top{display:flex;justify-content:space-between;gap:16px;align-items:center}.menu-top p{font:18px/1.4 Inter,Arial,sans-serif;margin:0;color:#47614e}dialog h2{font:500 36px/1.15 var(--display);margin:16px 0 24px}.chapter-entry{border-top:1px solid #c6d3c3}.chapter-row{display:flex;gap:12px;align-items:center}.chapter-row>[data-chapter]{display:grid;grid-template-columns:120px minmax(0,1fr) 26px;gap:20px;align-items:center;flex:1;width:100%;padding:18px 0;text-align:left;min-height:105px}.chapter-row img{width:120px;height:68px;object-fit:cover}.chapter-row small{display:block;font:16px/1.45 Inter,Arial,sans-serif;color:#52694f;margin-bottom:6px}.chapter-row strong{display:block;font:500 26px/1.2 var(--display)}.chapter-row button:hover{color:#934f35}.chapter-pages{display:grid;grid-template-columns:1fr 1fr;gap:0 16px;padding:4px 0 18px}.chapter-pages button{min-height:56px;text-align:left;font-size:18px;line-height:1.4;padding:10px;border-bottom:1px solid #c8d4c3}.chapter-pages button:hover{background:#e0ead8}.menu-settings{display:grid;grid-template-columns:1fr 1fr;gap:16px 28px;padding-top:22px;margin-top:8px;border-top:1px solid #c6d3c3;font-size:18px}.menu-settings label,.menu-settings button,.menu-settings a{display:flex;align-items:center;gap:12px;min-height:56px;text-align:left}.menu-settings label{justify-content:space-between}.menu-settings input{width:24px;height:24px;accent-color:#496c50}.menu-settings select{font-size:18px;max-width:150px;min-height:56px;background:#e4eddd;border:1px solid #b9cbb4;padding:8px}.memory-section{border-top:1px solid #bdcbb8;padding:14px 0}.memory-section h3{font:500 30px/1.4 var(--display);margin:4px 0 10px}.memory-choice{width:100%;display:grid;grid-template-columns:120px 1fr 26px;gap:18px;align-items:center;min-height:94px;padding:10px 0;text-align:left;font-size:18px;line-height:1.4}.memory-choice img{width:120px;height:68px;object-fit:cover}.memory-choice[aria-pressed=true]{color:#914b2f;background:#e4eddb}
@media(max-width:1100px){.scene-footer{gap:26px;grid-template-columns:minmax(0,1fr) minmax(200px,290px);left:32px;right:32px}.scene-heading{left:32px}.material-action{max-width:290px}}
@media(max-height:600px){.scene-heading{top:20px;max-width:calc(100% - 130px)}.scene-heading h1{font-size:calc(36px * var(--text-scale))}.chapter-mark{margin-top:10px}.scene-footer{bottom:94px;max-height:calc(100dvh - 240px);gap:24px}.scene-footer p{font-size:calc(28px * var(--text-scale))}.reading-progress{margin-top:4px}#tools-toggle{right:18px;top:16px}.scene-header{top:16px;right:82px}#experience-controls{left:20px;bottom:18px}.material-action{max-width:280px}#living::after{background:linear-gradient(180deg,#111c24ed,#111c24bb 25%,#111c2480 42%,#111c24ed 60%,#111c24f5)}dialog{max-height:88dvh;padding:20px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
.material-action{min-height:58px}
.material-action::before{left:var(--anchor-offset,27px);display:var(--anchor-visible,block)}
body[data-object-hints=false] #object-whisper{display:none}
#living::after{background:linear-gradient(180deg,#111c24ed,#111c24d6 130px,#111c2400 260px) top / 100% 260px no-repeat,linear-gradient(to top,#111c24f5,#111c24ed calc(100% - 80px),#111c2400) bottom / 100% var(--reading-shade-height,360px) no-repeat}
body[data-tools=open] .scene-heading{visibility:hidden;opacity:0}
body[data-reduced-motion=true] *,body[data-reduced-motion=true]::before,body[data-reduced-motion=true]::after,body[data-reduced-motion=true] *::before,body[data-reduced-motion=true] *::after{transition:none!important;animation:none!important}
dialog :is(button,a,input,select):focus-visible{outline-color:#285c54}
