/* Theme-specific opening covers. Copy remains live HTML; artwork files contain no site text. */
#cover.cover{
  --cover-ink:#29303a;--cover-muted:#716c6e;--cover-rule:#a99b91;--cover-accent:#8c6c72;
  position:fixed;inset:0;display:block;overflow:hidden;isolation:isolate;z-index:1000;
  padding:0;background:#eee9e1;color:var(--cover-ink);cursor:pointer;
  transition:background-color .45s,color .35s;
}
#cover .cover-scene{position:absolute;inset:0;z-index:-2;background:#eee9e1 center/cover no-repeat;transform:scale(1.005)}
#cover::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(90deg,#efe9df 0%,#efe9dfd9 38%,transparent 75%)}
#cover .cover-frame{position:absolute;inset:20px;z-index:4;border:1px solid color-mix(in srgb,var(--cover-rule) 72%,transparent);pointer-events:none}
#cover .cover-corner{display:none;position:absolute;color:var(--cover-accent);font:20px/1 'Songti SC','Noto Serif SC',serif}
#cover .cover-corner-tl{top:-9px;left:-7px;transform:rotate(135deg)}
#cover .cover-corner-tr{top:-9px;right:-7px;transform:rotate(225deg)}
#cover .cover-corner-bl{bottom:-9px;left:-7px;transform:rotate(45deg)}
#cover .cover-corner-br{bottom:-9px;right:-7px;transform:rotate(-45deg)}
#cover .cover-masthead,#cover .cover-content,#cover .cover-side-note,#cover .cover-footer{position:absolute;z-index:2}
#cover .cover-masthead{top:6.5%;left:7%;right:7%;display:flex;align-items:center;justify-content:space-between;gap:1rem}
#cover .cover-brand{display:flex;align-items:center;gap:11px;color:var(--cover-ink);font:600 14px/1.1 'Times New Roman',serif;letter-spacing:.28em}
#cover .cover-brand-mark{color:var(--cover-accent);font-size:22px;line-height:1}
#cover .cover-brand b{display:block;font:600 14px/1.2 'Times New Roman',serif;letter-spacing:.28em}
#cover .cover-brand small{display:block;margin-top:4px;font:9px/1 'Rajdhani',sans-serif;letter-spacing:.23em;opacity:.72}
#cover .cover-theme-label{padding:5px 10px;color:var(--cover-muted);border-bottom:1px solid var(--cover-rule);font:11px/1.3 'Songti SC','Noto Serif SC',serif;letter-spacing:.15em}
#cover .cover-content{top:25%;left:9%;width:min(48vw,700px);padding:0;text-align:left}
#cover .cover-kicker{margin:0 0 13px;color:var(--cover-accent);font:11px/1.5 'Rajdhani',sans-serif;letter-spacing:.23em}
#cover .cover-title{margin:0;color:var(--cover-ink);font:500 clamp(48px,7vw,102px)/1.2 'Songti SC','Noto Serif SC','SimSun',serif;letter-spacing:.1em;text-shadow:none}
#cover .cover-author{margin:15px 0 0;color:var(--cover-muted);font:17px/1.6 'Songti SC','Noto Serif SC',serif;letter-spacing:.28em}
#cover .cover-divider{display:flex;align-items:center;gap:11px;width:min(300px,70%);margin:20px 0;color:var(--cover-accent)}
#cover .cover-divider span{height:1px;flex:1;background:var(--cover-rule)}
#cover .cover-divider i{font:12px/1 'Songti SC',serif;font-style:normal}
#cover .cover-epigraph{max-width:35em;margin:0;color:var(--cover-muted);font:15px/2.05 'Songti SC','Noto Serif SC',serif;letter-spacing:.12em}
#cover .cover-hint{display:inline-flex;align-items:center;justify-content:center;gap:28px;min-width:192px;margin-top:35px;padding:13px 19px;color:var(--cover-ink);border:1px solid var(--cover-rule);background:transparent;font:14px/1.4 'Songti SC','Noto Serif SC',serif;letter-spacing:.12em;cursor:pointer;animation:none;opacity:1;transition:color .2s,background .2s,border-color .2s}
#cover .cover-hint:hover{color:var(--cover-button-hover,#fff);background:var(--cover-accent);border-color:var(--cover-accent)}
#cover .cover-arrow{font:20px/1 'Times New Roman',serif;transition:transform .2s}
#cover .cover-hint:hover .cover-arrow{transform:translateX(4px)}
#cover .cover-side-note{left:3.7%;top:37%;writing-mode:vertical-rl;color:var(--cover-accent);font:10px/1.8 'Rajdhani','Songti SC',serif;letter-spacing:.25em}
#cover .cover-footer{left:7%;right:7%;bottom:5.4%;display:flex;align-items:center;gap:14px;color:var(--cover-muted);font:9px/1.4 'Rajdhani',sans-serif;letter-spacing:.22em;opacity:.72}
#cover .cover-footer-rule{height:1px;flex:1;background:var(--cover-rule)}
#cover :is(.cover-title,.cover-author,.cover-epigraph,.cover-brand,.cover-theme-label){user-select:text}
#cover :focus-visible{outline:2px solid var(--cover-accent);outline-offset:4px}

