:root {
  --bg: #e7e7ee;
  --bg-2: #dfe0ea;
  --ui: #5d5d68;
  --ui-soft: #9a9aa8;
  --accent: #4a62de;
  --paper: #f7f2e7;
  --ink: #2b2622;
  --ui-font: 'Jost', 'Futura', system-ui, sans-serif;
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .42  0 0 0 0 .37  0 0 0 0 .3  0 0 0 .11 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --mottle: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='600'><filter id='m'><feTurbulence type='fractalNoise' baseFrequency='.008' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .55  0 0 0 0 .47  0 0 0 0 .33  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23m)'/></svg>");
  --chrome: 210px;
}
body.editing { --chrome: 330px; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(ellipse at 50% 40%, #eeeef4 0%, var(--bg) 55%, var(--bg-2) 100%);
  color: var(--ui);
  font-family: var(--ui-font);
  font-weight: 300;
  overflow-x: hidden;
  min-height: 100svh;
}
button, input, select, textarea { font: inherit; color: inherit; }

.read-only .write-only, body:not(.editing) .edit-only { display: none !important; }

/* ---------- header ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 2.5vw, 28px);
}
.name { color: var(--ui); text-decoration: none; letter-spacing: .06em; font-size: 15px; }
.top nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.top nav button {
  background: none; border: 0; padding: 6px 10px; border-radius: 99px;
  letter-spacing: .06em; font-size: 14px; cursor: pointer; color: var(--ui);
}
.top nav button:hover { background: rgba(255,255,255,.55); }
#edit { font-weight: 400; }
.editing #edit { background: var(--accent); color: #fff; }

/* ---------- hero (after matthewyu.dev) ---------- */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 64px 0 calc(var(--chrome) - 150px);
  position: relative;
}
.kicker {
  margin: 0 16px 10px; text-align: center; max-width: 720px;
  font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--ui-soft);
  line-height: 1.7;
}
.hero-title {
  position: absolute; left: 0; right: 0; top: calc(50% - 30vh + 10px); margin: 0;
  text-align: center; pointer-events: none; user-select: none;
  font-family: var(--ui-font); font-weight: 400; letter-spacing: .01em;
  font-size: clamp(64px, 13vw, 190px); line-height: 1;
  color: var(--accent); opacity: .72; filter: blur(9px);
}
.editing .hero-title { opacity: .35; }
.stage {
  position: relative; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: clamp(4px, 3vw, 60px);
}
.arrow {
  background: none; border: 0; color: #3d3d48; cursor: pointer; padding: 12px 8px;
  transition: opacity .2s, transform .2s;
}
.arrow:hover { transform: scale(1.08); }
.arrow:disabled { opacity: .15; cursor: default; transform: none; }
.caption {
  margin: 26px 16px 0; min-height: 1.5em; text-align: center;
  font-size: 12px; letter-spacing: .26em; text-transform: uppercase; color: var(--ui);
}

/* ---------- the book ---------- */
.book {
  --w: min(84vw, 1040px, calc((100svh - var(--chrome)) * 1.43));
  width: var(--w); aspect-ratio: 1.43;
  position: relative; z-index: 2;
  user-select: none; -webkit-user-select: none;
  touch-action: pan-y;
  container-type: inline-size; /* cqw below = % of the open spread's width */
  --r: 2.3cqw;                 /* rounded page corners */
  --board: #1c2a4c;            /* the cover board seen around the pages */
}
.book.muji { --board: #b08d62;
}
@media (max-width: 640px) { .book { --w: min(88vw, calc((100svh - var(--chrome)) * 1.43)); } .stage { gap: 0; } .arrow { padding: 8px 2px; } }
.book-inner {
  position: absolute; inset: 0;
  perspective: 2800px;
  transition: transform .9s cubic-bezier(.645,.045,.355,1);
}
.closed-front .book-inner { transform: translateX(-25%); }
.closed-back .book-inner { transform: translateX(25%); }

/* the navy cover board, framing the open pages */
.book-inner::before, .book-inner::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 50%;
  background: var(--board);
  box-shadow: 0 0 0 .75cqw var(--board), 0 2.4cqw 3.4cqw -1.4cqw rgba(30,30,70,.5);
  transition: opacity .3s ease .6s, box-shadow .3s ease .6s;
}
.book-inner::before { left: 0; border-radius: var(--r) 0 0 var(--r); }
.book-inner::after { right: 0; border-radius: 0 var(--r) var(--r) 0; }
.closed-front .book-inner::before, .closed-back .book-inner::after { opacity: 0; transition-delay: 0s; }
/* closed: the cover is the board itself */
.closed-front .book-inner::after, .closed-back .book-inner::before { box-shadow: 0 2.4cqw 3.4cqw -1.4cqw rgba(30,30,70,.5); }

.leaf {
  position: absolute; top: 0; left: 50%; width: 50%; height: 100%;
  transform-origin: left center; transform-style: preserve-3d;
}
/* paper pages: stay hinged at the spine the whole way; the free edge curls a little
   (skewY is anchored at the binding, so that edge never moves), quick peel, soft landing.
   One linear timeline; the easing lives in where the angles fall. */
