/* New Year garland pinned to the top of the hero (NEW_YEAR_DECOR=true). */
/* --ny-s scales the whole garland on narrow screens (balls, wire and spacing together). */
.ny-garland {
  --ny-s: 1;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(115px * var(--ny-s));
  overflow: hidden;
  z-index: 10;
  pointer-events: none;
  background: url("../images/ny/b-head-decor_newyear.png") repeat-x 0 0 / calc(373px * var(--ny-s)) calc(116px * var(--ny-s));
}

.ny-block {
  position: absolute;
  top: 0;
  left: calc(var(--i, 0) * 373px * var(--ny-s));
  height: 115px;
  width: 373px;
  transform: scale(var(--ny-s));
  transform-origin: 0 0;
}

.ny-ball {
  position: absolute;
}

.ny-ball i {
  position: absolute;
  inset: 0;
  transform-origin: 50% 0;
  background-repeat: no-repeat;
}

/* Only the hanging balls react to the pointer; the garland itself stays click-through. */
.ny-ball[data-swing] {
  pointer-events: auto;
}

.ny-ball.swing i {
  animation: ny-swing 1.2s ease-out;
}

@keyframes ny-swing {
  0%   { transform: rotate(calc(var(--d, 1) * 9deg)); }
  25%  { transform: rotate(calc(var(--d, 1) * -6deg)); }
  50%  { transform: rotate(calc(var(--d, 1) * 3deg)); }
  75%  { transform: rotate(calc(var(--d, 1) * -1.5deg)); }
  100% { transform: rotate(0); }
}

.ny-n1 { top: 0;     left: 3px;   width: 59px; height: 83px; }
.ny-n2 { top: -19px; left: 51px;  width: 55px; height: 70px; }
.ny-n3 { top: 9px;   left: 88px;  width: 49px; height: 67px; }
.ny-n4 { top: 0;     left: 133px; width: 57px; height: 102px; }
.ny-n5 { top: 0;     left: 166px; width: 49px; height: 57px; }
.ny-n6 { top: 6px;   left: 200px; width: 54px; height: 70px; }
.ny-n7 { top: 0;     left: 240px; width: 56px; height: 67px; }
.ny-n8 { top: 0;     left: 283px; width: 54px; height: 53px; }
.ny-n9 { top: 10px;  left: 321px; width: 49px; height: 66px; }

.ny-i1 { top: 0; left: 0;     width: 25px; height: 71px; }
.ny-i2 { top: 0; left: 25px;  width: 61px; height: 27px; }
.ny-i3 { top: 0; left: 176px; width: 29px; height: 31px; }
.ny-i4 { top: 0; left: 205px; width: 50px; height: 51px; }
.ny-i5 { top: 0; left: 289px; width: 78px; height: 28px; }
.ny-i6 { top: 0; left: 367px; width: 6px;  height: 69px; }

.ny-n1 i { background-image: url("../images/ny/b-ball_n1.png"); }
.ny-n2 i { background-image: url("../images/ny/b-ball_n2.png"); }
.ny-n3 i { background-image: url("../images/ny/b-ball_n3.png"); }
.ny-n4 i { background-image: url("../images/ny/b-ball_n4.png"); }
.ny-n5 i { background-image: url("../images/ny/b-ball_n5.png"); }
.ny-n6 i { background-image: url("../images/ny/b-ball_n6.png"); }
.ny-n7 i { background-image: url("../images/ny/b-ball_n7.png"); }
.ny-n8 i { background-image: url("../images/ny/b-ball_n8.png"); }
.ny-n9 i { background-image: url("../images/ny/b-ball_n9.png"); }
.ny-i1 i { background-image: url("../images/ny/b-ball_i1.png"); }
.ny-i2 i { background-image: url("../images/ny/b-ball_i2.png"); }
.ny-i3 i { background-image: url("../images/ny/b-ball_i3.png"); }
.ny-i4 i { background-image: url("../images/ny/b-ball_i4.png"); }
.ny-i5 i { background-image: url("../images/ny/b-ball_i5.png"); }
.ny-i6 i { background-image: url("../images/ny/b-ball_i6.png"); }

@media (max-width: 768px) {
  .ny-garland { --ny-s: 0.7; }
}

@media (max-width: 480px) {
  .ny-garland { --ny-s: 0.6; }
}

@media (prefers-reduced-motion: reduce) {
  .ny-ball.swing i { animation: none; }
}

/* The footer card hosts its own snow (added by newyear.js). */
.inner-footer {
  position: relative;
  overflow: hidden;
}

/* Snow: above the content, never intercepts the pointer. */
.ny-snow {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 10;
  pointer-events: none;
}

/* The hero snow starts under the header. The header blurs what is behind it
   (backdrop-filter), and blurring a moving snowfall every frame made the page
   stutter; with nothing moving behind it the blur is computed once. */
#ny-snow {
  top: 72px;
}

@media (prefers-reduced-motion: reduce) {
  .ny-snow { display: none; }
}

/* Santa hat on the header logo. */
header .logo {
  position: relative;
}

header .logo::before {
  content: "";
  position: absolute;
  left: 4px;
  top: -12px;
  width: 38px;
  height: 38px;
  background: url("../images/ny/santa-hat-96.png") no-repeat center / contain;
  transform: rotate(-10deg);
  pointer-events: none;
  z-index: 1;
}

/* Christmas tree under the footer logo. Anchored to the bottom-left of the footer card
   (above the drifts); on narrower layouts the columns reflow, so it is hidden. */
.inner-footer::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 39px;
  z-index: 11;
  width: 216px;
  height: 216px;
  background: url("../images/ny/christmas-tree.png") no-repeat center / contain;
  pointer-events: none;
}

@media (max-width: 1179px) {
  .inner-footer::after { display: none; }
}

/* Snowdrifts along the bottom of the footer card, drawn from the start. They sit
   above the falling flakes (z-index 10), so the snow "lands" behind them. */
.inner-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  background: url("../images/ny/snowdrift.svg") repeat-x left bottom / 720px 100%;
  pointer-events: none;
  z-index: 11;
}

@media (max-width: 768px) {
  .inner-footer::before { height: 44px; background-size: 480px 100%; }
}
