/* Keep the snowcap and its positioning parent in the same stylesheet. */
.blog-story .blog-christmas-hero-frame { position: relative; }

/* Seasonal snowfall sits below menus and dialogs. */
.home-snowcap {
  --snow-radius: 24px;
  position: absolute;
  z-index: 2;
  inset: -6px 0 auto;
  height: 29px;
  pointer-events: none;
  border-radius: var(--snow-radius) var(--snow-radius) 0 0;
  background: linear-gradient(#f2f8ff, #e6f1fe 42%, #c7dcf4 88%);
  clip-path: polygon(
    0 0, 100% 0, 100% 94%, calc(100% - 6px) 77%,
    calc(100% - 13px) 62%, calc(100% - 24px) 49%,
    91% 46%, 84% 55%, 77% 47%, 69% 58%, 62% 51%, 55% 62%,
    47% 52%, 40% 57%, 33% 47%, 26% 55%, 19% 48%, 12% 57%,
    24px 49%, 13px 62%, 6px 77%, 0 94%
  );
}
.home-category-snowcap {
  --snow-radius: 16px;
  top: -5px;
  height: 22px;
  clip-path: polygon(
    0 0, 100% 0, 100% 94%, 94% 73%, 88% 59%, 76% 53%, 65% 63%,
    53% 54%, 42% 62%, 29% 51%, 18% 61%, 10% 57%, 5% 73%, 0 94%
  );
}
@media (max-width: 767px) {
  .home-hero-snowcap { --snow-radius: 20px; }
  .home-category-snowcap { --snow-radius: 12px; }
}
@supports (clip-path: shape(from 0 0, line to 100% 0, close)) {
  .home-snowcap {
    --snow-overhang: 5px;
    inset: -14px calc(-1 * var(--snow-overhang)) auto;
    height: 37px;
    border-radius: 0;
    clip-path: shape(
      from var(--snow-overhang) 92%,
      curve to 0 62% with 1px 86% / 0 77%,
      curve to 9% 23% with 0 25% / 5% 23%,
      curve to var(--snow-peak-left, 19%) var(--snow-height-left, 8%) with 13% 23% / 16% var(--snow-height-left, 8%),
      curve to 32% 29% with 25% var(--snow-height-left, 8%) / 29% 29%,
      curve to var(--snow-peak-middle, 46%) var(--snow-height-middle, 3%) with 37% 29% / 42% var(--snow-height-middle, 3%),
      curve to 61% 27% with 55% var(--snow-height-middle, 3%) / 58% 27%,
      curve to var(--snow-peak-right, 76%) var(--snow-height-right, 11%) with 66% 27% / 71% var(--snow-height-right, 11%),
      curve to 91% 23% with 85% var(--snow-height-right, 11%) / 88% 23%,
      curve to 100% 61% with 95% 23% / 100% 25%,
      curve to calc(100% - var(--snow-overhang)) 92% with 100% 77% / calc(100% - 1px) 86%,
      curve to 88% 62% with calc(100% - 13px) 63% / 94% 59%,
      smooth to 73% 58% with 80% 58%,
      smooth to 56% 64% with 62% 65%,
      smooth to 41% 57% with 48% 57%,
      smooth to 25% 65% with 31% 66%,
      smooth to 12% 60% with 17% 60%,
      curve to var(--snow-overhang) 92% with 6% 60% / 14px 66%,
      close
    );
  }
  .home-category-snowcap {
    --snow-overhang: 3px;
    top: -9px;
    height: 27px;
  }
  .home-category:nth-child(1) .home-category-snowcap {
    --snow-peak-left: 23%;
    --snow-height-left: 2%;
    --snow-height-middle: 20%;
    --snow-height-right: 16%;
  }
  .home-category:nth-child(2) .home-category-snowcap {
    --snow-height-left: 20%;
    --snow-peak-middle: 52%;
    --snow-height-middle: 1%;
    --snow-height-right: 19%;
  }
  .home-category:nth-child(3) .home-category-snowcap {
    --snow-height-left: 23%;
    --snow-height-middle: 18%;
    --snow-peak-right: 81%;
    --snow-height-right: 1%;
  }
  .home-category:nth-child(4) .home-category-snowcap {
    --snow-peak-left: 20%;
    --snow-height-left: 5%;
    --snow-height-middle: 23%;
    --snow-peak-right: 73%;
    --snow-height-right: 4%;
  }
}
.home-snow {
  --flake-edge: 0 0 0 1px #7394be, 0 1px 3px #607fa8;
  position: fixed;
  z-index: 8;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
html[data-home-theme=dark] .home-snow {
  --flake-edge: 0 0 2px #44618f;
}
.home-snow span {
  position: absolute;
  top: -8px;
  left: var(--flake-x);
  width: var(--flake-size);
  height: var(--flake-size);
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--flake-edge);
  opacity: var(--flake-opacity);
  animation: home-snow-fall var(--flake-speed) linear var(--flake-delay) infinite;
}
.home-snow span::before,
.home-snow span::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  box-shadow: inherit;
}
.home-snow span::before { transform: translateX(-100vw); }
.home-snow span::after { transform: translateX(100vw); }
@keyframes home-snow-fall {
  from { transform: translate(0, 0); }
  33% { transform: translate(calc(var(--flake-drift) * .33 + var(--flake-sway)), 33vh); }
  68% { transform: translate(calc(var(--flake-drift) * .68 - var(--flake-sway)), 68vh); }
  to { transform: translate(var(--flake-drift), calc(100vh + 16px)); }
}
@media (max-width: 600px) {
  .home-snow span:nth-child(2n) { display: none; }
}
@media (prefers-reduced-motion: reduce), print {
  .home-snow { display: none; }
}

