/* V06: separate compact chapters, consistent photo notes, and a photo-card dialog. */
.paper-scene.names-scene,.paper-scene.memories-scene{height:auto;min-height:0;background:var(--page-paper);color:var(--ink)}
.paper-scene.names-scene .stage,.paper-scene.memories-scene .stage{position:relative;top:auto;height:auto;min-height:0;padding:32px 5% 14px;background:transparent}
.paper-scene.memories-scene .stage{padding-top:18px;padding-bottom:48px}
.paper-scene.names-scene .canvas,.paper-scene.memories-scene .canvas{width:100%;max-width:920px;height:auto;max-height:none;aspect-ratio:16/9}
.paper-scene .names-mountains{height:30%;bottom:0;left:0;width:100%;mask-image:linear-gradient(transparent,#000 25%,#000 78%,transparent)}
.paper-scene .names-mountains img{opacity:.7}
.paper-scene .names-people{right:8%;bottom:0;width:41%;height:90%;z-index:3}
.paper-scene .names-type{left:11%;top:5%;width:35%;text-align:left;letter-spacing:0;z-index:5;line-height:1.1}
.paper-scene .names-type p{width:100%;line-height:1;margin:0}
.paper-scene .names-type>span{display:block;font:italic 4.4cqw/1 Georgia,serif;color:#b77f83;margin:6px 0 7px 25%}
.paper-scene .names-type h2{font-size:clamp(12px,2cqw,18px);line-height:1.8;margin-top:15px;letter-spacing:.04em;white-space:nowrap}
.paper-scene .names-type h2 i{margin:0 3px}
.paper-scene .married-type{left:12%;top:77%;width:35%;max-width:35%;font:12px/1.6 Georgia,serif;letter-spacing:.15em;color:#7d866f}
.paper-scene .names-hearts{left:auto;right:7%;top:1%;width:11%;height:18%}
.paper-scene.memories-scene .memories-canvas{aspect-ratio:1.62}
.paper-scene .memory-paper{left:12%;top:11%;width:76%;height:83%;background:#e4e8d5;z-index:1;rotate:-3deg}
.paper-scene .memory-frame{left:14%;top:7%;width:72%;height:auto;padding:1.8%;z-index:3;rotate:1.5deg}
.paper-scene .memory-slides{height:auto;aspect-ratio:3/2}
.paper-scene .memory-slide{object-fit:cover;object-position:center;transform:none}
.paper-scene .memory-controls{height:43px;padding:0 4px 0 5%;font-size:14px;letter-spacing:0}
.paper-scene .memory-controls button{font-size:20px;min-width:38px;min-height:38px}
.paper-scene .quote-mark{right:9%;top:0;font:90px/1 Georgia,serif;z-index:4;color:#c7b9d0}
.paper-scene .memory-flower{left:8%;bottom:1%;width:9%;height:18%;z-index:4}

.base-scene .photo-paper{padding-bottom:48px}
.base-scene .photo-paper figcaption{font-family:Georgia,var(--serif);font-size:14px;font-weight:400;font-style:normal;line-height:1.5;letter-spacing:.04em;text-align:center;color:#667454;white-space:normal;overflow-wrap:normal}
.base-scene .photo-paper .base-idle-photo figcaption{left:4px;right:4px;bottom:-38px!important}
.base-scene#red .card-two{top:18%}
.base-scene#red .card-three{bottom:-10%}

.lightbox{position:fixed;inset:0;margin:auto;border:1px solid #d7ddcb;padding:0;width:min(940px,calc(100% - 32px));height:fit-content;max-width:none;max-height:calc(100svh - 32px);background:#fbfaf4;color:var(--ink);border-radius:18px;box-shadow:0 25px 100px #17201645;overflow:hidden}
.lightbox[data-photo-shape="portrait"]{width:min(600px,calc(100% - 32px))}
.lightbox::backdrop{background:#23302170;backdrop-filter:blur(9px)}
.lightbox[open]{display:block;animation:photo-popup .24s ease-out both}
.photo-modal-card{display:grid;grid-template-rows:auto minmax(0,1fr) auto;padding:18px;gap:12px}
.photo-modal-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;min-width:0;padding-left:5px}
.photo-modal-heading h2{font-family:var(--hand);font-size:21px;font-weight:400;letter-spacing:.07em;line-height:1.3}
.lightbox .lightbox-figure{display:grid;grid-template:1fr/1fr;gap:0;place-items:center;width:100%;height:auto;aspect-ratio:var(--photo-ratio,1.5);max-height:min(64svh,650px);min-height:0;background:#eef0e5;border-radius:10px;overflow:hidden}
.lightbox .lightbox-figure img{width:100%;height:100%;max-width:100%;max-height:100%;min-height:0;object-fit:contain;opacity:1;transition:opacity .22s}
.lightbox.is-loading .lightbox-figure img{opacity:.35}
.photo-modal-footer{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:12px;align-items:center;padding:0 5px}
.photo-modal-footer #lightbox-caption{text-align:center;font:13px/1.55 Georgia,var(--serif);letter-spacing:.05em;color:#69765b}
.lightbox button{position:static;inset:auto;margin:0;color:var(--ink);background:#e9edde;width:44px;height:44px;min-width:44px;min-height:44px;display:grid;place-items:center;border:1px solid #dbe1cf;border-radius:50%;font-family:Arial,sans-serif;line-height:1;transition:background .18s,transform .18s}
.lightbox .lightbox-close{font-size:26px;background:transparent}
.lightbox .lightbox-prev,.lightbox .lightbox-next{font-size:30px;padding-bottom:3px}
.lightbox button:hover{background:#dce4cc;transform:translateY(-2px)}
.lightbox button:active{transform:scale(.94)}
.lightbox button:focus-visible{outline:2px solid #65784d;outline-offset:2px}
@keyframes photo-popup{from{opacity:0;transform:translateY(12px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}

@media(max-width:700px){
 .paper-scene.names-scene .stage{padding:28px 5% 16px}
 .paper-scene.memories-scene .stage{padding:16px 5% 40px}
 .paper-scene.names-scene .canvas{aspect-ratio:1.18}
 .paper-scene .names-type{left:2%;top:5%;width:48%}
 .paper-scene .names-type>span{font-size:6cqw;margin:4px 0 5px 26%}
 .paper-scene .names-type h2{font-size:12px;margin-top:9px}
 .paper-scene .names-people{right:0;bottom:0;width:48%;height:83%}
 .paper-scene .names-mountains{height:26%;bottom:0}
 .paper-scene .married-type{left:3%;top:75%;width:43%;max-width:43%;font-size:10px;letter-spacing:.1em}
 .paper-scene .names-hearts{right:1%;top:2%;width:13%;height:15%}
 .paper-scene.memories-scene .memories-canvas{aspect-ratio:1.12}
 .paper-scene .memory-frame{top:7%;height:auto;left:3%;width:94%;padding:2.5%;rotate:1.5deg}
 .paper-scene .memory-paper{top:9%;left:1%;width:98%;height:81%;rotate:-2deg}
 .paper-scene .memory-controls{font-size:12px;height:40px}
 .paper-scene .quote-mark{font-size:55px;top:0;right:0}
 .paper-scene .memory-flower{bottom:0;left:0;width:9%;height:14%}
 .base-scene .photo-paper{padding-bottom:44px}
 .base-scene .photo-paper figcaption{font-size:11px;line-height:1.5;letter-spacing:.04em}
 .base-scene .photo-paper .base-idle-photo figcaption{bottom:-34px!important}
 .base-scene#red .collage-stage{padding-bottom:85px}
 .base-scene#red .card-two{top:16%}
 .lightbox,.lightbox[data-photo-shape="portrait"]{width:calc(100% - 24px);max-height:calc(100svh - 24px);border-radius:16px}
 .photo-modal-card{padding:12px;gap:10px}
 .photo-modal-heading{padding-left:2px;gap:10px}
 .photo-modal-heading h2{font-size:18px}
 .lightbox .lightbox-figure{max-height:min(60svh,560px);border-radius:8px}
 .photo-modal-footer{gap:8px;padding:0 2px}
 .photo-modal-footer #lightbox-caption{font-size:12px;letter-spacing:.02em}
}
@media(max-height:520px){
 .lightbox{width:min(720px,calc(100% - 24px));max-height:calc(100svh - 20px);border-radius:12px}
 .lightbox[data-photo-shape="portrait"]{width:min(420px,calc(100% - 24px))}
 .photo-modal-card{padding:8px 12px;gap:6px}
 .lightbox .lightbox-figure{height:auto;max-height:calc(100svh - 142px)}
 .photo-modal-heading h2{font-size:17px}
 .photo-modal-footer #lightbox-caption{font-size:12px}
}
@media(max-width:360px){.paper-scene .names-type h2{font-size:11px}.paper-scene .memory-controls{font-size:10px}}
@media(prefers-reduced-motion:reduce){.lightbox[open]{animation:none}.lightbox button,.lightbox .lightbox-figure img{transition:none}}
.reduced-motion .lightbox[open]{animation:none}
