/* Shared by the letter viewer and the site pages: the app's palette (android/.../ui/theme/Theme.kt),
   its hand-drawn leaves and the sealed envelope. The app is light only, and so is the web. */
:root{--cream:#efe2d2;--beige:#e2c7a7;--sand:#d9a66a;--terracotta:#c97434;--cinnamon:#a56434;--coffee:#6a4a2d;--coffee-soft:#7a5636;--sage:#a8b089;--sheet:#fbf6ef;--paper:#f8f0e6;--cheek:#f0a48c;--sage-deep:#7d8a55;--blush:#f4d8c2;--rule:#d9a66a55;
  --env-back:#c9935a;--env-side:#e6c9a2;--env-bottom:#edd6b7;--env-flap:#dfbb8e;
  --display:"Fraunces",Georgia,serif;--body:"Figtree",system-ui,sans-serif;--hand:"Caveat","Segoe Print",cursive;
  color-scheme:light;color:var(--coffee);background:var(--cream);font-family:var(--body)}
*{box-sizing:border-box}
[hidden]{display:none!important}

/* Background leaves: the app's Leaf(), same path and thin outline. */
#leaves{position:fixed;inset:0;pointer-events:none;z-index:0;overflow:hidden}
#leaves>div{position:absolute}
#leaves svg{display:block;width:100%;height:100%;overflow:visible}
#leaves .sway{width:100%;height:100%;transform-origin:50% 90%;animation:sway var(--d,9s) ease-in-out infinite alternate}
@keyframes sway{from{transform:rotate(-3deg)}to{transform:rotate(3deg)}}

