/* Not My Event: the look of "A Very Merry Formality" (public/templates/a-very-merry-formality.html), an exceptionally elegant Christmas dinner.
   Ruby #A50E22, silver #C7C9CD, champagne gold #D2B77B, ivory #F5F1E9, espresso #231D1D. Serif display type, plain readable sans for everything you tap or type.
   The drawings are /assets/merry-art.js and the tree is /assets/merry-tree.js. Moving things use only transform and opacity. */
:root {
  --ruby: #A50E22; --ruby2: #d8283c; --silver: #C7C9CD; --gold: #D2B77B; --goldL: #efe0b4; --ivory: #F5F1E9; --ivory2: #dcd5c6; --esp: #231D1D; --ink: #F5F1E9; --ink2: #d9cfc0;
  --accent: #D2B77B; --accentInk: #231D1D; --btn: #A50E22; --tint: rgba(0, 0, 0, 0); --panel: rgba(35, 29, 29, .82); --line: rgba(210, 183, 123, .45);
  --serif: "Playfair Display", "Cormorant Garamond", Georgia, serif; --ui: "Lato", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
[data-theme="evergreen"] { --btn: #2c6a4d; --tint: rgba(10, 70, 40, .22); }
[data-theme="silver"] { --accent: #C7C9CD; --btn: #5d6572; --tint: rgba(160, 170, 190, .12); }
* { box-sizing: border-box; }
html, body { background: #120a0c; color: var(--ink); }
body { margin: 0; font-family: var(--ui); font-size: 17px; line-height: 1.55; overflow-x: clip; -webkit-tap-highlight-color: transparent; }
body.modal { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 700; line-height: 1.15; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -64px; z-index: 100; padding: 10px 16px; border-radius: 6px; background: var(--accent); color: var(--accentInk); font-weight: 700; transition: top .15s; }
.skip:focus { top: 12px; }

/* ---------- the stage: the house, behind everything ---------- */
#stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #120a0c; }
.world { position: absolute; inset: 0; overflow: hidden; transform-origin: 0 0; will-change: opacity; }
.world[hidden] { display: none; }
.lyr { position: absolute; inset: 0; transform-origin: 0 0; }
.world svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* the tree is to be looked at: it turns as the page scrolls and nothing on it can be pressed */
#cv-tree { position: absolute; inset: 0; pointer-events: none; }
#cv-tree.drag { cursor: grabbing; }
#hots { position: absolute; inset: 0; pointer-events: none; }
.ob { position: absolute; left: 0; top: 0; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; pointer-events: auto; transform: translate3d(-100px, -100px, 0); visibility: hidden; touch-action: pan-y; }
.ob:hover { box-shadow: 0 0 0 3px rgba(239, 224, 180, .85); }
.ob.on { visibility: visible; }
.grade { position: absolute; inset: 0; pointer-events: none; }
.g-warm { background: radial-gradient(120% 90% at 50% 55%, rgba(255, 200, 120, .08), rgba(10, 4, 4, .45) 100%); }
.g-tint { background: var(--tint); }
#fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* things in the drawings that move */
.flm { transform-box: fill-box; transform-origin: 50% 100%; animation: flick .9s ease-in-out infinite alternate; }
.flm.b { animation-duration: 1.3s; animation-delay: -.4s; } .flm.c { animation-duration: 1.1s; animation-delay: -.7s; }
@keyframes flick { 0% { transform: scale(1, 1) skewX(0); } 50% { transform: scale(.93, 1.08) skewX(2deg); } 100% { transform: scale(1.05, .94) skewX(-2deg); } }
.glint { transform-box: fill-box; transform-origin: 50% 50%; animation: glint 2.6s ease-in-out infinite; }
@keyframes glint { 0%, 60%, 100% { opacity: 0; transform: scale(.4); } 75% { opacity: 1; transform: scale(1.2); } }
.leaf { will-change: transform; }
.bf-w { transform-box: fill-box; animation: flap .32s ease-in-out infinite alternate; }
.bf-w.l { transform-origin: 100% 50%; } .bf-w.r { transform-origin: 0 50%; }
@keyframes flap { from { transform: scaleX(1); } to { transform: scaleX(.3); } }
#bfly.rest .bf-w { animation-duration: 1.6s; }
.hot { cursor: pointer; pointer-events: all; }
.gl { animation: gl 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 50%; }
.gl.g1 { animation-delay: -.6s; } .gl.g2 { animation-delay: -1.2s; } .gl.g3 { animation-delay: -1.8s; }
@keyframes gl { 0%, 100% { opacity: .5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.6); } }
.shimmer .gl { animation-duration: .5s; }
/* the sitting room: a mood changes one small thing */
#mfire { transform-origin: 600px 724px; transition: transform .6s; }
.m-pre #mfire { transform: scale(1.07); }
.m-pre #mfire .flm, #mfire.warm .flm { animation-duration: .45s; }
#mfire.warm { transform: scale(1.12); }
#mgl1 { transition: transform .7s cubic-bezier(.3, 1.4, .5, 1); }
.m-soc #mgl1 { transform: translateY(-22px); }
#mtray { transition: transform .8s ease; }
.m-food #mtray { transform: translate(-14px, 16px) scale(1.06); transform-box: fill-box; transform-origin: 50% 100%; }
/* the dining room: a lifted dome */
.dome .lid { transition: transform .7s cubic-bezier(.3, 1.2, .5, 1); transform-box: fill-box; transform-origin: 50% 100%; }
.dome .dish { opacity: 0; transition: opacity .4s; }
.dome.lifted .lid { transform: translate(26px, -54px) rotate(22deg); }
.dome.lifted .dish { opacity: 1; }
.dome .steam .st { opacity: 0; }
.dome.lifted .steam .st { animation: steam 2.6s ease-out infinite; }
.dome.lifted .steam .s1 { animation-delay: -.8s; } .dome.lifted .steam .s2 { animation-delay: -1.6s; }
@keyframes steam { 0% { opacity: .7; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-22px); } }
/* the place: the chair slides out and in, the card lifts, the chandelier glimmers, the light swells */
#mchair { transition: transform 1.1s cubic-bezier(.5, 0, .2, 1); }
.chair-in #mchair { transform: translateX(150px); }
.chair-half #mchair { transform: translateX(70px); }
#mcard { transition: transform .9s ease; transform-box: fill-box; transform-origin: 50% 100%; }
.card-up #mcard { transform: translateY(-14px); }
#mswell { transition: opacity 1.6s ease; }
.glow-on #mswell { opacity: .55; }
.glim .gl { animation-duration: .45s; }
.lite .flm, .lite .gl, .lite .glint { animation: none; }

/* ---------- the heads-up display ---------- */
.hud { position: fixed; z-index: 20; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 14px 10px; background: linear-gradient(rgba(18, 10, 12, .72), rgba(18, 10, 12, 0)); pointer-events: none; }
.hud > * { pointer-events: auto; }
.brand { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--goldL); text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.hud-r { display: flex; gap: 8px; }
.hbtn { min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: rgba(35, 29, 29, .72); font-size: 14px; letter-spacing: .02em; }
.hbtn.solid { background: var(--btn); border-color: transparent; font-weight: 700; }
.dots { position: fixed; z-index: 15; right: 10px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; }
.dots button { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 28px; padding: 0 2px; border: 0; background: none; color: var(--ink2); font-size: 12px; }
.dots button span { opacity: 0; transition: opacity .2s; padding: 2px 8px; border-radius: 6px; background: rgba(35, 29, 29, .85); white-space: nowrap; }
.dots button:hover span, .dots button:focus-visible span { opacity: 1; }
.dots i { display: block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--goldL); }
.dots button[aria-current="true"] i { background: var(--goldL); }
#cap { position: fixed; z-index: 18; left: 50%; top: 64px; transform: translateX(-50%); width: min(92vw, 520px); padding: 12px 16px; border-radius: 14px; background: var(--panel); border: 1.5px solid var(--line); text-align: center; pointer-events: none; }
#cap b { display: block; font: 700 12px var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--goldL); }
#cap span { font-family: var(--serif); font-size: 18px; }
#cap.in { animation: capin .3s ease-out; }
@keyframes capin { from { opacity: 0; transform: translate(-50%, -8px); } }

/* ---------- the story: words over the house ---------- */
#story { position: relative; z-index: 2; pointer-events: none; }
.scene { position: relative; }
.beat { min-height: 100vh; min-height: 100svh; padding: 92px 18px 36px; display: flex; flex-direction: column; justify-content: flex-start; gap: 14px; max-width: 560px; margin: 0 auto; }
.beat.spacer { justify-content: flex-end; min-height: 80svh; }
.beat > * { pointer-events: auto; }
.beat.free { pointer-events: none; }
.kick { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--goldL); text-shadow: 0 1px 8px rgba(0, 0, 0, .7); }
h1 { font-size: clamp(36px, 9vw, 54px); text-shadow: 0 2px 14px rgba(0, 0, 0, .65); }
h2 { font-size: clamp(25px, 6.4vw, 36px); text-shadow: 0 2px 12px rgba(0, 0, 0, .65); }
.lead { font-family: var(--serif); font-size: clamp(19px, 4.8vw, 24px); font-style: italic; color: var(--ivory); text-shadow: 0 1px 10px rgba(0, 0, 0, .75); }
.tagline { font-size: 15px; color: var(--ink2); text-shadow: 0 1px 8px rgba(0, 0, 0, .75); }
.cue { align-self: center; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink2); padding: 10px 14px; border-radius: 999px; background: var(--panel); }
.btn { min-height: 48px; padding: 12px 22px; border: 0; border-radius: 999px; background: var(--btn); color: #fff; font-weight: 700; letter-spacing: .01em; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.btn.ghost { background: rgba(35, 29, 29, .8); border: 1.5px solid var(--line); box-shadow: none; }
.btn:disabled { opacity: .6; cursor: default; }
.linkish { align-self: flex-start; min-height: 44px; padding: 8px 4px; border: 0; background: none; color: var(--goldL); text-decoration: underline; text-underline-offset: 3px; }
.f-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: rgba(35, 29, 29, .82); font-size: 14px; white-space: nowrap; }
.chip[aria-pressed="true"], .chip.done { border-color: var(--goldL); background: rgba(165, 14, 34, .55); }
.chip.done::after { content: " ✓"; color: var(--goldL); }
.wrap-chips { flex-wrap: wrap; overflow: visible; }

