/* The backplate fills the space reserved for the fixed navigation, edge to edge. */
.sith-header::before {
  position: absolute;
  z-index: -1;
  inset: calc(-1 * max(10px, env(safe-area-inset-top))) 0 calc(-1 * var(--sith-noel-foot, 18px));
  background:
    radial-gradient(ellipse at 18% 110%, #d9b37236, transparent 44%),
    radial-gradient(ellipse at 82% -40%, #a8cfbf42, transparent 46%),
    linear-gradient(180deg, #04181355, transparent 55%, #04181333),
    var(--sith-noel-bg, #174b40);
  box-shadow: inset 0 -1px 0 #e4c89055;
  content: "";
  pointer-events: none;
}

.sith-header .sith-inner { position: relative; overflow: visible; }
.sith-header .sith-brand { position: relative; z-index: 5; }

.sith-noel-frame {
  position: absolute;
  z-index: 4;
  inset: -24px calc(-1 * var(--sith-noel-side, 0px)) -78px;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.sith-noel-frame[data-logo] {
  mask-image: radial-gradient(ellipse var(--logo-rx) var(--logo-ry) at var(--logo-x) var(--logo-y), transparent 91%, #000 117%);
}

.sith-noel-bauble {
  position: absolute;
  width: var(--diameter);
  height: calc(var(--diameter) * 1.8);
  transform-origin: 50% 0;
  background: linear-gradient(#d2b67d, #9d8255) center top / 1px 52% no-repeat;
}

.sith-noel-bauble::before {
  position: absolute;
  inset: auto 0 0;
  height: var(--diameter);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #fffae2 2%, var(--glint) 18%, var(--glaze) 48%, var(--shade) 90%);
  box-shadow: inset 0 -.5px 1px #351e1970, 1px 2px 3px #102e2480;
  content: "";
}

.sith-noel-bauble::after {
  position: absolute;
  bottom: calc(var(--diameter) - 1px);
  left: 32%;
  width: 36%;
  height: 3px;
  border-radius: 1px;
  background: #d9b677;
  content: "";
}

.sith-noel-bauble { --glint: #ffe4a0; --glaze: #d09b47; --shade: #78522e; }
.sith-noel-bauble.is-red { --glint: #f39479; --glaze: #a33631; --shade: #581e24; }

.sith-noel-frame > canvas {
  position: absolute;
  display: block;
  max-width: none;
  filter: drop-shadow(0 3px 2px #061b16ac);
}

.sith-noel-led {
  position: absolute;
  width: 5px;
  height: 6px;
  border-radius: 50%;
  background: #646754;
  box-shadow: 0 1px 2px #0e2018;
  transform: translate(-50%, -50%);
}

.sith-noel-led::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 43% 36%, #ffffeb 12%, var(--lamp) 65%);
  box-shadow: 0 0 4px 1px var(--lamp), 0 0 11px 3px var(--lamp);
  content: "";
}

@media (prefers-reduced-motion: no-preference) {
  .sith-noel-frame[data-swing="1"] .sith-noel-bauble {
    animation: sith-noel-swing var(--swing-period) ease-in-out var(--swing-phase) infinite alternate;
  }
  .sith-noel-frame[data-twinkle="1"] .sith-noel-led::after {
    animation: sith-noel-illumination var(--period) ease-in-out var(--phase) infinite;
  }
}

@keyframes sith-noel-swing {
  from { transform: rotate(-15deg); }
  to { transform: rotate(15deg); }
}

@keyframes sith-noel-illumination {
  0%, 12%, 97%, 100% { opacity: 0; }
  29%, 63% { opacity: 1; }
  82% { opacity: .46; }
}

@media (max-width: 650px) {
  .sith-noel-led { width: 4px; height: 4px; }
}
