/* The pop-up book. Everything is measured in --u, 1% of the scene. The hinge between the two pages is the origin. */
.hero { --u: min(1vw, .465svh); --w: min(94vw, 178 * var(--u)); --h: calc(116 * var(--u)); --pages: calc(6.5 * var(--u)); --card: calc(1.6 * var(--u)); --lip: calc(2 * var(--u)); position: relative; height: 100svh; min-height: 480px; overflow: hidden; }
.stage { position: absolute; inset: 0; perspective: calc(430 * var(--u)); perspective-origin: 50% 34%; }
.world { position: absolute; left: 50%; top: calc(50% + 14 * var(--u)); width: 0; height: 0; transform-style: preserve-3d; transform: translateZ(calc(-34 * var(--u))) rotateX(-22deg) rotateX(var(--lean, 0deg)) rotateY(var(--turn, 0deg)); }
.sheet { position: absolute; left: calc(var(--w) / -2); width: var(--w); height: var(--h); }
.back { bottom: 0; transform-origin: 50% 100%; transform-style: preserve-3d; }
.back > * { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.sheet { transform-style: preserve-3d; }

/* The book itself. Under each printed page lies a block of pages (--pages thick), then the hard cover (--card thick)
   that reaches --lip past the pages on the three outer sides. Faces are turned out of the page's plane, so the book has
   real thickness from every angle and when it is shut. On the back half the hinge is the bottom edge; on the floor, the top. */
.sheet > :is(.pages, .board) { position: absolute; transform-style: preserve-3d; -webkit-backface-visibility: visible; backface-visibility: visible; pointer-events: none; }
.sheet > .pages { inset: 0; }
.sheet > .board { transform: translateZ(calc(-1 * var(--pages))); background: #8f1820 url(/art/red.webp) 0 0 / 160px; box-shadow: inset 0 0 0 calc(.35 * var(--u)) #6e1018; }
.back > .board { inset: calc(-1 * var(--lip)) calc(-1 * var(--lip)) 0; }
.floor > .board { inset: 0 calc(-1 * var(--lip)) calc(-1 * var(--lip)); }
:is(.pages, .board) > i { position: absolute; -webkit-backface-visibility: visible; backface-visibility: visible; }
/* Page edges: fine cream lines, a little darker towards the cover. */
.pages > i { --lines: repeating-linear-gradient(var(--dir), #fffaf0 0 1.6px, #e3d1ad 1.6px 2.4px); background: linear-gradient(var(--dir), #0000 55%, #6b4d4033), var(--lines); }
.pages > .end { --dir: 180deg; left: 0; width: 100%; height: var(--pages); }
.pages > .side { --dir: 270deg; top: 0; height: 100%; width: var(--pages); transform-origin: 0 50%; transform: rotateY(90deg); }
.pages > .left { left: 0; }
.pages > .right { left: 100%; --dir: 270deg; }
.board > i { background: #6e1018; }
.board > .end { left: 0; width: 100%; height: var(--card); }
.board > .side { top: 0; height: 100%; width: var(--card); transform-origin: 0 50%; transform: rotateY(90deg); }
.board > .left { left: 0; }
.board > .right { left: 100%; }
.floor > * > .end { top: 100%; transform-origin: 50% 0; transform: rotateX(-90deg); }
.back > * > .end { bottom: 100%; transform-origin: 50% 100%; transform: rotateX(90deg); }
/* The fold: both pages darken into the gutter, like paper bending into the spine. */
.sky::after, .floor::before { content: ''; position: absolute; left: 0; right: 0; height: calc(7 * var(--u)); pointer-events: none; }
.sky::after { bottom: 0; background: linear-gradient(#0000, #0a162655 70%, #0a1626a0); }
.floor::before { top: 0; z-index: 1; background: linear-gradient(#0a1626a0, #0a162640 35%, #0000); }
.bookmark { transform-style: preserve-3d; position: absolute; left: 63%; top: calc(100% - 9 * var(--u)); width: calc(2.6 * var(--u)); height: calc(9 * var(--u) + 1px); transform: translateZ(1px); background: linear-gradient(90deg, #a8141d, #d8343b 45%, #a8141d); -webkit-backface-visibility: visible; backface-visibility: visible; }
.bookmark::after { content: ''; position: absolute; left: 0; top: 100%; width: 100%; height: calc(13 * var(--u)); transform-origin: 50% 0; transform: rotateX(-90deg) translateZ(calc(.3 * var(--u))); background: inherit; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%); }
.sky { background: #122c50 url(/art/sky.webp) 50% 0 / auto 100%; box-shadow: inset 0 0 0 1px #0a162640; }
.back > .cover { inset: calc(-1 * var(--lip)) calc(-1 * var(--lip)) 0; transform: rotateX(180deg) translateZ(calc(var(--pages) + var(--card))); display: grid; place-content: center; justify-items: center; gap: calc(2.4 * var(--u)); text-align: center; color: #ffe3a0; background: #c4272d url(/art/red.webp) 0 0 / 160px; box-shadow: inset 0 0 0 calc(3.2 * var(--u)) #b01f27, inset 0 0 0 calc(3.8 * var(--u)) var(--gold), inset 0 0 0 calc(5 * var(--u)) #b01f27, inset 0 0 0 calc(5.3 * var(--u)) #f0b44190, 0 0 0 calc(1 * var(--u)) var(--red-deep), 0 calc(4 * var(--u)) calc(10 * var(--u)) #04140f; }
.cover b { font: 700 calc(9 * var(--u))/1.1 Sansita, serif; text-shadow: 0 1px 0 #7c111a, 0 -1px 0 #fff3c4; }
.cover span { font: 400 calc(7.4 * var(--u))/1 Caveat, cursive; }
.wreath { position: relative; width: calc(56 * var(--u)); aspect-ratio: 1; }
.wreath img { position: absolute; inset: 0; width: 100%; }
.wreath .bell { inset: 25%; width: 50%; transform-origin: 50% 12%; }
.wreath .bow { inset: auto auto -7% 27%; width: 46%; }
.floor { top: 0; transform-origin: 50% 0; transform: rotateX(90deg); background: url(/art/ground.webp) 50% 0 / 100% 100%; box-shadow: inset 0 0 0 1px #0a162630; }
.light { position: absolute; inset: 0; opacity: 0; background: radial-gradient(#fff3c4, #f7c552 60%, #dd9a2c); }

/* Loading: the closed book waits on the gift wrap. */
.is-closed .world { transform: translateY(calc(-56 * var(--u))) translateZ(calc(-70 * var(--u))) rotateX(-60deg) rotateY(-16deg); animation: hover 3s ease-in-out infinite alternate; }
/* On a narrow screen the turned book would reach past the edges: it stays further away and turns less. */
@media (max-aspect-ratio: 3/4) { .is-closed .world { transform: translateX(calc(9 * var(--u))) translateY(calc(-50 * var(--u))) translateZ(calc(-170 * var(--u))) rotateX(-60deg) rotateY(-8deg); } }
.is-closed .back { transform: rotateX(-89deg); }
.is-closed .world > :not(.back, .floor), .is-closed .hangers { visibility: hidden; }
/* While it waits, the bell on the cover rings now and then. */
.is-closed .wreath .bell { animation: ring 2.6s ease-in-out infinite; }
@keyframes hover { from { translate: 0 0; rotate: z -1deg; } to { translate: 0 calc(-2.5 * var(--u)); rotate: z 1deg; } }
@keyframes ring { 0%, 45%, 100% { rotate: 0deg; } 55% { rotate: 14deg; } 65% { rotate: -11deg; } 75% { rotate: 7deg; } 85% { rotate: -3deg; } }
.caption { position: absolute; inset: auto 16px 9%; text-align: center; font: 700 1.5rem/1.2 Sansita, serif; color: #ffe3a0; visibility: hidden; }
.is-closed .caption { visibility: visible; }

/* A cut-out standing on the page: --x sideways, --y up, --z towards the reader. It folds flat at the page, even when it stands on a hill. */
.stand { position: absolute; bottom: calc(var(--y, 0) * var(--u)); left: calc(var(--s) * var(--u) / -2); width: calc(var(--s) * var(--u)); aspect-ratio: var(--ar); translate: calc(var(--x, 0) * var(--u)) 0 calc(var(--z) * var(--u)); transform-origin: 50% calc(100% + var(--y, 0) * var(--u)); transform-style: preserve-3d; }
.cloud img { width: 100%; }
.back > .hangers { transform-style: preserve-3d; -webkit-backface-visibility: visible; backface-visibility: visible; }
.strip { left: calc(var(--w) / -2); width: var(--w); height: calc(var(--s) * var(--u)); aspect-ratio: auto; background: 50% 0 / auto 100%; }
.forest { --s: 47; --z: 4; background-image: url(/art/forest.webp); }
.hills { --s: 27; --z: 10; background-image: url(/art/hills.webp); }
.slope { --s: 17; --z: 19; background: url(/art/hills.webp) 20% 0 / auto 170%; }
.drift { --s: 8; --z: 27; background-image: url(/art/drift.webp); }
.cloud { --z: 7; position: absolute; left: 50%; bottom: calc(var(--y) * var(--u)); width: calc(25 * var(--u)); translate: calc((var(--x) - 12) * var(--u)) 0 calc(var(--z) * var(--u)); }
.cloud img { animation: float 11s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -5s); }
@keyframes float { from { translate: -28% 0; } to { translate: 28% 0; } }

.half { position: absolute; top: 0; left: 0; width: 50%; height: 100%; background: var(--img) 0 0 / 200% 100%; transform-origin: 100% 50%; transform: rotateY(-26deg); }
.half + .half { left: 50%; background-position-x: 100%; transform-origin: 0 50%; transform: rotateY(26deg); }
.house { --s: 21; --ar: 180 / 190; }
.church { --s: 27; --ar: 220 / 320; }
.pine { --s: 17; --ar: 120 / 170; }
.smoke { position: absolute; left: 70%; top: 4%; width: calc(2.8 * var(--u)); aspect-ratio: 1; border-radius: 50%; background: #c5d6e2; box-shadow: 0 0 0 calc(.35 * var(--u)) #fff9ea, 1px 2px 2px #0a162660; animation: smoke 4.8s linear infinite; animation-delay: calc((var(--i) * 1.6 + var(--x) * .13 + 12) * -1s); }
@keyframes smoke { from { translate: 0 0; scale: .3; opacity: 0; } 12% { opacity: 1; } 60% { opacity: .9; } to { translate: calc(4 * var(--u)) calc(-13 * var(--u)); scale: 1.3; opacity: 0; } }
.tree { --s: 60; --ar: 400 / 580; --x: -15; --z: 47; }
.half b { position: absolute; width: calc(3.5 * var(--u)); aspect-ratio: 1; margin: calc(-1.75 * var(--u)); border-radius: 50%; border: calc(.5 * var(--u)) solid #fff9ea; background: linear-gradient(90deg, #0000 50%, #0000002e 50%), var(--c); box-shadow: 0 calc(.5 * var(--u)) calc(.8 * var(--u)) #03201990; }
.lights { position: absolute; inset: 0; animation: twinkle 1.5s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -1s); }
@keyframes twinkle { 30% { opacity: 1; } 100% { opacity: .45; } }
.tree > .topper { position: absolute; left: 50%; bottom: calc(100% - 8 * var(--u)); width: calc(17 * var(--u)); margin-left: calc(-8.5 * var(--u)); translate: 0 0 calc(2 * var(--u)); }
.santa-spot { --s: 37; --ar: 320 / 470; --x: 27; --z: 62; }
.snow-spot { --s: 28; --ar: 260 / 310; --x: -32; --z: 74; }

.hang { position: absolute; left: calc(50% + var(--x) * var(--u)); bottom: calc((115 - var(--len)) * var(--u)); width: calc(9 * var(--u)); height: calc(var(--len) * var(--u)); margin-left: calc(-4.5 * var(--u)); translate: 0 0 calc(var(--z) * var(--u)); transform-origin: 50% 0; animation: hang 3.8s ease-in-out infinite alternate; animation-delay: calc(var(--len) * -.3s); }
.hang::before { content: ''; position: absolute; left: 50%; top: calc(var(--z) * -.42 * var(--u)); bottom: calc(8 * var(--u)); width: 1px; background: #fff6e3b0; }
.hang img { position: absolute; bottom: 0; width: 100%; }
@keyframes hang { from { rotate: y -34deg; } to { rotate: y 34deg; } }

.flight { position: absolute; left: 0; bottom: calc(78 * var(--u)); width: calc(74 * var(--u)); height: calc(20 * var(--u)); translate: 0 0 calc(13 * var(--u)); visibility: hidden; }
.flight img { position: absolute; bottom: 0; }
.flight .sled { width: 34%; left: 0; }
.flight .deer { width: 21%; bottom: 20%; left: calc(31% + var(--i) * 21%); animation: gallop .4s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.16s); }
.flight::before { content: ''; position: absolute; left: 30%; right: 10%; bottom: 47%; height: 2px; background: var(--gold); }
.strings { --line: linear-gradient(#fff6e390, #fff6e390); position: absolute; inset: auto 0 55%; height: calc(90 * var(--u)); background: var(--line) 19% 0, var(--line) 43% 0, var(--line) 64% 0, var(--line) 85% 0; background-size: 1px 100%; background-repeat: no-repeat; }
@keyframes gallop { from { rotate: -9deg; translate: 0 8%; } to { rotate: 7deg; translate: 0 -10%; } }

/* The box: four walls hinged on the page, plus a lid. */
.gift { --g: calc(27 * var(--u)); --cut: inset 0 0 0 calc(.35 * var(--u)) #fff3dc; position: absolute; left: 0; bottom: 0; width: 0; height: 0; transform-style: preserve-3d; translate: calc(-2 * var(--u)) 0 calc(82 * var(--u)); transform: rotateY(-24deg); cursor: pointer; }
.shake { position: absolute; transform-style: preserve-3d; }
.wall { position: absolute; left: calc(var(--g) / -2); bottom: 0; width: var(--g); height: var(--g); transform-style: preserve-3d; transform-origin: 50% 100%; transform: rotateY(calc(var(--k) * 90deg)) translateZ(calc(var(--g) / 2)) rotateX(var(--fall, 0deg)); }
.wall::before, .wall::after { content: ''; position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; background: url(/art/wall.webp) 0 0 / 100%; filter: brightness(var(--lit, 1)); box-shadow: var(--cut); }
.wall::after { background-image: url(/art/inside.webp); transform: rotateY(180deg); filter: none; }
.base { position: absolute; left: calc(var(--g) / -2); bottom: calc(var(--g) / -2); width: var(--g); height: var(--g); transform: translateY(-1px) rotateX(90deg); background: url(/art/inside.webp) 0 0 / 100%; box-shadow: 0 0 calc(6 * var(--u)) calc(2 * var(--u)) #1b416370; }
.rays { position: absolute; left: calc(var(--g) * -1.35); bottom: calc(var(--g) * .94); width: calc(var(--g) * 2.7); transform: scale(1, 0); transform-origin: 50% 100%; }
.lid { position: absolute; bottom: var(--g); transform-style: preserve-3d; }
.lid > i { position: absolute; left: calc(var(--g) * -.54); width: calc(var(--g) * 1.08); box-shadow: var(--cut); }
.lid .top { height: calc(var(--g) * 1.08); bottom: calc(var(--g) * -.54); transform: rotateX(90deg); background: url(/art/lid.webp) 0 0 / 100%; }
.lid .rim { height: calc(var(--g) * .21); top: 0; background: url(/art/wall.webp) 0 0 / 100%; filter: brightness(var(--lit, 1)); transform: rotateY(calc(var(--k) * 90deg)) translateZ(calc(var(--g) * .54)); }
.bow { position: absolute; bottom: calc(var(--g) * -.06); left: calc(var(--g) * -.45); width: calc(var(--g) * .9); transform-origin: 50% 100%; transform: rotateY(var(--r)); }
.tag { position: absolute; left: calc(var(--g) * -.44); bottom: calc(var(--g) * .2); translate: 0 0 calc(var(--g) / 2 + 2px); width: max-content; max-width: calc(var(--g) * .88); padding: calc(1.2 * var(--u)) calc(2 * var(--u)); font: 400 calc(4.2 * var(--u))/1 Caveat, cursive; color: var(--ink); background: var(--cream); box-shadow: 0 -2px 0 var(--board), 0 3px 4px #0a162680; rotate: -5deg; overflow-wrap: break-word; }
.is-open .wall { --fall: -86deg; }
.is-open .lid, .is-open .tag { visibility: hidden; }
.is-open .tape { visibility: hidden; }
.no-gift .gift { display: none; }
/* Ribbon strips, separate from the paper so they can be pulled off. */
.tape { position: absolute; top: 0; left: 42%; width: 16%; height: 100%; background: linear-gradient(90deg, #f0b441 75%, #c98a2a 75%); box-shadow: 0 0 0 calc(.2 * var(--u)) #fff3dc90; }
.tape.across { top: 42%; left: 0; width: 100%; height: 16%; background: linear-gradient(#f0b441 75%, #c98a2a 75%); }
.wall > .tape { transform: translateZ(1px); filter: brightness(var(--lit, 1)); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.is-waiting .shake { animation: shake .3s linear infinite; }
.is-ready .shake { animation: nudge 3.2s ease-in-out infinite; }
@keyframes shake { 25% { rotate: z 1.2deg; } 75% { rotate: z -1.2deg; } }
@keyframes nudge { 0%, 70%, 100% { rotate: z 0deg; translate: 0 0; } 76%, 88% { rotate: z 4deg; translate: 0 -4%; } 82%, 94% { rotate: z -4deg; } }

/* The end of the ribbon stands up out of the bow with a tag; it faces the reader. Pulling it up unties the gift.
   Seven nested pieces each bend and twist a little, out of step, so the ribbon curls like paper ribbon. */
@property --drop { syntax: '<length>'; inherits: true; initial-value: 0px; }
@property --slack { syntax: '<number>'; inherits: true; initial-value: 1; }
.leash { --drop: 0px; --slack: 1; --tail: calc(var(--g) * .95); position: absolute; left: 0; bottom: calc(var(--g) * .2); width: 0; height: 0; transform-origin: 0 0; transform: rotateY(24deg) translateZ(2px); transition: --slack .5s; }
.leash.taut { --slack: .12; }
.leash:has(.pull[hidden]) { display: none; }
.link { position: absolute; left: calc(-1.6 * var(--u)); bottom: -1px; width: calc(3.2 * var(--u)); height: calc((var(--tail) + var(--drop) + 15.1 * var(--u)) / 7 + 1px); transform-origin: 50% 100%; animation: curl 2.6s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.45s); }
.link .link { left: 0; bottom: calc(100% - 1px); }
.link::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #fff9ea 0 9%, #f0b441 9% 64%, #c98a2a 64% 91%, #fff9ea 91%); box-shadow: 0 0 3px #1b416370; animation: twist 1.9s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.3s); }
@keyframes curl { from { rotate: calc(-6deg * var(--slack)); } to { rotate: calc(6deg * var(--slack)); } }
@keyframes twist { from { scale: calc(1 - .45 * var(--slack)) 1; filter: brightness(.86); } to { scale: 1 1; filter: brightness(1.08); } }
.pull, .pull:hover, .pull:active { position: absolute; left: calc(50% - 21 * var(--u)); bottom: calc(100% - 15.1 * var(--u)); width: calc(42 * var(--u)); min-height: 0; aspect-ratio: 340 / 150; padding: calc(5.2 * var(--u)) 0 0; border: 0; border-radius: 0; box-shadow: none; translate: none; filter: drop-shadow(0 3px 3px #0a162680); background: url(/art/pull.webp) 0 0 / 100% 100%; font: 700 calc(4 * var(--u))/1 Sansita, serif; color: var(--red-deep); touch-action: none; user-select: none; -webkit-user-select: none; white-space: nowrap; cursor: grab; }
.sign { position: absolute; z-index: 31; left: 16px; right: 16px; bottom: 16px; margin: auto; width: fit-content; max-width: 420px; padding: 12px 20px; text-align: center; background: var(--cream); border-radius: 4px; box-shadow: var(--lift); font-weight: 700; }
.sign:empty { display: none; }
.sign.error { bottom: 17%; color: var(--red-deep); }

/* The name: rosette, ribbon, and a gatefold card with standing letters. */
@property --fan { syntax: '<angle>'; inherits: false; initial-value: 362deg; }
.dim { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: radial-gradient(circle calc(95 * var(--u)) at 50% calc(50% + 34 * var(--u)), #0000 30%, #040d1ae0 85%); }
.reveal { position: absolute; z-index: 31; inset: calc(50% - 74 * var(--u)) 0 auto; display: grid; justify-items: center; pointer-events: none; perspective: 900px; }
.rosette { position: absolute; left: 50%; top: 52%; width: calc(90 * var(--u)); aspect-ratio: 1; margin: calc(-45 * var(--u)); background: url(/art/rosette.webp) 0 0 / 100%; -webkit-mask: conic-gradient(from 180deg, #000 var(--fan), #0000 0); mask: conic-gradient(from 180deg, #000 var(--fan), #0000 0); border-radius: 50%; }
.ribbon-top { position: relative; z-index: 2; width: min(96vw, 440px); margin-bottom: -44px; overflow: visible; filter: drop-shadow(0 6px 5px #0a162690); }
.ribbon-top text { font: 700 18.5px Alegreya, sans-serif; fill: #fffaf0; }
.band, .tail { transform-box: fill-box; transform-origin: 50% 100%; }
.tail { transform-origin: 100% 50%; }
.tail.right { transform-origin: 0 50%; }
.plate { position: relative; transform-style: preserve-3d; transform-origin: 50% 100%; }
.inside { position: absolute; inset: 0; display: grid; align-content: center; justify-content: center; padding: 0 0 16px; border: 24px solid #0000; border-image: url(/art/frame.webp) 80 / 24px round; background: linear-gradient(90deg, #3a262024, #0000 22% 78%, #3a262024), var(--paper) url(/art/paper.webp) 0 0 / 200px padding-box; transform-style: preserve-3d; }
.line { display: flex; justify-content: center; line-height: 1.12; transform-style: preserve-3d; }
/* Once everything stands still, the card is drawn as a single sheet. */
.still :is(.inside, .line) { transform-style: flat; }
/* Each letter: coloured paper on a cream cut edge, with the thickness of card. */
.glyph { --c: #c4272d; position: relative; display: block; white-space: pre; font-family: Sansita, serif; font-weight: 700; color: var(--c); rotate: var(--tilt); transform-origin: 50% 90%;
  text-shadow: .045em 0 #fff9ea, -.045em 0 #fff9ea, 0 .045em #fff9ea, 0 -.045em #fff9ea, .032em .032em #fff9ea, -.032em .032em #fff9ea, .032em -.032em #fff9ea, -.032em -.032em #fff9ea,
    0 -.07em #cfb486, .03em -.065em #cfb486, -.03em -.065em #cfb486, 0 -.085em #b99a68, .02em .1em .08em #0a162699; }
.glyph:nth-child(even) { --c: #1d6a50; }
.glyph::after { content: attr(data-letter); position: absolute; inset: 0; color: #0000; text-shadow: none; background: linear-gradient(90deg, #ffffff2e 50%, #0000001f 50%); -webkit-background-clip: text; background-clip: text; }
.bank { position: absolute; inset: auto -8px -8px; height: 17px; background: url(/art/drift.webp) 50% 0 / 620px 43px; transform: translateZ(8px); }
.sprig { position: absolute; bottom: -2px; width: 30px; transform-origin: 50% 100%; }
.sprig.left { left: -6px; }
.sprig.right { right: -6px; }
.door { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); transform-style: preserve-3d; translate: 0 0 11px; transform-origin: 0 50%; transform: rotateY(-101deg); }
.door.right { left: 50%; transform-origin: 100% 50%; transform: rotateY(101deg); }
.door::before, .door::after { content: ''; position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; box-shadow: inset 0 0 0 2.5px #fff9ea, inset 0 0 0 7px #a51c25, inset 0 0 0 8.5px #f0b441; background: url(/art/wreath.webp) calc(100% + 54px) 50% / 108px no-repeat, url(/art/flakes.webp) 0 0 / 84px; }
.door.right::before { background-position: -54px 50%, 0 0; }
.door::after { transform: rotateY(180deg); background: linear-gradient(90deg, #0000, #0a162640), url(/art/flakes.webp) 0 0 / 84px; box-shadow: inset 0 0 0 2.5px #fff9ea, inset 0 0 0 5px #f0b441; }
/* Gold foil to scratch off, with a star that shows how until the first touch. */
.foil-box { position: absolute; inset: 14px; transform: translateZ(3px); pointer-events: none; }
.foil-box.ready { pointer-events: auto; }
.foil { display: block; width: 100%; height: 100%; border-radius: 3px; box-shadow: 0 2px 4px #0a162670; touch-action: none; cursor: grab; }
.scraper { position: absolute; left: 8%; top: 52%; width: 40px; height: 40px; border-radius: 50%; pointer-events: none; visibility: hidden; background: radial-gradient(circle at 36% 32%, #fff3c4 0 12%, #0000 13%), radial-gradient(circle, #e9eef2 0 52%, #b9c3cc 53% 60%, #dfe6ec 61% 100%); box-shadow: inset 0 0 0 2px #8e99a3, inset 0 -3px 0 #a3adb6, 0 0 0 3px #fff9ea, 0 3px 4px #0a162680; }
.ready:not(.touched) .scraper { visibility: visible; animation: scrape 2s ease-in-out infinite; }
@keyframes scrape { 0%, 100% { left: 8%; top: 52%; rotate: -18deg; } 50% { left: calc(92% - 44px); top: 18%; rotate: 18deg; } }
.crumb { position: absolute; width: 7px; height: 5px; margin: -3px; border-radius: 1px; background: #e2ad48; box-shadow: inset 0 -1px #a7741f; pointer-events: none; }
.reveal.docked { top: 52px; scale: var(--dock); transform-origin: 50% 0; }
.scroll { position: absolute; z-index: 31; left: 50%; bottom: 18px; margin-left: -110px; width: 220px; }

main { position: relative; z-index: 31; display: grid; gap: 116px; width: min(100% - 12px, 640px); margin: 0 auto; padding: 110px 0 0; }
main > * { min-width: 0; }
.theme { position: relative; width: fit-content; max-width: 100%; margin: 0 auto 26px; padding: 10px 24px 12px 70px; text-align: center; background: var(--cream); border-radius: 4px; box-shadow: var(--lift); rotate: -1.5deg; }
.theme::before { content: ''; position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 44px; aspect-ratio: 1; background: url(/art/bauble-red.webp) center / contain no-repeat; rotate: -8deg; }
.theme small { display: block; color: var(--soft); }
.theme strong { display: block; font: 700 1.75rem/1.15 Sansita, serif; color: var(--red-deep); overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; align-items: center; }
.calendar { width: 124px; text-align: center; background: #fffdf6; border-radius: 4px; box-shadow: var(--lift); rotate: -3deg; line-height: 1.2; padding-bottom: 8px; }
.calendar b { display: block; padding: 6px; color: var(--cream); background: var(--red); border-bottom: 3px dotted #fff6e3; border-radius: 4px 4px 0 0; }
.calendar strong { display: block; font: 700 3.5rem/1.05 Sansita, serif; }
.label { padding: 30px 20px 14px; min-width: 130px; max-width: 210px; text-align: center; line-height: 1.25; font-weight: 700; font-size: 1.1875rem; background: radial-gradient(circle at 50% 15px, #6b4d40 5px, #f0b441 5.5px 9px, #0000 9.5px), #fffdf6; border-radius: 22px 22px 4px 4px; box-shadow: var(--lift); rotate: 2deg; }
.label small { display: block; font-weight: 400; font-size: 1rem; color: var(--soft); }
.message { margin-top: 22px; text-align: center; white-space: pre-line; }
.message:empty { display: none; }
.letter { --line: 2.125rem; }
.hand { font: 400 1.5rem/var(--line) Caveat, cursive; white-space: pre-line; overflow-wrap: anywhere; background: repeating-linear-gradient(#0000 0 calc(var(--line) - 1.5px), #9dbac7 0 var(--line)); min-height: calc(var(--line) * 3); }
textarea.hand { display: block; border-radius: 0; box-shadow: none; padding: 0 4px; background-color: #0000; background-attachment: local; min-height: calc(var(--line) * 5); resize: none; field-sizing: content; }
.address { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 10px; color: var(--soft); }
.address strong { display: block; font: 400 1.5rem/1.3 Caveat, cursive; color: var(--ink); }
.address img { width: 66px; rotate: 4deg; }
.send { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 18px; }
.flying { position: fixed; z-index: 40; width: 160px; pointer-events: none; }
.opened { text-align: center; color: #e2efe6; margin-top: -60px; }
.opened button.quiet { color: #ffdf94; }
footer { --u: 4.6px; position: relative; height: 330px; margin-top: 10px; overflow: hidden; perspective: 900px; }
footer::after { content: ''; position: absolute; inset: auto 0 0; height: 74px; background: url(/art/drift.webp) 50% 0 / 1080px 74px; }
footer .santa { inset: auto auto 34px 50%; width: 176px; height: 258px; margin-left: -88px; }
footer > img { position: absolute; bottom: 52px; left: 50%; width: 112px; }
.problem { position: relative; z-index: 31; display: grid; place-items: center; min-height: 100svh; padding: 130px 16px 32px; }
.problem .card { max-width: 440px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.problem .card > img:not(.deco) { width: 150px; }

/* Gift ideas under the wish list: three paper slips and a way to draw three more. */
.ideas { margin-top: 18px; padding-top: 14px; border-top: 2px dotted #c9a987; }
.ideas ul { list-style: none; margin: 6px 0 4px; padding: 0; display: grid; gap: 6px; }
.ideas li { padding: 6px 12px; background: #fffdf6; border-radius: 4px; box-shadow: var(--lift); rotate: -.6deg; }
.ideas li:nth-child(2) { rotate: .8deg; }
.ideas .more { padding-left: 0; }

/* Anonymous notes: my words on the right in cream, theirs on the left on gold paper, each with its time. */
.notes { display: grid; gap: 12px; }
.notes .about { color: var(--soft); }
.letter .to-santa { margin-top: 26px; padding-top: 20px; border-top: 2px dotted #c9a987; }
.letter .to-santa h3 { margin: 0; font: 700 1.5rem/1.2 Sansita, serif; color: var(--pine); }
.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.thread:empty { display: none; }
.thread li { max-width: 85%; padding: 8px 12px 6px; border-radius: 12px; box-shadow: var(--lift); }
.thread li p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; font: 400 1.375rem/1.25 Caveat, cursive; }
.thread li small { display: block; margin-top: 2px; font-size: .8125rem; color: var(--soft); }
.thread .mine { justify-self: end; background: #fffdf6; border-bottom-right-radius: 3px; }
.thread .theirs { justify-self: start; background: #ffe3a0; border-bottom-left-radius: 3px; }
.write { display: grid; gap: 8px; }
.write textarea { min-height: 72px; resize: vertical; font: 400 1.375rem/1.3 Caveat, cursive; }
.write .send { margin-top: 0; }
