/* Christmas Eve at the Brices'. Palette is fixed by DESIGN.md. */
:root {
  --night: #0e1a3a;
  --dusk: #1c2f66;
  --pine: #0f4a38;
  --pine-light: #1d7a58;
  --berry: #b3122f;
  --berry-deep: #7c0c22;
  --gold: #f2c14e;
  --gold-deep: #b9851f;
  --candle: #ffd98a;
  --snow: #f6f8fd;
  --ink: #1a2340;
  --paper: #fff;
  --mist: #dbe2f1;
  --quiet: #47516f;
  --display: 'Berkshire Swash', Georgia, 'Times New Roman', serif;
  --body: 'Atkinson Hyperlegible', Verdana, sans-serif;
  --vh: 1vh;
  --gift-scene: clamp(540px, calc(var(--vh) * 90), 860px);
}
@supports (height: 1svh) { :root { --vh: 1svh; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--snow); }
body {
  position: relative;
  margin: 0;
  background: var(--snow);
  color: var(--ink);
  font: 400 1.1875rem/1.5 var(--body);
  overflow-x: clip;
}
h1, h2 { font-family: var(--display); font-weight: 400; line-height: 1.12; margin: 0; }
h2 { font-size: 2.05rem; color: var(--berry-deep); }
p { margin: 0; }
img { display: block; }
a { color: var(--berry); text-underline-offset: 3px; }
a:hover { color: var(--berry-deep); }
:focus-visible { outline: 3px solid var(--berry-deep); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

/* Icons are masks, so they take the colour of the text around them. */
.icon {
  display: inline-block;
  flex: none;
  width: 1.3em;
  height: 1.3em;
  background: currentColor;
  -webkit-mask: var(--glyph) center / contain no-repeat;
  mask: var(--glyph) center / contain no-repeat;
}
.i-bell { --glyph: url(/art/icon-bell.svg); }
.i-bell-off { --glyph: url(/art/icon-bell-off.svg); }
.i-link { --glyph: url(/art/icon-link.svg); }
.i-logout { --glyph: url(/art/icon-logout.svg); }
.i-people { --glyph: url(/art/icon-people.svg); }
.i-star { --glyph: url(/art/icon-star.svg); }
.i-trash { --glyph: url(/art/icon-trash.svg); }

/* Header, laid over the top of the scene */
.bar {
  position: absolute;
  z-index: 20;
  inset: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 12px;
  padding: max(6px, env(safe-area-inset-top)) 10px 0 16px;
  color: var(--snow);
}
.bar :focus-visible { outline-color: var(--gold); }
.brand {
  color: var(--snow);
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 48px;
  text-decoration: none;
  text-shadow: 0 1px 8px var(--night);
}
.brand:hover { color: var(--candle); }
.bar nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.bar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 48px;
  min-height: 48px;
  padding: 0 10px;
  border: 0;
  border-radius: 24px;
  background: rgb(14 26 58 / .62);
  color: var(--snow);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.bar-btn:hover { color: var(--night); background: var(--candle); }
.bar-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
[data-sound] .i-bell { display: none; }
[data-sound][aria-pressed='true'] .i-bell { display: inline-block; }
[data-sound][aria-pressed='true'] .i-bell-off { display: none; }
[data-sound][aria-pressed='true'] { color: var(--gold); }
[data-sound][aria-pressed='true']:hover { color: var(--night); }
.advent {
  order: 3;
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--candle);
  text-shadow: 0 1px 8px var(--night);
}
.advent .icon { width: 1em; height: 1em; color: var(--gold); }
@media (min-width: 620px) {
  .bar { padding-left: 24px; padding-right: 16px; }
  .bar-label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
}
@media (min-width: 760px) {
  .advent { order: 0; flex-basis: auto; margin-left: 12px; }
  .bar nav { margin-left: auto; }
}

