/* Seasonal decorations: a snowy night outside, snow on the cabinet, stockings on the crown.
   Everything here is decorative; remove this file and festive.js to go back to the plain cabinet. */

body {
  position: relative;
  background:
    radial-gradient(28% 22% at 84% 6%, rgba(200,215,255,.10), transparent 70%),
    radial-gradient(60% 40% at 50% 70%, rgba(255,170,80,.08), transparent 70%),
    linear-gradient(180deg, #121826 0%, #1a1a22 30%, var(--soot) 62%);
}

/* stars in the sky behind the masthead */
.sky {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: 640px;
  z-index: -1;
  pointer-events: none;
}
.sky circle { fill: #f4efe0; }
.sky .twinkle { animation: star-twinkle 4s ease-in-out infinite; }
@keyframes star-twinkle { 50% { opacity: .2; } }
@media (max-width: 600px) { .sky .dense { display: none; } }

/* frost creeping in from the window corners */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 29;
  pointer-events: none;
  background:
    radial-gradient(38% 30% at 0 0, rgba(225,236,255,.16), transparent 70%),
    radial-gradient(38% 30% at 100% 0, rgba(225,236,255,.14), transparent 70%),
    radial-gradient(30% 26% at 0 100%, rgba(225,236,255,.10), transparent 70%),
    radial-gradient(30% 26% at 100% 100%, rgba(225,236,255,.10), transparent 70%);
}

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

/* soft drift along the bottom of the page */
.drift {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 120px;
  z-index: -1;
  pointer-events: none;
}
.foot { padding-bottom: 130px; }

/* snow resting on the crown and the plinth */
.snow-cap {
  position: absolute;
  left: -4px;
  z-index: 2;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.35));
}

/* ---------- stockings hung from the crown ---------- */
/* the crown paints above the drawers so the stockings can hang over the frame */
.cornice { z-index: 2; }

.stockings { position: absolute; inset: 0; pointer-events: none; }
.stocking {
  --w: clamp(34px, 4.4vw, 60px);
  position: absolute;
  top: clamp(2px, .5vw, 6px);
  width: calc(var(--w) * var(--s, 1));
  margin-left: calc(var(--w) * var(--s, 1) / -2);
  transform-origin: 50% 2%;
  filter: drop-shadow(0 6px 5px rgba(0,0,0,.5));
}
.stocking svg { display: block; width: 100%; height: auto; overflow: visible; }
/* only the painted stocking catches the pointer, so the drawers behind stay clickable */
.stocking svg * { pointer-events: visiblePainted; }
.stocking:nth-child(4n+2) { --s: .9; top: clamp(4px, .9vw, 10px); }
.stocking:nth-child(4n+3) { --s: 1.06; }
.stocking:nth-child(4n+4) { --s: .95; top: clamp(3px, .7vw, 8px); }

.stocking.is-swaying { animation: stocking-sway 2.2s ease-in-out; }
@keyframes stocking-sway {
  0%   { transform: rotate(0); }
  13%  { transform: rotate(calc(var(--dir, 1) * 14deg)); }
  31%  { transform: rotate(calc(var(--dir, 1) * -9deg)); }
  49%  { transform: rotate(calc(var(--dir, 1) * 5.5deg)); }
  66%  { transform: rotate(calc(var(--dir, 1) * -3deg)); }
  83%  { transform: rotate(calc(var(--dir, 1) * 1.2deg)); }
  100% { transform: rotate(0); }
}
