/* ---------- scrapbook view (rendered by scrapbook.js) ---------- */
#scrapbook{ position:relative; z-index:1; }
.sb-wrap{ padding:4px 14px 40px; }

/* ransom-note title */
.sb-title{
  margin:22px 0 6px;
  text-align:center;
  font-size:clamp(2.3rem, 10.5vw, 3.9rem);
  line-height:1.35;
  font-weight:400;
}
.rnword{ white-space:nowrap; display:inline-block; }
.rnw{ display:inline-block; margin:0 .02em; filter:drop-shadow(0 .05em .04em rgba(60,30,20,.38)); }
.rn{ display:inline-block; padding:.04em .17em .07em; line-height:1.05; font-size:1em; }
.rn-sp{ display:inline-block; width:.3em; }

.sb-book{
  display:grid;
  grid-template-columns:minmax(0, 1fr);
  justify-items:center;
  gap:42px;
  padding:20px 0 24px;
}
@media (min-width:1000px){
  .sb-book{ grid-template-columns:repeat(2, minmax(0, 520px)); justify-content:center; gap:52px 46px; }
}

/* one page */
.sb-page{
  position:relative;
  width:100%;
  max-width:520px;
  aspect-ratio:3/4;
  container-type:inline-size;
  overflow:hidden;
  isolation:isolate;
  border-radius:6px;
  background:#e9dcc3;
  box-shadow:0 22px 34px -16px rgba(80,40,30,.62), 0 2px 7px rgba(80,40,30,.32);
}
.pg-bg{ position:absolute; inset:0; z-index:0; }