/* The sealed envelope with its wax seal and little face. */
.env-btn{all:unset;cursor:pointer;display:block;position:relative;width:min(80vw,360px,52vh);border-radius:14px}
.env-btn:focus-visible{outline:3px solid var(--terracotta);outline-offset:8px}
.env-float{animation:float 3.6s ease-in-out infinite}
@keyframes float{0%,100%{transform:translateY(0) rotate(-1.2deg)}50%{transform:translateY(-8px) rotate(1.2deg)}}
.envelope{position:relative;aspect-ratio:1.48;perspective:900px}
.env-shadow{position:absolute;left:10%;right:10%;bottom:-26px;height:18px;border-radius:50%;background:#6a4a2d2e;filter:blur(8px);animation:shadow 3.6s ease-in-out infinite}
@keyframes shadow{0%,100%{transform:scaleX(1);opacity:1}50%{transform:scaleX(.88);opacity:.7}}
.env-back{position:absolute;inset:0;border-radius:12px;background:var(--env-back)}
.mini{position:absolute;left:7%;right:7%;top:5%;height:90%;border-radius:4px;z-index:1;background:var(--sheet) repeating-linear-gradient(180deg,transparent 0 13px,#d9a66a66 13px 14px) 0 10px;transition:transform .7s cubic-bezier(.3,1.4,.5,1)}
.env-front{position:absolute;inset:0;z-index:2;border-radius:12px;overflow:hidden}
.env-front i{position:absolute;inset:0}
.env-front .l{background:var(--env-side);clip-path:polygon(0 0,52% 54%,0 100%)}
.env-front .r{background:var(--env-side);clip-path:polygon(100% 0,48% 54%,100% 100%);filter:brightness(.97)}
.env-front .b{background:var(--env-bottom);clip-path:polygon(0 100%,50% 46%,100% 100%)}
.flap-wrap{position:absolute;left:0;right:0;top:0;height:60%;z-index:4;transform-origin:50% 0;filter:drop-shadow(0 4px 3px #6a4a2d33);transition:transform .6s cubic-bezier(.5,0,.3,1)}
.flap{position:absolute;inset:0;background:linear-gradient(180deg,var(--env-flap),#e7c79e);clip-path:polygon(0 0,100% 0,52% 98%,48% 98%);border-radius:12px 12px 0 0}
.seal{position:absolute;left:50%;top:60%;z-index:5;width:clamp(42px,14%,55px);aspect-ratio:1;transform:translate(-50%,-55%);background:url(/seal.webp) center/contain no-repeat;filter:drop-shadow(0 3px 3px #6a4a2d59);transition:transform .35s cubic-bezier(.3,1.6,.5,1),opacity .3s}
.face{position:absolute;left:50%;bottom:4%;z-index:3;transform:translateX(-50%);width:30%;height:21%}
.eye{position:absolute;top:18%;width:9%;aspect-ratio:1/1.25;border-radius:50%;background:var(--coffee);animation:blink 4.5s infinite}
.eye.a{left:24%}.eye.b{right:24%}
.eye:after{content:"";position:absolute;top:18%;left:22%;width:34%;height:30%;border-radius:50%;background:#fff}
@keyframes blink{0%,92%,100%{transform:scaleY(1)}95%{transform:scaleY(.1)}}
.happy{position:absolute;top:16%;width:16%;opacity:0;stroke:var(--coffee);stroke-width:2.4;fill:none;stroke-linecap:round}
.happy.a{left:20%}.happy.b{right:20%}
.cheek{position:absolute;top:44%;width:17%;height:15%;border-radius:50%;background:var(--cheek);opacity:.6}
.cheek.a{left:6%}.cheek.b{right:6%}
.mouth{position:absolute;left:50%;top:44%;width:16%;transform:translateX(-50%);stroke:var(--coffee);stroke-width:2.2;fill:none;stroke-linecap:round}
.hearts{position:absolute;inset:0;pointer-events:none;z-index:6}
.hearts svg{position:absolute;bottom:62%;width:18px;opacity:0;animation:rise 4.2s ease-out infinite}
.hearts svg:nth-child(1){left:8%;animation-delay:.2s}
.hearts svg:nth-child(2){right:6%;width:14px;animation-delay:1.6s}
.hearts svg:nth-child(3){right:20%;width:11px;animation-delay:3s}
.hearts svg:nth-child(4){left:20%;bottom:auto;top:-8%;width:14px;animation:twinkle 2.6s ease-in-out infinite .6s}
.hearts svg:nth-child(5){right:-4%;bottom:12%;width:14px;animation:twinkle 3.1s ease-in-out infinite 1.4s}
@keyframes rise{0%{transform:translateY(10px) scale(.6);opacity:0}15%{opacity:1}100%{transform:translateY(-70px) scale(1) rotate(12deg);opacity:0}}
@keyframes twinkle{0%,100%{transform:scale(.4) rotate(0);opacity:0}50%{transform:scale(1) rotate(45deg);opacity:1}}

/* The sheet of a letter, as the viewer and the moderation panel draw it. */
.paper{position:relative;width:min(100cqw,calc(100cqh * 1080 / 1520));aspect-ratio:1080/1520;overflow:hidden;border-radius:6px;background:#fbf6ef url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");box-shadow:inset 0 0 55px #8e6e3826,0 18px 36px #6a4a2d33,0 3px 8px #6a4a2d1f}
.paper.parchment{background-color:#e6cb98;box-shadow:inset 0 0 80px #a5643455,0 18px 36px #6a4a2d33}
.paper.blank{background:#fffdf9}
.paper.solid{background-image:none}
.paper .photo-sheet{position:absolute;display:block;pointer-events:none}
.paper canvas,.paper svg{position:absolute;inset:0;width:100%;height:100%;z-index:1}
/* Letters with several pages: one at a time, with «2 de 3». */
.page-viewer{position:relative;width:100cqw;height:100cqh;display:grid;place-items:center;touch-action:pan-y;user-select:none;outline:none}
.page-viewer>.paper{grid-area:1/1}
/* The edges of the pages under the one on top, at its bottom right. */
.page-viewer>.paper.stack-1{box-shadow:inset 0 0 55px #8e6e3826,2px 2px 0 -.5px #f1e6d6,2px 2px 0 0 #d9a66a80,0 18px 36px #6a4a2d33}
.page-viewer>.paper.stack-2{box-shadow:inset 0 0 55px #8e6e3826,2px 2px 0 -.5px #f1e6d6,2px 2px 0 0 #d9a66a80,4px 4px 0 -.5px #efe3d2,4px 4px 0 0 #d9a66a70,0 18px 36px #6a4a2d33}
/* The fold of a page being turned (or of its turned-down corner): placed and shaped from app.js. */
.page-flap,.page-fold-shadow{position:absolute;pointer-events:none}
.page-flap{filter:drop-shadow(0 1px 1px #6a4a2d26)}
/* ‹ 2 de 3 ›, below the sheet. */
.page-nav{position:absolute;z-index:40;bottom:8px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:6px}
.page-turn{width:30px;height:30px;padding:0;border:0;border-radius:999px;background:#f8f0e6e6;box-shadow:0 0 0 1px #d9a66a66,0 2px 6px #6a4a2d26;color:var(--coffee);font:600 20px/1 var(--body);cursor:pointer}
.page-turn:disabled{opacity:.35;cursor:default}
.page-counter{padding:5px 10px;border-radius:999px;background:#f8f0e6e6;box-shadow:0 0 0 1px #d9a66a66;font:600 13px/1 var(--body);color:var(--coffee)}
