/* Shared interface tokens for the room, readers and standalone documents. */
:root{--ui-bg:#fafbfc;--ui-surface:#f3f5f7;--ui-ink:#303944;--ui-muted:#738092;--ui-line:#dce2e9;--ui-accent:#40566d;--ui-radius:12px;--ui-radius-small:8px;--ui-radius-image:3px;--ui-icon-size:44px;--ui-edge:3.5vw;--ui-font:Arial,'Microsoft YaHei',sans-serif;--ui-mono:'Courier New',monospace;--ui-shadow:4px 5px 12px #34465f14,-4px -4px 10px #fff;--ui-shadow-inset:inset 2px 2px 6px #34465f14,inset -2px -2px 6px #fff}
html body{background:var(--ui-bg);color:var(--ui-ink);font-family:var(--ui-font)}
html body :is(.scene-room.reading-room,.works-page,.reading-page,.proposal-reader){background:var(--ui-bg);color:var(--ui-ink);font-family:var(--ui-font)}
html body :is(.profile-sheet[data-slot],.computer-sheet[data-slot],.proposal-directory,.thumbnail-tray){background:var(--ui-surface);color:var(--ui-ink)}
html body :is(.soft-button,.proposal-button,.page-side-controls button,.scene-reset){width:var(--ui-icon-size);height:var(--ui-icon-size);flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;padding:0;border:1px solid #ffffffb3;border-radius:var(--ui-radius);background:var(--ui-surface);color:var(--ui-accent);box-shadow:var(--ui-shadow);transition:color .18s,box-shadow .18s,background .18s,transform .18s}
html body :is(.soft-button,.proposal-button,.page-side-controls button,.scene-reset):hover:not(:disabled){background:#fff;color:var(--ui-ink);box-shadow:var(--ui-shadow);transform:translateY(-1px)}
html body :is(.soft-button,.proposal-button,.page-side-controls button,.scene-reset):active:not(:disabled){box-shadow:var(--ui-shadow-inset);transform:none}
html body :is(.soft-button,.proposal-button,.page-side-controls button,.scene-reset):disabled{opacity:.32;box-shadow:none;transform:none}
html body :is(.soft-button,.proposal-button,.page-side-controls button,.scene-reset) svg{width:18px;height:18px;stroke-width:1.5}
html body :is(button,a):focus-visible{outline:2px solid var(--ui-accent);outline-offset:4px}
html body :is(.reader-header,.proposal-header){min-height:82px;padding:16px var(--ui-edge);gap:20px}
html body :is(.reader-footer,.proposal-footer){height:82px;min-height:82px;padding:16px var(--ui-edge)}
html body :is(.return-button,.proposal-return){font-size:var(--ui-text-control);color:var(--ui-muted);gap:16px}
html body :is(.reader-title,.proposal-header h1){font-size:var(--ui-text-heading-sm);font-weight:400;line-height:1.6;letter-spacing:.03em}
html body :is(.detail-heading,.proposal-detail-head){color:var(--ui-muted);font-size:var(--ui-text-caption);height:38px;margin:0 0 12px;flex-shrink:0}
html body :is(.detail-viewport,.proposal-detail-image){background:#edf0f4;border:4px solid var(--ui-surface);border-radius:var(--ui-radius-image);box-shadow:0 8px 22px #34465f12}
html body :is(.detail-instruction,.proposal-detail p,.reader-touch-tools,.reader-touch-tools button,.reader-footer,.proposal-footer,.profile-intro,.contact-item){color:var(--ui-muted)}
html body :is(.zoom-controls,.proposal-detail-head>div,.page-controls>span,.proposal-pagination){font-family:var(--ui-mono);font-size:var(--ui-text-caption);font-variant-numeric:tabular-nums}
html body :is(.plain-icon,.proposal-detail-head button){min-width:32px;min-height:32px;display:inline-flex;align-items:center;justify-content:center}
html body :is(.proposal-status,.proposal-reader.touch-reader .proposal-header,.proposal-reader.touch-reader .proposal-footer){background:var(--ui-bg)}
html body :is(.thumbnail-tray,.proposal-directory){border:1px solid var(--ui-line);border-radius:var(--ui-radius);box-shadow:0 10px 30px #34465f18}
html body .live-dot{background:var(--ui-accent)}
html body .lens-cursor{color:var(--ui-accent);border-color:var(--ui-accent);background:#40566d0a}
html body .lens-cursor:after{background:var(--ui-accent)}
html body .works-page{padding:30px var(--ui-edge) 70px}
html body :is(.works-heading h1,.cv-page h1){font-size:var(--ui-text-display);font-weight:400;letter-spacing:.02em;line-height:1.3}
html body :is(.works-nav,.scene-work-link,.cv-page .back-room,.pdf-page .back-room){font-size:var(--ui-text-control);color:var(--ui-muted)}
html body :is(.works-nav a,.cv-page .back-room,.pdf-page .back-room){display:inline-flex;align-items:center;gap:10px;min-height:44px;text-decoration:none}
html body :is(.full-pdf,.personal-actions>a,.cv-page .actions a:first-child,.pdf-page nav>a,.pdf-page nav>button){display:inline-flex;align-items:center;justify-content:space-between;gap:14px;min-height:48px;padding:12px 18px;border:1px solid #ffffffb3;border-radius:var(--ui-radius);font:var(--ui-text-control)/var(--ui-leading-control) var(--ui-font);text-decoration:none;background:var(--ui-surface);color:var(--ui-accent);box-shadow:var(--ui-shadow)}
html body :is(.full-pdf,.personal-actions>a,.cv-page .actions a:first-child,.pdf-page nav>a,.pdf-page nav>button){white-space:nowrap;flex-shrink:0}
html body :is(.full-pdf,.personal-actions>a,.cv-page .actions a:first-child,.pdf-page nav>a,.pdf-page nav>button) svg{width:18px;height:18px;flex:0 0 18px;stroke-width:1.5}
html body :is(.full-pdf,.personal-actions>a,.cv-page .actions a:first-child,.pdf-page nav>a,.pdf-page nav>button):active{box-shadow:var(--ui-shadow-inset)}
html body :is(.full-pdf,.personal-actions>a,.cv-page .actions a:first-child,.pdf-page nav>a,.pdf-page nav>button):hover{filter:brightness(1.04)}
html body :is(.works-heading,.personal-chapters,.personal-chapters>a,.contact-item,.cv-page .top,.cv-page .chapter){border-color:var(--ui-line)}
html body.cv-page :is(.number,.identity){color:var(--ui-accent)}
html body.cv-page .number{border-radius:var(--ui-radius);background:var(--ui-surface);box-shadow:var(--ui-shadow)}
html body.cv-page :is(.alias,.eyebrow,.contact,.practice,.date,nav a){color:var(--ui-muted)}
html body.cv-page :is(.alias,.eyebrow,.top){font-family:var(--ui-mono)}
html body.cv-page :is(h2,.role){color:var(--ui-ink)}
html body.cv-page :is(h3,a){color:var(--ui-accent)}
html body.cv-page .back-room svg,html body.pdf-page svg{width:18px;height:18px;stroke-width:1.5;flex-shrink:0}
html body.pdf-page p{font-size:var(--ui-text-body);color:var(--ui-muted)}
html body.pdf-page progress{accent-color:var(--ui-accent)}
html body.pdf-page nav{flex-wrap:wrap}
html body.pdf-page *,html body.pdf-page *::before,html body.pdf-page *::after{box-sizing:border-box}
@media(max-width:860px){:root{--ui-edge:20px}html body :is(.reader-header,.proposal-header){height:70px;min-height:70px;padding:12px var(--ui-edge)}html body :is(.reader-footer,.proposal-footer){padding:12px var(--ui-edge)}html body .proposal-reader{grid-template-rows:70px minmax(0,1fr) 82px}}
@media(prefers-reduced-motion:reduce){html body :is(.soft-button,.proposal-button,.page-side-controls button,.scene-reset){transition:none}}
@media print{html body.cv-page{background:#fff}html body.cv-page .number{box-shadow:none}}

/* Typography contract: six size steps, assigned by UI role rather than per component.
   Artwork (publication covers, image/PDF lettering) keeps its original typography. */
:root{
 --ui-text-display:40px; --ui-text-heading:24px; --ui-text-heading-sm:18px;
 --ui-text-body:14px; --ui-text-caption:12px; --ui-text-micro:10px;
 --ui-text-control:var(--ui-text-body); --ui-text-tag:var(--ui-text-caption);
 --ui-leading-heading:1.35; --ui-leading-body:1.8; --ui-leading-control:1.5;
}
html body{font-size:var(--ui-text-body)}
html body :is(.works-heading h1,.cv-page h1){font-size:var(--ui-text-display);line-height:var(--ui-leading-heading);font-weight:400;letter-spacing:.02em}
html body :is(.contact-heading,.personal-archive .profile-name,.cv-page h2,.pdf-page h1){font-size:var(--ui-text-heading);line-height:var(--ui-leading-heading);font-weight:400;letter-spacing:.02em}
html body :is(.reader-title,.proposal-header h1,.personal-positioning,.retro-window-body h3,.cv-page h3,.cv-page .role){font-size:var(--ui-text-heading-sm);line-height:var(--ui-leading-heading);font-weight:400;letter-spacing:0}
html body :is(.profile-intro,.personal-summary,.contact-item,.retro-window-body p,.pdf-page p,.cv-page .entry p,.cv-page h4,.cv-page .identity strong){font-size:var(--ui-text-body);line-height:var(--ui-leading-body)}
html body :is(.scene-work-link,.email-link,.works-nav,.return-button,.proposal-return,.full-pdf,.personal-actions>a,.personal-chapters>a,.entrance-enter,.entrance-skip,.entrance-replay,.portrait-caption,.retro-window-body a,.cv-page .back-room,.cv-page .actions,.cv-page nav a,.pdf-page .back-room,.pdf-page nav>a,.pdf-page nav>button,.page-lift-handle,.reader-touch-tools button){font-size:var(--ui-text-control);font-weight:400;line-height:var(--ui-leading-control);letter-spacing:0}
html body :is(.scene-footer,.scene-message,.scene-number,.detail-message,.detail-heading,.proposal-detail-head,.detail-instruction,.proposal-detail p,.reader-touch-tools,.zoom-controls,.page-controls>span,.proposal-pagination,.thumbnail-tray span,.proposal-directory span,.proposal-header h1 span,.work-card-meta,.works-heading p,.personal-role,.personal-positioning>span,.profile-name span,.personal-updated,.copy-status,.entrance-progress,.page-preparing,.page-flip-error,.proposal-status,.retro-menubar,.retro-taskbar,.desktop-icons button,.retro-window header,.computer-sheet-title,.cv-page .alias,.cv-page .practice,.cv-page .contact,.cv-page .entry .meta,.cv-page .date,.cv-page footer){font-size:var(--ui-text-caption);line-height:var(--ui-leading-control)}
html body :is(.personal-eyebrow,.personal-actions small,.personal-chapters>a>span,.cv-page .eyebrow,.cv-page .top,.cv-page .identity span){font-size:var(--ui-text-micro);line-height:var(--ui-leading-control)}
html body.cv-page .number{font-size:var(--ui-text-heading)}
html body .entrance-index button{font-size:var(--ui-text-tag);line-height:var(--ui-leading-control)}
html body :is(.entrance-index-number,.entrance-index button[aria-disabled] small){font-size:var(--ui-text-micro);line-height:var(--ui-leading-control)}
@media(max-width:700px){
 :root{--ui-text-display:28px;--ui-text-heading:20px;--ui-text-heading-sm:16px;--ui-text-control:var(--ui-text-caption);--ui-text-tag:var(--ui-text-micro);--ui-leading-heading:1.3;--ui-leading-body:1.65;--ui-leading-control:1.4}
 html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
}
@media print{html body.cv-page{--ui-text-display:32px;--ui-text-heading:22px;--ui-text-heading-sm:16px}}

/* Contact rows share the type scale and a full-size copy target on phones. */
.contact-panel{min-width:0}
.contact-panel .contact-heading{margin-top:40px}
.contact-panel .contact-item{display:grid;grid-template-columns:18px minmax(0,1fr) var(--ui-icon-size);align-items:center;gap:16px;padding:20px 0}
.contact-details{display:flex;flex-direction:column;gap:6px;min-width:0}
.contact-label{font-size:var(--ui-text-caption);line-height:var(--ui-leading-control);color:var(--ui-muted)}
.contact-value{font-size:var(--ui-text-body);line-height:var(--ui-leading-body);color:var(--ui-ink);overflow-wrap:anywhere;user-select:text}
.contact-value[href]:hover{text-decoration:underline;text-underline-offset:4px}
.contact-social{display:grid;grid-template-columns:18px minmax(0,1fr) var(--ui-icon-size);align-items:center;gap:16px;padding:20px 0;border-bottom:1px solid var(--ui-line)}
.contact-social:hover .contact-value{color:var(--ui-accent)}
.contact-panel .copy-status{min-height:36px;margin:16px 0 0}
@media(max-width:700px){.contact-panel .contact-heading{margin-top:24px}.contact-panel .contact-item,.contact-social{padding:16px 0;gap:10px}.contact-panel .contact-value{font-size:var(--ui-text-control)}}

.contact-symbol{color:var(--ui-muted);stroke-width:1.5;flex-shrink:0}

/* Shape contract: controls/panels 12px; compact tags 8px; image frames 3px.
   Printed pages, full-height drawers and the vintage computer keep their native outline. */
html body :is(.entrance-enter,.page-lift-handle,.personal-actions>a,.computer-sheet .sheet-close,.proposal-pagination .proposal-button,.page-turn-buttons .soft-button,.cv-page .identity){border-radius:var(--ui-radius)}
html body :is(.entrance-index button,.page-flip-error){border-radius:var(--ui-radius-small)}
html body :is(.portrait-crop,.cv-portrait){border-radius:var(--ui-radius-image);overflow:hidden}
html body .scene-header-left .avatar-button{border-radius:calc(var(--ui-radius-image) + 2px)}
html body .scene-header-left .avatar-button img{border-radius:var(--ui-radius-image)}

/* Spacing contract: compact groups, content divisions, and major chapters. */
:root{--ui-space-xs:8px;--ui-space-sm:12px;--ui-space-md:16px;--ui-space-lg:24px;--ui-space-xl:32px;--ui-divider-space:16px;--ui-section-gap:24px;--ui-chapter-space:32px;--ui-heading-gap:12px}
@media(max-width:860px){:root{--ui-chapter-space:24px}}
/* CV chapter rules use equal clearance on both sides of each separator. */
html body.cv-page .top{padding-bottom:var(--ui-divider-space)}
html body.cv-page .hero{padding-block:var(--ui-chapter-space)}
html body.cv-page .chapter{padding-block:var(--ui-chapter-space)}
html body.cv-page .chapter>header{margin-bottom:var(--ui-section-gap)}
html body.cv-page .chapter>header+h3{margin-top:0}
html body.cv-page h3{margin:var(--ui-section-gap) 0 var(--ui-space-md)}
html body.cv-page h4{margin-bottom:var(--ui-space-xs)}
html body.cv-page .entry{margin-bottom:var(--ui-section-gap)}
html body.cv-page .chapter>.entry:last-child{margin-bottom:0}
html body.cv-page footer{margin-top:0;padding-top:var(--ui-chapter-space)}
