@font-face {
  font-family: Caveat;
  src: url("assets/caveat.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
.wish-post {
  --hand: Caveat, "Instrument Serif", cursive;
  display: block; position: fixed; inset: auto 20px max(18px,env(safe-area-inset-bottom)) auto;
  width: min(390px,calc(100vw - 28px)); height: 222px; margin: 0; padding: 0; z-index: 30;
  overflow: hidden; pointer-events: none; isolation: isolate;
  border: 1px solid #d5bc7e; border-radius: 15px; color: #fff7db;
  background: linear-gradient(0deg,#08162df5,#0f254740 68%),url("assets/polar-night-compact.webp") center 66%/cover,#122547;
  box-shadow: 0 12px 45px #06173455;
  animation: post-appear .25s ease-out both, post-disappear .25s 4s ease-in both;
}
.wish-post::backdrop { background:transparent; pointer-events:none; }
.post-destination { position:absolute; top:11px; right:8%; text-align:center; letter-spacing:.045em; font:600 .72rem var(--sans); text-shadow:0 1px 6px #07162a; }
.north-star { display:block; font:26px/1 Georgia,serif; color:#ffdc78; filter:drop-shadow(0 0 6px #ffd86b); }
.post-route { position:absolute; inset:0; height:90%; width:100%; fill:none; pointer-events:none; }
.post-route path { stroke:#ffdf8d; stroke-width:1.8; stroke-linecap:round; stroke-dasharray:1 7; animation:post-trail .7s 2.5s both; }
.post-paper {
  position:absolute; top:29%; left:8%; width:80%; padding:10px 18px 15px;
  background:linear-gradient(112deg,#fcf0cf,#fffaf0 50%,#eedab2); border:1px solid #f3e1b4; box-shadow:0 7px 20px #04112d66;
  color:#273d58; transform-origin:center 80%; transform:rotate(-4deg); font:600 27px/1.15 var(--hand);
  animation:post-fold .62s 1.94s ease-in-out both;
}
.post-line { position:relative; width:fit-content; max-width:100%; border-bottom:1px solid #b0aa95; }
.post-ink { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:24px; animation:post-write 1.25s .38s ease-in-out both; }
.post-pen { position:absolute; width:38px; height:46px; bottom:1px; left:0; animation:post-pen-travel 1.25s .38s ease-in-out both,post-pen-lift .22s 1.72s ease-in both; }
.post-pen svg { width:100%; height:100%; transform-origin:7% 96%; animation:post-stroke .18s .38s 7 alternate ease-in-out; }
.post-envelope { position:absolute; left:23%; top:69%; width:83px; height:52px; transform-origin:center; background:linear-gradient(30deg,#e4ca91,#fff2cf 48%,#edd39b); border:1px solid #dec18b; box-shadow:0 3px 9px #05163366; animation:post-flight 1.52s 2.15s both; }
.post-envelope i { position:absolute; inset:0; clip-path:polygon(0 0,100% 0,50% 68%); background:linear-gradient(#fff5d8,#d6b678); }
.post-envelope b { position:absolute; left:41%; top:43%; width:16px; height:16px; border-radius:50%; background:#9f3542; font:11px/16px Georgia,serif; text-align:center; color:#ffe5aa; }
.post-caption { position:absolute; bottom:13px; inset-inline:10px; height:19px; color:#fff8eb; text-align:center; font:600 .8rem/19px var(--sans); }
.post-caption span { position:absolute; inset:0; }
.post-caption span:first-child { animation:post-disappear .2s 2s both; }
.post-caption span:last-child { animation:post-trail .25s 2.2s both; }
@keyframes post-write { from{clip-path:inset(0 100% 0 0)} to{clip-path:inset(0)} }
@keyframes post-pen-travel { from{left:0} to{left:100%} }
@keyframes post-stroke { to{transform:rotate(-9deg) translateY(-2px)} }
@keyframes post-pen-lift { to{transform:translate(6px,-10px);opacity:0} }
@keyframes post-fold { 0%{transform:rotate(-4deg)} 50%{transform:perspective(360px) rotateX(45deg) rotate(-4deg) scale(.78)} 100%{opacity:0;transform:translate(-20%,32%) scale(.25,.06) rotate(-7deg)} }
@keyframes post-flight {
  0%{left:23%;top:68%;opacity:0;transform:translate(-50%,-50%) scale(.55) rotate(-8deg)}
  15%{opacity:1;transform:translate(-50%,-50%) scale(1) rotate(-7deg)}
  48%{left:55%;top:58%;transform:translate(-50%,-50%) scale(.7) rotate(12deg)}
  75%{left:70%;top:40%;opacity:1}
  100%{left:85%;top:10%;opacity:0;transform:translate(-50%,-50%) scale(.07) rotate(-24deg)}
}
@keyframes post-appear { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
@keyframes post-disappear { to{opacity:0} }
@keyframes post-trail { from{opacity:0} to{opacity:1} }
@media(max-width:500px){.wish-post{right:14px;height:192px}.post-paper{padding:8px 12px 10px;font-size:24px}.post-ink{font-size:21px}}
@media(prefers-reduced-motion:reduce){
  .wish-post,.wish-post *{animation:none!important}
  .wish-post{height:49px;width:min(290px,calc(100vw - 28px));background:#132849}
  .post-paper,.post-route,.post-envelope,.post-destination,.post-caption span:last-child{display:none}
}

.shop-sheet[aria-labelledby="wish-title"] {
  width:min(580px,calc(100vw - 24px)); color:#253851; border-radius:8px; background:#fffaeb;
}
.shop-sheet[aria-labelledby="wish-title"] .sheet-content {
  border-top:8px solid transparent;
  border-image:repeating-linear-gradient(125deg,#a33f46 0 12px,#f9f2de 12px 24px,#314c73 24px 36px,#f9f2de 36px 48px) 8;
  padding:clamp(22px,4vw,42px);
  background:radial-gradient(ellipse at top left,#f3e1b940,transparent 52%),#fff9e9;
}
.letter-address { display:flex; justify-content:space-between; align-items:center; padding:0 40px 20px 0; margin-bottom:22px; border-bottom:1px solid #cfc3a7; }
.letter-recipient { display:grid;gap:3px; }
.letter-recipient small { color:#6f5743; font:650 .66rem var(--sans); letter-spacing:.09em; text-transform:uppercase; }
.letter-recipient strong { font:700 1.12rem "Bricolage Grotesque",var(--sans); }
.letter-recipient span,.letter-local,.letter-empty { font:.82rem/1.5 var(--sans); }
.letter-stamp { flex:none; position:relative; width:46px; height:55px; display:grid; place-items:center; outline:1px dashed #899aab; outline-offset:2px; border:4px solid #fff5dc; color:#ffe09b; font:34px Georgia,serif; background:linear-gradient(#192f50aa,#10284491),url("assets/polar-night-compact.webp") center/cover; transform:rotate(6deg); }
.shop-sheet #wish-title { color:#203951; font:600 clamp(2.45rem,7vw,3.75rem)/1 Caveat,cursive; letter-spacing:-.015em; padding:0; }
.letter-intro,.letter-closing { font:500 1.65rem/1.12 Caveat,cursive; }
.letter-intro { margin:6px 0 22px; }
.letter-empty { margin:8px 0 20px;color:#514c43; }
.wish-row { border-color:#d6c9ac; }
.wish-row .shop-photo { border-radius:6px; border:1px solid #e7dabb; }
.wish-row .wish-copy h3 { font-family:"Bricolage Grotesque",var(--sans);font-weight:700;line-height:1.25; }
.wish-remove { color:#6f4240; }
.letter-closing { margin:20px 0 16px; display:grid; justify-items:end; color:#425775; }
.letter-local { color:#55574e; margin:0 0 14px; }
