/* A repeating paper wash and an independently anchored bottom grow with the page.
   The mirrored texture meets itself at every edge; scenery is never stretched. */
body.notebook-body, body.scrapbook-landing {
 position:relative;isolation:isolate;min-height:100svh;
 background:#fbf5eb url('/assets/book-backdrops/faded-warm-wash-v4.svg') top center / 1400px 1400px repeat;
 padding-bottom:clamp(80px,12vw,170px);
}
body.notebook-body::before, body.scrapbook-landing::before {
 content:"";position:absolute;z-index:-1;pointer-events:none;inset:0 0 auto;height:620px;
 background:radial-gradient(ellipse at 6% 4%,#badcf15c,transparent 60%),radial-gradient(ellipse at 95% 12%,#d7e6ef45,transparent 60%);
}
body.notebook-body::after, body.scrapbook-landing::after {
 content:"";position:absolute;z-index:-1;pointer-events:none;inset:auto 0 0;
 height:min(33.334vw,640px);
 background:var(--book-backdrop-bottom) center bottom / min(100%,1920px) auto no-repeat;
}
body.notebook-body {--book-backdrop-bottom:url('/assets/book-backdrops/la-panorama-v4-lossless.webp');}
body.scrapbook-landing {--book-backdrop-bottom:url('/assets/book-backdrops/la-panorama-v4-lossless.webp');}
body.notebook-body .hf-masthead-shell, body.scrapbook-landing .hf-masthead-shell {background:transparent;}
@media(max-width:660px) {
 body.notebook-body, body.scrapbook-landing {background-size:900px 900px;padding-bottom:80px;}
 body.notebook-body::before, body.scrapbook-landing::before {height:350px;}
}

/* Paint the full iPhone canvas while keeping the books and menu in the safe area. */
html:has(> body.notebook-body), html:has(> body.scrapbook-landing) {
 min-height:100%;
 background:#fbf5eb url('/assets/book-backdrops/faded-warm-wash-v4.svg') top center / 1400px 1400px repeat;
}
body.notebook-body, body.scrapbook-landing {
 box-sizing:border-box;
 padding-top:env(safe-area-inset-top,0px);
 padding-bottom:calc(clamp(80px,12vw,170px) + env(safe-area-inset-bottom,0px));
}
body.notebook-body .hf-masthead-shell, body.scrapbook-landing .hf-masthead-shell {
 box-sizing:border-box;
 padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px);
}
@media(min-width:661px) {
 .notebook-stage .notebook-directory.illustrated-cover,
 .notebook-stage .book-spread,
 .notebook-stage .book-spread:has(.practical-guide:not([hidden])) {
  width:min(var(--notebook-frame-max),calc(100% - max(14px,env(safe-area-inset-left,0px)) - max(14px,env(safe-area-inset-right,0px))));
 }
}
@media(min-width:701px) {
 .scrapbook-landing .hf-album-library {
  width:calc(100% - max(12px,env(safe-area-inset-left,0px)) - max(12px,env(safe-area-inset-right,0px)));
 }
}
@media(max-width:660px) {
 html:has(> body.notebook-body), html:has(> body.scrapbook-landing) {background-size:900px 900px;}
 body.notebook-body, body.scrapbook-landing {padding-bottom:calc(80px + env(safe-area-inset-bottom,0px));}
}

/* Original sunlit city artwork fades into a continuously repeating warm wash. */
body.notebook-body::before, body.scrapbook-landing::before {
 height:min(66.667vw,1280px);
 background:url('/assets/book-backdrops/faded-urban-surround-v4-lossless.webp') center top / min(100%,1920px) auto no-repeat;
}

/* Reserve the complete panorama below the content. The upper surround ends
   before that zone, even when a directory or filtered album is very short. */
body.notebook-body, body.scrapbook-landing {
 --la-panorama-height:min(33.334vw,640px);
 padding-bottom:calc(min(18vw,346px) + 12px + env(safe-area-inset-bottom,0px));
}
body.notebook-body::before, body.scrapbook-landing::before {
 height:max(0px,min(66.667vw,1280px,calc(100% - var(--la-panorama-height) - 150px)));
 -webkit-mask-image:linear-gradient(#000 65%,transparent);
 mask-image:linear-gradient(#000 65%,transparent);
}
body.notebook-body::after, body.scrapbook-landing::after {
 height:var(--la-panorama-height);
 opacity:.68;
 background-size:100% auto;
}

/* Phone headers see continuous sky rather than the desktop book's open center. */
@media(max-width:660px) {
 body.notebook-body::before, body.scrapbook-landing::before {
  background-size:1100px auto;background-position:center top;
 }
}
