.aurora-mode {
  --bg: #060c1c;
  background: var(--bg);
}

.aurora-sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1px 1px at 11% 12%, #d2e8ff 90%, transparent),
    radial-gradient(1px 1px at 24% 24%, #a8bded 90%, transparent),
    radial-gradient(1px 1px at 43% 9%, #d2e8ff 90%, transparent),
    radial-gradient(1px 1px at 65% 21%, #a8bded 90%, transparent),
    radial-gradient(1px 1px at 86% 11%, #e4dafc 90%, transparent),
    radial-gradient(1px 1px at 93% 34%, #a8bded 90%, transparent),
    radial-gradient(1px 1px at 35% 19%, #849ac1 90%, transparent),
    radial-gradient(1px 1px at 74% 14%, #c2d1ee 90%, transparent),
    radial-gradient(1px 1px at 53% 27%, #bccaef 90%, transparent),
    radial-gradient(1px 1px at 8% 32%, #c2d1ee 90%, transparent),
    radial-gradient(ellipse 72% 17% at 19% 29%, #123f476e, transparent),
    radial-gradient(ellipse 64% 24% at 74% 39%, #40366970, transparent),
    linear-gradient(#040813 10%, #0b1529 59%, #1d3652 91%);
}

.aurora-moon {
  position: absolute;
  z-index: 1;
  top: 19%;
  right: 15%;
  width: clamp(28px, 6vmin, 68px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 37%, #c2e2ea 0 9%, transparent 11%),
    radial-gradient(circle at 60% 60%, #cee9ee 0 15%, transparent 18%),
    radial-gradient(circle at 64% 24%, #d5edf2 0 6%, transparent 8%),
    radial-gradient(circle at 38% 73%, #d8ecf0 0 7%, transparent 9%),
    radial-gradient(circle at 33% 28%, #faffff, #eefaff 62%, #bddef0);
  box-shadow: 0 0 1.3rem #c5eaff66, 0 0 4.5rem 1.15rem #c5eaff2e;
}

.aurora-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
}

.aurora-sky::before,
.aurora-sky::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
}

.aurora-sky::before {
  height: 54%;
  background: linear-gradient(#b4cbdc 5%, #697f99 31%, #283c53 68%, #101d30);
  clip-path: polygon(0 40%, 4% 29%, 7% 32%, 12% 44%, 16% 41%, 20% 26%, 24% 24%, 30% 7%, 33% 13%, 36% 12%, 41% 34%, 45% 39%, 50% 25%, 54% 36%, 58% 45%, 62% 40%, 67% 26%, 70% 28%, 75% 9%, 81% 33%, 85% 37%, 89% 28%, 94% 39%, 100% 27%, 100% 100%, 0 100%);
}

.aurora-sky::after {
  height: 32%;
  background: linear-gradient(#576d86, #17283d 68%);
  clip-path: polygon(0 22%, 6% 44%, 13% 53%, 20% 39%, 27% 46%, 36% 24%, 44% 46%, 48% 48%, 55% 25%, 62% 43%, 69% 51%, 76% 38%, 83% 43%, 89% 23%, 96% 48%, 100% 43%, 100% 100%, 0 100%);
}

.aurora-content { position: relative; z-index: 1; }

.aurora-mode.legacy-zangvu-theme .site-header,
.aurora-mode .shop-acc-stats__item,
.aurora-mode .product-info .product-price {
  position: relative;
}

.aurora-mode .site-header::after,
.aurora-mode .floating-contact-menu::before,
.aurora-mode .shop-acc-stats__item::before,
.aurora-mode .product-info .product-price::before {
  content: "";
  position: absolute;
  pointer-events: none;
  background:
    radial-gradient(ellipse 1px 0.7px at 5px 3px, #fff9 55%, transparent) 0 0 / 17px 9px,
    radial-gradient(ellipse 1.2px 0.8px at 11px 7px, #6d92ab55 50%, transparent) 0 0 / 29px 13px,
    radial-gradient(ellipse 16% 57% at 23% 38%, #fff9, transparent),
    radial-gradient(ellipse 22% 63% at 72% 64%, #88a8c290, transparent),
    linear-gradient(#f4f9fc 8%, #deedf6 49%, #b1c9db 82%, #839eb4);
}

.aurora-mode .site-header::after {
  inset: auto 0 0;
  height: 14px;
  clip-path: polygon(
    0 41%, 1% 37%, 2.5% 38%, 4% 28%, 5% 27%, 6% 17%, 7.5% 16%, 9% 22%,
    10% 31%, 12% 32%, 13% 41%, 16% 46%, 18% 50%, 19.5% 45%, 21% 42%,
    23% 29%, 25% 26%, 26% 30%, 27.5% 26%, 29% 34%, 31% 36%, 34% 50%,
    37% 49%, 39% 52%, 41% 43%, 43% 38%, 45% 39%, 47% 29%, 49% 24%, 51% 25%,
    53% 12%, 54.5% 10%, 56% 13%, 58% 25%, 59% 26%, 60.5% 36%, 64% 43%, 66% 50%,
    69% 46%, 71% 51%, 73% 45%, 75% 35%, 77% 32%, 79% 36%, 81% 34%, 84% 47%,
    88% 52%, 91% 48%, 93% 40%, 95% 29%, 97% 29%, 98.5% 35%, 100% 37%,
    100% 100%, 0 100%
  );
}

.aurora-mode .shop-acc-stats__item::before {
  inset: -11px 6px auto;
  height: 16px;
  clip-path: polygon(
    0 65%, 4% 56%, 8% 58%, 12% 40%, 16% 33%, 20% 20%, 25% 17%, 30% 24%,
    35% 46%, 39% 41%, 44% 57%, 50% 69%, 57% 75%, 64% 65%, 69% 60%, 73% 42%,
    77% 36%, 82% 45%, 87% 52%, 92% 69%, 97% 71%, 100% 76%,
    98% 84%, 92% 88%, 86% 85%, 81% 93%, 75% 86%, 69% 92%, 61% 89%, 53% 92%,
    44% 87%, 37% 91%, 29% 90%, 23% 99%, 19% 94%, 14% 97%, 8% 86%, 3% 85%
  );
}

.aurora-mode .shop-acc-stats__item:nth-child(even)::before {
  transform: scaleX(-1);
}

.aurora-mode .product-info .product-price::before {
  inset: 0 0 auto;
  height: 11px;
  clip-path: polygon(
    0 31%, 3% 24%, 5% 28%, 7% 12%, 10% 8%, 13% 17%, 16% 31%, 19% 31%,
    23% 56%, 26% 58%, 29% 75%, 35% 77%, 39% 61%, 43% 67%, 47% 52%, 50% 35%,
    53% 38%, 56% 29%, 59% 9%, 62% 7%, 65% 16%, 68% 14%, 72% 38%, 74% 38%,
    77% 55%, 81% 68%, 86% 56%, 88% 40%, 92% 41%, 95% 24%, 98% 29%, 100% 43%,
    100% 75%, 96% 80%, 91% 73%, 86% 79%, 81% 79%, 77% 87%, 73% 83%, 70% 94%,
    65% 93%, 62% 99%, 57% 89%, 53% 93%, 49% 77%, 43% 81%, 39% 73%, 35% 85%,
    29% 84%, 25% 75%, 20% 79%, 17% 70%, 12% 90%, 9% 83%, 6% 94%, 3% 82%, 0 78%
  );
}

@media (width > 849px) {
  /* The snow stays at the top when the filter list scrolls. */
  .aurora-mode .account-image-filters {
    background:
      radial-gradient(ellipse 2px 1px at 11% 4px, #fff9 55%, transparent),
      radial-gradient(ellipse 1px 1px at 61% 5px, #fff9 55%, transparent),
      radial-gradient(ellipse 15% 7px at 15% 0, #f4f9fc 28%, #dceaf4 62%, #91afc5 87%, transparent),
      radial-gradient(ellipse 24% 5px at 27% 1px, #edf5fa 34%, #aec6d9 83%, transparent),
      radial-gradient(ellipse 18% 8px at 64% 0, #f4f9fc 30%, #dceaf4 65%, #91afc5 88%, transparent),
      radial-gradient(ellipse 20% 5px at 80% 1px, #edf5fa 35%, #aec6d9 85%, transparent),
      var(--surface-muted);
  }
}

.aurora-mode .floating-contact-menu::before {
  inset: -13px 21px auto;
  height: 22px;
  clip-path: polygon(
    0 64%, 3% 62%, 6% 50%, 9% 52%, 12% 33%, 15% 28%, 18% 33%, 21% 45%, 24% 47%,
    28% 60%, 31% 62%, 35% 53%, 37% 42%, 40% 38%, 43% 23%, 46% 27%, 49% 16%,
    51% 18%, 54% 29%, 57% 46%, 60% 50%, 63% 64%, 68% 67%, 71% 56%, 74% 55%,
    77% 40%, 80% 38%, 83% 46%, 86% 44%, 89% 58%, 93% 61%, 97% 68%, 100% 72%,
    97% 77%, 94% 76%, 91% 83%, 87% 83%, 84% 90%, 80% 84%, 77% 92%,
    73% 90%, 70% 80%, 65% 82%, 62% 78%, 58% 86%, 55% 85%, 51% 93%, 48% 96%,
    45% 87%, 42% 92%, 39% 85%, 35% 90%, 31% 83%, 28% 86%, 24% 77%, 21% 85%,
    17% 87%, 14% 83%, 10% 89%, 8% 81%, 4% 78%, 1% 72%
  );
}

.aurora-snow {
  position: fixed;
  inset: 0;
  z-index: 120;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.aurora-flight {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  pointer-events: none;
}

.aurora-sleigh {
  position: absolute;
  top: 0;
  left: 0;
  width: clamp(128px, 22vw, 270px);
  filter: drop-shadow(0 2px 5px #12152182);
}

.aurora-sleigh img {
  display: block;
  width: 100%;
  height: auto;
}

/* These cuts follow the joints of the reindeer in aurora-sleigh.webp. */
.aurora-sleigh-art {
  position: relative;
  clip-path: polygon(
    0 0, 100% 0, 100% 66%, 90% 66%, 90% 100%,
    84% 100%, 84% 73%, 76% 71%, 71% 75%, 69% 80%, 69% 71%, 61% 73%, 61% 100%,
    55% 100%, 55% 74%, 47% 70%, 40% 81%, 40% 100%, 0 100%
  );
}

.aurora-sleigh-legs {
  position: absolute;
  inset: 0;
  animation: aurora-gallop 650ms ease-in-out var(--phase) infinite;
}

.aurora-sleigh-legs--rear-hind {
  clip-path: polygon(39.5% 76%, 46% 65%, 55% 67%, 56% 97%, 39.5% 97%);
  transform-origin: 49% 69%;
  --phase: -120ms;
  --stride: 23deg;
  --recoil: -14deg;
}

.aurora-sleigh-legs--rear-front {
  clip-path: polygon(60% 70%, 68% 64%, 70.5% 67%, 70.5% 75%, 67% 86%, 60% 86%);
  transform-origin: 65% 69%;
  --phase: -10ms;
  --stride: -22deg;
  --recoil: 18deg;
}

.aurora-sleigh-legs--lead-hind {
  clip-path: polygon(68% 79%, 75% 66%, 84% 67%, 84% 98%, 68% 98%);
  transform-origin: 78% 69%;
  --phase: -370ms;
  --stride: 23deg;
  --recoil: -14deg;
}

.aurora-sleigh-legs--lead-front {
  clip-path: polygon(89% 64%, 100% 62%, 100% 84%, 89% 84%);
  transform-origin: 94% 66%;
  --phase: -260ms;
  --stride: -22deg;
  --recoil: 18deg;
}

@keyframes aurora-gallop {
  0%, 100% { transform: rotate(var(--recoil)); }
  50% { transform: rotate(var(--stride)); }
}

.aurora-mode .copyright-footer,
.aurora-mode .legacy-home-prices h2,
.aurora-mode .legacy-home-recent h2 { text-shadow: 0 1px 3px #040813, 0 1px 8px #040813; }

.aurora-mode.legacy-zangvu-theme {
  --accent: #67e8f9;
  --accent-strong: #22d3ee;
  --accent-contrast: #042033;
  --header-top-bg: #060c1c;
  --header-bg: #0c1929;
  --text: #e2e8f0;
  --text-main: #f8fafc;
  --text-sub: #cbd5e1;
  --border: #3c536a;
  --price: #facc15;
  --link: #a5f3fc;
}

.aurora-mode.legacy-zangvu-theme .searchform { background: var(--input-bg); }
.aurora-mode.legacy-zangvu-theme .header-inner { border-bottom-color: var(--border); }
.aurora-mode .legacy-home-prices h2,
.aurora-mode .legacy-home-recent h2 { color: var(--text-main); }
.aurora-mode.legacy-zangvu-theme .legacy-home-price-grid a,
.aurora-mode.legacy-zangvu-theme .legacy-home-all {
  background: var(--surface);
  border-color: var(--border);
}

@media (max-width: 768px) {
  .aurora-mode .floating-contact-menu::before {
    inset: -10px 16px auto;
    height: 17px;
  }
}

@media (max-width: 600px) {
  .aurora-mode .site-header::after { height: 9px; }

  .aurora-sky::before,
  .aurora-sky::after {
    left: 50%;
    right: auto;
    width: max(100%, 600px);
    transform: translateX(-50%);
  }

  .aurora-sky::before { height: 43%; }
  .aurora-sky::after { height: 29%; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora-canvas,
  .aurora-snow,
  .aurora-flight { display: none; }
}