/* The scene */
.scene { position: relative; display: block; color: var(--snow); }
.world {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  background: linear-gradient(var(--night), var(--dusk) 70%, var(--snow) 70%);
}
.layer {
  position: absolute;
  left: -70px;
  right: -70px;
  bottom: 0;
  display: block;
  height: clamp(520px, 52vw, 1000px);
  background-repeat: repeat-x;
  background-position: bottom center;
  background-size: auto 100%;
}
.layer-sky {
  top: -110px;
  bottom: -30px;
  height: auto;
  background: var(--night) url(/art/scene-sky.svg) center top / cover no-repeat;
}
.layer-far { background-image: url(/art/scene-far.svg); }
.layer-mid { background-image: url(/art/scene-mid.svg); }
.layer-near { height: clamp(380px, 54vw, 1000px); background-image: url(/art/scene-near.svg); }
.layer-near::after {
  content: '';
  position: absolute;
  inset: 100% 0 auto;
  height: 120px;
  background: var(--snow);
}

/* Three groups of stars twinkle out of step, on top of the sky art. */
.stars {
  position: absolute;
  inset: 110px 0 45%;
  background-repeat: no-repeat;
  animation: twinkle 3.6s ease-in-out infinite;
}
.stars-a {
  background-image:
    radial-gradient(1.6px 1.6px at 8% 22%, var(--candle) 60%, transparent),
    radial-gradient(1.3px 1.3px at 23% 61%, var(--snow) 60%, transparent),
    radial-gradient(2px 2px at 37% 14%, var(--snow) 60%, transparent),
    radial-gradient(1.4px 1.4px at 52% 48%, var(--candle) 60%, transparent),
    radial-gradient(1.8px 1.8px at 68% 27%, var(--snow) 60%, transparent),
    radial-gradient(1.3px 1.3px at 84% 66%, var(--snow) 60%, transparent),
    radial-gradient(2px 2px at 93% 12%, var(--candle) 60%, transparent);
}
.stars-b {
  animation-duration: 4.7s;
  animation-delay: -1.4s;
  background-image:
    radial-gradient(1.8px 1.8px at 14% 44%, var(--snow) 60%, transparent),
    radial-gradient(1.3px 1.3px at 29% 9%, var(--candle) 60%, transparent),
    radial-gradient(1.6px 1.6px at 44% 72%, var(--snow) 60%, transparent),
    radial-gradient(2px 2px at 59% 18%, var(--snow) 60%, transparent),
    radial-gradient(1.4px 1.4px at 74% 53%, var(--candle) 60%, transparent),
    radial-gradient(1.7px 1.7px at 89% 38%, var(--snow) 60%, transparent);
}
.stars-c {
  animation-duration: 2.9s;
  animation-delay: -2.2s;
  background-image:
    radial-gradient(1.4px 1.4px at 4% 68%, var(--snow) 60%, transparent),
    radial-gradient(2px 2px at 19% 30%, var(--snow) 60%, transparent),
    radial-gradient(1.5px 1.5px at 33% 42%, var(--candle) 60%, transparent),
    radial-gradient(1.3px 1.3px at 47% 7%, var(--snow) 60%, transparent),
    radial-gradient(1.9px 1.9px at 63% 62%, var(--snow) 60%, transparent),
    radial-gradient(1.5px 1.5px at 78% 16%, var(--candle) 60%, transparent);
}
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }

/* Window flicker: a brightened copy of the village. Only what is already lit
   changes much, so the glow lands exactly on the windows. */
.glow {
  position: absolute;
  inset: 0;
  background: inherit;
  filter: brightness(1.45) saturate(1.2);
  opacity: 0;
  animation: flicker 5.3s steps(1) infinite;
}
.glow-a { clip-path: inset(0 66% 0 0); }
.glow-b { clip-path: inset(0 33% 0 34%); animation-duration: 7.1s; animation-delay: -2s; }
.glow-c { clip-path: inset(0 0 0 67%); animation-duration: 6.1s; animation-delay: -4s; }
@keyframes flicker {
  0%, 100% { opacity: .15; }
  11% { opacity: .8; }
  14% { opacity: .35; }
  19% { opacity: 1; }
  37% { opacity: .55; }
  43% { opacity: .9; }
  61% { opacity: .3; }
  66% { opacity: .75; }
  83% { opacity: .45; }
}

