.hero-winter {
  --winter-landscape: url('/platform/assets/home-winter-landscape.webp');
  position: relative;
  isolation: isolate;
  background: linear-gradient(180deg, #f7fbff, #fff 39%, #edf6ff 100%);
}

.hero-winter--sunlit {
  --winter-landscape: url('/platform/assets/home-winter-landscape-sun.webp');
  background: linear-gradient(180deg, #fff8e9, #fffdf8 39%, #f3f8f7 100%);
}

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

.winter-hero__art,
.winter-hero__sky-glow,
.winter-hero__sunlight {
  position: absolute;
  inset: 0;
}

.winter-hero__art {
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  container-type: size;
}

.winter-hero__sky-glow {
  background:
    radial-gradient(ellipse 50% 64% at 0 22%, #dceef8 0%, transparent 100%),
    radial-gradient(ellipse 48% 66% at 100% 32%, #e5e6fa 0%, transparent 100%);
  animation: winter-hero-sky-glow 11s ease-in-out infinite alternate;
}

@keyframes winter-hero-sky-glow {
  from { opacity: .36; }
  to { opacity: .83; }
}

.winter-hero__landscape {
  position: absolute;
  inset: auto 0 0;
  height: min(78%, 34vw);
  background: var(--winter-landscape) center bottom / cover no-repeat;
  mask-image: linear-gradient(transparent, #000 36%);
}

.winter-hero__sunlight {
  display: none;
  background:
    radial-gradient(ellipse 27% 38% at 100% 0, rgb(255 222 150 / 51%), transparent 100%),
    conic-gradient(at 100% 0,
      transparent 190deg,
      rgb(255 216 134 / 19%) 204deg,
      rgb(255 234 179 / 44%) 215deg,
      rgb(255 247 217 / 7%) 225deg,
      rgb(255 222 151 / 24%) 236deg,
      rgb(255 240 207 / 12%) 242deg,
      transparent 254deg);
  mask-image: linear-gradient(153deg, transparent 33%, #000 68%);
  transform-origin: top right;
  opacity: .8;
  animation: winter-hero-sunrise 4.2s ease-out both;
}

.winter-hero__sunlight::after {
  position: absolute;
  inset: auto 0 0 42%;
  height: 19%;
  background: radial-gradient(ellipse at 69% 91%, rgb(255 227 165 / 47%), transparent 72%);
  content: '';
  animation: winter-hero-snow-glow 3.6s ease-out .55s both;
}

@keyframes winter-hero-sunrise {
  0% { transform: translate3d(13%, -8%, 0) scale(1.14); opacity: .02; }
  55% { opacity: .67; }
  100% { transform: translate3d(0, 0, 0) scale(1); opacity: .8; }
}

@keyframes winter-hero-snow-glow {
  from { transform: translate3d(16%, 9%, 0); opacity: 0; }
  to { transform: translate3d(0, 0, 0); opacity: 1; }
}

.hero-winter--sunlit .winter-hero__sunlight { display: block; }

.co-home-popup-active .winter-hero__sunlight,
.co-home-popup-active .winter-hero__sunlight::after { animation-play-state: paused; }

.hero-winter--sunlit :is(.winter-hero__sky-glow, .winter-hero__lane, .winter-hero__pause, .winter-hero__control) {
  display: none;
}

.winter-hero__lane {
  position: absolute;
  inset-block: 0;
  width: 32%;
}

.winter-hero__lane--left { inset-inline-start: 0; }
.winter-hero__lane--right { inset-inline-end: 0; }
.winter-hero__lane--center { inset-inline: 32%; width: auto; }

.winter-hero__flake {
  position: absolute;
  top: 0;
  inset-inline-start: var(--start);
  width: var(--size);
  height: var(--size);
  background:
    radial-gradient(ellipse at 40% 34%, #fff 18%, rgb(255 255 255 / 90%) 28%, transparent 43%),
    radial-gradient(ellipse at 63% 49%, #fff 16%, rgb(244 250 255 / 88%) 29%, transparent 48%),
    radial-gradient(ellipse at 43% 60%, #fff 20%, rgb(222 239 250 / 86%) 32%, transparent 52%);
  filter: drop-shadow(0 1px 1px rgb(68 113 147 / 46%));
  opacity: .86;
  animation: winter-hero-snowfall var(--duration) linear var(--delay) infinite;
}

@keyframes winter-hero-snowfall {
  0% { transform: translate3d(-8px, -20px, 0); opacity: 0; }
  6% { opacity: .94; }
  28% { transform: translate3d(var(--sway), 28cqh, 0); }
  64% { transform: translate3d(calc(var(--sway) * -.65), 64cqh, 0); }
  93% { opacity: .9; }
  100% { transform: translate3d(calc(var(--sway) * .45), 102cqh, 0); opacity: 0; }
}

.winter-hero__pause {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.winter-hero__control {
  position: absolute;
  z-index: 2;
  inset-inline-end: clamp(12px, 3vw, 56px);
  bottom: 16px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgb(47 85 68 / 17%);
  border-radius: 50%;
  background: rgb(255 255 255 / 78%);
  color: #426753;
  cursor: pointer;
}

.winter-hero__control::before {
  width: 10px;
  height: 12px;
  border-inline: 3px solid currentColor;
  content: '';
}

.winter-hero__control:hover { background: #fff; }

.winter-hero__pause:focus-visible + .winter-hero__control {
  outline: 2px solid #008945;
  outline-offset: 3px;
}

.winter-hero__pause:checked + .winter-hero__control::before {
  width: 0;
  height: 0;
  margin-inline-start: 2px;
  border: solid transparent;
  border-width: 7px 0 7px 10px;
  border-inline-start-color: currentColor;
}

.winter-hero__pause:checked ~ .winter-hero__art :is(.winter-hero__sky-glow, .winter-hero__flake) {
  animation-play-state: paused;
}

@media (max-width: 650px) {
  .hero-winter {
    --winter-landscape: url('/platform/assets/home-winter-landscape-sm.webp');
    --winter-bank-height: clamp(130px, 39vw, 170px);
    padding-bottom: var(--winter-bank-height);
  }

  .hero-winter--sunlit { --winter-landscape: url('/platform/assets/home-winter-landscape-sun-sm.webp'); }
  .winter-hero__landscape { height: var(--winter-bank-height); }
  .winter-hero__sunlight {
    top: calc(100% - var(--winter-bank-height) - 88px);
    mask-image: linear-gradient(180deg, transparent, #000 44%);
  }
  .winter-hero__sunlight::after { inset-inline-start: 18%; height: 35%; }
  .winter-hero__lane { width: 25%; }
  .winter-hero__lane--center { inset-inline: 25%; width: auto; }
  .winter-hero__flake {
    width: calc(var(--size) * .84);
    height: calc(var(--size) * .84);
  }
  .winter-hero__flake:nth-child(n + 7),
  .winter-hero__lane--center .winter-hero__flake:nth-child(n + 6) { display: none; }
  .winter-hero__control { inset-inline-end: 8px; bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .winter-hero__pause,
  .winter-hero__control { display: none; }

  .winter-hero__sky-glow {
    animation: none;
    opacity: .55;
  }

  .winter-hero__sunlight,
  .winter-hero__sunlight::after { animation: none; }

  .winter-hero__flake {
    top: var(--rest);
    animation: none;
    opacity: .58;
  }
}
