:root {
  color-scheme: dark;
  background: #0c1329;
}

body {
  margin: 0;
  min-height: 100svh;
  isolation: isolate;
}

.landscape {
  --horizon: 75%;
  --afterglow-x: 57%;
  --afterglow-size: 46% 28%;
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse var(--afterglow-size) at var(--afterglow-x) var(--horizon), #f4b28e 0%, #cb858d 29%, #8e628655 70%, transparent 100%),
    radial-gradient(ellipse at 20% 32%, #2b406066, transparent 55%),
    linear-gradient(180deg, #0c1329 0%, #1a2342 34%, #373652 58%, #6b4c66 var(--horizon), #584053 100%);
}

.landscape::before,
.landscape::after {
  position: absolute;
  inset: 0;
  content: "";
}

.landscape::before {
  background:
    radial-gradient(circle at 7% 26%, #e2e6f38c 0 0.6px, transparent 1.3px),
    radial-gradient(circle at 11% 13%, #d8e6ffc4 0 0.8px, transparent 1.6px),
    radial-gradient(circle at 16% 36%, #e2e6f380 0 0.5px, transparent 1.2px),
    radial-gradient(circle at 19% 19%, #e2e6f385 0 0.5px, transparent 1.2px),
    radial-gradient(circle at 23% 10%, #e2e6f374 0 0.6px, transparent 1.3px),
    radial-gradient(circle at 27% 31%, #f0dcdeaa 0 0.6px, transparent 1.4px),
    radial-gradient(circle at 33% 16%, #e3edffbf 0 0.8px, transparent 1.5px),
    radial-gradient(circle at 39% 24%, #e2e6f380 0 0.5px, transparent 1.3px),
    radial-gradient(circle at 44% 8%, #e2e6f38c 0 0.5px, transparent 1.2px),
    radial-gradient(circle at 49% 29%, #f1e3eb9e 0 0.5px, transparent 1.3px),
    radial-gradient(circle at 52% 13%, #e2e6f370 0 0.5px, transparent 1.2px),
    radial-gradient(circle at 58% 20%, #f0dcdebf 0 0.7px, transparent 1.4px),
    radial-gradient(circle at 63% 8%, #e2e6f380 0 0.5px, transparent 1.2px),
    radial-gradient(circle at 68% 34%, #e2e6f38c 0 0.5px, transparent 1.2px),
    radial-gradient(circle at 73% 17%, #fff2e9 0 0.9px, #e3c7e942 1.8px, transparent 4px),
    radial-gradient(circle at 77% 24%, #e2e6f380 0 0.5px, transparent 1.3px),
    radial-gradient(circle at 81% 11%, #e2e6f384 0 0.6px, transparent 1.3px),
    radial-gradient(circle at 86% 30%, #f0dcdeaa 0 0.6px, transparent 1.4px),
    radial-gradient(circle at 90% 16%, #e3edffa8 0 0.7px, transparent 1.5px),
    radial-gradient(circle at 95% 25%, #e2e6f38c 0 0.5px, transparent 1.2px);
}

.landscape::after {
  background:
    radial-gradient(ellipse 15% 0.7% at 33% 66%, #c18c9a33, transparent),
    radial-gradient(ellipse 11% 0.5% at 73% 62%, #cf90a040, transparent),
    radial-gradient(ellipse 7% 0.4% at 80% 64%, #cf90a038, transparent),
    radial-gradient(ellipse 14% 0.5% at 66% 71%, #6b476550, transparent);
}

.landscape-sea {
  position: absolute;
  z-index: 1;
  inset: var(--horizon) 0 0;
  background:
    radial-gradient(ellipse 15% 1.3% at var(--afterglow-x) 0%, #ffd0a68c, transparent),
    radial-gradient(ellipse 16% 80% at var(--afterglow-x) 0%, #e8a28c8c, #ca8c8b47 40%, transparent),
    linear-gradient(180deg, #554962, #3b3b55 20%, #29324b 56%, #1a263c);
}

.landscape-sea::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(ellipse 4% 0.6% at 55% 7%, #ffbf9f70, transparent),
    radial-gradient(ellipse 4% 0.6% at 59% 14%, #f6b29b62, transparent),
    radial-gradient(ellipse 7% 0.7% at 55% 21%, #edaa9566, transparent),
    radial-gradient(ellipse 5% 1% at 60% 29%, #eaa49658, transparent),
    radial-gradient(ellipse 9% 1% at 56% 39%, #e29c8e44, transparent),
    radial-gradient(ellipse 7% 0.9% at 61% 53%, #c7939145, transparent),
    radial-gradient(ellipse 12% 1% at 55% 65%, #ba898331, transparent),
    radial-gradient(ellipse 14% 1.3% at 67% 82%, #8b7b922c, transparent);
}

.ridge {
  position: absolute;
  z-index: 1;
  inset-inline: 0;
  bottom: 0;
}

.ridge--distant {
  --pine-color: #4b415d;
  height: 34%;
}

.ridge--distant::before,
.ridge--distant::after,
.ridge--foreground::after {
  position: absolute;
  inset: 0;
  content: "";
}

.ridge--distant::before,
.ridge--distant::after {
  background: linear-gradient(180deg, #5a4c68, #38354e 74%);
}

.ridge--distant::before {
  clip-path: polygon(
    0 20%, 6% 18%, 10% 13%, 13% 15%, 17% 20%, 22% 18%,
    26% 22%, 31% 23%, 37% 28%, 31% 30%, 23% 34%, 11% 36%, 0 38%
  );
}

.ridge--distant::after {
  clip-path: polygon(
    65.5% 32%, 67.2% 27%, 69% 24%, 71% 18%, 73% 20%, 75% 18%,
    78% 15%, 82% 17%, 86% 9%, 89% 10%, 94% 5%, 100% 8%,
    100% 66%, 91% 59%, 84% 57%, 77% 50%, 72% 46%, 68% 39%
  );
}

.ridge--middle {
  height: 23%;
  background: linear-gradient(160deg, #26283e, #1d2337 80%);
  clip-path: polygon(
    0 13%, 5% 16%, 9% 22%, 13% 18%, 17% 26%, 21% 35%, 25% 39%,
    29% 48%, 34% 51%, 38% 59%, 43% 65%, 40% 72%, 35% 79%, 29% 92%,
    27% 100%, 0 100%
  );
}

.ridge--foreground {
  --pine-color: #151b2e;
  height: 15%;
}

.ridge--foreground::after {
  background: linear-gradient(180deg, #161c30, #111728);
  clip-path: polygon(
    0 20%, 4% 26%, 8% 22%, 13% 35%, 18% 40%, 24% 50%, 29% 48%,
    34% 55%, 38% 64%, 42% 68%, 45% 77%, 49% 85%, 52% 100%, 0 100%
  );
}

.pine {
  position: absolute;
  top: var(--base);
  left: var(--x);
  height: calc(var(--height) * var(--pine-scale, 1));
  aspect-ratio: 1 / 2;
  transform: translate(-50%, -100%);
  background: var(--pine-color);
  clip-path: polygon(
    50% 0, 69% 30%, 61% 29%, 82% 56%, 72% 54%, 98% 83%,
    57% 79%, 55% 100%, 45% 100%, 43% 79%, 2% 83%, 28% 54%,
    18% 56%, 39% 29%, 31% 30%
  );
}

@media (max-aspect-ratio: 3/4) {
  .landscape {
    --afterglow-size: 76% 18%;
    --pine-scale: .72;
  }

  .ridge {
    inset-inline: -26%;
  }
}