/* Wisteria: rainy travel photograph weighted to the right, book-jacket text panel to the left. */
body.theme-wisteria #cover{--cover-ink:#38243d;--cover-muted:#705c73;--cover-rule:#a784a5;--cover-accent:#8a5f8d;--cover-button-hover:#fff;background:#eee5ef}
body.theme-wisteria #cover .cover-scene{background-image:linear-gradient(90deg,#f2eaf4 0%,#f2eaf4f2 31%,#f2eaf4bd 48%,#f2eaf44a 62%,transparent 78%),url('/assets/scenes/wisteria/rainy-station.jpg');background-position:center,68% 52%}
body.theme-wisteria #cover .cover-frame{inset:18px;border-color:#9e7a9b}
body.theme-wisteria #cover .cover-frame::before{content:"";position:absolute;inset:5px;border:1px solid #cdb7cd}
body.theme-wisteria #cover .cover-corner{display:block}
body.theme-wisteria #cover .cover-content{top:27%;left:10%;width:44vw}
body.theme-wisteria #cover .cover-title{font-size:clamp(54px,7.4vw,108px);letter-spacing:.16em}
body.theme-wisteria #cover .cover-side-note{left:4.3%;top:34%}
body.theme-wisteria #cover .cover-hint{border-radius:28px;padding-inline:24px}
body.theme-wisteria #cover .cover-divider{width:280px}

/* Ink: open paper with the monochrome study pushed toward the lower-right; typography sits high. */
body.theme-ink #cover{--cover-ink:#201f1d;--cover-muted:#595650;--cover-rule:#8d8981;--cover-accent:#34332f;background:#f5f3ee}
body.theme-ink #cover .cover-scene{background-image:linear-gradient(180deg,#f6f4ef 0%,#f6f4efd9 32%,#f6f4ef22 62%,transparent 84%),url('/assets/scenes/ink/archive-header.webp');background-position:center,center bottom}
body.theme-ink #cover .cover-frame{inset:26px;border-color:#6e6a64}
body.theme-ink #cover .cover-corner{display:block;font-size:13px}
body.theme-ink #cover .cover-content{top:16%;left:50%;width:min(52vw,700px);transform:translateX(-50%);text-align:center}
body.theme-ink #cover .cover-divider{margin:19px auto}
body.theme-ink #cover .cover-epigraph{margin-inline:auto}
body.theme-ink #cover .cover-hint{border-radius:0}
body.theme-ink #cover .cover-side-note{display:none}
body.theme-ink #cover .cover-footer{left:12%;right:12%}

