.homepage { height:100svh; min-height:0; overflow:hidden; }
.homepage .prototype-current { position:fixed; inset:0; }
.homepage .paper-scene { position:fixed; inset:0; width:100vw; height:100svh; max-width:none; margin:0; overflow:hidden; }
.homepage .paper-scene > img:not(.moving-ball) { position:absolute; width:var(--scene-width); height:var(--scene-height); max-width:none; left:var(--scene-left); top:var(--scene-top); transform:none; z-index:1; }
.homepage .paper-message { position:fixed; z-index:5; box-sizing:border-box; display:flex; flex-direction:column; left:var(--paper-left); top:var(--paper-top); width:var(--paper-width); height:var(--paper-height); max-width:none; padding:var(--paper-padding); transform:none; overflow:hidden; color:#332d29; background:transparent; }
.homepage .paper-heading { flex:none; min-width:0; }
.homepage .paper-heading h1 { margin:0; font:400 clamp(12px,calc(14px * var(--scene-scale)),16px)/1.35 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; letter-spacing:.015em; white-space:normal; text-wrap:wrap; overflow-wrap:anywhere; }
.homepage .paper-body-wrap { display:flex; flex:1 1 auto; flex-direction:column; justify-content:flex-end; min-width:0; min-height:0; width:100%; margin-top:0; overflow:hidden; }
.homepage .paper-body { flex:0 1 auto; box-sizing:border-box; width:100%; max-height:var(--preview-max-height,100%); margin:calc(4px * var(--scene-scale)) 0 0; overflow:hidden; color:inherit; font:400 var(--preview-font-size,16px)/1.28 var(--type); letter-spacing:-.02em; text-wrap:wrap; overflow-wrap:anywhere; white-space:break-spaces; }
.homepage .paper-actions { display:flex; flex:none; flex-wrap:wrap; align-items:baseline; gap:2px 10px; margin-top:4px; font:400 12px/1.4 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; }
.homepage .paper-actions[hidden] { display:none; }
.homepage .paper-actions .read-chapter-link { display:inline-block; margin:0; color:#21334a; font:400 12px/1.4 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; }
.homepage .typing-replay { appearance:none; border:0; border-bottom:1px solid currentColor; padding:0 1px; color:#21334a; background:transparent; font:inherit; text-decoration:none; cursor:pointer; }
.homepage .typing-replay:hover { border-bottom-width:2px; }
.homepage .typing-replay:focus-visible { outline:2px solid #21334a; outline-offset:3px; }
.homepage .prototype-masthead { position:fixed; z-index:6; inset:18px 28px auto; width:auto; max-width:none; min-height:0; margin:0; gap:20px; }
.homepage .prototype-masthead .identity { font-size:12px; }
.homepage .prototype-masthead .study-controls { font-size:10px; }
.homepage .permanent { z-index:6; padding:28px 0 18px; background:linear-gradient(transparent,#17171bd9); pointer-events:none; }
.homepage .footer-inner { pointer-events:auto; min-height:0; max-width:1200px; width:calc(100% - 56px); margin:auto; padding:0; }
.homepage .notebook-link { color:var(--ink); }
.homepage .paper-continuation { display:none; }
.homepage .compact-note[hidden] { display:none; }
@media(max-width:760px) {
 .homepage .prototype-masthead { inset:15px 24px auto; gap:18px; }
 .homepage .footer-inner { width:calc(100% - 48px); gap:5px 13px; padding:0; }
 .homepage .notebook-link { flex-basis:100%; }
}
@media(max-height:500px) {
 .homepage .prototype-masthead { top:10px; }
 .homepage .permanent { padding:22px 0 10px; }
 .homepage .footer-inner { flex-wrap:nowrap; }
 .homepage .notebook-link { flex-basis:auto; }
}
@media(prefers-reduced-motion:reduce) {
 .homepage .typing-replay { scroll-behavior:auto; }
}
/* Wider room is decorative and never changes the calibrated central scene. */
.homepage.scene-ready:not(.reading-layout) .paper-scene::before {
 content:""; position:absolute; pointer-events:none; z-index:0;
 left:50%; top:var(--scene-top); transform:translateX(-50%);
 width:calc(var(--scene-height) * 3); height:var(--scene-height);
 background:url('/assets/wide-room-v1.png') center / 100% 100% no-repeat;
 mask-image:linear-gradient(to right,transparent,#000 12%,#000 88%,transparent);
}
@media print { .homepage .paper-scene::before {display:none!important;} }
/* Blend only the outer frame/desk margins; paper and machine remain opaque. */
.homepage.scene-ready:not(.reading-layout) .paper-scene > img:not(.moving-ball) {
 mask-image:linear-gradient(to right,transparent,#000 5%,#000 95%,transparent);
}