body[data-home-snow="off"] :is(.home-snow, .home-snowcap) { display: none; }
.home-footer-icons { display: inline-flex; align-items: center; gap: .65rem; }
.home-snow-toggle {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: inherit;
  cursor: pointer;
}
.home-snow-toggle[hidden] { display: none; }
.home-snow-toggle::before {
  content: "";
  width: 20px;
  height: 20px;
  background: currentColor;
  mask: url("/img/parea-footer-snowflake.svg") center / contain no-repeat;
  opacity: .72;
}
.home-snow-toggle:is(:hover, :focus-visible, [aria-pressed="true"]) { background: rgb(255 255 255 / 14%); }
.home-snow-toggle:is(:hover, :focus-visible, [aria-pressed="true"])::before { opacity: 1; }


[data-seasonal-logo][data-home-snow="off"] #parea-page-top .nav-christmas-logo img.nav-christmas-frame,
[data-seasonal-logo][data-home-snow="on"] #parea-page-top .nav-christmas-logo img.nav-dotmatrix-logo {
  display: none;
}

/* Three aligned frames change once a second without moving the navigation. */
[data-seasonal-logo][data-home-snow="on"] #parea-page-top > div > .nav-christmas-logo {
  display: grid;
  width: 112px;
}
[data-seasonal-logo][data-home-snow="on"] #parea-page-top > div > .nav-christmas-logo[aria-label="Parea home"] .nav-christmas-frame {
  grid-area: 1 / 1;
  width: 100%;
  height: auto;
  max-height: none;
  opacity: 0;
}
[data-seasonal-logo][data-home-snow="on"] #parea-page-top > div > .nav-christmas-logo .nav-christmas-frame:first-child { opacity: 1; }
html[data-home-theme=dark] body[data-seasonal-logo][data-home-snow="on"] #parea-page-top > div > .nav-christmas-logo[aria-label="Parea home"] {
  background: transparent;
  mask: none;
}
html[data-home-theme=dark] body[data-seasonal-logo][data-home-snow="on"] #parea-page-top > div > .nav-christmas-logo .nav-christmas-frame {
  visibility: visible;
  filter: drop-shadow(0 0 8px rgb(255 213 158 / 52%)) drop-shadow(0 0 14px rgb(255 202 126 / 24%));
}
@media (max-width: 767px) {
  [data-seasonal-logo][data-home-snow="on"] #parea-page-top > div > .nav-christmas-logo { width: 104px; }
}
@media (prefers-reduced-motion: no-preference) {
  [data-seasonal-logo][data-home-snow="on"] #parea-page-top > div > .nav-christmas-logo .nav-christmas-frame {
    animation: home-christmas-logo 3s steps(1, end) infinite;
  }
  [data-seasonal-logo][data-home-snow="on"] #parea-page-top > div > .nav-christmas-logo .nav-christmas-frame:nth-child(2) { animation-delay: -2s; }
  [data-seasonal-logo][data-home-snow="on"] #parea-page-top > div > .nav-christmas-logo .nav-christmas-frame:nth-child(3) { animation-delay: -1s; }
}
@keyframes home-christmas-logo {
  0% { opacity: 1; }
  33.333333%, 100% { opacity: 0; }
}