/* Print proof: engraved press and paper sit to the right, with quiet title field and crop marks. */
body.theme-printproof #cover{--cover-ink:#242321;--cover-muted:#6d6861;--cover-rule:#91897e;--cover-accent:#6c655c;background:#eee8dc}
body.theme-printproof #cover .cover-scene{background-image:linear-gradient(90deg,#f1ebdf 0%,#f1ebdfed 37%,#f1ebdf8f 58%,transparent 77%),url('/assets/scenes/printproof/press-sheet.jpg');background-position:center,center}
body.theme-printproof #cover .cover-frame{inset:28px;border:1px solid #8d8579}
body.theme-printproof #cover .cover-frame::before{content:"";position:absolute;inset:5px;border:1px dotted #b0a99e}
body.theme-printproof #cover .cover-corner{display:block;color:#8f3f2c;font-size:13px}
body.theme-printproof #cover .cover-content{top:29%;left:11%;width:43vw}
body.theme-printproof #cover .cover-kicker{letter-spacing:.3em}
body.theme-printproof #cover .cover-title{font-size:clamp(46px,6vw,88px)}
body.theme-printproof #cover .cover-hint{border-style:double;border-width:3px;padding:11px 20px}
body.theme-printproof #cover .cover-side-note{left:auto;right:4%;top:32%;writing-mode:vertical-rl}
body.theme-printproof #cover .cover-footer{font-family:'Courier New',monospace}

/* Deep space: orbital archive on the right; title and entry control stay in the dark left field. */
body.theme-spacetech #cover{--cover-ink:#e7e5ee;--cover-muted:#b6bfd0;--cover-rule:#8096b5;--cover-accent:#a9c9ef;--cover-button-hover:#0a1424;background:#08101e}
body.theme-spacetech #cover .cover-scene{background-image:linear-gradient(90deg,#08101ef5 0%,#08101edb 34%,#08101e52 59%,#08101e12 100%),url('/assets/scenes/celestial/reading-room.webp');background-position:center,72% center}
body.theme-spacetech #cover .cover-frame{inset:22px;border-color:#8699b466}
body.theme-spacetech #cover .cover-corner{display:block;color:#c2d5f1;font-size:11px}
body.theme-spacetech #cover .cover-content{top:28%;left:9%;width:45vw}
body.theme-spacetech #cover .cover-title{font-size:clamp(48px,6.6vw,94px)}
body.theme-spacetech #cover .cover-divider i{content:"";font-size:0;width:8px;height:8px;border:1px solid #a9c9ef;transform:rotate(45deg)}
body.theme-spacetech #cover .cover-hint{border-color:#91a9cc;color:#e7e5ee}
body.theme-spacetech #cover .cover-hint:hover{color:#091321}
body.theme-spacetech #cover .cover-side-note{left:auto;right:5%;top:22%;writing-mode:vertical-rl}
body.theme-spacetech #cover .cover-footer{color:#c6d0df}

/* Poolcore: symmetric water corridor; centered title aligned with the vanishing point. */
body.theme-poolcore #cover{--cover-ink:#154e52;--cover-muted:#477578;--cover-rule:#70aaa4;--cover-accent:#398c88;--cover-button-hover:#fff;background:#cfe8e1}
body.theme-poolcore #cover .cover-scene{background-image:linear-gradient(180deg,#e7f4efcc 0%,#e7f4ef50 40%,#0b676520 100%),url('/assets/scenes/poolrooms/corridor.webp');background-position:center,center}
body.theme-poolcore #cover .cover-frame{inset:34px 8%;border:1px solid #6daaa3a8;border-radius:160px 160px 4px 4px}
body.theme-poolcore #cover .cover-frame::before{content:"";position:absolute;inset:9px;border:1px solid #e9f6f0a1;border-radius:150px 150px 0 0}
body.theme-poolcore #cover .cover-corner{display:none}
body.theme-poolcore #cover .cover-masthead{left:50%;right:auto;transform:translateX(-50%);justify-content:center}
body.theme-poolcore #cover .cover-content{top:31%;left:50%;width:min(62vw,760px);transform:translateX(-50%);text-align:center}
body.theme-poolcore #cover .cover-title{font-size:clamp(46px,6vw,88px);letter-spacing:.2em}
body.theme-poolcore #cover .cover-divider{margin:18px auto}
body.theme-poolcore #cover .cover-epigraph{margin-inline:auto}
body.theme-poolcore #cover .cover-hint{border-radius:99px;background:#eff8f2a8}
body.theme-poolcore #cover .cover-side-note{display:none}
body.theme-poolcore #cover .cover-footer{display:none}