.leaf.flipping.fwd { animation: page-fwd .9s linear both; }
.leaf.flipping.bwd { animation: page-bwd .9s linear both; }
@keyframes page-fwd {
  0%   { transform: rotateY(0deg)    skewY(0deg); }
  12%  { transform: rotateY(-12deg)  skewY(-1.5deg); }
  30%  { transform: rotateY(-50deg)  skewY(-3deg); }
  50%  { transform: rotateY(-96deg)  skewY(-3.5deg); }
  70%  { transform: rotateY(-150deg) skewY(-2deg); }
  86%  { transform: rotateY(-172deg) skewY(-.6deg); }
  100% { transform: rotateY(-180deg) skewY(0deg); }
}
@keyframes page-bwd {
  0%   { transform: rotateY(-180deg) skewY(0deg); }
  12%  { transform: rotateY(-168deg) skewY(-1.5deg); }
  30%  { transform: rotateY(-130deg) skewY(-3deg); }
  50%  { transform: rotateY(-84deg)  skewY(-3.5deg); }
  70%  { transform: rotateY(-30deg)  skewY(-2deg); }
  86%  { transform: rotateY(-8deg)   skewY(-.6deg); }
  100% { transform: rotateY(0deg)    skewY(0deg); }
}
/* covers are board: a firmer, even swing */
.leaf.board.flipping.fwd { animation: board-fwd .95s cubic-bezier(.45,.05,.3,1) both; }
.leaf.board.flipping.bwd { animation: board-bwd .95s cubic-bezier(.45,.05,.3,1) both; }
@keyframes board-fwd { from { transform: rotateY(0); } to { transform: rotateY(-180deg); } }
@keyframes board-bwd { from { transform: rotateY(-180deg); } to { transform: rotateY(0); } }
.leaf.flipped { transform: rotateY(-180deg); }
.face {
  position: absolute; inset: 0; overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--paper);
}
.face.front { border-radius: 0 var(--r) var(--r) 0; }
.face.back { transform: rotateY(180deg); border-radius: var(--r) 0 0 var(--r); }
/* gutter shading */
.face::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 20;
}
/* thick paper: dips into the gutter, catches light along its outer edge */
.face.front::after { background: linear-gradient(to right, rgba(60,45,20,.3), rgba(60,45,20,.1) 2.5%, rgba(60,45,20,.03) 8%, transparent 14%); }
.face.back::after { background: linear-gradient(to left, rgba(60,45,20,.3), rgba(60,45,20,.1) 2.5%, rgba(60,45,20,.03) 8%, transparent 14%); }
/* covers: a solid board with a bevelled edge and a hinge groove by the spine */
.face.is-cover-face::after { background: none; box-shadow: inset -.5cqw -.5cqw 1cqw rgba(0,0,0,.2), inset .35cqw .35cqw .7cqw rgba(255,255,255,.18); }
/* light sweeping across the page as it turns */
.face::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 21; opacity: 0;
  background: linear-gradient(to left, rgba(20,20,40,.28), transparent 55%);
}
.face.back::before { background: linear-gradient(to right, rgba(255,255,255,.35), transparent 60%); }
.leaf.flipping .face::before { animation: sweep .9s ease-in-out; }
.leaf.flipping .face-content { animation: mblur .9s ease-in-out; }
@keyframes sweep { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
@keyframes mblur { 0%, 100% { filter: none; } 40%, 55% { filter: blur(.8px); } }

.face-content {
  position: absolute; inset: 0; container-type: size;
  background-color: var(--paper);
  background-image: var(--noise), var(--mottle);
  overflow: hidden;
}

/* papers */
.paper-white { --paper: #fbfaf6; }
.paper-kraft { --paper: #d9c3a0; }
.paper-grid { background-image: var(--noise), linear-gradient(rgba(90,120,170,.16) 1px, transparent 1px), linear-gradient(90deg, rgba(90,120,170,.16) 1px, transparent 1px); background-size: auto, 2.5cqw 2.5cqw, 2.5cqw 2.5cqw; }
.paper-dots { background-image: var(--noise), radial-gradient(rgba(80,70,60,.28) .45px, transparent .8px); background-size: auto, 2.5cqw 2.5cqw; }
.paper-lined { background-image: var(--noise), linear-gradient(transparent calc(3cqw - 1px), rgba(90,120,170,.22) 0); background-size: auto, 100% 3cqw; }

/* covers */
.is-cover { --paper: #e3d9c6; background-image: var(--noise), repeating-linear-gradient(0deg, rgba(0,0,0,.025) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(0,0,0,.025) 0 1px, transparent 1px 3px), var(--mottle); }
.paper-cover-navy { --paper: #2e3a58; color: #e9e1cf; }
/* muji: plain kraft board with fibres and specks */
.paper-cover-muji { --paper: #d8b68c; background-image:
    var(--noise),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='k'><feTurbulence type='fractalNoise' baseFrequency='.04 .9' numOctaves='2' seed='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .3  0 0 0 0 .15  0 0 0 .045 0'/></filter><rect width='100%' height='100%' filter='url(%23k)'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='s'><feTurbulence type='fractalNoise' baseFrequency='1.6' numOctaves='1' seed='9' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .2  0 0 0 0 .1  0 0 0 14 -9.9'/></filter><rect width='100%' height='100%' filter='url(%23s)'/></svg>"),
    var(--mottle); }
.muji-title { position: absolute; left: 22%; top: 12%; z-index: 2; font-family: var(--ui-font); font-weight: 400; font-size: 6.2cqw; letter-spacing: .32em; text-transform: uppercase; color: #3d2c1e; }
.muji-sign { position: absolute; left: 22%; top: 21%; width: 26%; z-index: 2; opacity: .9; }
/* xoxo: powder-blue gingham with double navy pinstripes */
.paper-cover-xoxo { --paper: #f3f1ea; background-image: var(--noise),
    repeating-linear-gradient(90deg, transparent 0 8.2cqw, #1c2a4c 8.2cqw 8.55cqw, transparent 8.55cqw 9.15cqw, #1c2a4c 9.15cqw 9.5cqw, transparent 9.5cqw 10cqw),
    repeating-linear-gradient(0deg, transparent 0 8.2cqw, #1c2a4c 8.2cqw 8.55cqw, transparent 8.55cqw 9.15cqw, #1c2a4c 9.15cqw 9.5cqw, transparent 9.5cqw 10cqw),
    repeating-linear-gradient(90deg, rgba(110,150,214,.5) 0 2.5cqw, transparent 2.5cqw 5cqw),
    repeating-linear-gradient(0deg, rgba(110,150,214,.5) 0 2.5cqw, transparent 2.5cqw 5cqw); }
.cover-hinge { position: absolute; top: 0; bottom: 0; z-index: 1; pointer-events: none; }
.cover-front .cover-hinge { left: 0; width: 10%; background: linear-gradient(90deg, rgba(0,0,0,.26), rgba(0,0,0,.05) 74%, rgba(0,0,0,.2) 76%, rgba(255,255,255,.12) 84%, transparent); }
.cover-back .cover-hinge { right: 0; width: 10%; background: linear-gradient(270deg, rgba(0,0,0,.26), rgba(0,0,0,.05) 74%, rgba(0,0,0,.2) 76%, rgba(255,255,255,.12) 84%, transparent); }
.xo-plate {
  position: absolute; left: 20%; right: 12%; top: 30%; padding: 6cqw 5cqw 5cqw; text-align: center; z-index: 2; color: #22386e;
  background: #fbf8f0 var(--noise); border-radius: 50% / 38%;
  box-shadow: 0 .6cqw 1.6cqw rgba(30,40,80,.25), inset 0 0 0 1cqw #fbf8f0, inset 0 0 0 1.25cqw #2b4580;
}
.xo-title { font-family: 'Playfair Display', serif; font-weight: 500; font-size: 8.5cqw; letter-spacing: .14em; line-height: 1.1; text-transform: uppercase; }
.xo-sign { width: 46%; margin: 1.4cqw auto 0; }
.xo-star { position: absolute; z-index: 3; height: auto; aspect-ratio: 1; }
.paper-cover-sage { --paper: #9aa88c; }
.paper-cover-rose { --paper: #d7aaa2; }
.paper-cover-kraft { --paper: #b99468; }
.cover-front, .cover-back { position: absolute; inset: 0; }
.cover-label {
  position: absolute; left: 14%; right: 16%; top: 22%;
  background: #fbf7ee; color: var(--ink);
  padding: 7cqw 8cqw 6cqw; border-radius: 1.5cqw;
  box-shadow: 0 .3cqw .8cqw rgba(0,0,0,.12), inset 0 0 0 .4cqw #fbf7ee, inset 0 0 0 .6cqw rgba(43,38,34,.55);
}
.cover-title { width: 100%; }
.cover-rule { height: 1px; background: rgba(43,38,34,.35); margin: 3cqw 0 3.5cqw; }
.cover-tag { margin: 0; font-size: 2.6cqw; letter-spacing: .2em; line-height: 1.8; text-transform: uppercase; color: #6f6860; }
.cover-band { position: absolute; top: 0; bottom: 0; right: 9%; width: 3.2%; background: linear-gradient(90deg, #1f1c1a, #3a3431 50%, #1f1c1a); box-shadow: 0 0 1cqw rgba(0,0,0,.35); }
.cover-fin { position: absolute; left: 50%; bottom: 14%; width: 22%; transform: translateX(-50%); opacity: .6; }
.paper-cover-navy .cover-fin { color: #e9e1cf; }

/* ---------- things on pages ---------- */
.item { position: absolute; transform-origin: 50% 50%; line-height: 0; }
.item svg.hw { display: block; }
.item-note { z-index: 1; }

.f-bleed { mix-blend-mode: multiply; }
.ph { position: relative; }
.ph-img { position: relative; width: 100%; overflow: hidden; }
.ph-img img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.frame-bleed .ph-img { overflow: visible; }
.frame-taped, .frame-plain, .frame-polaroid {
  box-shadow: 0 .15cqw .3cqw rgba(0,0,0,.18), 0 1.4cqw 2.6cqw -1.2cqw rgba(40,30,10,.35);
}
.frame-taped .ph-img::after, .frame-plain .ph-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(255,255,255,.14), transparent 40%, rgba(0,0,0,.05));
}
.frame-polaroid { background: #fbfaf5; padding: 5% 5% 18%; }
.ph.busy .ph-img {
  background: linear-gradient(100deg, rgba(0,0,0,.04) 20%, rgba(74,98,222,.12) 50%, rgba(0,0,0,.04) 80%) 0 0 / 200% 100%;
  animation: shimmer 1.3s linear infinite; border-radius: 1cqw;
}
.busy-lbl { position: absolute; inset: 0; display: grid; place-items: center; font-family: 'Reenie Beanie', cursive; font-size: 7cqw; line-height: 1; color: var(--ink); opacity: .6; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* washi / clear tape */
.tape {
  position: absolute; z-index: 3; aspect-ratio: 3.6 / 1;
  background: var(--tc);
  mix-blend-mode: multiply;
  clip-path: polygon(0 4%, 3% 14%, 1% 26%, 3.5% 38%, .5% 52%, 3% 64%, 1% 78%, 3.5% 90%, 1% 100%, 99% 97%, 97% 86%, 99.5% 72%, 97% 60%, 99% 47%, 96.5% 34%, 99% 21%, 97% 9%, 100% 0);
  background-image: linear-gradient(rgba(255,255,255,.25), transparent 30%, transparent 70%, rgba(0,0,0,.04)), repeating-linear-gradient(90deg, transparent 0 7px, rgba(255,255,255,.08) 7px 8px);
}
.tape-clear { --tc: rgba(236, 232, 216, .5); mix-blend-mode: normal; background-color: rgba(255,255,255,.28); backdrop-filter: brightness(1.04) saturate(.9); }
.tape-cream { --tc: rgba(240, 225, 185, .72); }
.tape-pink { --tc: rgba(240, 170, 180, .66); }
.tape-blue { --tc: rgba(150, 185, 230, .66); }
.tape-mint { --tc: rgba(160, 215, 190, .66); }
.tape-yellow { --tc: rgba(245, 215, 110, .66); }

.stamp-svg { width: 100%; display: block; }
.item-stamp { mix-blend-mode: multiply; }
.stamp-date { width: 62%; margin: 10% 0 0 4%; }

/* ---------- editing ---------- */
.editing .item { cursor: grab; }
.editing .item:active { cursor: grabbing; }
.editing .item:hover { outline: 1px dashed rgba(74,98,222,.55); outline-offset: 3px; }
.editing .item.selected { outline: 1.5px solid var(--accent); outline-offset: 3px; z-index: 30; }
.h { display: none; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 1.5px solid var(--accent); z-index: 40; line-height: normal; }
.selected .h { display: block; }
.h-size { right: -10px; bottom: -10px; cursor: nwse-resize; }
.h-rot { left: 50%; top: -30px; margin-left: -7px; cursor: grab; }
.h-rot::after { content: ''; position: absolute; left: 5px; top: 12px; width: 1.5px; height: 14px; background: var(--accent); }
.editing .face-content.active { box-shadow: inset 0 0 0 2px rgba(74,98,222,.35); }
.empty-hint {
  position: absolute; inset: 30% 15%; display: grid; place-items: center; text-align: center;
  border: 1.5px dashed rgba(43,38,34,.2); border-radius: 2cqw;
  font-size: 3.2cqw; letter-spacing: .1em; line-height: 1.6; color: rgba(43,38,34,.4); pointer-events: none;
}
.book.dropping .face-content { box-shadow: inset 0 0 0 3px rgba(74,98,222,.55); }

.toolbar {
  position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  width: min(820px, calc(100vw - 24px));
  background: rgba(252,252,255,.88); backdrop-filter: blur(14px);
  border-radius: 18px; padding: 10px 12px;
  box-shadow: 0 10px 40px -12px rgba(30,30,80,.35), 0 0 0 1px rgba(30,30,80,.06);
  display: grid; gap: 8px;
}
.tb-row { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tb-lbl { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ui-soft); min-width: 74px; white-space: nowrap; }
.toolbar button, .chip {
  background: #fff; border: 1px solid rgba(30,30,80,.12); border-radius: 99px;
  padding: 6px 12px; font-size: 13.5px; cursor: pointer; white-space: nowrap; font-weight: 400;
}
.toolbar button:hover:not(:disabled), .chip:hover { border-color: var(--accent); color: var(--accent); }
.toolbar button:disabled { opacity: .35; cursor: default; }
.toolbar input, .toolbar select, #inspector input, #inspector textarea {
  border: 1px solid rgba(30,30,80,.14); border-radius: 10px; background: #fff; padding: 6px 10px; font-size: 13.5px; min-width: 0;
}
#page-caption { flex: 1 1 180px; }
#book-tagline { flex: 1 1 300px; }
.danger { color: #b8322a !important; }

#inspector {
  position: fixed; right: 16px; top: 64px; z-index: 60; width: 290px; max-height: calc(100svh - var(--chrome) - 20px); overflow: auto;
  background: rgba(252,252,255,.94); backdrop-filter: blur(14px);
  border-radius: 16px; padding: 14px; display: grid; gap: 12px;
  box-shadow: 0 10px 40px -12px rgba(30,30,80,.35), 0 0 0 1px rgba(30,30,80,.06);
}
@media (max-width: 900px) {
  #inspector { top: auto; right: 12px; left: 12px; width: auto; bottom: calc(var(--chrome) - 80px); max-height: 38svh; }
}
#inspector .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#inspector .lbl, #inspector .field { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ui-soft); }
#inspector .field { display: grid; gap: 6px; }
#inspector .field textarea, #inspector .field input { text-transform: none; letter-spacing: normal; color: var(--ui); resize: vertical; }
.chip { font-size: 13px; padding: 5px 11px; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip.on:hover { color: #fff; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: var(--c); box-shadow: 0 0 0 1px rgba(0,0,0,.15); cursor: pointer; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--accent); }
.tape-sw { background: var(--tc); border-radius: 4px; width: 34px; }

#toast {
  position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 90;
  background: #2b2b36; color: #fff; padding: 9px 16px; border-radius: 99px; font-size: 13.5px; font-weight: 400;
  box-shadow: 0 8px 26px -8px rgba(0,0,0,.4); max-width: calc(100vw - 32px); text-align: center;
}

/* ---------- handwriting studio ---------- */
dialog.studio {
  width: min(1020px, calc(100vw - 24px)); max-height: calc(100svh - 24px);
  border: 0; border-radius: 20px; padding: 0; background: #fbfaf7; color: var(--ui);
  box-shadow: 0 30px 80px -20px rgba(20,20,60,.5);
}
dialog.studio::backdrop { background: rgba(40,40,70,.35); backdrop-filter: blur(3px); }
.studio-head { display: flex; justify-content: space-between; gap: 16px; padding: 20px 24px 8px; }
.studio-head h2 { margin: 0 0 4px; font-weight: 400; font-size: 20px; letter-spacing: .04em; color: #333; }
.studio-head p { margin: 0; font-size: 14px; line-height: 1.5; max-width: 640px; }
.studio-head .x { background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer; align-self: start; }
.studio-body { display: grid; grid-template-columns: 1fr 1.15fr; gap: 20px; padding: 12px 24px 24px; }
@media (max-width: 760px) { .studio-body { grid-template-columns: 1fr; } }
.charset { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 5px; max-height: 50svh; overflow: auto; padding: 2px; }
.charset button {
  position: relative; aspect-ratio: 1; border: 1px solid rgba(30,30,80,.1); border-radius: 8px; background: #fff;
  cursor: pointer; display: grid; place-items: center; padding: 3px; font-size: 17px; color: #b6b3ad;
}
.charset button.done { color: var(--ink); border-color: rgba(74,98,222,.35); }
.charset button.on { outline: 2px solid var(--accent); }
.charset button svg { width: 100%; height: 100%; }
.charset button i { position: absolute; right: 3px; top: 1px; font-style: normal; font-size: 9px; color: var(--accent); }
.custom { display: flex; gap: 8px; align-items: center; margin-top: 12px; font-size: 13px; }
.custom input { width: 110px; border: 1px solid rgba(30,30,80,.14); border-radius: 8px; padding: 5px 8px; }
.pad-wrap { position: relative; background: #fff; border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(30,30,80,.1); }
.pad { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; border-radius: 14px; }
.pad-char { position: absolute; left: 12px; top: 8px; font-size: 13px; color: var(--ui-soft); pointer-events: none; }
.pad-tools { display: flex; gap: 8px; margin: 10px 0; }
.pad-tools .grow { flex: 1; }
.pad-tools button, .font-row .btn { background: #fff; border: 1px solid rgba(30,30,80,.14); border-radius: 99px; padding: 6px 14px; cursor: pointer; font-size: 13.5px; }
.pad-tools .primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.variants { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; min-height: 8px; }
.variant { width: 44px; height: 44px; border: 1px solid rgba(30,30,80,.12); border-radius: 8px; background: #fff; cursor: pointer; padding: 4px; }
.variant:hover { border-color: #b8322a; }
.preview-lbl { display: grid; gap: 6px; margin-top: 14px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ui-soft); }
.preview-lbl input { text-transform: none; letter-spacing: normal; border: 1px solid rgba(30,30,80,.14); border-radius: 8px; padding: 6px 10px; }
.preview { margin-top: 8px; padding: 14px 16px; min-height: 80px; background: var(--paper); border-radius: 10px; font-size: 24px; }
.preview svg { width: 100%; }
.font-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; font-size: 13px; }

/* ---------- letters ---------- */
.item-letter { cursor: pointer; }
.folded { position: relative; width: 100%; overflow: hidden; filter: drop-shadow(0 .2cqw .3cqw rgba(0,0,0,.16)) drop-shadow(0 1.4cqw 1.6cqw rgba(40,30,10,.22)); }
.fold-inner, .half-inner { position: absolute; left: 0; top: 0; width: 100%; height: 200%; }
/* the folded-up back half, seen along the crease */
.folded-lip { position: absolute; left: 0; right: 0; bottom: 0; height: 7%; background: linear-gradient(#e6dfcc, #f6f1e4 45%, #efe7d6); box-shadow: 0 -.2cqw .5cqw rgba(0,0,0,.12); }
.lcard-img { position: absolute; inset: 0; background-size: 100% 100%; }
.lcard { position: absolute; inset: 0; background: #faf6ec var(--noise); color: var(--ink); }
.lcard .hw { display: block; }
.lcard-date { position: absolute; }
.lcard-crease { position: absolute; left: 0; right: 0; top: 50%; height: 1.5%; transform: translateY(-50%); background: linear-gradient(rgba(0,0,0,.04), rgba(255,255,255,.5) 50%, rgba(0,0,0,.05)); pointer-events: none; }
.unfold-hint { position: absolute; left: 0; right: 0; top: 102%; text-align: center; font-family: 'Reenie Beanie', cursive; font-size: 3.4cqw; line-height: 1.4; color: rgba(43,38,34,.5); pointer-events: none; }
.envelope { position: relative; width: 100%; aspect-ratio: 1.5; margin-top: 18%; }
.env-letter { position: absolute; left: 7%; right: 7%; top: -26%; height: 90%; overflow: hidden; box-shadow: 0 .2cqw .5cqw rgba(0,0,0,.15); transform: rotate(-2deg); }
.env-body { position: absolute; inset: 0; background: #efe5d2 var(--noise); clip-path: polygon(0 18%, 50% 58%, 100% 18%, 100% 100%, 0 100%); box-shadow: 0 1cqw 2cqw -1cqw rgba(0,0,0,.3); }
.env-body::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to top right, transparent 49.6%, rgba(0,0,0,.07) 50%, transparent 50.6%), linear-gradient(to top left, transparent 49.6%, rgba(0,0,0,.07) 50%, transparent 50.6%); }
.env-to { position: absolute; left: 30%; right: 12%; bottom: 14%; }
.env-flap { position: absolute; left: 0; right: 0; top: 18%; height: 42%; background: linear-gradient(#e6dac3, #efe5d2); clip-path: polygon(0 0, 100% 0, 50% 96%); filter: drop-shadow(0 .3cqw .3cqw rgba(0,0,0,.12)); transform-origin: top; transform: rotateX(180deg) translateY(100%) scaleY(-1); display: none; }
.envelope:hover .env-letter { transform: rotate(-2deg) translateY(-6%); transition: transform .3s; }

.reader {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; align-content: center; gap: 14px;
  background: rgba(38,36,52,0); backdrop-filter: blur(0); transition: background .4s, backdrop-filter .4s; cursor: zoom-out; perspective: 2000px;
  padding: 24px;
}
.reader.open { background: rgba(38,36,52,.55); backdrop-filter: blur(6px); }
.reader-card { position: relative; height: min(86svh, calc((100vw - 48px) * 1.4)); max-width: calc(100vw - 48px); container-type: size; transform-style: preserve-3d; transform: translateY(30px) scale(.9); opacity: 0; transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .3s; }
.reader.open .reader-card { transform: none; opacity: 1; }
.half { position: absolute; left: 0; right: 0; height: 50%; overflow: hidden; box-shadow: 0 20px 50px -20px rgba(0,0,0,.5); backface-visibility: hidden; }
.half.top { top: 0; }
.half.bottom { top: 50%; transform-origin: top; transform: rotateX(-178deg); transition: transform .9s cubic-bezier(.5,0,.2,1) .25s; }
.half.bottom .half-inner { top: -100%; }
.half.bottom::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.18), transparent 30%); }
.reader.open .half.bottom { transform: rotateX(0); }
.reader-from { margin: 0; color: #fff; font-family: 'Reenie Beanie', cursive; font-size: 30px; line-height: 1; }
.reader-x { position: fixed; top: 16px; right: 16px; background: rgba(255,255,255,.9); border: 0; border-radius: 99px; padding: 7px 14px; cursor: pointer; }

/* ---------- across the gutter, clipped handwriting ---------- */
.item.mirror { pointer-events: auto; }
.editing .item.mirror:hover { outline: none; }
.item-clip { mix-blend-mode: multiply; }
.clip { position: relative; width: 100%; overflow: hidden; }
.clip img { position: absolute; max-width: none; height: auto; display: block; }
.lcard-ink { position: absolute; inset: 0; width: 100%; height: 100%; mix-blend-mode: multiply; }

.clipper { position: fixed; inset: 0; z-index: 100; background: rgba(38,36,52,.6); backdrop-filter: blur(6px); display: grid; place-items: center; align-content: center; gap: 12px; padding: 20px; }
.clipper-tip { margin: 0; color: #fff; font-size: 14px; letter-spacing: .06em; }
.clipper-sheet { position: relative; height: min(84svh, calc((100vw - 40px) * 1.4)); max-width: calc(100vw - 40px); background: #faf6ec; cursor: crosshair; touch-action: none; box-shadow: 0 20px 50px -20px rgba(0,0,0,.5); }
.clipper-sheet img { width: 100%; height: 100%; display: block; mix-blend-mode: multiply; pointer-events: none; }
.clipper-box { position: absolute; border: 1.5px dashed var(--accent); background: rgba(74,98,222,.1); pointer-events: none; }

/* ---------- digital journal: flat / full-bleed photos, doodles, white words ---------- */
.frame-flat .ph-img { border-radius: .9cqw; }
.frame-full .ph-img { border-radius: 0; }
.f-full { z-index: 0; }
.doodle-svg { display: block; width: 100%; height: auto; overflow: visible; }
.item-doodle { z-index: 4; }
.ink-white { filter: drop-shadow(0 .15cqw .35cqw rgba(0,0,0,.35)); }
.font-row .chip { padding: 2px 10px; }
.doodle-pick { gap: 4px; }
.doodle-chip { width: 34px; height: 34px; padding: 5px; border-radius: 10px; }
.doodle-chip.on svg { color: #fff; }

/* cut-out sticker: white die-cut edge + a soft shadow (works on transparent PNGs) */
.f-sticker { z-index: 5; }
.frame-sticker .ph-img { overflow: visible; }
.frame-sticker img {
  filter:
    drop-shadow(.45cqw 0 0 #fff) drop-shadow(-.45cqw 0 0 #fff) drop-shadow(0 .45cqw 0 #fff) drop-shadow(0 -.45cqw 0 #fff)
    drop-shadow(.3cqw .3cqw 0 #fff) drop-shadow(-.3cqw -.3cqw 0 #fff)
    drop-shadow(0 .9cqw 1.1cqw rgba(30,25,20,.32));
}

/* cut-out keepsake (e.g. a boarding pass with its own rounded edges): shadow follows the shape */
.f-cutout { z-index: 4; }
.frame-cutout .ph-img { overflow: visible; }
.frame-cutout img { filter: drop-shadow(0 .15cqw .25cqw rgba(0,0,0,.25)) drop-shadow(0 1.2cqw 1.6cqw rgba(30,25,20,.3)); }

/* the navy bookcloth strip on a MUJI-style cover (left on the front, right on the back) */
.muji-spine {
  position: absolute; top: 0; bottom: 0; width: 12.5%; z-index: 1;
  background-color: #1d2742;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.12) 0 1px, transparent 1px 3px),
    var(--noise);
}
.cover-front .muji-spine { left: 0; box-shadow: inset -.25cqw 0 .3cqw rgba(0,0,0,.25), .15cqw 0 .25cqw rgba(0,0,0,.18); }
.cover-back .muji-spine { right: 0; box-shadow: inset .25cqw 0 .3cqw rgba(0,0,0,.25), -.15cqw 0 .25cqw rgba(0,0,0,.18); }

/* ---------- page view: a deck of seamless pages, neighbours peeking out ---------- */
.book.carousel { perspective: 2400px; }
.carousel-track { position: absolute; inset: 0; transform-style: preserve-3d; }
.card {
  position: absolute; inset: 0; display: flex; overflow: hidden;
  border-radius: var(--r); background: #f8f3e8; transform-origin: left center;
  box-shadow: 0 1.2cqw 2.6cqw -1cqw rgba(30,30,70,.42), 0 0 0 1px rgba(0,0,0,.05);
  transition: transform .5s cubic-bezier(.3,.7,.2,1);
}
.card.single { width: 50%; left: 25%; }
.card .face { position: relative; flex: 1; transform: none; backface-visibility: visible; -webkit-backface-visibility: visible; border-radius: 0; overflow: hidden; background: transparent; }
.card .face::after, .card .face::before { display: none; } /* one seamless sheet: no fold down the middle */
.card.behind { cursor: pointer; }
.card.behind .face-content { pointer-events: none; }
.card.behind::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,20,40,.14), rgba(20,20,40,.06)); pointer-events: none; z-index: 50; }

/* ---------- template pieces ---------- */
.slot { width: 100%; display: grid; place-items: center; color: rgba(255,255,255,.75); }
.slot-light { background: repeating-linear-gradient(135deg, #dfe2ea 0 1.1cqw, #e7e9ef 1.1cqw 2.2cqw); color: rgba(60,60,80,.5); }
.slot-full { box-shadow: inset 0 0 0 1px rgba(255,255,255,.6); }
.slot-flat { border-radius: .8cqw; }
.slot-in { display: grid; justify-items: center; gap: .6cqw; font-family: var(--ui-font); font-size: 2.6cqw; letter-spacing: .12em; text-transform: uppercase; line-height: 1.2; text-align: center; padding: 0 6%; }
.slot-in svg { width: 5.5cqw; height: 5.5cqw; }
.slot-polaroid { background: #fbfaf5; padding: 5% 5% 4%; box-shadow: 0 .3cqw .8cqw rgba(0,0,0,.18), 0 1.4cqw 2.4cqw -1cqw rgba(0,0,0,.3); }
.slot-caption { height: 7cqw; margin-top: 3%; border-bottom: 1px solid rgba(43,38,34,.25); margin-inline: 12%; }
.slot-cutout { background: rgba(255,255,255,.38); border: .35cqw dashed rgba(255,255,255,.9); border-radius: 45% 45% 12% 12% / 30% 30% 8% 8%; color: #fff; }
.slot-sticker { background: rgba(255,255,255,.4); border: .35cqw dashed rgba(255,255,255,.9); border-radius: 50%; color: #fff; }
.slot-cutout .slot-in, .slot-sticker .slot-in { font-size: 2.2cqw; text-shadow: 0 .1cqw .3cqw rgba(0,0,0,.3); }
.item-slot { line-height: normal; }
.item-slot:has(.slot-full) { z-index: 0; }

/* ruled space to write in */
.wlines { width: 100%; }
.wlines-white { background: repeating-linear-gradient(transparent 0 calc(3.6cqw - 1.5px), rgba(255,255,255,.78) calc(3.6cqw - 1.5px) 3.6cqw); filter: drop-shadow(0 .1cqw .2cqw rgba(0,0,0,.25)); }
.wlines-navy { background: repeating-linear-gradient(transparent 0 calc(3.6cqw - 1px), rgba(31,50,102,.28) calc(3.6cqw - 1px) 3.6cqw); }
.item-lines { line-height: normal; z-index: 3; }

/* a lifted cut-out (a person, food) with no border: just a soft shadow that follows its shape */
.f-lift { z-index: 5; }
.frame-lift .ph-img { overflow: visible; }
.frame-lift img { filter: drop-shadow(0 .5cqw .8cqw rgba(20,15,10,.35)); }

/* grid of drafts */
body.grid-mode .hero { justify-content: flex-start; padding-top: 70px; }
body.grid-mode .hero-title, body.grid-mode .arrow, body.grid-mode #caption { display: none; }
body.grid-mode .stage { display: block; }
.book.grid-view { width: min(1200px, 96vw); aspect-ratio: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 16px; container-type: normal; margin: 0 auto; }
.mini { margin: 0; }
.mini-book { position: relative; aspect-ratio: 1.43; container-type: inline-size; --r: 2cqw; }
.mini-book .card { transform: none; transition: none; }
.mini figcaption { text-align: center; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; margin-top: 8px; color: #3c3c48; }

/* layering: background photos at the back, then photos/polaroids, then cut-outs, then words */
.item { z-index: 2; }
.f-full { z-index: 0; }
.item-note { z-index: 6; }
/* stamps soak into paper, but over a photo red ink would turn black — print them plainly there */
.face-content:has(.f-full) .item-stamp { mix-blend-mode: normal; }

/* the fold down the middle of an open spread: pages curve into the binding */
.card:not(.single)::before {
  content: ''; position: absolute; inset: 0; z-index: 40; pointer-events: none;
  background: linear-gradient(90deg, transparent 0 40%, rgba(40,30,20,.05) 45%, rgba(40,30,20,.16) 48.6%, rgba(20,15,10,.32) 50%, rgba(40,30,20,.16) 51.4%, rgba(40,30,20,.05) 55%, transparent 60% 100%),
              linear-gradient(90deg, rgba(255,255,255,.12), transparent 4%, transparent 96%, rgba(255,255,255,.12));
}

/* a page in the middle of being turned */
.turn-frame { position: absolute; inset: 0; z-index: 300; pointer-events: none; transform-style: preserve-3d; }
.turn-stay, .turn-shadow { position: absolute; top: 0; bottom: 0; width: 50%; overflow: hidden; }
.turn-stay.left, .turn-shadow.left { left: 0; border-radius: var(--r) 0 0 var(--r); }
.turn-stay.right, .turn-shadow.right { right: 0; border-radius: 0 var(--r) var(--r) 0; }
.turn-stay > .face-content, .tface > .face-content { position: absolute; inset: 0; }
.turn-shadow { opacity: 0; background: linear-gradient(90deg, rgba(10,10,25,.35), rgba(10,10,25,.12)); }
.turn-shadow.left { background: linear-gradient(270deg, rgba(10,10,25,.35), rgba(10,10,25,.12)); }
.turn-leaf { position: absolute; top: 0; bottom: 0; left: 50%; width: 50%; transform-origin: left center; transform-style: preserve-3d; }
.tface { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #f8f3e8; }
.tface.front { border-radius: 0 var(--r) var(--r) 0; }
.tface.back { transform: rotateY(180deg); border-radius: var(--r) 0 0 var(--r); }
@property --shade { syntax: '<number>'; inherits: false; initial-value: 0; }
.tface::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 60; opacity: var(--shade);
  background: linear-gradient(90deg, rgba(20,20,40,.28), rgba(20,20,40,.04) 60%, rgba(255,255,255,.1)); }
.tface.back::after { background: linear-gradient(270deg, rgba(20,20,40,.28), rgba(20,20,40,.04) 60%, rgba(255,255,255,.1)); }

/* ---------- the book seen at an angle, lying open on a desk (like the journal app) ---------- */
.book.carousel { perspective: 1700px; perspective-origin: 50% 40%; --open: 5deg; }
.book.carousel .carousel-track {
  transform: rotateX(9deg) rotateY(13deg) rotateZ(-2.2deg) scale(.94);
  transition: transform .6s cubic-bezier(.3,.7,.2,1);
}
body.editing .book.carousel .carousel-track { transform: none; } /* flat while you're arranging things */

/* open spreads: the two pages rise a little from the spine instead of one flat card */
.card:not(.single) { overflow: visible; background: transparent; box-shadow: none; transform-style: preserve-3d; }
.card:not(.single)::before { display: none; }
.card:not(.single) .face { overflow: hidden; background: #f8f3e8; box-shadow: 0 1.2cqw 2.6cqw -1cqw rgba(30,30,70,.42), 0 0 0 1px rgba(0,0,0,.05); }
.card:not(.single) .face.back { border-radius: var(--r) 0 0 var(--r); transform-origin: right center; transform: rotateY(var(--open)); }
.card:not(.single) .face.front { border-radius: 0 var(--r) var(--r) 0; transform-origin: left center; transform: rotateY(calc(-1 * var(--open))); }
/* soft shading into the fold */
.card:not(.single) .face::after { display: block; content: ''; position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.card:not(.single) .face.back::after { background: linear-gradient(270deg, rgba(20,15,10,.28), rgba(20,15,10,.08) 4%, transparent 14%), linear-gradient(90deg, rgba(255,255,255,.1), transparent 5%); }
.card:not(.single) .face.front::after { background: linear-gradient(90deg, rgba(20,15,10,.28), rgba(20,15,10,.08) 4%, transparent 14%), linear-gradient(270deg, rgba(0,0,0,.05), transparent 5%); }
body.editing .card:not(.single) .face { transform: none; }
/* pages further back in the stack sit a little in shadow */
.card.behind::after { display: none; }
.card.behind .face-content::before { content: ''; position: absolute; inset: 0; z-index: 45; background: rgba(20,20,40,.1); pointer-events: none; }

/* the page being turned starts and lands at the same slight rise */
.turn-stay.left { transform-origin: right center; transform: rotateY(var(--open)); }
.turn-stay.right { transform-origin: left center; transform: rotateY(calc(-1 * var(--open))); }
.turn-shadow.left { transform-origin: right center; transform: rotateY(var(--open)); }
.turn-shadow.right { transform-origin: left center; transform: rotateY(calc(-1 * var(--open))); }
/* tilt the whole book as one picture; each spread keeps its own 3D (fold + turning page), and the
   stacking order of pages stays exact instead of being decided by depth */
.book.carousel .carousel-track { transform-style: flat; perspective: 1700px; perspective-origin: 50% 45%; }

/* ---------- covers: a closed book is just the cover, centred, with the page edges peeking out ---------- */
.card.single.first { left: 50%; width: 50%; }
.card.single.last { left: 0; width: 50%; }
.book.carousel.at-cover { --shift: -25%; }
.book.carousel.at-back { --shift: 25%; }
.book.carousel .carousel-track { transform: translateX(var(--shift, 0%)) rotateX(9deg) rotateY(13deg) rotateZ(-2.2deg) scale(.94); }
body.editing .book.carousel .carousel-track { transform: translateX(var(--shift, 0%)); }
.book.carousel.at-cover .card:not(.current), .book.carousel.at-back .card:not(.current) { visibility: hidden !important; }
.book.carousel.at-cover .card.current, .book.carousel.at-back .card.current {
  box-shadow: .3cqw .25cqw 0 -.05cqw #efe8d8, .6cqw .5cqw 0 -.1cqw #e3dbc8, .9cqw .75cqw 0 -.15cqw #ece5d4, 1.1cqw 1cqw 0 -.2cqw #ddd4c0, 0 1.6cqw 3cqw -1cqw rgba(30,30,70,.45);
}
.book.carousel.at-back .card.current { box-shadow: -.3cqw .25cqw 0 -.05cqw #efe8d8, -.6cqw .5cqw 0 -.1cqw #e3dbc8, -.9cqw .75cqw 0 -.15cqw #ece5d4, -1.1cqw 1cqw 0 -.2cqw #ddd4c0, 0 1.6cqw 3cqw -1cqw rgba(30,30,70,.45); }
/* while a cover swings, the half it hasn't reached yet stays empty */
.card.hide-left .face.back, .card.hide-right .face.front { visibility: hidden; }
/* a turning cover is board: flat, no paper curl shading */
.tface.cover-face::after { display: none; }
.tface.front.cover-face { border-radius: 0 var(--r) var(--r) 0; }
.book.carousel.cover-turn .card:not(.turn-target) { visibility: hidden !important; }

/* ---------- NYC ephemera stickers: die-cut white edge and a soft lift off the page ---------- */
.item-ephemera { z-index: 5; }
.eph-svg { display: block; width: 100%; height: auto; overflow: visible;
  filter: drop-shadow(.28cqw 0 0 #fff) drop-shadow(-.28cqw 0 0 #fff) drop-shadow(0 .28cqw 0 #fff) drop-shadow(0 -.28cqw 0 #fff) drop-shadow(.25cqw .5cqw .6cqw rgba(20,20,40,.32)); }

/* warm grid paper, like a Ghibli scrapbook sheet: cream with soft grey-brown squares */
.paper-ghibli { --paper: #f4f0e7; background-image: var(--noise), linear-gradient(rgba(120,108,92,.2) 1px, transparent 1px), linear-gradient(90deg, rgba(120,108,92,.2) 1px, transparent 1px); background-size: auto, 5cqw 5cqw, 5cqw 5cqw; }

/* a plain photo print: thin white border, no polaroid chin */
.frame-print { background: #fbfaf5; padding: 2.6%; box-shadow: 0 .15cqw .3cqw rgba(0,0,0,.25), 0 1.4cqw 2.6cqw -1.2cqw rgba(0,0,0,.5); }
.frame-print .ph-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255,255,255,.12), transparent 40%, rgba(0,0,0,.05)); }

.ink-white.ink-strong { filter: drop-shadow(0 0 .25cqw rgba(0,0,0,.55)) drop-shadow(0 .15cqw .5cqw rgba(0,0,0,.45)); }

/* clean view: no kicker, faint background title, caption or edit button */
.kicker, .hero-title, .caption, #edit { display: none !important; }

#view { display: none !important; }

/* the side of a page you can't see is hidden outright: WebKit (iPhone) doesn't reliably honour
   backface-visibility, so turned pages showed through mirrored. While a page turns, each side
   switches at the moment it passes edge-on (same timing/easing as the turn). */
.leaf.buried:not(.flipping) { visibility: hidden; }
.leaf.flipped:not(.flipping) > .face.front, .leaf:not(.flipped):not(.flipping) > .face.back { visibility: hidden; }
@keyframes vis-first { 0%, 47% { visibility: visible; } 47.1%, 100% { visibility: hidden; } }
@keyframes vis-second { 0%, 47% { visibility: hidden; } 47.1%, 100% { visibility: visible; } }
@keyframes vis-first-b { 0%, 50% { visibility: visible; } 50.1%, 100% { visibility: hidden; } }
@keyframes vis-second-b { 0%, 50% { visibility: hidden; } 50.1%, 100% { visibility: visible; } }
.leaf.flipping.fwd > .face.front, .leaf.flipping.bwd > .face.back { animation: vis-first .9s linear both; }
.leaf.flipping.fwd > .face.back, .leaf.flipping.bwd > .face.front { animation: vis-second .9s linear both; }
.leaf.board.flipping.fwd > .face.front, .leaf.board.flipping.bwd > .face.back { animation: vis-first-b .95s cubic-bezier(.45,.05,.3,1) both; }
.leaf.board.flipping.fwd > .face.back, .leaf.board.flipping.bwd > .face.front { animation: vis-second-b .95s cubic-bezier(.45,.05,.3,1) both; }
/* phones: skip the motion blur on turning pages (a full-page filter every frame is what stutters) */
@media (pointer: coarse) { .leaf.flipping .face-content { animation: none; } }