/* the tree scene is tall and pinned: the guest turns the camera around the tree by scrolling */
.scene.tall { height: 420vh; height: 420svh; }
.pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; flex-direction: column; justify-content: space-between; padding: 84px 16px max(14px, env(safe-area-inset-bottom)); pointer-events: none; max-width: 640px; margin: 0 auto; }
.pin > * { pointer-events: auto; }
.pin-top { display: flex; flex-direction: column; gap: 8px; background: linear-gradient(rgba(18, 10, 12, .62), rgba(18, 10, 12, 0)); margin: -8px -10px 0; padding: 8px 10px 22px; pointer-events: none; }
.pin-top > * { pointer-events: auto; }
.pin-top h2 { font-size: clamp(24px, 6vw, 34px); }
.pin-top .lead { font-size: clamp(16px, 4.2vw, 21px); }
.pin-bottom { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 22px 10px 0; margin: 0 -10px; background: linear-gradient(rgba(18, 10, 12, 0), rgba(18, 10, 12, .72)); pointer-events: none; }
.pin-bottom > * { pointer-events: auto; max-width: 100%; }
.hint { font-size: 14px; color: var(--ink2); text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
.rev { position: fixed; left: 16px; right: 16px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 5; max-height: 52svh; overflow: auto; padding: 18px 18px 16px; border-radius: 18px; background: rgba(35, 29, 29, .94); border: 1.5px solid var(--line); box-shadow: 0 14px 40px rgba(0, 0, 0, .55); animation: revin .3s ease-out; }
@keyframes revin { from { opacity: 0; transform: translateY(18px); } }
.rev h3 { font-size: 22px; color: var(--goldL); padding-right: 40px; }
.rev p { margin-top: 8px; font-family: var(--serif); font-size: 19px; }
.rev .x { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1); font-size: 24px; line-height: 1; }
.rev dl { margin: 10px 0 0; display: grid; gap: 6px; }
.rev dl div { display: grid; grid-template-columns: 96px 1fr; gap: 8px; font-family: var(--ui); font-size: 16px; }
.rev dt { color: var(--goldL); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding-top: 3px; }
.rev dd { margin: 0; }
.mirror { margin: 12px auto 2px; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; text-align: center; font-family: var(--serif); font-style: italic; font-size: 24px; background: radial-gradient(circle at 34% 30%, #ff8f9b, #d8283c 40%, #7a0a18 80%); box-shadow: inset -10px -12px 24px rgba(0, 0, 0, .45), 0 4px 18px rgba(165, 14, 34, .5); }
.gift { margin: 4px auto 0; width: 96px; height: 84px; position: relative; }
.gift i { position: absolute; left: 6px; right: 6px; bottom: 0; height: 56px; background: #a50e22; border-radius: 4px; }
.gift i::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 12px; margin-left: -6px; background: var(--gold); }
.gift b { position: absolute; left: 0; right: 0; bottom: 52px; height: 22px; background: #c4162c; border-radius: 4px; transition: transform .7s cubic-bezier(.3, 1.4, .5, 1); transform-origin: 0 100%; }
.gift.open b { transform: translate(14px, -30px) rotate(-26deg); }
.ribbon-reveal { margin-top: 10px; height: 64px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 18px; border-radius: 6px; background: linear-gradient(var(--goldL), var(--gold)); color: #3a2a10; font-family: var(--serif); font-style: italic; font-size: 20px; transform-origin: 0 50%; animation: unfurl .9s cubic-bezier(.3, 1, .4, 1) both; }
@keyframes unfurl { from { transform: scaleX(0); opacity: .2; } }

/* the cards the reply, the potluck and the mood live on */
.card, .paper { padding: 18px; border-radius: 18px; background: rgba(35, 29, 29, .9); border: 1.5px solid var(--line); box-shadow: 0 12px 36px rgba(0, 0, 0, .45); }
.q-count { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--goldL); margin-bottom: 8px; }
.note { font-size: 14px; color: var(--ink2); }
.moods { display: grid; gap: 10px; margin: 10px 0 6px; border: 0; padding: 0; }
.mood { display: block; min-height: 54px; padding: 12px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(255, 255, 255, .05); text-align: left; font-weight: 700; width: 100%; }
.mood[aria-checked="true"] { border-color: var(--goldL); background: rgba(165, 14, 34, .6); }
.react { min-height: 28px; font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--goldL); }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; }
label, legend, .flabel { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--goldL); padding: 0; }
input[type="text"], textarea { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(255, 255, 255, .08); color: var(--ink); font: inherit; }
textarea { min-height: 84px; resize: vertical; }
input::placeholder, textarea::placeholder { color: rgba(245, 241, 233, .45); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; flex: 1 1 140px; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(255, 255, 255, .05); text-transform: none; letter-spacing: 0; font-size: 16px; text-align: center; color: var(--ink); }
.choice input:checked + span { border-color: var(--goldL); background: rgba(165, 14, 34, .65); font-weight: 700; }
.choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line); background: rgba(255, 255, 255, .08); font-size: 24px; }
.stepper output { min-width: 32px; text-align: center; font-size: 22px; font-weight: 700; }
.err { padding: 10px 14px; border-radius: 10px; background: rgba(216, 40, 60, .25); border: 1.5px solid var(--ruby2); }
.result h3 { font-size: 24px; color: var(--goldL); margin-bottom: 8px; }
.confirm { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: rgba(210, 183, 123, .18); font-family: var(--serif); font-style: italic; }
.f-rows { display: grid; gap: 8px; margin: 0; }
.f-rows > div { display: grid; grid-template-columns: 104px 1fr; gap: 8px; }
.f-rows dt { color: var(--goldL); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding-top: 4px; }
.f-rows dd { margin: 0; }
.overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; padding: 14px; background: rgba(8, 4, 5, .72); }
.sheet { position: relative; width: min(100%, 520px); max-height: 86svh; overflow: auto; padding: 22px 18px; border-radius: 20px; background: #2a2122; border: 1.5px solid var(--line); }
.sheet h2 { margin-bottom: 12px; padding-right: 48px; }
.sheet .x { position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1); font-size: 26px; line-height: 1; }
.sound-hint { font-size: 13px; color: var(--ink2); }

@media (min-width: 900px) {
  .beat { margin-left: max(5vw, 40px); margin-right: auto; max-width: 480px; }
  .pin { max-width: none; margin: 0; padding-left: max(5vw, 40px); padding-right: max(5vw, 40px); }
  .pin-top, .pin-bottom { max-width: 520px; }
  .rev { left: auto; right: max(5vw, 40px); width: 440px; bottom: 24px; }
  .dots { right: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