/* Forest: botanical plate on the left, small parchment title panel set at upper-right. */
body.theme-forest #cover{--cover-ink:#33412d;--cover-muted:#68765b;--cover-rule:#8c9b79;--cover-accent:#596e49;--cover-button-hover:#f8f4e9;background:#dfe4d0}
body.theme-forest #cover .cover-scene{background-image:linear-gradient(90deg,#e6eadbaa 0%,#e6eadb30 48%,#e8ead9d9 73%,#e8ead9eb 100%),url('/assets/scenes/woodland-museum.webp');background-position:center,center}
body.theme-forest #cover .cover-frame{inset:24px 30px;border-color:#81916e}
body.theme-forest #cover .cover-corner{display:block;color:#748463;font-size:14px}
body.theme-forest #cover .cover-content{top:22%;left:auto;right:10%;width:38vw;text-align:center;padding:25px 24px;background:#f2f0e2c9}
body.theme-forest #cover .cover-title{font-size:clamp(42px,5.4vw,78px)}
body.theme-forest #cover .cover-divider{margin:17px auto}
body.theme-forest #cover .cover-epigraph{margin-inline:auto}
body.theme-forest #cover .cover-hint{border-radius:2px 18px 2px 18px}
body.theme-forest #cover .cover-side-note{left:6%;top:28%;color:#f1f0dc}
body.theme-forest #cover .cover-footer{color:#4e6042}

/* Mid-century future: geometric museum pavilion and asymmetrical exhibition-title placement. */
body.theme-midcentury #cover{--cover-ink:#153a3a;--cover-muted:#557473;--cover-rule:#c18a55;--cover-accent:#b76335;--cover-button-hover:#fff7e6;background:#dce7df}
body.theme-midcentury #cover .cover-scene{background-image:linear-gradient(90deg,#f2ecd9eb 0%,#f2ecd9b3 38%,#f2ecd91a 72%,#f2ecd92b 100%),url('/assets/scenes/future-expo/pavilion.webp');background-position:center,58% center}
body.theme-midcentury #cover .cover-frame{inset:32px 5%;border:1px solid #b9824c;border-radius:2px 2px 90px 2px}
body.theme-midcentury #cover .cover-frame::before{content:"";position:absolute;inset:7px;border:1px solid #d8b68d;border-radius:2px 2px 82px 2px}
body.theme-midcentury #cover .cover-corner{display:block;color:#b76335}
body.theme-midcentury #cover .cover-content{top:25%;left:11%;width:42vw}
body.theme-midcentury #cover .cover-kicker{color:#a75332}
body.theme-midcentury #cover .cover-title{font-size:clamp(50px,6.5vw,94px)}
body.theme-midcentury #cover .cover-hint{border-radius:2px 18px 2px 18px;background:#f6edda9c}
body.theme-midcentury #cover .cover-side-note{writing-mode:horizontal-tb;left:auto;right:10%;top:17%;color:#b76335}
body.theme-midcentury #cover .cover-footer{color:#4f6b69}

/* DOS: phosphor landscape on the right, monospaced live text aligned like a terminal log. */
body.theme-dos #cover{--cover-ink:#83ff97;--cover-muted:#69c87b;--cover-rule:#36b958;--cover-accent:#6eff85;--cover-button-hover:#041009;background:#020a05;font-family:'Courier New',monospace}
body.theme-dos #cover .cover-scene{background-image:linear-gradient(90deg,#020a05f5 0%,#020a05e6 38%,#020a0570 61%,#020a0512 100%),url('/assets/scenes/dos/terminal-landscape.jpg');background-position:center,center}
body.theme-dos #cover .cover-frame{inset:22px;border:1px solid #24a942;clip-path:polygon(0 0,calc(100% - 14px) 0,100% 14px,100% 100%,14px 100%,0 calc(100% - 14px))}
body.theme-dos #cover .cover-frame::before{content:"";position:absolute;inset:7px;border:1px dashed #237c39;clip-path:inherit}
body.theme-dos #cover .cover-corner{display:none}
body.theme-dos #cover .cover-brand,body.theme-dos #cover .cover-brand b,body.theme-dos #cover .cover-kicker,body.theme-dos #cover .cover-title,body.theme-dos #cover .cover-author,body.theme-dos #cover .cover-epigraph,body.theme-dos #cover .cover-theme-label,body.theme-dos #cover .cover-footer{font-family:'Courier New',monospace}
body.theme-dos #cover .cover-brand-mark{font-size:0}
body.theme-dos #cover .cover-brand-mark::after{content:"[ ]";font:700 17px/1 'Courier New',monospace;color:#6eff85}
body.theme-dos #cover .cover-brand b{letter-spacing:.18em}
body.theme-dos #cover .cover-kicker{color:#45d565}
body.theme-dos #cover .cover-content{top:21%;left:9%;width:46vw}
body.theme-dos #cover .cover-title{font-size:clamp(42px,6vw,84px);letter-spacing:.04em;text-shadow:0 0 16px #38e85b66}
body.theme-dos #cover .cover-author{letter-spacing:.14em}
body.theme-dos #cover .cover-divider i{font-size:0;width:7px;height:7px;border:1px solid #6eff85;transform:rotate(45deg)}
body.theme-dos #cover .cover-hint{border-radius:0;border:1px solid #39ce58;background:#04120a;color:#83ff97;font:13px/1.4 'Courier New',monospace;letter-spacing:.06em}
body.theme-dos #cover .cover-hint:hover{color:#041009}
body.theme-dos #cover .cover-side-note{left:auto;right:7%;top:auto;bottom:16%;writing-mode:horizontal-tb;color:#53de70;font-family:'Courier New',monospace;letter-spacing:.1em}
body.theme-dos #cover .cover-footer{font-family:'Courier New',monospace;letter-spacing:.1em}