.snowfall { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.scene-lead { position: relative; z-index: 2; max-width: 36rem; margin: 0 auto; padding: 112px 20px 0; text-align: center; }
.scene h1 {
  font-size: clamp(2.3rem, 10vw, 3.9rem);
  text-shadow: 0 2px 14px var(--night);
  text-wrap: balance;
}
.scene-lead p { margin-top: 10px; text-shadow: 0 1px 8px var(--night); text-wrap: balance; }

.scene-small { height: clamp(320px, calc(var(--vh) * 42), 400px); }
.scene-small .scene-lead { padding-top: 104px; }
.scene-small .layer:not(.layer-sky) { height: clamp(260px, 30vw, 460px); }
@media (min-width: 760px) { .scene-small .scene-lead { padding-top: 76px; } }

.scene-tree { height: clamp(520px, calc(var(--vh) * 74), 760px); }
.tree-spot {
  position: absolute;
  inset: auto 0 6%;
  height: calc(94% - 262px);
  display: flex;
  justify-content: center;
}
.tree-art { position: relative; display: block; height: 100%; aspect-ratio: 640 / 860; }
.tree { width: 100%; height: 100%; }
.tree-lights { position: absolute; inset: 0; width: 100%; height: 100%; }
.lights-a, .lights-b { animation: lights 2.4s ease-in-out infinite; }
.lights-b { animation-delay: -1.2s; }
@keyframes lights { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
/* Narrow phones wrap the heading further, so the tree gives way to it. */
@media (max-width: 359px) {
  .scene-tree { height: 590px; }
  .tree-spot { height: calc(94% - 316px); }
}
@media (min-width: 900px) {
  .scene-tree { height: clamp(520px, calc(var(--vh) * 76), 760px); }
  .scene-tree .scene-lead {
    margin-left: max(5vw, calc(50vw - 610px));
    padding-top: 130px;
    text-align: left;
  }
  .tree-spot { height: 84%; justify-content: flex-end; padding-right: max(8vw, calc(50vw - 520px)); }
}

/* The reveal */
.reveal { position: relative; --gift-w: min(60vw, calc(var(--vh) * 33), 320px); --tag-w: min(90vw, calc(var(--vh) * 62), 480px); }
.reveal > summary { list-style: none; cursor: pointer; }
.reveal > summary::-webkit-details-marker { display: none; }
.reveal > summary:focus-visible { outline: none; }
.reveal > summary:focus-visible .gift::after {
  content: '';
  position: absolute;
  inset: -68% -7% -6%;
  border: 3px solid var(--gold);
  border-radius: 16px;
}
.scene-gift {
  height: var(--gift-scene);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 116px 20px 0;
  text-align: center;
}
.scene-gift .layer-mid { background-position-x: calc(50% - 90px); }
.scene-gift .tag-closed { position: relative; z-index: 2; max-width: 13em; font-size: clamp(2.15rem, 9.5vw, 3.6rem); }
.hint-closed { position: relative; z-index: 2; margin-top: 10px; text-shadow: 0 1px 8px var(--night); text-wrap: balance; }
.hint-open {
  position: absolute;
  z-index: 4;
  inset: auto 0 6px;
  width: fit-content;
  max-width: calc(100% - 16px);
  margin: 0 auto;
  padding: 1px 12px;
  border-radius: 16px;
  background: rgb(246 248 253 / .86);
  color: var(--ink);
  opacity: 0;
}

.gift {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 54px;
  display: block;
  width: var(--gift-w);
  height: calc(var(--gift-w) * .59375);
  margin-left: calc(var(--gift-w) / -2);
}
.gift-rock, .gift-box, .gift-halo { position: absolute; display: block; }
.gift-rock { inset: 0; transform-origin: 50% 100%; animation: invite 5s ease-in-out infinite; }
.gift-box { inset: 0; width: 100%; height: 100%; }
.gift-halo {
  inset: -38% -30% -14%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(255 217 138 / .5), transparent);
  animation: halo 3.4s ease-in-out infinite;
}
/* The lid art includes the bow. Its loops are clipped off and the separate
   knot, which is the same drawing offset by (50, 34), sits exactly over them. */
.gift-lid, .gift-knot { position: absolute; display: block; height: auto; }
.gift-lid { left: 0; bottom: 87.37%; width: 100%; clip-path: inset(60% 0 0); transform-origin: 50% 100%; }
.gift-knot { left: 15.625%; bottom: 85.27%; width: 68.75%; transform-origin: 50% 41%; }
@keyframes invite {
  0%, 74%, 100% { transform: none; }
  78% { transform: rotate(-1.6deg); }
  82% { transform: rotate(1.5deg) translateY(-3px); }
  86% { transform: rotate(-1deg); }
  90% { transform: rotate(.6deg); }
  94% { transform: none; }
}
@keyframes halo { 0%, 100% { opacity: .55; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.05); } }

