:root {
  --desk: #f4bfd3;
  --desk-hi: #fde6ee;
  --desk-lo: #e597b8;
  --ink: #1a0c12;
  --ink-2: #5d3a48;
  --hot: #ff3d96;
  --cherry: #d1002f;
  --paper: #fffcf7;
  --rule: rgba(84, 140, 214, .32);
  --margin: rgba(232, 52, 92, .5);
  --cv: #ff4fa3; --cv-d: #c21268; --cv-l: #ff9cca;
  --rb-d: #b56f84; --rb-m: #eaa7bb; --rb-l: #ffe8ef;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-io: cubic-bezier(.77, 0, .175, 1);
  --spring: cubic-bezier(.3, 1.45, .45, 1);
  --hand: "Mansalva", "Segoe Print", cursive;
  --type: "Courier Prime", "Courier New", monospace;
  --label: "Rubik Mono One", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: var(--desk); color: var(--ink);
  font: 400 16px/1.45 var(--type);
  overflow: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--hot); color: #fff; }
:focus-visible { outline: 2px dashed var(--hot); outline-offset: 4px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
input, textarea { font: inherit; color: var(--ink); caret-color: var(--hot); }

/* ---------- desk + flash photography ---------- */
.desk {
  position: fixed; inset: 0;
  background:
    radial-gradient(90% 75% at 42% 42%, var(--desk-hi) 0%, transparent 62%),
    radial-gradient(140% 120% at 50% 40%, transparent 50%, var(--desk-lo) 100%),
    var(--paper-tex, none) 0 0 / 384px, var(--desk);
  background-blend-mode: normal, normal, multiply, normal;
}
.flash { position: fixed; inset: 0; z-index: 90; background: #fff; pointer-events: none; opacity: 0; }
body.in .flash { animation: flash .9s ease-out both; }
@keyframes flash { 0% { opacity: 0; } 8% { opacity: .95; } 100% { opacity: 0; } }

.screen { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.screen > * { pointer-events: auto; }

/* ---------- ransom letters ---------- */
.ransom { display: inline; }
.rw { display: inline-block; white-space: nowrap; margin: 0 .22em .08em 0; }
.rl {
  display: inline-block; line-height: 1; padding: .09em .11em .05em; margin: 0 .015em;
  transform: translateY(var(--dy)) rotate(var(--rot));
  box-shadow: 0 1px 1px rgba(70, 0, 25, .22), 0 5px 9px -4px rgba(70, 0, 25, .4);
}
body.in .headline .rl { animation: slap .55s var(--spring) both; animation-delay: calc(var(--d) * 42ms + 650ms); }
@keyframes slap { from { opacity: 0; transform: translateY(calc(var(--dy) - .3em)) rotate(calc(var(--rot) - 16deg)) scale(1.55); } }

.marker { font-family: var(--hand); font-weight: 400; line-height: 1.12; }

/* ---------- label-maker buttons ---------- */
.dymo {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 56px; padding: 0 30px; white-space: nowrap;
  font-family: var(--label); font-size: 15px; letter-spacing: .18em; color: #f6f2f4;
  background: linear-gradient(180deg, #3a3036 0%, #151014 38%, #070506 100%);
  clip-path: polygon(1.5% 0, 100% 0, 98.5% 100%, 0 100%);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, .9), 0 1px 0 rgba(255, 255, 255, .28);
  transform: rotate(-1.6deg);
  transition: transform .22s var(--ease-out), filter .22s;
  filter: drop-shadow(0 8px 10px rgba(90, 0, 35, .35)) drop-shadow(0 2px 2px rgba(60, 0, 25, .3));
  text-decoration: none;
}
.dymo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.16), transparent 40%); pointer-events: none; }
.dymo.pink { background: linear-gradient(180deg, #ff6fb0 0%, #ff3d96 40%, #d61a73 100%); }
.dymo:active { transform: rotate(-1.6deg) scale(.96); }
.dymo[disabled] { opacity: .6; cursor: progress; }
@media (hover: hover) {
  .dymo:hover { transform: rotate(0deg) translateY(-2px); }
  .peek:hover { color: var(--hot); }
}

/* ---------- washi tape + post-it ---------- */
.tape {
  position: absolute; width: 118px; height: 30px; z-index: 3;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.35) 0 6px, transparent 6px 14px),
    rgba(255, 128, 182, .62);
  clip-path: polygon(0 8%, 5% 0, 10% 10%, 15% 0, 20% 8%, 25% 0, 75% 0, 80% 10%, 85% 0, 90% 8%, 95% 0, 100% 10%, 100% 92%, 95% 100%, 90% 90%, 85% 100%, 80% 92%, 75% 100%, 25% 100%, 20% 90%, 15% 100%, 10% 92%, 5% 100%, 0 90%);
  mix-blend-mode: multiply;
}
.postit {
  position: relative; width: min(360px, calc(100vw - 32px)); padding: 30px 26px 22px;
  background: linear-gradient(168deg, #ffe4ef 0%, #ffd0e3 70%, #ffc2da 100%);
  box-shadow: 0 1px 1px rgba(90, 0, 35, .18), 0 18px 26px -14px rgba(90, 0, 35, .45);
  transform: rotate(-2deg);
}
.postit::after { content: ""; position: absolute; right: 0; bottom: 0; width: 46px; height: 46px; background: linear-gradient(315deg, rgba(120, 20, 60, .14), transparent 55%); }

/* ---------- stage: props + book ---------- */
.stage { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.prop {
  position: absolute; display: block; height: auto; pointer-events: none;
  filter: drop-shadow(0 14px 14px rgba(120, 20, 60, .26)) drop-shadow(0 2px 2px rgba(80, 0, 30, .22));
  transform: rotate(var(--r, 0deg));
  transition: opacity .7s var(--ease-out), transform .9s var(--ease-out);
}
body.in .prop { animation: drop .7s var(--spring) both; animation-delay: var(--dl, .3s); }
@keyframes drop { from { opacity: 0; transform: rotate(calc(var(--r, 0deg) - 12deg)) translateY(-22px) scale(1.12); filter: drop-shadow(0 34px 30px rgba(120,20,60,.16)); } }

/* intro, desktop */
.p-phone { width: min(21vw, 330px); right: -4vw; top: 4vh; --r: 16deg; --dl: .2s; }
.p-bfly { width: min(9vw, 140px); left: 47vw; top: 8vh; --r: -18deg; --dl: .5s; }
.p-lip { width: min(10vw, 150px); left: 45vw; bottom: 5vh; --r: -26deg; --dl: .35s; }
.p-perf { width: min(9vw, 140px); right: 3vw; bottom: 6vh; --r: 9deg; --dl: .45s; }
.p-sun { width: min(17vw, 260px); left: -3vw; bottom: -1vh; --r: 14deg; --dl: .25s; }
.p-cherry { width: min(6.5vw, 100px); left: 37vw; top: 13vh; --r: 8deg; --dl: .6s; }
.p-pot { width: min(9vw, 140px); right: 29vw; bottom: -5vh; --r: -6deg; --dl: .4s; }
body:not([data-screen="intro"]) .prop { opacity: 0; }
body[data-screen="make"] .p-phone, body[data-screen="make"] .p-sun, body[data-screen="make"] .p-lip { opacity: 1; }
body[data-screen="make"] .p-lip { left: 2vw; bottom: 4vh; }
body[data-screen="make"] .p-sun { left: 30vw; bottom: -4vh; }
body[data-screen="make"] .p-phone { right: auto; left: -8vw; top: -4vh; --r: -14deg; }
body[data-screen="done"] .p-cherry, body[data-screen="done"] .p-perf, body[data-screen="done"] .p-bfly, body[data-screen="done"] .p-pot { opacity: 1; }
body[data-screen="done"] .p-bfly { left: 14vw; top: 10vh; }
body[data-screen="done"] .p-cherry { left: 10vw; top: 70vh; }
body[data-screen="gift"] .p-phone, body[data-screen="gift"] .p-lip, body[data-screen="gift"] .p-perf, body[data-screen="gift"] .p-bfly { opacity: 1; }
body[data-screen="gift"] .p-lip { left: 18vw; bottom: 8vh; }
body[data-screen="gift"] .p-bfly { left: 26vw; top: 12vh; }
body.opened .prop { opacity: 0 !important; }

/* the book, positioned by JS (--x --y --s --r in px/deg) */
.book {
  position: absolute; left: 0; top: 0; width: 480px; height: 660px;
  transform: translate(calc(var(--x, 50vw) - 240px), calc(var(--y, 50vh) - 330px)) rotate(var(--br, -4deg)) scale(var(--s, .8));
  transition: transform 1.1s var(--ease-io);
  perspective: 2200px; pointer-events: none;
}
body.in .book { animation: bookIn .9s var(--ease-out) both .15s; }
@keyframes bookIn { from { opacity: 0; } }
.book::before { /* flash shadow */
  content: ""; position: absolute; inset: 14px -18px -26px 10px; border-radius: 14px;
  background: rgba(110, 10, 50, .42); filter: blur(22px); transform: translate(14px, 18px);
}
.block { /* page edges peeking out */
  position: absolute; inset: 5px -7px -6px 10px; border-radius: 3px 10px 10px 3px;
  background: repeating-linear-gradient(90deg, #f7efe9 0 1.5px, #e6d8d2 1.5px 2.5px), #f4ece6;
  box-shadow: 0 1px 2px rgba(80, 0, 30, .25);
}
.pages { position: absolute; inset: 6px 4px 6px 6px; transform-style: preserve-3d; }
.cover {
  position: absolute; inset: 0; transform-origin: 0 50%; transform-style: preserve-3d;
  transition: transform 1.5s var(--ease-io);
}
.cover-front, .cover-back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 5px 16px 16px 5px; overflow: hidden; }
.cover-front {
  background:
    linear-gradient(90deg, rgba(0,0,0,.28) 0, rgba(0,0,0,.08) 22px, rgba(255,255,255,.14) 27px, rgba(0,0,0,.12) 31px, transparent 40px),
    linear-gradient(125deg, rgba(255,255,255,.22) 0%, transparent 38%, transparent 62%, rgba(80,0,30,.22) 100%),
    var(--leather, none) 0 0 / 256px, var(--cv);
  background-blend-mode: normal, normal, soft-light, normal;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), inset -3px -4px 10px rgba(60,0,25,.25), inset 2px 2px 6px rgba(255,255,255,.18);
}
.stitch { position: absolute; inset: 20px 20px 20px 46px; border: 2.5px dashed rgba(255, 255, 255, .62); border-radius: 12px; filter: drop-shadow(0 1px 0 rgba(60, 0, 25, .35)); }
.cover-name { position: absolute; left: 150px; right: 34px; top: 74px; font-size: 40px; line-height: 1.1; z-index: 2; }
.cover-name:empty { display: none; }
.gg { position: absolute; left: 132px; top: 178px; width: 330px; overflow: visible; }
.gg text { font-family: var(--hand); font-size: 150px; }
.cover-gem { position: absolute; width: 86px; right: 44px; top: 396px; transform: rotate(14deg); filter: drop-shadow(0 4px 4px rgba(60, 0, 25, .45)); }
.cover-st { position: absolute; filter: drop-shadow(0 6px 6px rgba(70, 0, 30, .35)); }
.st-a { width: 128px; right: -22px; top: 12px; transform: rotate(22deg); }
.st-b { width: 84px; left: 150px; bottom: 40px; transform: rotate(-14deg); }
.cover-warn { position: absolute; right: 54px; bottom: 50px; font-family: var(--hand); font-size: 30px; color: rgba(255,255,255,.92); transform: rotate(-4deg); text-shadow: 0 2px 0 rgba(90,0,40,.25); }
.cover-warn::after { content: ""; position: absolute; left: -4px; right: -6px; bottom: -4px; height: 8px; border-bottom: 3px solid rgba(255,255,255,.85); border-radius: 0 0 60% 40%; }
.book[data-cover="baby"] { --cv: #f7a8c8; --cv-d: #d97aa2; }
.book[data-cover="cherry"] { --cv: #c8002c; --cv-d: #7e0019; }
.book[data-cover="noir"] { --cv: #1d1418; --cv-d: #000; }
.book[data-cover="baby"] .stitch { border-color: rgba(255,255,255,.75); }
.book[data-cover="noir"] .cover-warn { color: #ff8fc4; }

.cover-back {
  transform: rotateY(180deg);
  background: var(--paper-tex, none) 0 0 / 384px, #f9d3e2;
  background-blend-mode: multiply;
  box-shadow: inset -10px 0 18px -10px rgba(80, 0, 30, .35);
  padding: 70px 46px;
}
.prop-of { font-family: var(--hand); font-size: 38px; line-height: 1.05; transform: rotate(-3deg); }
.prop-of span { color: var(--hot); display: block; font-size: 1.3em; }
.prop-warn { font-family: var(--type); font-size: 15px; margin-top: 22px; max-width: 26ch; color: var(--ink-2); }
.cb-st { position: absolute; filter: drop-shadow(0 6px 6px rgba(70,0,30,.3)); }
.cb-a { width: 170px; left: 30px; bottom: 40px; transform: rotate(-12deg); }
.cb-b { width: 96px; right: 50px; bottom: 120px; transform: rotate(16deg); }
.cb-c { width: 58px; right: 150px; bottom: 50px; transform: rotate(-8deg); }

/* satin ribbon tie */
.tie { position: absolute; inset: 0; z-index: 5; pointer-events: none; transition: opacity .6s; }
.tie .band {
  position: absolute; top: -8px; bottom: -8px; left: 70px; width: 54px;
  background: linear-gradient(90deg, var(--rb-d), var(--rb-m) 20%, var(--rb-l) 42%, var(--rb-m) 58%, var(--rb-d) 86%, var(--rb-m));
  box-shadow: 3px 0 6px rgba(70, 0, 30, .25), -1px 0 2px rgba(70,0,30,.2);
  transform-origin: 50% 0; transition: transform 1s var(--ease-io);
}
.tie .band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(255,255,255,.4) 45%, transparent 60%) 0 0 / 100% 300%; animation: sheen 6s linear infinite; mix-blend-mode: soft-light; }
@keyframes sheen { from { background-position: 0 150%; } to { background-position: 0 -150%; } }
.bow { position: absolute; left: 97px; top: -78px; width: 236px; translate: -50% 0; overflow: visible; filter: drop-shadow(0 10px 10px rgba(70, 0, 30, .35)); transition: transform .9s var(--spring), opacity .5s; }
.bow g { transform-box: fill-box; transition: transform 1s var(--ease-io), opacity .8s ease; }
.loop.ll { transform-origin: 100% 85%; }
.loop.lr { transform-origin: 0% 85%; }
.tail { transform-origin: 50% 0; }
.knot { transform-origin: 50% 50%; }
.bow-hit { position: absolute; left: -20px; top: -90px; width: 250px; height: 230px; pointer-events: none; border-radius: 40%; }
.tie.off { opacity: 0; }
.tie.off .band { transform: scaleY(0); }
.tie.off .bow { transform: scale(.4); opacity: 0; }
.tie.on .bow { transition-delay: .7s; }
.tie.untie .band { transform: translateY(-110%); transition-delay: .35s; }
.tie.untie .loop.ll { transform: translate(-70%, -40%) rotate(-55deg) scale(.5); opacity: 0; }
.tie.untie .loop.lr { transform: translate(70%, -40%) rotate(55deg) scale(.5); opacity: 0; }
.tie.untie .tail.tl { transform: translate(-30%, 100%) rotate(20deg); opacity: 0; }
.tie.untie .tail.tr { transform: translate(30%, 100%) rotate(-20deg); opacity: 0; }
.tie.untie .knot { transform: scale(0); opacity: 0; }
body[data-screen="gift"]:not(.opened) .bow-hit { pointer-events: auto; cursor: pointer; }
body[data-screen="gift"]:not(.opened) .tie:not(.untie) .bow { animation: tug 2.8s ease-in-out infinite 2s; }
@keyframes tug { 0%, 100% { transform: none; } 8% { transform: rotate(-4deg) scale(1.03); } 16% { transform: rotate(3deg); } 24% { transform: none; } }

/* open book */
body.opened .cover { transform: rotateY(-178deg); }
body.opened .tie { opacity: 0; visibility: hidden; transition: opacity .4s, visibility 0s .4s; }

/* ---------- pages ---------- */
.leaf { position: absolute; inset: 0; transform-origin: 0 50%; transform-style: preserve-3d; transition: transform 1s var(--ease-io), opacity .35s ease .6s; }
.leaf.turned { transform: rotateY(-176deg); opacity: 0; }
.leaf.back-in { transition: transform 1s var(--ease-io), opacity .2s ease 0s; }
.leaf .front, .leaf .back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 2px 10px 10px 2px; overflow: hidden; }
.leaf .front {
  background:
    linear-gradient(90deg, rgba(60,0,25,.16), transparent 24px),
    linear-gradient(90deg, transparent 60px, var(--margin) 60px 61.5px, transparent 61.5px),
    repeating-linear-gradient(180deg, transparent 0 31px, var(--rule) 31px 32px) 0 76px / 100% calc(100% - 96px) no-repeat,
    var(--paper-tex, none) 0 0 / 384px, var(--paper);
  background-blend-mode: normal, normal, normal, multiply, normal;
  box-shadow: inset -2px 0 4px rgba(80,0,30,.08);
}
.leaf .back { transform: rotateY(180deg); background: var(--paper-tex, none) 0 0 / 384px, #f6efe9; background-blend-mode: multiply; }
.pg { position: absolute; inset: 0; padding: 40px 34px 30px 78px; }

/* title page */
.pg-title .tname { font-size: 64px; line-height: 1.12; margin-top: 14px; }
.pg-title .is { font-family: var(--hand); font-size: 46px; margin: 8px 0 26px; transform: rotate(-2deg); }
.facts { list-style: none; font-family: var(--hand); font-size: 25px; line-height: 32px; }
.facts li { display: flex; align-items: center; gap: 12px; }
.facts .box { width: 22px; height: 22px; border: 2.5px solid var(--ink); border-radius: 3px; position: relative; flex: none; transform: rotate(-4deg); }
.facts .box::after { content: ""; position: absolute; left: 3px; top: -8px; width: 12px; height: 22px; border: solid var(--hot); border-width: 0 4px 4px 0; transform: rotate(40deg); }
.facts img { width: 30px; height: 30px; vertical-align: middle; }
.stamp {
  position: absolute; right: 30px; bottom: 96px; padding: 8px 16px 6px; transform: rotate(-11deg);
  font-family: var(--label); font-size: 22px; letter-spacing: .12em; color: var(--cherry);
  border: 4px double var(--cherry); border-radius: 6px; opacity: .82;
  -webkit-mask: var(--paper-tex, none) 0 0 / 120px, linear-gradient(#000, #000); mask-composite: intersect;
}
.signed { position: absolute; left: 78px; bottom: 44px; font-family: var(--hand); font-size: 28px; color: var(--ink-2); }

/* photo page */
.pg-photo .head { font-size: 30px; line-height: 1.12; }
.print {
  position: absolute; left: 50%; top: 116px; width: 330px; padding: 10px 10px 12px; background: #fff;
  transform: translateX(-50%) rotate(var(--pr, -2deg));
  box-shadow: 0 1px 2px rgba(70,0,30,.25), 0 16px 22px -12px rgba(70,0,30,.45);
}
.print .ph { position: relative; }
.print img.photo { display: block; width: 100%; max-height: 330px; object-fit: cover; filter: saturate(1.06) contrast(1.04); }
.print .ph::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(60,0,30,.2)), var(--paper-tex, none) 0 0 / 200px; mix-blend-mode: multiply; opacity: .7; pointer-events: none; }
.print .tape { width: 92px; height: 26px; }
.print .t1 { left: -26px; top: -10px; transform: rotate(-38deg); }
.print .t2 { right: -26px; top: -8px; transform: rotate(32deg); }
.halo { position: absolute; overflow: visible; pointer-events: none; filter: drop-shadow(0 0 1px rgba(255,255,255,.9)) drop-shadow(0 1px 2px rgba(80,0,40,.5)); }
.halo .d { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.leaf.now .halo .d, .ed-halo .halo .d { animation: draw .9s ease-out forwards; animation-delay: calc(var(--k, 0) * .22s + .4s); }
.halo .d:nth-child(1) { --k: 0; } .halo .d:nth-child(2) { --k: 1; } .halo .d:nth-child(3) { --k: 1.4; } .halo .d:nth-child(4) { --k: 2; } .halo .d:nth-child(5) { --k: 2.3; } .halo .d:nth-child(6) { --k: .6; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.pg-photo .cap { position: absolute; left: 78px; right: 30px; bottom: 54px; font-family: var(--hand); font-size: 30px; line-height: 32px; transform: rotate(-1.5deg); }
.doodle { position: absolute; width: 58px; color: var(--hot); }
.pg-stk { position: absolute; filter: drop-shadow(0 8px 8px rgba(70, 0, 30, .3)); }

/* last page */
.pg-last .head { font-size: 44px; }
.pg-last .note { font-family: var(--hand); line-height: 32px; margin-top: 20px; overflow-wrap: anywhere; }
.pg-last .xo { font-family: var(--hand); font-size: 36px; color: var(--hot); margin-top: 18px; transform: rotate(-3deg); }
.pg-last .acts { position: absolute; left: 78px; right: 34px; bottom: 46px; display: grid; gap: 10px; justify-items: start; }
.pg-last .again { font-family: var(--type); font-size: 15px; text-decoration: underline; text-underline-offset: 4px; padding: 6px 0; }

/* ---------- intro ---------- */
.brand { position: absolute; top: max(22px, env(safe-area-inset-top)); left: 6vw; font-family: var(--type); font-size: 13px; letter-spacing: .24em; text-transform: uppercase; }
.intro-copy { position: absolute; left: 6vw; top: 50%; transform: translateY(-50%); width: min(40vw, 560px); display: grid; gap: 22px; justify-items: start; }
.headline { font-size: clamp(42px, 5.2vw, 86px); line-height: 1.08; font-weight: 400; }
.lede { font-size: clamp(22px, 1.9vw, 30px); max-width: 19ch; transform: rotate(-1.5deg); }
body.in .lede { animation: write 1.1s var(--ease-out) both 1.5s; }
@keyframes write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.cta-row { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
body.in .cta-row { animation: fadeUp .8s var(--ease-out) both 1.9s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
.peek { font-family: var(--hand); font-size: 24px; padding: 8px 2px; position: relative; transition: color .2s; }
.peek::after { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 6px; border-bottom: 2.5px solid currentColor; border-radius: 0 0 50% 50%; }
.legal-link { position: absolute; left: 6vw; bottom: max(14px, env(safe-area-inset-bottom)); font-size: 10px; color: rgba(26,12,18,.4); text-decoration: none; letter-spacing: .08em; }

/* ---------- make: torn notebook sheet ---------- */
#make .sheet { position: absolute; right: 6vw; top: 50%; translate: 0 -50%; }
.sheet {
  width: min(460px, 100%); max-height: calc(100svh - 40px); display: grid; grid-template-rows: auto 1fr auto; gap: 14px;
  padding: 30px 30px 24px 58px; isolation: isolate;
  filter: drop-shadow(0 2px 2px rgba(70,0,30,.2)) drop-shadow(0 22px 26px rgba(90,0,35,.3));
  transform: rotate(.8deg);
}
.sheet::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, transparent 44px, var(--margin) 44px 45.5px, transparent 45.5px),
    repeating-linear-gradient(180deg, transparent 0 33px, var(--rule) 33px 34px) 0 14px,
    var(--paper-tex, none) 0 0 / 384px, var(--paper);
  background-blend-mode: normal, normal, multiply, normal;
  -webkit-mask: radial-gradient(circle 7px at 20px 22px, #0000 96%, #000) 0 0 / 100% 44px repeat-y;
  mask: radial-gradient(circle 7px at 20px 22px, #0000 96%, #000) 0 0 / 100% 44px repeat-y;
}
.sheet .tape-a { left: 50%; top: -14px; translate: -50% 0; transform: rotate(-3deg); }
#make .sheet { animation: sheetIn .8s var(--ease-out) both; }
@keyframes sheetIn { from { opacity: 0; transform: rotate(5deg) translateY(30px); } }
.sheet-top { display: flex; align-items: center; justify-content: space-between; }
.back { font-family: var(--type); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; padding: 8px 0; }
.steps { display: flex; gap: 6px; list-style: none; }
.steps li { width: 22px; height: 22px; border: 2px solid var(--ink); border-radius: 50%; transform: rotate(var(--sr, 0deg)); position: relative; }
.steps li:nth-child(2) { --sr: 20deg; } .steps li:nth-child(3) { --sr: -15deg; } .steps li:nth-child(4) { --sr: 35deg; }
.steps li.on::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--hot); }
.step { display: grid; gap: 16px; align-content: start; overflow-y: auto; min-height: 0; scrollbar-width: none; padding: 4px 2px; animation: stepIn .5s var(--ease-out) both; }
.step::-webkit-scrollbar { display: none; }
@keyframes stepIn { from { opacity: 0; transform: translateX(14px); } }
.step-title { font-size: 28px; line-height: 1.15; font-weight: 400; }
.field { display: grid; gap: 2px; }
.field label, .label { font-family: var(--type); font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.field input, .field textarea {
  width: 100%; border: 0; background: transparent; font-family: var(--hand); font-size: 30px; line-height: 34px; height: 40px; padding: 2px 2px 0;
  border-bottom: 2px solid transparent; transition: border-color .2s;
}
.field textarea { height: auto; resize: none; background: transparent; }
.field input::placeholder, .field textarea::placeholder { color: rgba(26, 12, 18, .38); }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--hot); }
.field.bad input { border-bottom-color: var(--cherry); }
.err { font-family: var(--hand); color: var(--cherry); font-size: 20px; }
.err:empty { display: none; }
.hint { font-size: 14px; color: var(--ink-2); }
.fine { font-size: 12px; color: var(--ink-2); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.gems { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; }
.gem-b { position: relative; display: grid; justify-items: center; gap: 0; padding: 6px 0 4px; transition: transform .16s var(--ease-out); }
.gem-b img { width: 36px; height: 36px; filter: drop-shadow(0 3px 3px rgba(70,0,30,.35)); }
.gem-b span { font-size: 11px; font-weight: 700; color: var(--ink-2); }
.gem-b:active { transform: scale(.92); }
.circ { position: absolute; inset: -4px; width: auto; color: var(--hot); pointer-events: none; }
.circ path { stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: draw .45s ease-out forwards; }
.gem-name { font-family: var(--hand); font-size: 24px; color: var(--hot); min-height: 1.1em; }

.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; }
.shot { position: relative; aspect-ratio: 4 / 5; transition: transform .2s var(--ease-out); }
.shots.compact { grid-template-columns: repeat(6, 1fr); gap: 8px; }
.shots.compact .shot.full { padding: 3px 3px 8px; }
.shots.compact .shot.add { font-size: 16px; }
.shot.full { background: #fff; padding: 5px 5px 14px; box-shadow: 0 1px 2px rgba(70,0,30,.25), 0 8px 12px -8px rgba(70,0,30,.4); transform: rotate(var(--sr, -2deg)); }
.shot:nth-child(2n).full { --sr: 2.5deg; }
.shot.full img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot.full .halo { width: 100%; }
.shot.add { border: 2px dashed rgba(26, 12, 18, .35); border-radius: 4px; display: grid; place-items: center; font-family: var(--hand); font-size: 22px; color: var(--ink-2); }
.shot.add:first-of-type, .shot.add.next { border-color: var(--ink); color: var(--ink); }
.shot.sel { outline: 3px solid var(--hot); outline-offset: 3px; }
.shot.busy { background: repeating-linear-gradient(-45deg, #fff 0 8px, #ffe3ee 8px 16px); animation: busy 1s linear infinite; background-size: 200% 200%; }
@keyframes busy { to { background-position: 100% 0; } }
.shot:active { transform: scale(.96); }
.editor { display: grid; gap: 10px; animation: stepIn .35s var(--ease-out) both; }
.ed-photo { position: relative; background: #fff; padding: 8px; box-shadow: 0 1px 2px rgba(70,0,30,.25), 0 10px 16px -10px rgba(70,0,30,.5); cursor: crosshair; touch-action: manipulation; }
.ed-wrap { position: relative; width: fit-content; margin: 0 auto; }
.ed-wrap img { display: block; max-width: 100%; max-height: 34svh; }
.ed-halo { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ed-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chips { display: flex; gap: 4px; }
.chips button { min-width: 40px; height: 34px; padding: 0 10px; border: 2px solid var(--ink); border-radius: 999px; font-size: 13px; font-weight: 700; }
.chips button[aria-checked="true"] { background: var(--ink); color: #fff; }
.ed-del { font-size: 13px; text-decoration: underline; text-underline-offset: 3px; color: var(--cherry); padding: 6px 0; }

.swatches { display: flex; gap: 16px; flex-wrap: wrap; padding: 6px 4px 10px; }
.sw-b { position: relative; width: 56px; height: 56px; border-radius: 50%; transition: transform .2s var(--ease-out); box-shadow: 0 6px 10px -6px rgba(70,0,30,.6), inset 0 0 0 1px rgba(0,0,0,.08); }
.sw-b:active { transform: scale(.92); }
.sw-b .circ { inset: -9px; }
.sheet-foot { display: grid; gap: 10px; justify-items: start; }
.sheet-foot .dymo { min-width: 200px; }

/* ---------- done ---------- */
#done { display: grid; align-items: center; justify-items: end; padding-right: 8vw; }
#done .postit { animation: stick .7s var(--spring) both .9s; }
@keyframes stick { from { opacity: 0; transform: rotate(-12deg) translateY(-30px) scale(1.1); } }
#done h2 { font-size: 34px; line-height: 1.1; }
#doneName { color: var(--hot); }
.postit .link { font-size: 13px; margin: 14px 0 18px; overflow-wrap: anywhere; color: var(--ink-2); }
.postit .tape-b { left: 50%; top: -15px; translate: -50% 0; transform: rotate(4deg); }
.post-links { display: flex; gap: 18px; margin-top: 16px; font-size: 14px; }
.post-links > * { text-decoration: underline; text-underline-offset: 4px; padding: 4px 0; }
#deleteBtn { color: var(--cherry); margin-left: auto; }

/* ---------- gift ---------- */
.postit.small { position: absolute; width: 210px; padding: 18px 18px 16px; left: calc(50% + 120px); top: 12vh; transform: rotate(7deg); animation: stick .7s var(--spring) both 1.2s; }
.postit.small p { font-size: 27px; }
#giftName { color: var(--hot); }
body.opened #giftNote { opacity: 0; transform: rotate(20deg) translateY(-40px); transition: .6s var(--ease-out); pointer-events: none; }
.pager { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); translate: -50% 0; display: flex; align-items: center; gap: 20px; font-size: 14px; animation: fadeUp .6s var(--ease-out) both; }
.pager button { min-height: 44px; padding: 0 14px; text-decoration: underline; text-underline-offset: 4px; }
.pager button:disabled { opacity: .3; text-decoration: none; cursor: default; }
#pageNum { font-weight: 700; letter-spacing: .1em; white-space: nowrap; }
body.opened .pages { pointer-events: auto; cursor: pointer; }

/* toast */
.toast { position: fixed; left: 50%; bottom: max(26px, env(safe-area-inset-bottom)); translate: -50% 0; z-index: 95; padding: 12px 20px; background: var(--ink); color: #fff; font-size: 14px; opacity: 0; transform: translateY(10px) rotate(-1deg); transition: opacity .3s, transform .4s var(--ease-out); pointer-events: none; }
.toast.on { opacity: 1; transform: rotate(-1deg); }
.noscript { position: fixed; inset: auto 0 40px; text-align: center; z-index: 99; }

@media (min-width: 768px) and (max-height: 760px) {
  .headline { font-size: clamp(36px, 4.4vw, 64px); }
  .intro-copy { gap: 16px; top: 54%; }
}
/* link-preview capture (?og) */
html.og .book { transition: none; }
html.og .cta-row, html.og .legal-link, html.og .brand, html.og #tassh-mark { display: none !important; }

/* ---------- phones ---------- */
@media (max-width: 767px) {
  .brand { left: 18px; font-size: 11px; }
  .intro-copy { left: 18px; right: 18px; top: auto; bottom: max(40px, calc(env(safe-area-inset-bottom) + 30px)); transform: none; width: auto; gap: 14px; }
  .headline { font-size: clamp(34px, 10.4vw, 46px); }
  .lede { font-size: 22px; }
  .cta-row { gap: 6px 16px; }
  .legal-link { left: 18px; }
  .p-phone { width: 40vw; right: -16vw; top: 1vh; }
  .p-bfly { width: 17vw; left: 3vw; top: 30svh; }
  .p-lip { width: 22vw; left: -6vw; top: 3svh; bottom: auto; }
  .p-cherry { width: 13vw; left: auto; right: 4vw; top: 41svh; }
  .p-perf, .p-sun, .p-pot { display: none; }
  body[data-screen="make"] .prop, body[data-screen="done"] .prop, body[data-screen="gift"] .p-perf { opacity: 0; }
  body[data-screen="gift"] .p-lip { left: -6vw; bottom: auto; top: 4svh; }
  body[data-screen="gift"] .p-bfly { left: auto; right: 3vw; top: auto; bottom: 14svh; }
  #make .sheet { position: absolute; left: 0; right: 0; bottom: 0; top: auto; translate: none; width: 100%; max-height: 72svh; transform: none; padding: 26px 18px max(20px, env(safe-area-inset-bottom)) 48px; }
  #make .sheet { animation-name: sheetUp; }
  @keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
  .sheet::before { -webkit-mask: radial-gradient(circle 6px at 16px 22px, #0000 96%, #000) 0 0 / 100% 44px repeat-y; mask: radial-gradient(circle 6px at 16px 22px, #0000 96%, #000) 0 0 / 100% 44px repeat-y; background: linear-gradient(90deg, transparent 36px, var(--margin) 36px 37.5px, transparent 37.5px), repeating-linear-gradient(180deg, transparent 0 33px, var(--rule) 33px 34px) 0 14px, var(--paper-tex, none) 0 0 / 384px, var(--paper); background-blend-mode: normal, normal, multiply, normal; }
  .sheet-foot { padding-bottom: 30px; }
  .sheet-foot .dymo { width: 100%; }
  .gem-b img { width: 32px; height: 32px; }
  .field input { font-size: 28px; }
  #done { justify-items: center; align-items: end; padding: 0 16px max(54px, calc(env(safe-area-inset-bottom) + 40px)); }
  .postit.small { left: auto; right: 14px; top: auto; bottom: 7svh; width: 190px; }
}
@media (max-width: 767px) and (max-height: 700px) {
  .gem-b span { display: none; }
  .step { gap: 10px; }
  .field input { height: 36px; font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .2s !important; transition-delay: 0s !important; }
}