/* stickers and pasted bits */
.sk{ position:absolute; container-type:inline-size; filter:drop-shadow(0 .5cqw .7cqw rgba(50,25,15,.32)); pointer-events:none; }
.sk svg{ display:block; width:100%; height:auto; overflow:visible; }
.sk-patch{ container-type:normal; }
.die{
  filter:
    drop-shadow(.5cqw 0 0 #fff) drop-shadow(-.5cqw 0 0 #fff)
    drop-shadow(0 .5cqw 0 #fff) drop-shadow(0 -.5cqw 0 #fff)
    drop-shadow(0 .8cqw .9cqw rgba(50,25,15,.38));
}
.dsh{ width:100%; height:auto; display:block; }

/* gingham scraps */
.pa{ width:100%; height:100%; }
.pa-gingham, .rd-gingham{
  background-color:#f7efe3;
  background-image:linear-gradient(90deg, rgba(178,38,48,.52) 50%, transparent 50%), linear-gradient(rgba(178,38,48,.52) 50%, transparent 50%);
  background-size:6cqw 6cqw;
}
.pa-kraft{ background:#d3b283; }

/* kraft page */
.kr-dash{ position:absolute; inset:2.6cqw; border:.5cqw dashed rgba(45,30,20,.55); border-radius:1.2cqw; }

/* newspaper page */
.nw-mast{ position:absolute; left:4cqw; top:2.6cqw; width:66cqw; color:#2a2218; z-index:1; }
.nw-mast b{ display:block; font:700 9.4cqw/1 'UnifrakturCook', 'Old English Text MT', serif; }
.nw-mast span{ display:block; margin-top:1.4cqw; padding-top:1cqw; border-top:.5cqw solid #2a2218; font:3cqw 'Special Elite', monospace; letter-spacing:.14em; }
.nw-sheet{
  position:absolute; left:4.5%; right:4.5%; top:17%; bottom:5%;
  background:
    radial-gradient(circle, rgba(140,120,95,.22) .7px, transparent 1.1px) 0 0/6px 6px,
    #fbf8f1;
  filter:drop-shadow(0 .6cqw 1cqw rgba(50,30,15,.3));
}

/* patchwork page */
.mp-grid{ position:absolute; inset:0; display:grid; grid-template-columns:34fr 34fr 32fr; grid-template-rows:repeat(4, 1fr); }
.mp{ display:block; box-shadow:inset 0 0 0 .3cqw rgba(255,255,255,.55); }
.mp0{ grid-area:1/1 } .mp1{ grid-area:1/2/2/4 } .mp2{ grid-area:2/1 } .mp3{ grid-area:2/2 } .mp4{ grid-area:2/3 }
.mp5{ grid-area:3/1 } .mp6{ grid-area:3/2/4/4 } .mp7{ grid-area:4/1 } .mp8{ grid-area:4/2 } .mp9{ grid-area:4/3 }

/* red hearts page */
.rd-gingham{ position:absolute; right:-5%; top:-3%; width:34%; height:26%; transform:rotate(8deg); }

/* page label */
.pg-label{
  position:absolute; z-index:9;
  background:rgba(255,252,243,.92);
  padding:1cqw 2.8cqw 1.2cqw;
  font:3.2cqw 'Special Elite', monospace;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#4b3a30;
  box-shadow:0 .4cqw .9cqw rgba(60,30,20,.25);
  pointer-events:none;
}

/* ---------- text and paper stickers (sizes relative to the sticker) ---------- */
.tk{
  position:relative; aspect-ratio:2.15/1;
  background:#efbdc3; color:#7a3140;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; padding:0 13cqw 0 7cqw;
  -webkit-mask:radial-gradient(circle 4.6cqw at 0 50%, #0000 97%, #000), radial-gradient(circle 4.6cqw at 100% 50%, #0000 97%, #000);
  -webkit-mask-composite:source-in;
  mask:radial-gradient(circle 4.6cqw at 0 50%, #0000 97%, #000), radial-gradient(circle 4.6cqw at 100% 50%, #0000 97%, #000);
  mask-composite:intersect;
}
.tk::before{ content:""; position:absolute; inset:4.5cqw 11cqw 4.5cqw 5cqw; border:.7cqw dashed rgba(122,49,64,.4); }
.tk-a{ font:7cqw 'Special Elite', monospace; letter-spacing:.14em; position:relative; }
.tk-b{ font:700 12.5cqw/1.1 Georgia, serif; letter-spacing:.05em; position:relative; }
.tk-n{ position:absolute; right:4.5cqw; top:0; bottom:0; display:flex; align-items:center; writing-mode:vertical-rl; font:normal 6.4cqw 'Special Elite', monospace; letter-spacing:.1em; }

.pt{
  aspect-ratio:2/1; text-align:center; color:#8e2b36;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  background:linear-gradient(#f4f2ee, #d9d6d0);
  border-radius:5cqw;
  box-shadow:inset 0 0 0 1.4cqw #c9c6c0, inset 0 0 0 1.9cqw #f9f7f3, inset 0 0 0 2.4cqw #a9a69f;
}
.pt small{ display:block; font:6.6cqw/1.2 Georgia, serif; letter-spacing:.22em; font-weight:700; }
.pt b{ display:block; font:400 19cqw/1 Impact, 'Arial Narrow', sans-serif; letter-spacing:.05em; }

.dc{ background:#f6f0e4; padding:6cqw 7cqw 7cqw; font:7.4cqw/1.25 Georgia, serif; color:#2a2623; }
.dc b{ font-size:1.3em; font-weight:700; }
.dc i{ font-size:.85em; }

.pi{ background:#fbfaf7; border:1cqw solid #1a1a1a; border-radius:60cqw / 45cqw; text-align:center; font:700 27cqw/1 Georgia, serif; padding:6cqw 8cqw 8cqw; color:#161616; }

.bb{ position:relative; background:#fbf8f2; border:.9cqw solid #6b605a; border-radius:50%; padding:13cqw 8cqw; text-align:center; font:italic 700 16cqw/1 Georgia, serif; color:#3a2f2b; }
.bb::after{ content:""; position:absolute; left:22%; bottom:-5cqw; width:11cqw; height:11cqw; background:#fbf8f2; border-right:.9cqw solid #6b605a; border-bottom:.9cqw solid #6b605a; transform:rotate(45deg) skew(8deg, 8deg); }

.sn{ background:#f6f0e4; padding:3cqw 7cqw 3.4cqw; font:italic 12.5cqw/1.1 Georgia, serif; color:#3a2f2b; text-align:center; white-space:nowrap; }
.nt{ background:#f7e27a; padding:10cqw 8cqw; font:15cqw/1.1 'Caveat', cursive; color:#4a3a20; }
.hd{ font-family:'Nothing You Could Do', cursive; font-size:19cqw; line-height:1.12; white-space:nowrap; }

/* ---------- photo slots ---------- */
.sl{
  position:absolute;
  transform:rotate(var(--rot, 0deg));
  transition:transform .28s cubic-bezier(.34, 1.56, .64, 1);
  cursor:pointer;
  outline:none;
  filter:drop-shadow(0 1cqw 1.3cqw rgba(50,25,15,.4));
  -webkit-tap-highlight-color:transparent;
}
.sl:hover, .sl:focus-visible{ transform:rotate(0deg) scale(1.04); z-index:20 !important; }
.sl:focus-visible{ filter:drop-shadow(0 0 .8cqw #d9707c) drop-shadow(0 1cqw 1.3cqw rgba(50,25,15,.4)); }

.sl-frame{ position:relative; }
.sl-ph{ position:relative; display:block; aspect-ratio:var(--ar); overflow:hidden; background:#e8dccb; }
.sl-ph img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:0; transition:opacity .5s ease; }
.sl-ph img[src]{ opacity:1; }
.sl .ph{
  position:absolute; inset:0;
  background:linear-gradient(110deg, #eadfce 30%, #f6eee1 50%, #eadfce 70%) 0 0/220% 100%;
  animation:sbShimmer 1.7s linear infinite;
  display:flex; align-items:center; justify-content:center;
  font:3cqw 'Nunito', sans-serif; color:#a08c78;
}
@keyframes sbShimmer{ to{ background-position:-220% 0; } }
@media (prefers-reduced-motion:reduce){ .sl .ph{ animation:none; } }

.sl-print .sl-frame{ background:#fffdf8; padding:2.4cqw; }
.sl-polaroid .sl-frame{ background:#fbf7ee; padding:3cqw 3cqw 0; }
.sl-strip{ height:11cqw; display:flex; align-items:center; justify-content:center; text-align:center; overflow:hidden; font:5cqw/1 'Caveat', cursive; color:#4a3a36; padding:0 1cqw; }
.sl-strip span{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.sl-torn .sl-frame{ background:#fffdf8; padding:1.8cqw; clip-path:var(--tclip); }
.sl-cutout .sl-frame{ background:#fff; padding:1.4cqw; border:2.8cqw solid #c32a22; border-radius:3.6cqw; }
.sl-cutout .sl-ph{ border-radius:1cqw; }
.sl-oval .sl-frame{
  padding:2.6cqw; border-radius:50%;
  background:linear-gradient(135deg, #f5e2a2, #b88a2b 38%, #f7e6ae 58%, #86601b);
  box-shadow:inset 0 0 0 .5cqw rgba(80,50,10,.6), inset 0 0 0 1.5cqw rgba(255,240,190,.5);
}
.sl-oval .sl-ph{ border-radius:50%; box-shadow:0 0 0 .5cqw rgba(60,35,8,.55); }
.sl-arch .sl-frame{ background:#fffdf8; padding:2.4cqw; border-radius:999px 999px 1cqw 1cqw; }
.sl-arch .sl-ph{ border-radius:999px 999px 1px 1px; }
.sl-heart .sl-frame{ aspect-ratio:1; background:#fffdf8; clip-path:url(#sbHeart); }
.sl-heart .sl-ph{ position:absolute; inset:5% 5.5% 6.5%; aspect-ratio:auto; clip-path:url(#sbHeart); }

.sl-lab{
  position:absolute; left:-3%; bottom:-3.6cqw; z-index:3;
  max-width:92%;
  display:flex; flex-direction:column; gap:0;
  background:#fffbe9; padding:.7cqw 2cqw 1cqw;
  transform:rotate(-3deg);
  box-shadow:0 .3cqw .7cqw rgba(0,0,0,.24);
}
.sl-lab small{ font:2.5cqw/1.2 'Special Elite', monospace; letter-spacing:.07em; color:#6a5646; white-space:nowrap; }
.sl-lab em{
  font:normal 4.4cqw/1 'Caveat', cursive; color:#3b2a22;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.sl-heart .sl-lab{ left:18%; bottom:-.5cqw; }
.sl-love{ position:absolute; right:-2.4cqw; top:-2.4cqw; width:7.5cqw; z-index:4; transform:rotate(12deg); filter:drop-shadow(0 .4cqw .5cqw rgba(60,20,20,.35)); }
.sl-love svg{ display:block; width:100%; height:auto; }

/* washi tape */
.tp{
  position:absolute; z-index:3; width:32%; height:5.8cqw; opacity:.95;
  box-shadow:0 .3cqw .6cqw rgba(0,0,0,.18);
  clip-path:polygon(0 0, 100% 0, 98% 25%, 100% 50%, 98% 75%, 100% 100%, 0 100%, 2% 75%, 0 50%, 2% 25%);
}
.tp-top{ top:-2.8cqw; left:34%; transform:rotate(-3deg); }
.tp-tl{ top:-.8cqw; left:-6cqw; width:22%; transform:rotate(-38deg); }
.tpc-gingham{ background-color:rgba(251,203,215,.94); background-image:linear-gradient(0deg, rgba(232,110,144,.42) 50%, transparent 50%), linear-gradient(90deg, rgba(232,110,144,.42) 50%, transparent 50%); background-size:1.6cqw 1.6cqw; }
.tpc-kraft{ background:rgba(212,184,140,.95); }
.tpc-blue{ background:repeating-linear-gradient(90deg, rgba(150,186,222,.92) 0 .9cqw, rgba(236,244,251,.92) .9cqw 1.8cqw); }
.tpc-yellow{ background:rgba(247,214,120,.93); }

/* the next empty spot on the newest page */
.sl-empty{ cursor:default; pointer-events:none; filter:none; transform:rotate(var(--rot, 0deg)); }
.sl-empty .sl-frame{ background:none !important; padding:0 !important; border:0 !important; box-shadow:none !important; clip-path:none !important; border-radius:0 !important; aspect-ratio:auto; }
.sl-empty .sl-ph{
  position:relative; inset:auto; clip-path:none; border-radius:2cqw !important; box-shadow:none;
  background:rgba(255,255,255,.28); border:.55cqw dashed rgba(60,40,30,.5);
  display:flex; align-items:center; justify-content:center; text-align:center; padding:2cqw;
  font:5.6cqw/1.1 'Nothing You Could Do', cursive; color:rgba(60,40,30,.78);
}

/* ---------- scrapbook viewer and uploader ---------- */
.sv-stage{ width:min(90vw, 460px); }
.sv-card{
  margin:0; background:#fffdf8; padding:3.2% 3.2% 0;
  box-shadow:0 22px 40px -14px rgba(30,10,10,.7);
  transform:rotate(-1deg);
}
.sv-ph{ background:#e8dccb; }
.sv-ph img{ display:block; width:100%; max-height:calc(100vh - 250px); object-fit:contain; background:#efe6d8; }
.sv-card figcaption{ display:flex; flex-direction:column; gap:2px; padding:12px 6px 14px; text-align:center; min-height:20px; }
.sv-card small{ font:12px 'Special Elite', monospace; letter-spacing:.08em; color:#8a7566; text-transform:uppercase; }
.sv-card span{ font:26px/1.1 'Caveat', cursive; color:#3b2a22; }
.sv-card span:empty{ display:none; }

.sb-previews{ display:flex; gap:8px; flex-wrap:wrap; }
.sb-previews:empty{ display:none; }
.sb-previews img{ width:64px; height:64px; object-fit:cover; border:3px solid #fffdf8; box-shadow:0 2px 6px rgba(60,30,20,.35); transform:rotate(-2deg); }
.sb-previews img:nth-child(even){ transform:rotate(2deg); }