/* Everything below is the open state. Keyframes run from [open], so the same
   sequence plays with or without JS. Static values are the resting pose. */
.tag-rise {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  height: var(--gift-scene);
  overflow: hidden;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 74%, transparent 92%);
  mask: linear-gradient(#000 74%, transparent 92%);
}
.tag-rise::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% calc(100% - var(--gift-w) * .56 - 54px), rgb(255 217 138 / .9), rgb(242 193 78 / .42) 26%, rgb(14 26 58 / .58) 66%);
  animation: light-up 1.1s .7s ease-out both;
}
.rays {
  position: absolute;
  left: 50%;
  top: calc(var(--gift-scene) * .46 - 75vmin);
  width: 150vmin;
  height: 150vmin;
  margin-left: -75vmin;
  border-radius: 50%;
  background: repeating-conic-gradient(rgb(255 217 138 / .34) 0 9deg, transparent 9deg 24deg);
  -webkit-mask: radial-gradient(closest-side, #000 18%, transparent);
  mask: radial-gradient(closest-side, #000 18%, transparent);
  animation: rays-in 1s .85s ease-out both, rays-turn 40s linear infinite;
}
@keyframes light-up { from { opacity: 0; } 35% { opacity: 1; } to { opacity: 1; } }
@keyframes rays-in { from { opacity: 0; scale: .3; } to { opacity: 1; scale: 1; } }
@keyframes rays-turn { to { rotate: 360deg; } }

.tag {
  position: absolute;
  left: 50%;
  top: calc(var(--gift-scene) * .46 - var(--tag-w) * .305);
  width: var(--tag-w);
  height: calc(var(--tag-w) * .611);
  margin-left: calc(var(--tag-w) / -2);
  container-type: inline-size;
  transform: rotate(-3deg);
  transform-origin: 17% 55%;
  animation: tag-up 1s 1.05s cubic-bezier(.2, .85, .3, 1) both, tag-swing 2.6s 2.05s ease-in-out both;
}
@keyframes tag-up {
  from { transform: translateY(calc(var(--gift-scene) * .36)) scale(.36) rotate(-12deg); opacity: 0; }
  14% { opacity: 1; }
  to { transform: rotate(-3deg); }
}
@keyframes tag-swing {
  0% { transform: rotate(-3deg); }
  18% { transform: rotate(1deg); }
  40% { transform: rotate(-4.4deg); }
  64% { transform: rotate(-2.2deg); }
  100% { transform: rotate(-3deg); }
}
.tag-art { width: 100%; height: 100%; }
.tag-text {
  position: absolute;
  inset: 36% 8% 16% 26%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  text-align: center;
}
.tag-for { font-size: 19px; font-size: max(19px, 5cqw); font-weight: 700; animation: fade-in .4s 1.6s both; }
.tag-name {
  font-family: var(--display);
  font-size: min(12vw, 3.6rem);
  font-size: 13.5cqw;
  line-height: 1.04;
  color: var(--berry-deep);
  overflow-wrap: anywhere;
  animation: name-in .6s 1.78s cubic-bezier(.2, .9, .3, 1.25) both;
}
.tag-name.short { font-size: min(15vw, 4.6rem); font-size: 17cqw; }
.tag-name.mid { font-size: min(10vw, 3rem); font-size: 11cqw; }
.tag-name.long { font-size: min(7vw, 2.2rem); font-size: 7.9cqw; }
.tag-name.longer { font-size: min(6vw, 1.9rem); font-size: 6.6cqw; }
@keyframes name-in { from { opacity: 0; transform: scale(.7); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

.reveal[open] .tag-closed, .reveal[open] .hint-closed { animation: fade-out .3s both; }
.reveal[open] .hint-open { animation: fade-in .5s 2.3s both; }
.reveal[open] .gift-rock { animation: tug .62s ease-in-out both; }
.reveal[open] .gift-halo { animation: none; opacity: 0; }
.reveal[open] .gift-knot {
  transform: translate(-88%, 118%) rotate(-22deg) scale(.6);
  animation: bow-loose 1.02s cubic-bezier(.4, 0, .4, 1) both;
}
.reveal[open] .gift-lid {
  transform: translate(44%, 83%) rotate(12deg) scale(.62);
  animation: lid-off .95s .48s cubic-bezier(.45, 0, .3, 1) both;
}
@keyframes tug {
  0% { transform: none; }
  14% { transform: translateY(2px) scaleY(.97); }
  34% { transform: rotate(-2.2deg) translateY(-5px); }
  52% { transform: rotate(2.2deg); }
  72% { transform: rotate(-1.2deg); }
  100% { transform: none; }
}
@keyframes bow-loose {
  0% { transform: none; }
  16% { transform: scale(1.16, .84); }
  28% { transform: scale(.92, 1.1) rotate(-4deg); }
  40% { transform: scale(1.12, .9) rotate(3deg); }
  62% { transform: translate(-46%, -60%) rotate(-42deg) scale(.86); }
  90% { transform: translate(-88%, 124%) rotate(-26deg) scale(.6); }
  100% { transform: translate(-88%, 118%) rotate(-22deg) scale(.6); }
}
@keyframes lid-off {
  0% { transform: none; }
  32% { transform: translate(5%, -86%) rotate(-7deg); }
  58% { transform: translate(32%, -66%) rotate(10deg) scale(.86); }
  88% { transform: translate(44%, 88%) rotate(15deg) scale(.62); }
  100% { transform: translate(44%, 83%) rotate(12deg) scale(.62); }
}

/* Closing: a quick reverse */
.reveal.is-closing .tag { animation: tag-down .5s ease-in both; }
.reveal.is-closing .tag-rise::before, .reveal.is-closing .rays { animation: fade-out .55s both; }
.reveal.is-closing .gift-lid { animation: lid-back .5s .1s ease-in-out both; }
.reveal.is-closing .gift-knot { animation: bow-back .5s .24s ease-in-out both; }
.reveal.is-closing .hint-open { animation: fade-out .2s both; }
.reveal.is-closing .reveal-body { animation: fade-out .4s both; }
.reveal.is-closing .tag-closed, .reveal.is-closing .hint-closed { animation: fade-in .4s .35s both; }
@keyframes tag-down {
  from { transform: rotate(-3deg); }
  to { transform: translateY(calc(var(--gift-scene) * .36)) scale(.36) rotate(-12deg); opacity: 0; }
}
@keyframes lid-back {
  0% { transform: translate(44%, 83%) rotate(12deg) scale(.62); }
  55% { transform: translate(18%, -50%) rotate(5deg) scale(.9); }
  100% { transform: none; }
}
@keyframes bow-back {
  0% { transform: translate(-88%, 118%) rotate(-22deg) scale(.6); }
  55% { transform: translate(-22%, -40%) rotate(-14deg) scale(.9); }
  100% { transform: none; }
}

/* Their wishlist unfolds below, like a folded card. */
.reveal-body { max-width: 38rem; margin: 0 auto; padding: 0 20px; }
.reveal-body section { margin-top: 28px; }
.reveal[open] .reveal-body h2, .reveal[open] .reveal-body section > p { animation: fade-in .5s 2.1s both; }
.reveal[open] .reveal-body .label { transform-origin: 50% 0; animation: unfold .55s 2.2s cubic-bezier(.2, .8, .3, 1) both; }
.reveal[open] .reveal-body .label:nth-child(2) { animation-delay: 2.3s; }
.reveal[open] .reveal-body .label:nth-child(3) { animation-delay: 2.4s; }
.reveal[open] .reveal-body .label:nth-child(4) { animation-delay: 2.5s; }
.reveal[open] .reveal-body .label:nth-child(n + 5) { animation-delay: 2.6s; }
@keyframes unfold {
  from { opacity: 0; transform: perspective(700px) rotateX(-78deg); }
  to { opacity: 1; transform: none; }
}

/* Page content */
main { max-width: 38rem; margin: 0 auto; padding: 8px 20px 72px; }
section { margin-top: 36px; }
main > section:first-child { margin-top: 8px; }
main > section:not(.plain)::before, .reveal-body section::before {
  content: '';
  display: block;
  height: 62px;
  margin-bottom: 18px;
  background: url(/art/divider.svg) center / contain no-repeat;
}
section > p { margin-top: 8px; }
section.plain { margin-top: 28px; }
.quiet { color: var(--quiet); }
.notice {
  position: relative;
  margin-top: 24px;
  padding: 14px 16px;
  background: var(--paper);
  border-left: 6px solid var(--gold);
  white-space: pre-line;
  box-shadow: 0 6px 18px rgb(14 26 58 / .08);
}
.notice.error { border-left-color: var(--berry); font-weight: 700; }

/* Wishlist rows, each a paper gift label with a gold edge */
.items { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.label {
  --cut: polygon(30px 0, 100% 0, 100% 100%, 30px 100%, 0 calc(100% - 22px), 0 22px);
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 84px;
  padding: 14px 12px 14px 54px;
  background: var(--gold);
  clip-path: var(--cut);
}
.label::before {
  content: '';
  position: absolute;
  inset: 2px 2px 2px 3px;
  background: var(--paper);
  clip-path: var(--cut);
}
.label::after {
  content: '';
  position: absolute;
  left: 21px;
  top: calc(50% - 8px);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--snow);
  box-shadow: 0 0 0 3px var(--gold-deep);
}
.label:nth-child(3n + 2)::after { box-shadow: 0 0 0 3px var(--berry); }
.label:nth-child(3n)::after { box-shadow: 0 0 0 3px var(--pine-light); }
.label > * { position: relative; }
.item-title { font-weight: 700; overflow-wrap: anywhere; }
.item-note { color: var(--quiet); overflow-wrap: anywhere; white-space: pre-line; }
.item-body { min-width: 0; flex: 1; }
.item-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.item-link .icon { width: 1.05em; height: 1.05em; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: -4px -2px 0 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--berry);
}
.icon-btn:hover { background: var(--berry); color: var(--paper); }
.just-added { animation: settle .7s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes settle { from { transform: scale(.94) rotate(-1deg); } to { transform: none; } }

/* Forms */
form { margin: 0; }
.stack { display: grid; gap: 18px; margin-top: 20px; }
.paper {
  position: relative;
  padding: 22px 18px;
  background: var(--paper);
  border-radius: 6px;
  box-shadow: 0 0 0 2px var(--gold), 0 14px 30px rgb(14 26 58 / .1);
}
main > .paper { margin-top: 28px; }
.paper::after {
  content: '';
  position: absolute;
  top: -16px;
  right: -10px;
  width: 84px;
  height: 84px;
  transform: scaleX(-1);
  background: url(/art/corner-holly.svg) center / contain no-repeat;
  pointer-events: none;
}
label { display: grid; gap: 6px; font-weight: 700; }
label small { font-weight: 400; font-size: 1.0625rem; color: var(--quiet); }
input[type=text], input[type=url], input[type=password], textarea {
  width: 100%;
  min-height: 52px;
  font: 400 1.25rem/1.4 var(--body);
  color: var(--ink);
  background: var(--paper);
  border: 2px solid #6a7596;
  border-radius: 8px;
  padding: 10px 14px;
}
input:focus-visible, textarea:focus-visible { border-color: var(--berry-deep); outline-offset: 1px; }
textarea { min-height: 96px; resize: vertical; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; }
.check input { width: 26px; height: 26px; margin: 2px 0 0; flex: none; accent-color: var(--berry); }
button { font: inherit; cursor: pointer; }
.btn {
  min-height: 56px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 12px 22px;
  background: var(--berry);
  box-shadow: inset 0 0 0 2px var(--berry), inset 0 0 0 3px var(--gold), 0 4px 0 var(--berry-deep);
  color: #fff;
  font-weight: 700;
}
.btn:hover { background: var(--berry-deep); box-shadow: inset 0 0 0 2px var(--berry-deep), inset 0 0 0 3px var(--gold), 0 4px 0 var(--berry-deep); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 0 0 2px var(--berry), inset 0 0 0 3px var(--gold), 0 1px 0 var(--berry-deep); }
.btn.plain { background: var(--pine); box-shadow: inset 0 0 0 2px var(--pine), inset 0 0 0 3px var(--gold), 0 4px 0 #0a3226; }
.btn.plain:hover { background: #0a3226; }
.linkish {
  background: none;
  border: 0;
  padding: 6px 0;
  color: var(--berry);
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 48px;
  flex: none;
}

/* Who's in: baubles on a garland. Each name brings its own swag of rope, so
   the garland carries on across however many rows it wraps to. */
.garland {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  row-gap: 18px;
}
.garland > li { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; padding-top: 12px; text-align: center; }
.garland > li::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 20px;
  border-bottom: 6px solid var(--pine-light);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
}
.garland > li::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
}
.bauble {
  width: 62px;
  height: auto;
  transform-origin: 50% 0;
  animation: sway 5.5s ease-in-out infinite;
}
.garland > li:nth-child(2n) .bauble { animation-duration: 6.4s; animation-delay: -2s; }
.garland > li:nth-child(3n) .bauble { animation-duration: 4.9s; animation-delay: -3.5s; }
.garland > li:hover .bauble { animation-duration: 1.6s; }
.bauble-name { margin-top: 6px; padding: 0 4px; font-weight: 700; overflow-wrap: anywhere; line-height: 1.25; }
@keyframes sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }

/* Organiser */
.people { list-style: none; margin: 16px 0 0; padding: 0; }
.people > li { padding: 16px 0; border-top: 2px solid var(--mist); }
.people > li:last-child { border-bottom: 2px solid var(--mist); }
.person-name { font-weight: 700; overflow-wrap: anywhere; }
.person-actions { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 4px; }
.people label { margin-top: 8px; font-weight: 400; }
.copy { font-size: 1.1875rem; word-break: break-all; background: var(--paper); padding: 12px 14px; border: 2px solid var(--gold); border-radius: 8px; margin-top: 10px; }

/* Overlays */
.fx { position: fixed; z-index: 60; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.is-drawing { overflow: hidden; }
.draw-show {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 50%, var(--dusk), var(--night) 70%);
  color: var(--snow);
  animation: fade-in .35s both;
}
.draw-show canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.draw-show p {
  position: absolute;
  inset: auto 20px max(calc(var(--vh) * 12), 60px);
  text-align: center;
  font-family: var(--display);
  font-size: clamp(2rem, 8vw, 3rem);
}
.draw-gift { position: relative; width: min(40vw, 190px); aspect-ratio: 320 / 190; animation: draw-pulse 2.6s ease-in both; }
.draw-gift img { position: absolute; left: 0; bottom: 0; width: 100%; height: auto; }
.draw-gift .draw-lid { bottom: 87.37%; }
.draw-show.is-flash::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, var(--snow), var(--candle) 45%, var(--gold));
  animation: fade-in .55s ease-in both;
}
@keyframes draw-pulse { from { transform: scale(.8); } to { transform: scale(1.08); } }

@media (prefers-reduced-motion: reduce) {
  .stars, .glow, .lights-a, .lights-b, .gift-rock, .gift-halo, .bauble, .just-added { animation: none; }
  .glow { opacity: .5; }
  .reveal[open] .gift-rock, .reveal[open] .gift-lid, .reveal[open] .gift-knot, .reveal[open] .tag, .reveal[open] .tag-for,
  .reveal[open] .tag-name, .reveal[open] .rays, .reveal[open] .reveal-body .label,
  .reveal[open] .reveal-body h2, .reveal[open] .reveal-body section > p, .reveal[open] .hint-open,
  .reveal[open] .tag-rise::before, .reveal.is-closing .tag, .reveal.is-closing .gift-lid {
    animation: fade-in .45s both;
  }
  .reveal.is-closing .tag, .reveal.is-closing .tag-rise::before, .reveal.is-closing .rays,
  .reveal.is-closing .reveal-body { animation: fade-out .2s both; }
  .reveal.is-closing .gift-lid, .reveal.is-closing .gift-knot { animation: none; }
  .draw-gift { animation: none; }
}

/* Family pictures. All served from the logged-in /family/ route. */
/* The lane scrolls away with the page, so the sleigh never flies over a form. */
.sky-lane {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  height: 70vh;
  overflow: hidden;
  pointer-events: none;
}
.sleigh {
  position: absolute;
  top: 27vh;
  left: 0;
  width: min(56vw, 420px);
  height: auto;
  transform: translateX(-110%);
  animation: sleigh-flight 46s linear 3s infinite;
}
@keyframes sleigh-flight {
  0% { transform: translate(-110%, 26px) rotate(-3deg); }
  9% { transform: translate(calc(33vw - 50%), -8px) rotate(-1deg); }
  18% { transform: translate(calc(66vw - 50%), 18px) rotate(-4deg); }
  28%, 100% { transform: translate(calc(100vw + 10%), -30px) rotate(-5deg); }
}

.peek {
  position: fixed;
  right: 6vw;
  bottom: 0;
  z-index: 4;
  width: clamp(92px, 24vw, 140px);
  pointer-events: none;
  transform: translateY(105%) rotate(-8deg);
  transition: transform .6s cubic-bezier(.3, 1.5, .5, 1);
}
.peek.from-left { right: auto; left: 6vw; transform: translateY(105%) rotate(8deg); }
.peek.is-up { transform: translateY(16%) rotate(-5deg); }
.peek.from-left.is-up { transform: translateY(16%) rotate(5deg); }
.peek img { display: block; width: 100%; height: auto; }

.tag-face {
  position: absolute;
  left: 60%;
  bottom: 74%;
  z-index: -1;
  width: 40%;
  height: auto;
  transform: translateX(-50%);
}
.reveal[open] .tag-face { animation: face-pop .7s cubic-bezier(.3, 1.5, .5, 1) 1.9s backwards; }
@keyframes face-pop {
  from { transform: translate(-50%, 60%) scale(.6); opacity: 0; }
  to { transform: translateX(-50%); opacity: 1; }
}

.bauble-face { width: min(100%, 120px); height: auto; }

.carollers { margin: 48px -20px 0; text-align: center; }
.carollers img { display: block; width: 100%; max-width: 760px; height: auto; margin: 0 auto; }

@media (prefers-reduced-motion: reduce) {
  .sky-lane, .peek { display: none; }
  .reveal[open] .tag-face { animation: none; }
}