/* Hidden analog-horror state gets its own restrained damaged-film cover. */
body.theme-analoghorror #cover{--cover-ink:#eaded0;--cover-muted:#baaaa0;--cover-rule:#8b726d;--cover-accent:#c4553f;background:#171313}
body.theme-analoghorror #cover .cover-scene{background-image:linear-gradient(90deg,#171313f5 0%,#171313ca 44%,#17131320 100%),url('/assets/scenes/dos/terminal-landscape.jpg');filter:grayscale(.8) contrast(1.2)}
body.theme-analoghorror #cover .cover-content{top:32%;left:11%;width:50vw}
body.theme-analoghorror #cover .cover-title{font-family:'Courier New',serif}
body.theme-analoghorror #cover .cover-hint{border-color:#9c554b;color:#f4ddd2}
body.theme-analoghorror #cover .cover-side-note{display:none}

/* Narrow screens keep each cover's own focal point and shift live text into safe space. */
@media(max-width:760px){
  #cover .cover-frame{inset:9px}
  #cover .cover-masthead{top:5%;left:7%;right:7%}
  #cover .cover-brand b{font-size:12px}
  #cover .cover-brand small{font-size:8px}
  #cover .cover-theme-label{font-size:10px}
  #cover .cover-footer{left:8%;right:8%;bottom:4%;font-size:8px}
  #cover .cover-side-note{display:none}
  #cover .cover-content{top:auto;left:8%;right:8%;bottom:16%;width:auto;transform:none;text-align:left;padding:0}
  #cover .cover-title{font-size:clamp(42px,12vw,70px);letter-spacing:.08em}
  #cover .cover-author{font-size:15px;margin-top:9px}
  #cover .cover-divider{margin:13px 0;width:min(240px,70%)}
  #cover .cover-epigraph{font-size:13px;line-height:1.85}
  #cover .cover-hint{min-width:160px;margin-top:21px;padding:11px 16px;gap:20px;font-size:13px}
  body.theme-wisteria #cover .cover-scene{background-image:linear-gradient(180deg,#f2eaf4f5 0%,#f2eaf4e8 42%,#f2eaf466 68%,transparent 100%),url('/assets/scenes/wisteria/rainy-station.jpg');background-position:center,63% center}
  body.theme-wisteria #cover .cover-content{bottom:13%;width:auto}
  body.theme-wisteria #cover .cover-title{font-size:clamp(44px,13vw,72px)}
  body.theme-ink #cover .cover-scene{background-image:linear-gradient(180deg,#f6f4eff5 0%,#f6f4efeb 42%,#f6f4ef60 72%,transparent 100%),url('/assets/scenes/ink/archive-header.webp');background-position:center,bottom center}
  body.theme-ink #cover .cover-content{top:17%;bottom:auto;left:8%;right:8%;width:auto;transform:none;text-align:left}
  body.theme-ink #cover .cover-divider{margin:13px 0}
  body.theme-ink #cover .cover-epigraph{margin-inline:0}
  body.theme-printproof #cover .cover-scene{background-image:linear-gradient(180deg,#f1ebdff5 0%,#f1ebdfd9 42%,#f1ebdf40 75%,transparent 100%),url('/assets/scenes/printproof/press-sheet.jpg');background-position:center,65% center}
  body.theme-printproof #cover .cover-content{top:18%;bottom:auto;left:8%;right:8%;width:auto}
  body.theme-spacetech #cover .cover-scene{background-image:linear-gradient(180deg,#08101ef5 0%,#08101ec7 45%,#08101e12 100%),url('/assets/scenes/celestial/reading-room.webp');background-position:center,72% center}
  body.theme-spacetech #cover .cover-content{bottom:12%;left:8%;right:8%;width:auto}
  body.theme-poolcore #cover .cover-scene{background-image:linear-gradient(180deg,#e7f4efab 0%,#e7f4ef3d 45%,#0b676546 100%),url('/assets/scenes/poolrooms/corridor.webp');background-position:center,center}
  body.theme-poolcore #cover .cover-content{top:35%;bottom:auto;left:8%;right:8%;width:auto;transform:none;text-align:center}
  body.theme-poolcore #cover .cover-divider{margin:12px auto}
  body.theme-poolcore #cover .cover-epigraph{margin-inline:auto}
  body.theme-forest #cover .cover-scene{background-image:linear-gradient(180deg,#e8ead9f0 0%,#e8ead9ba 43%,#e8ead944 77%,transparent 100%),url('/assets/scenes/woodland-museum.webp');background-position:center,center}
  body.theme-forest #cover .cover-content{top:18%;bottom:auto;left:8%;right:8%;width:auto;text-align:left;padding:10px;background:transparent}
  body.theme-forest #cover .cover-divider{margin:13px 0}
  body.theme-forest #cover .cover-epigraph{margin-inline:0}
  body.theme-midcentury #cover .cover-scene{background-image:linear-gradient(180deg,#f2ecd9f3 0%,#f2ecd9c7 42%,#f2ecd93a 80%,transparent 100%),url('/assets/scenes/future-expo/pavilion.webp');background-position:center,center}
  body.theme-midcentury #cover .cover-content{top:20%;bottom:auto;left:8%;right:8%;width:auto}
  body.theme-dos #cover .cover-scene{background-image:linear-gradient(180deg,#020a05f4 0%,#020a05d8 44%,#020a0560 74%,transparent 100%),url('/assets/scenes/dos/terminal-landscape.jpg');background-position:center,67% center}
  body.theme-dos #cover .cover-content{top:21%;bottom:auto;left:8%;right:8%;width:auto}
  body.theme-dos #cover .cover-title{font-size:clamp(40px,12vw,68px)}
  body.theme-dos #cover .cover-side-note{display:none}
  body.theme-analoghorror #cover .cover-content{bottom:14%;left:8%;right:8%;width:auto}
}
@media(prefers-reduced-motion:reduce){#cover,#cover .cover-scene,#cover .cover-hint,#cover .cover-arrow{transition:none!important;animation:none!important}}

/* Mobile fit: keep the live copy inside the safe viewport and leave the entry button easy to tap. */
@media(max-width:760px){
  #cover{height:100vh;height:100dvh}
  #cover .cover-content{
    box-sizing:border-box;
    max-height:calc(100dvh - 164px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    touch-action:pan-y;
    padding-bottom:4px;
  }
  #cover .cover-content::-webkit-scrollbar{display:none}
  #cover .cover-hint{min-height:44px;touch-action:manipulation}
}
@media(max-width:760px) and (max-height:680px){
  #cover .cover-content{max-height:calc(100dvh - 132px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
  #cover .cover-title{font-size:clamp(36px,10vw,58px)}
  #cover .cover-author{margin-top:6px}
  #cover .cover-divider{margin-top:9px;margin-bottom:9px}
  #cover .cover-epigraph{font-size:12px;line-height:1.7}
  #cover .cover-hint{margin-top:13px;padding-top:9px;padding-bottom:9px}
}
