@font-face { font-family: Sansita; src: url(/fonts/sansita-swashed-latin-ext-700-normal.woff2); font-weight: 700; font-display: swap; unicode-range: U+0100-02FF, U+1E00-1EFF; }
@font-face { font-family: Sansita; src: url(/fonts/sansita-swashed-latin-700-normal.woff2); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: Alegreya; src: url(/fonts/alegreya-sans-latin-ext-400-normal.woff2); font-display: swap; unicode-range: U+0100-02FF, U+1E00-1EFF; }
@font-face { font-family: Alegreya; src: url(/fonts/alegreya-sans-latin-400-normal.woff2); font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: Alegreya; src: url(/fonts/alegreya-sans-latin-ext-700-normal.woff2); font-weight: 700; font-display: swap; unicode-range: U+0100-02FF, U+1E00-1EFF; }
@font-face { font-family: Alegreya; src: url(/fonts/alegreya-sans-latin-700-normal.woff2); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: Caveat; src: url(/fonts/caveat-brush-latin-ext-400-normal.woff2); font-display: swap; unicode-range: U+0100-02FF, U+1E00-1EFF; }
@font-face { font-family: Caveat; src: url(/fonts/caveat-brush-latin-400-normal.woff2); font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --red: #bd2329; --red-deep: #85131d; --pine: #0f4436; --cream: #fff6e3; --paper: #f8ecd2; --ink: #3a2620; --soft: #6b4d40; --gold: #f0b441; --board: #cfb486;
  --lift: 0 1px 0 #ffffffb0 inset, 0 3px 0 var(--board), 0 4px 1px #0a162655, 0 10px 12px -3px #0a162680;
}
* { box-sizing: border-box; }
html { background: var(--pine); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100svh; font: 400 1.125rem/1.5 Alegreya, 'Trebuchet MS', sans-serif; color: var(--ink); background: var(--pine) url(/art/wrap.webp) 50% 0 / 200px; overflow-x: hidden; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: Sansita, Georgia, serif; line-height: 1.12; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: #12593f; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Buttons are thick card with a white cut edge; pressing one flattens it. */
button, .button { font: 700 1.125rem/1.2 Alegreya, sans-serif; color: var(--cream); background: #c4272d url(/art/red.webp) 0 0 / 160px; border: 3px solid var(--cream); border-radius: 9px; min-height: 50px; padding: 10px 20px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; box-shadow: var(--lift); transition: translate .16s, box-shadow .16s, filter .16s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:hover, .button:hover { filter: brightness(1.08); translate: 0 -2px; box-shadow: 0 1px 0 #ffffffb0 inset, 0 5px 0 var(--board), 0 6px 1px #0a162655, 0 14px 14px -3px #0a162680; }
button:active, .button:active { translate: 0 3px; box-shadow: 0 1px 0 #ffffffb0 inset, 0 0 0 var(--board), 0 1px 2px #0a162680; }
button:disabled { filter: grayscale(.7) brightness(.9); cursor: default; translate: none; }
button.quiet { color: var(--red-deep); background: none; border-color: #0000; box-shadow: none; padding: 10px 6px; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.card :focus-visible { outline-color: #1d6a50; }

/* Fields are windows cut into the sheet. */
input, textarea, select { font: inherit; color: var(--ink); background: #fffdf6; border: 0; border-radius: 4px; padding: 10px 12px; width: 100%; min-height: 48px; box-shadow: inset 0 2px 4px #3a262070, inset 0 0 0 1.5px #a98c66, 0 1px 0 #fff; }
label { font-weight: 700; display: grid; gap: 4px; }

/* Cream sheet stitched on a backing cut with pinking shears. */
.card { position: relative; border: 32px solid #0000; border-image: url(/art/frame.webp) 80 / 32px round; background: var(--paper) url(/art/paper.webp) 0 0 / 200px padding-box; padding: 4px; transform-origin: 50% 0; }
.card.green { border-image-source: url(/art/frame-green.webp); }
.card :is(h1, h2, h3) { position: relative; z-index: 2; width: fit-content; max-width: 100%; margin: -58px auto 20px; padding: 10px 22px 12px; font-size: 1.625rem; text-align: center; color: var(--cream); background: #c4272d url(/art/red.webp) 0 0 / 160px; box-shadow: 0 1px 0 #ffffff80 inset, 0 3px 0 #7c111a, 0 8px 8px -2px #0a162680; }
.card.green :is(h1, h2, h3) { background: #1d6a50; box-shadow: 0 1px 0 #ffffff60 inset, 0 3px 0 #0c3a2c, 0 8px 8px -2px #0a162680; }
.card :is(h1, h2, h3)::before, .card :is(h1, h2, h3)::after { content: ''; position: absolute; right: 100%; top: 9px; width: 18px; height: 100%; background: #7c111a; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 55% 50%); }
.card :is(h1, h2, h3)::after { right: auto; left: 100%; scale: -1 1; }
.card.green :is(h1, h2, h3)::before, .card.green :is(h1, h2, h3)::after { background: #0c3a2c; }
.pile { position: absolute; z-index: 3; max-width: none; pointer-events: none; transform: translateZ(1px); }
.card > .pile { z-index: 1; }
/* Little buildings that pop up along the top edge. */
.deco { position: absolute; bottom: calc(100% + 24px); width: 58px; transform-origin: 50% 100%; pointer-events: none; }
.deco.left { left: -16px; }
.deco.right { right: -16px; }

#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }

.garland { position: absolute; inset: 0 0 auto; height: 78px; z-index: 20; overflow: hidden; pointer-events: none; }
.garland svg { position: absolute; width: 100%; height: 100%; }
.garland i { position: absolute; width: 40px; height: 48px; margin: -4px 0 0 -20px; pointer-events: auto; cursor: pointer; transform-origin: 50% 0; animation: sway 3.4s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.7s); -webkit-tap-highlight-color: transparent; }
.garland i::before { content: ''; position: absolute; left: 9px; top: 8px; width: 22px; height: 29px; border: 2.5px solid #fff9ea; border-radius: 50% 50% 50% 50% / 36% 36% 64% 64%; background: linear-gradient(90deg, #ffffff30 50%, #0000002b 50%), var(--c); box-shadow: 0 -2px 0 var(--board), 1px 4px 4px #0a162680; }
.garland i::after { content: ''; position: absolute; left: 15px; top: 3px; width: 10px; height: 8px; background: #a56a35; border-radius: 2px; }
@keyframes sway { from { rotate: -9deg; } to { rotate: 9deg; } }

/* Puppets: every part shares the same canvas and turns around its own joint. */
.santa, .snowman { position: absolute; inset: 0; transform-style: preserve-3d; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.part { position: absolute; inset: 0; width: 100%; height: 100%; }
div.part { transform-style: preserve-3d; }
.sway { transform-origin: 50% 98%; }
.mirror { transform: scaleX(-1); }
.santa { --p: calc(var(--u, 4px) * .5); }
.santa .leg { transform-origin: 39% 82%; }
.santa .torso { transform: translateZ(var(--p)); }
.santa .arm { transform-origin: 69.4% 52.3%; transform: translateZ(calc(var(--p) * 2)); }
.santa .head { transform-origin: 50% 48%; transform: translateZ(calc(var(--p) * 3)); }
.santa .eyes, .santa .lids { transform: translateZ(calc(var(--p) * .3)); }
.santa .lids { opacity: 0; animation: lids 4.2s step-end infinite; }
.santa .stache { transform: translateZ(var(--p)); transform-origin: 50% 33%; }
.santa .hat { transform: translateZ(calc(var(--p) * 1.6)); transform-origin: 50% 22%; }
@keyframes lids { 0% { opacity: 0; } 95% { opacity: 1; } 98% { opacity: 0; } }
.bubble { position: absolute; right: 80%; top: 13%; padding: .5em .8em; scale: 0; transform: translateZ(calc(var(--p) * 8)); transform-origin: 100% 100%; font: 700 calc(var(--u, 4px) * 6)/1 Sansita, serif; white-space: nowrap; color: var(--red); background: #fffdf6; border-radius: 1em 1em .1em 1em; box-shadow: 0 -2px 0 var(--board), 0 5px 8px #0a162680; }
.snowman .arm { transform-origin: 68% 74%; animation: toss .55s ease-in-out infinite alternate; }
.snowman .head { transform-origin: 50% 60%; transform: translateZ(calc(var(--u, 4px) * .6)); animation: nod 1.1s ease-in-out infinite alternate; }
.snowman .hat { transform-origin: 50% 32%; transform: translateZ(calc(var(--u, 4px) * .6)); }
.snowman .ball { position: absolute; width: 18%; left: 8.5%; top: 45.5%; animation: juggle-x 1.8s linear infinite, juggle-y 1.8s infinite; animation-delay: calc(var(--i) * -.6s); }
@keyframes toss { from { rotate: -8deg; } to { rotate: 8deg; } }
@keyframes nod { from { rotate: -5deg; } to { rotate: 5deg; } }
@keyframes juggle-x { 0% { translate: 0; } 66% { translate: 430%; } 100% { translate: 0; } }
@keyframes juggle-y { 0% { transform: translate3d(0, 0, 8px); animation-timing-function: ease-out; } 33% { transform: translate3d(0, -360%, 8px); animation-timing-function: ease-in; } 66% { transform: translate3d(0, 0, 8px); animation-timing-function: ease-out; } 83% { transform: translate3d(0, 60%, 8px); animation-timing-function: ease-in; } 100% { transform: translate3d(0, 0, 8px); } }
.thrown { position: fixed; z-index: 45; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { *, ::before, ::after { animation: none !important; transition: none !important; } }
footer .bubble, .puppet .bubble { right: 62%; font-size: 20px; }

/* Language picker: a small paper chip. */
/* The language: a paper chip with the flag, opening a list of languages on the same paper. */
.language { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.language-button { min-height: 40px; padding: 6px 12px; gap: 8px; font-size: .9375rem; color: var(--ink); background: var(--cream); border: 0; border-radius: 8px; }
.language-button .caret { font-size: .75rem; color: var(--soft); }
.flag { display: inline-flex; flex: none; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1.5px #fff9ea, 0 1px 3px #0006; }
.flag svg { display: block; }
.language-list { position: absolute; z-index: 60; top: calc(100% + 8px); right: 0; display: grid; gap: 2px; min-width: 200px; max-height: min(60vh, 440px); overflow-y: auto; margin: 0; padding: 6px; list-style: none; background: var(--cream); border-radius: 10px; box-shadow: var(--lift), 0 16px 32px #04140f90; }
.language-list.up { top: auto; bottom: calc(100% + 8px); }
.language-list[hidden] { display: none; }
.language-list li { display: flex; align-items: center; justify-content: start; gap: 10px; padding: 9px 10px; border: 0; border-radius: 6px; font-weight: 700; color: var(--ink); cursor: pointer; }
.language-list li:hover, .language-list li:focus { background: #f6e3b9; outline: none; }
.language-list li:focus-visible { box-shadow: inset 0 0 0 2px var(--red); }
.language-list [aria-selected=true] { color: var(--red-deep); }
.language-list [aria-selected=true]::after { content: '✓'; margin-left: auto; }
.language small { padding: 2px 8px; font-size: .8125rem; color: var(--ink); background: #ffe3a0; border-radius: 4px; }
.foot { position: relative; z-index: 31; display: flex; flex-wrap: wrap; gap: 12px 20px; justify-content: center; align-items: center; padding: 0 16px 40px; }
.foot a { color: #ffe3a0; font-weight: 700; }
