/* Fonts are self-hosted: the CSP allows nothing from other origins. Licences: public/fonts/OFL-*.txt */
@font-face {
  font-family: "Bricolage Grotesque";
  font-weight: 500 800;
  font-display: swap;
  src: url("/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-weight: 500 800;
  font-display: swap;
  src: url("/fonts/bricolage-grotesque-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans";
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/dm-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/dm-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --night: #0f1a3d;
  --night-2: #18265a;
  --line: #2e3d7a;
  --line-2: #3a4a8c;
  --mist: #c9d2f2;
  --ice: #f5f7ff;
  --ice-line: #cfd6ee;
  --ink: #111a3a;
  --ink-2: #55607f;
  --red: #cf2a30;
  --red-deep: #8f171d;
  --gold: #ffc94d;
  --green: #1f8a62;
  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --stars:
    radial-gradient(1.5px 1.5px at 38px 118px, #fff 99%, transparent),
    radial-gradient(2px 2px at 322px 92px, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 208px 64px, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 356px 300px, #fff 99%, transparent),
    radial-gradient(2px 2px at 20px 392px, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 150px 470px, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 400px 540px, #fff 99%, transparent),
    radial-gradient(2px 2px at 96px 236px, #fff 99%, transparent);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  background-color: var(--night);
  background-image: var(--stars);
  background-size: 440px 620px;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font: 17px/1.5 var(--sans);
  color: #fff;
}

/* ---------------------------------------------------------------- decor */

.garland {
  position: absolute;
  inset: 0 0 auto;
  height: 56px;
  display: flex;
  overflow: hidden;
}
.garland svg { flex: none; }
.garland circle { animation: twinkle 2.4s ease-in-out infinite; }
.garland circle:nth-of-type(2) { animation-delay: 1.2s; }
.garland svg:nth-child(odd) circle:nth-of-type(1) { fill: var(--gold); }
.garland svg:nth-child(odd) circle:nth-of-type(2) { fill: #ff5a5f; }
.garland svg:nth-child(odd) circle:nth-of-type(3) { fill: #3ecf8e; }
.garland svg:nth-child(even) circle:nth-of-type(1) { fill: #fff; }
.garland svg:nth-child(even) circle:nth-of-type(2) { fill: var(--gold); }
.garland svg:nth-child(even) circle:nth-of-type(3) { fill: #ff5a5f; }

.moon, .scene-moon {
  position: absolute;
  border-radius: 50%;
  background: #ffe9a8;
  box-shadow: 0 0 60px rgb(255 233 168 / 35%);
}
.moon { display: none; top: 168px; right: 7%; width: 96px; height: 96px; }

.flakes { position: fixed; inset: 0; z-index: 20; overflow: hidden; pointer-events: none; }
.flakes i {
  position: absolute;
  top: -12px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.7;
  animation: fall linear infinite;
}

@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes fall { to { transform: translateY(106vh); } }
@keyframes appear { from { opacity: 0; transform: translateY(14px); } }

/* ---------------------------------------------------------------- frame */

.top, main, .foot {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 20px;
}

.top { position: relative; padding-top: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.lang { display: flex; padding: 3px; border-radius: 999px; background: var(--night-2); border: 1px solid var(--line); }
.lang button {
  min-width: 44px;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--mist);
  font: 700 13px var(--sans);
  letter-spacing: 0.06em;
  cursor: pointer;
}
.lang button:hover { color: #fff; }
.lang button[aria-pressed="true"] { background: #fff; color: var(--night); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font: 700 19px/1 var(--display);
  letter-spacing: -0.01em;
  color: #fff;
  text-decoration: none;
}

main { position: relative; flex: 1; padding-top: 20px; padding-bottom: 56px; }
main > * { animation: appear 0.45s ease-out both; }
main > :nth-child(2) { animation-delay: 0.08s; }
main > :nth-child(3) { animation-delay: 0.16s; }

.ground { position: relative; flex: none; height: 200px; }
.hill { position: absolute; inset: 0; width: 100%; height: 100%; fill: #fff; }
.trees { position: absolute; left: 5%; top: calc(21% - 58px); width: 80px; }
.gifts { position: absolute; right: 7%; top: calc(27% - 68px); width: 120px; }
.foot {
  position: absolute;
  inset: auto 0 18px;
  margin-block: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.35;
  color: #4a557a;
}
.foot svg { flex: none; }

/* ---------------------------------------------------------------- type */

h1, h2, h3 { margin: 0; font-family: var(--display); line-height: 1.02; overflow-wrap: anywhere; }
h1 { font-weight: 800; font-size: clamp(36px, 5vw, 56px); letter-spacing: -0.03em; }
h2 { font-weight: 800; font-size: clamp(24px, 3vw, 30px); letter-spacing: -0.02em; }
h3 { font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
p { margin: 0; }

.display { font-size: clamp(46px, 7.4vw, 92px); line-height: 0.98; }
.display em { font-style: normal; color: var(--gold); display: block; }
.lead { font-size: clamp(17px, 1.6vw, 21px); line-height: 1.45; color: var(--mist); max-width: 34em; }
.muted { font-size: 14px; line-height: 1.4; color: var(--mist); }
.card .muted { color: var(--ink-2); }
.eyebrow { font-weight: 700; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.tight { gap: 6px; }
.narrow { max-width: 520px; margin-inline: auto; }

/* ---------------------------------------------------------------- surfaces */

.card, .panel { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 22px; }
.card { background: #fff; color: var(--ink); color-scheme: light; }
.panel { background: var(--night-2); border: 1px solid var(--line); }

.note {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--night-2);
  border: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.4;
  color: #dbe1f7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.notice {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #3a2c12;
  border: 1px solid #7a5a16;
  color: #ffe2a0;
  font-size: 14px;
  line-height: 1.4;
}

.error {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fde8e8;
  color: var(--red-deep);
  font-size: 15px;
  font-weight: 600;
}

.chip { flex: none; padding: 3px 10px; border-radius: 999px; background: #e3f6ee; color: #0f5c40; font-weight: 700; font-size: 13px; }
.chip.warn { background: #fff1cf; color: #7a4b00; }

/* ---------------------------------------------------------------- controls */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 8px 26px;
  border: 0;
  border-radius: 16px;
  background: var(--red);
  color: #fff;
  font: 700 17px/1.2 var(--sans);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--red-deep);
  transition: transform 0.08s, box-shadow 0.08s, background-color 0.15s;
}
.btn:hover:not(:disabled) { background: #dc363c; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-deep); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn.block { display: flex; width: 100%; }
.btn.white { background: #fff; color: var(--night); box-shadow: 0 4px 0 #9aa6d4; }
.btn.white:hover:not(:disabled) { background: var(--ice); }
.btn.white:active:not(:disabled) { box-shadow: 0 1px 0 #9aa6d4; }
.btn.outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.outline:hover:not(:disabled) { background: var(--ice); }
.btn.outline:active:not(:disabled) { transform: none; box-shadow: inset 0 0 0 1.5px var(--ink); }

.btn-link {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: inherit;
  font: 600 14px var(--sans);
  text-decoration: underline;
  cursor: pointer;
}
a.btn-link { display: inline-flex; align-items: center; margin-left: -12px; color: var(--mist); text-decoration: none; }
a.btn-link:hover { color: #fff; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.card :focus-visible, dialog :focus-visible, .scene-actions :focus-visible { outline-color: var(--ink); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
label { font-weight: 700; font-size: 15px; }
label small { font-weight: 500; font-size: inherit; color: var(--ink-2); }

input, textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--ice-line);
  background: var(--ice);
  color: var(--ink);
  font: 500 16px/1.4 var(--sans);
}
textarea { min-height: 160px; resize: vertical; }
textarea.short { min-height: 76px; }
::placeholder { color: #8791b3; opacity: 1; }


.row { display: flex; gap: 10px; }
.row.even > * { flex: 1 1 0; padding-inline: 12px; }

/* ---------------------------------------------------------------- home */

.hero { display: grid; gap: 28px; align-items: center; padding-top: 8px; }
.hero-text { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }

.steps { margin-top: 48px; display: flex; flex-direction: column; gap: 18px; }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; padding: 18px 20px; border-radius: 20px; background: var(--night-2); border: 1px solid var(--line); }
.steps b { grid-row: span 2; min-width: 30px; font: 800 44px/0.9 var(--display); color: var(--gold); }
.steps p { font-size: 15px; line-height: 1.45; color: var(--mist); }

/* ---------------------------------------------------------------- create / created / group */

.page-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 20px; }
.split { display: grid; gap: 20px; align-items: start; }
.created { max-width: 640px; }
.preview { display: none; }
.preview-empty { color: var(--mist); font-size: 15px; }

.share-box {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px dashed #b9c2e2;
  background: var(--ice);
  font: 500 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #33406b;
  overflow-wrap: anywhere;
  user-select: all;
}


.progress { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--mist); }
.progress-labels { display: flex; justify-content: space-between; gap: 12px; }
.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--gold); transition: width 0.5s ease; }

.tags { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tag {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 14px 8px 16px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: 700 17px/1.25 var(--sans);
  text-align: left;
  overflow-wrap: anywhere;
  box-shadow: 0 3px 0 #9aa6d4;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.tag::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--night); border: 3px solid var(--gold); }
.tag span:first-child { flex: 1; }
.tag:not(:disabled)::after { content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px; border: solid #a81e25; border-width: 2.5px 2.5px 0 0; transform: rotate(45deg); }
.tag:hover:not(:disabled) { transform: translateY(-2px) rotate(-0.6deg); box-shadow: 0 5px 0 var(--gold); }
.tag:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #9aa6d4; }
.tag:disabled, .tag.static { background: transparent; color: #9aa6d4; font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--line-2); cursor: not-allowed; }
.tag:disabled::before { background: transparent; border-color: var(--line-2); }
.tag:disabled span:first-child { text-decoration: line-through; }
.tag .badge { flex: none; padding: 3px 10px; border-radius: 999px; background: var(--line); color: #dbe1f7; font-weight: 600; font-size: 12px; }
.tag.static { color: #fff; cursor: default; }
.tag.static::after { display: none; }

.loading { padding: 48px 0; text-align: center; color: var(--mist); animation: twinkle 1.6s ease-in-out infinite; }

/* ---------------------------------------------------------------- dialog */

dialog {
  width: min(92vw, 400px);
  padding: 28px 22px 22px;
  border: 0;
  border-radius: 24px;
  background: #fff;
  color: var(--ink);
  color-scheme: light;
  text-align: center;
  box-shadow: 0 24px 60px rgb(0 0 0 / 50%);
}
dialog[open] { display: flex; flex-direction: column; align-items: center; gap: 14px; animation: pop-in 0.3s cubic-bezier(0.2, 1.3, 0.4, 1); }
dialog::backdrop { background: rgb(5 9 26 / 72%); }
dialog h2 { font-size: 30px; }
dialog p { font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.actions { display: flex; gap: 10px; width: 100%; margin-top: 6px; }
.actions .btn { flex: 1 1 0; padding-inline: 10px; }
.actions .btn:last-child { flex-grow: 1.4; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.9); } }

/* ---------------------------------------------------------------- reveal scene
   app.js sets --fly (flight duration) and --t0 (the moment the sleigh is above the middle of the screen,
   when the gift is dropped). Every later step is timed from --t0. */

.scene {
  --hill: 250px;
  --s: 1;
  --r: min(125vw, 640px);
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  background-color: var(--night);
  background-image: var(--stars);
  background-size: 440px 620px;
}
.scene > * { position: absolute; }
.scene > .rotate { display: none; }
.scene.waiting * { animation-play-state: paused !important; }

.scene-moon { top: max(20vh, 150px); right: 12%; width: calc(84px * var(--s)); height: calc(84px * var(--s)); }

.scene-head { inset: max(7vh, 44px) 20px auto; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.scene-head h1 { font-size: clamp(34px, 5vw, 56px); }
.scene-head p { font-size: 16px; color: var(--mist); }
.early { animation: fade-out 0.4s ease-in calc(var(--t0) + 1.9s) forwards; }

.rays { left: calc(50% - var(--r) / 2); bottom: calc(var(--hill) + 130px - var(--r) / 2); width: var(--r); height: var(--r); animation: rays 0.9s ease-out calc(var(--t0) + 2.2s) both; }
.spin {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: repeating-conic-gradient(rgb(255 201 77 / 26%) 0 10deg, transparent 10deg 20deg);
  -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 68%);
  mask-image: radial-gradient(circle, #000 18%, transparent 68%);
  animation: spin 40s linear infinite;
}

.scene-hill { left: 0; bottom: 0; width: 100%; height: var(--hill); fill: #fff; }

.reveal-name {
  inset: auto 20px calc(var(--hill) + 100px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  animation: rise 0.9s cubic-bezier(0.2, 1.4, 0.4, 1) calc(var(--t0) + 2.35s) both;
}
.reveal-name span { font-size: clamp(18px, 2vw, 22px); font-weight: 600; }
.reveal-name strong { font: 800 clamp(64px, 13vw, 132px)/1 var(--display); letter-spacing: -0.03em; color: var(--gold); overflow-wrap: anywhere; }
.reveal-name.long strong { font-size: clamp(38px, 7vw, 76px); }
.reveal-name.xlong strong { font-size: clamp(26px, 4vw, 44px); line-height: 1.1; }

.gift { left: calc(50% - 80px); bottom: calc(var(--hill) - 66px); width: 160px; height: 140px; animation: drop 1.1s cubic-bezier(0.45, 0.05, 0.85, 0.6) var(--t0) both; }
.gift-in { position: relative; width: 100%; height: 100%; transform-origin: 50% 100%; animation: wiggle 0.9s ease-in-out calc(var(--t0) + 1.2s); }
.gift i, .gift svg { position: absolute; }
.gift-body { position: absolute; left: 12px; top: 32px; width: 136px; height: 108px; border-radius: 0 0 12px 12px; background: var(--red); overflow: hidden; }
.gift-dark { inset: 0 0 auto; height: 12px; background: #7d1319; }
.gift-ribbon { left: 55px; top: 12px; width: 26px; height: 96px; background: var(--gold); }
.lid { position: absolute; inset: 0 0 auto; height: 38px; animation: lid-pop 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) calc(var(--t0) + 2.2s) forwards; }
.bow { left: 30px; top: -38px; }
.lid-top { inset: 0; border-radius: 10px; background: #e23b3b; }
.lid-ribbon { left: 67px; top: 0; width: 26px; height: 38px; background: var(--gold); }

.sparks { left: calc(50% - 6px); bottom: calc(var(--hill) + 60px); width: 12px; height: 12px; }
.sparks i { position: absolute; inset: 0; }
.sparks b { display: block; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); animation: spark 1s ease-out calc(var(--t0) + 2.2s) both; }
.sparks i:nth-child(even) b { border-radius: 2px; }
.sparks i:nth-child(4n + 2) b { background: #fff; }
.sparks i:nth-child(4n + 3) b { background: #ff5a5f; }
.sparks i:nth-child(4n) b { background: #3ecf8e; }
.sparks i:nth-child(1) { transform: rotate(-80deg); }
.sparks i:nth-child(2) { transform: rotate(-55deg); }
.sparks i:nth-child(3) { transform: rotate(-30deg); }
.sparks i:nth-child(4) { transform: rotate(-10deg); }
.sparks i:nth-child(5) { transform: rotate(12deg); }
.sparks i:nth-child(6) { transform: rotate(34deg); }
.sparks i:nth-child(7) { transform: rotate(58deg); }
.sparks i:nth-child(8) { transform: rotate(82deg); }

.fly { left: 0; top: max(22vh, 170px); animation: fly var(--fly) linear both; }
.fly-scale { transform: scale(var(--s)); transform-origin: 0 0; }
.bob { position: relative; width: 350px; height: 110px; animation: bob 0.8s ease-in-out infinite alternate; }
.bob > * { position: absolute; }
.reins { left: 112px; top: 50px; width: 190px; height: 2px; background: var(--gold); }
.sleigh { left: 0; top: 18px; }
.deer { left: 126px; top: 8px; overflow: visible; }
.deer.d2 { left: 196px; }
.deer.d3 { left: 266px; }
.nose { fill: #3a2413; }
.d3 .nose { fill: #ff3b3b; }
.leg-a, .leg-b { transform-box: fill-box; transform-origin: 50% 0; animation: gallop 0.26s ease-in-out infinite alternate; }
.leg-b { animation-direction: alternate-reverse; }

.scene-actions {
  inset: auto 0 14px;
  width: min(100% - 40px, 420px);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ink);
  animation: late 0.6s ease-out calc(var(--t0) + 3.4s) both;
}
.scene-warn { display: flex; gap: 8px; font-size: 13.5px; line-height: 1.4; color: #33406b; }
.scene-warn svg { flex: none; margin-top: 1px; color: #a81e25; }
.scene-actions .btn-link { color: #33406b; }

@keyframes fly { from { transform: translate(calc(-350px * var(--s)), 8vh); } to { transform: translate(100vw, -6vh); } }
@keyframes bob { from { transform: translateY(-5px) rotate(-9deg); } to { transform: translateY(5px) rotate(-6deg); } }
@keyframes gallop { from { transform: rotate(34deg); } to { transform: rotate(-34deg); } }
@keyframes drop {
  0% { transform: translateY(calc(var(--hill) + 124px - 78vh)) scale(0.18) rotate(-50deg); opacity: 0; }
  8% { opacity: 1; }
  78% { transform: translateY(0) scale(1) rotate(0); }
  88% { transform: translateY(4px) scale(1.1, 0.86); }
  100% { transform: none; opacity: 1; }
}
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 15%, 45% { transform: rotate(-6deg); } 30%, 60% { transform: rotate(6deg); } 78% { transform: rotate(-3deg); } }
@keyframes lid-pop { to { transform: translate(90px, -210px) rotate(70deg); opacity: 0; } }
@keyframes rays { from { transform: scale(0); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { transform: translateY(200px) scale(0.15); opacity: 0; } }
@keyframes spark { from { transform: translateY(0) scale(0.2); opacity: 1; } to { transform: translateY(-190px) scale(1); opacity: 0; } }
@keyframes late { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade-out { to { opacity: 0; } }

/* ---------------------------------------------------------------- wider screens */

@media (min-width: 700px) {
  .scene { --s: 1.35; }
  .steps ol { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps li { grid-template-columns: 1fr; gap: 10px; padding: 24px; }
  .steps b { grid-row: auto; }
  .trees { width: 110px; top: calc(21% - 80px); }
  .gifts { width: 170px; top: calc(27% - 96px); }
}

@media (min-width: 960px) {
  .scene { --s: 1.7; --hill: 270px; }
  .top { padding-top: 76px; }
  main { padding-top: 32px; padding-bottom: 72px; }
  .ground { height: 250px; }
  .card, .panel { padding: 28px; }
  .hero { padding-top: 4vh; }
  .hero-text { gap: 28px; }
  .steps { margin-top: 80px; }
  .split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 32px; }
  .split > aside, .split > .sticky { position: sticky; top: 24px; }
  .preview { display: flex; }
  .group { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; }
}

/* The moon sits beside the content column: only where there is room for it. */
@media (min-width: 1440px) {
  .moon { display: block; }
}

@media (max-height: 640px) {
  .scene { --hill: 216px; }
  .scene-head { top: 20px; }
  .scene-head .eyebrow, .early { display: none; }
  .reveal-name { bottom: calc(var(--hill) + 84px); }
  .reveal-name strong { font-size: clamp(40px, 9vw, 72px); }
}

/* Very short windows: no room for the gift, the name simply rises from the snow. */
@media (max-height: 520px) {
  .scene { --hill: 132px; }
  .gift, .sparks, .rays, .scene-moon, .scene-actions .btn-link { display: none; }
  .scene-head h1 { font-size: 28px; }
  .reveal-name { bottom: calc(var(--hill) + 4px); }
  .reveal-name strong { font-size: clamp(34px, 7vw, 48px); }
  .scene-actions { bottom: 16px; gap: 6px; }
  .scene-actions .btn { min-height: 46px; }
}

/* Phones held sideways: ask to turn the phone. The same query is in app.js, which holds the
   animation back until the phone is upright. */
@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  .scene > .rotate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    inset: 0;
    padding: 20px;
    text-align: center;
    background-color: var(--night);
    background-image: var(--stars);
    background-size: 440px 620px;
  }
  .rotate svg { color: var(--gold); }
  .rotate p { color: var(--mist); }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation: none !important; transition: none !important; }
  .flakes, .fly, .lid, .sparks, .early { display: none; }
}
