@import url('https://fonts.googleapis.com/css2?family=Creepster&family=Nunito:wght@700;900&display=swap');

:root {
  --orange: #f26b1d;
  --orange-light: #ff9934;
  --orange-dark: #c94312;
  --purple: #24122f;
  --cream: #fff9e9;
  --yellow: #ffd86a;
  --pink: #f5a0a8;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--cream);
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--orange);
}

.wallpaper {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  align-items: center;
  min-height: 100vh;
  padding: clamp(40px, 7vw, 100px);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 16% 22%, rgba(255, 216, 106, .22) 0 3px, transparent 4px),
    radial-gradient(circle at 78% 72%, rgba(255, 216, 106, .16) 0 2px, transparent 3px),
    linear-gradient(135deg, var(--orange-light), var(--orange) 48%, var(--orange-dark));
  background-size: 95px 95px, 130px 130px, auto;
}

.wallpaper::before {
  content: '';
  position: absolute;
  z-index: -2;
  inset: 0;
  opacity: .18;
  background-image: repeating-linear-gradient(115deg, transparent 0 19px, rgba(74, 20, 45, .28) 20px 21px);
}

.wallpaper::after {
  content: '';
  position: absolute;
  z-index: -1;
  right: -12vw;
  bottom: -35vw;
  left: -12vw;
  height: 52vw;
  min-height: 340px;
  border-radius: 50% 50% 0 0;
  background: var(--purple);
  box-shadow: 0 -12px 0 rgba(255, 216, 106, .16);
}

.greeting {
  position: relative;
  z-index: 3;
  max-width: 760px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 18px;
  padding: 8px 18px;
  border: 2px solid var(--purple);
  border-radius: 999px;
  color: var(--purple);
  background: rgba(255, 249, 233, .22);
  font-size: clamp(.7rem, 1.2vw, .9rem);
  font-weight: 900;
  letter-spacing: .22em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: 'Creepster', fantasy;
  font-weight: 400;
  line-height: .78;
  letter-spacing: .02em;
  text-transform: uppercase;
  transform: rotate(-2deg);
}

h1 span {
  display: block;
}

.happy {
  color: var(--cream);
  font-size: clamp(5rem, 12vw, 10.5rem);
  text-shadow: 5px 6px 0 var(--purple), 10px 12px 0 rgba(59, 18, 47, .22);
}

.halloween {
  margin-top: .13em;
  color: var(--purple);
  font-size: clamp(3.8rem, 9vw, 8rem);
  text-shadow: 3px 4px 0 var(--yellow), 7px 8px 0 rgba(59, 18, 47, .2);
}

.message {
  margin: 34px 0 0;
  color: var(--cream);
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 900;
  letter-spacing: .08em;
  text-shadow: 2px 2px 0 var(--purple);
  text-transform: uppercase;
}

.moon {
  position: absolute;
  top: 7%;
  right: 7%;
  z-index: 0;
  width: clamp(100px, 14vw, 190px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 55px rgba(255, 222, 122, .65);
  opacity: .8;
}

.moon::before,
.moon::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(194, 113, 48, .22);
}

.moon::before {
  top: 22%;
  left: 22%;
  width: 24%;
  height: 24%;
}

.moon::after {
  right: 17%;
  bottom: 20%;
  width: 32%;
  height: 32%;
}

.ghost-wrap {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  min-height: 480px;
}

.ghost {
  position: relative;
  animation: float 3.4s ease-in-out infinite;
  filter: drop-shadow(13px 18px 0 rgba(25, 10, 34, .22));
}

.ghost-body {
  position: relative;
  width: clamp(230px, 25vw, 350px);
  height: clamp(290px, 32vw, 430px);
  border: clamp(5px, .55vw, 8px) solid var(--purple);
  border-bottom: 0;
  border-radius: 48% 48% 12% 12%;
  background: var(--cream);
}

.ghost-body::after {
  content: '';
  position: absolute;
  right: calc(clamp(5px, .55vw, 8px) * -1);
  bottom: -12%;
  left: calc(clamp(5px, .55vw, 8px) * -1);
  height: 22%;
  border-right: clamp(5px, .55vw, 8px) solid var(--purple);
  border-left: clamp(5px, .55vw, 8px) solid var(--purple);
  background: var(--cream);
  clip-path: polygon(0 0, 100% 0, 100% 43%, 84% 100%, 67% 43%, 50% 100%, 33% 43%, 16% 100%, 0 43%);
}

.eye {
  position: absolute;
  top: 39%;
  width: 13%;
  aspect-ratio: .78;
  border-radius: 50%;
  background: var(--purple);
}

.eye::after {
  content: '';
  position: absolute;
  top: 17%;
  left: 19%;
  width: 29%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: white;
}

.eye-left {
  left: 27%;
  transform: rotate(7deg);
}

.eye-right {
  right: 27%;
  transform: rotate(-7deg);
}

.cheek {
  position: absolute;
  top: 57%;
  width: 13%;
  height: 5%;
  border-radius: 50%;
  background: var(--pink);
  opacity: .7;
}

.cheek-left {
  left: 18%;
}

.cheek-right {
  right: 18%;
}

.mouth {
  position: absolute;
  top: 55%;
  left: 50%;
  width: 19%;
  height: 11%;
  border-right: 6px solid var(--purple);
  border-bottom: 6px solid var(--purple);
  border-left: 6px solid var(--purple);
  border-radius: 0 0 50px 50px;
  transform: translateX(-50%);
}

.arm {
  position: absolute;
  z-index: -1;
  top: 49%;
  width: 35%;
  height: 22%;
  border: 7px solid var(--purple);
  border-radius: 60%;
  background: var(--cream);
}

.arm-left {
  left: -24%;
  transform: rotate(-32deg);
}

.arm-right {
  right: -24%;
  transform: rotate(32deg);
}

.ghost-shadow {
  position: absolute;
  bottom: 2%;
  width: 65%;
  height: 36px;
  border-radius: 50%;
  background: rgba(12, 4, 18, .42);
  filter: blur(6px);
  animation: shadow 3.4s ease-in-out infinite;
}

.bat {
  position: absolute;
  z-index: 2;
  color: var(--purple);
  font-family: Georgia, serif;
  font-weight: 900;
  line-height: 1;
}

.bat-one {
  top: 11%;
  left: 8%;
  font-size: clamp(3rem, 6vw, 6rem);
  transform: rotate(12deg);
}

.bat-two {
  top: 22%;
  left: 41%;
  font-size: clamp(2rem, 3.5vw, 4rem);
  transform: rotate(-12deg);
}

.bat-three {
  top: 29%;
  right: 6%;
  font-size: clamp(2rem, 4vw, 4.5rem);
  transform: rotate(16deg);
}

.star {
  position: absolute;
  z-index: 1;
  color: var(--yellow);
  font-size: clamp(1rem, 2vw, 2rem);
  animation: twinkle 2s ease-in-out infinite;
}

.star-one { top: 9%; left: 34%; }
.star-two { top: 41%; left: 5%; animation-delay: -.7s; }
.star-three { top: 16%; right: 29%; animation-delay: -1.2s; }
.star-four { top: 48%; right: 4%; animation-delay: -.3s; }
.star-five { top: 65%; left: 44%; animation-delay: -1.6s; }

.ground {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 0;
  left: 0;
  height: 110px;
  pointer-events: none;
}

.pumpkin {
  position: absolute;
  bottom: -18px;
  width: 120px;
  height: 95px;
  border: 5px solid var(--purple);
  border-radius: 45% 45% 48% 48%;
  background: #ff8a22;
  box-shadow: inset 20px 0 rgba(191, 58, 14, .2), inset -20px 0 rgba(255, 190, 70, .22);
}

.pumpkin-left {
  left: 4%;
  transform: rotate(-7deg);
}

.pumpkin-right {
  right: 4%;
  transform: rotate(7deg) scale(.85);
}

.stem {
  position: absolute;
  top: -27px;
  left: 47px;
  width: 25px;
  height: 30px;
  border: 5px solid var(--purple);
  border-radius: 8px 8px 2px 2px;
  background: #66853b;
}

.pumpkin-eye {
  position: absolute;
  top: 30px;
  width: 22px;
  height: 20px;
  background: var(--purple);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.pumpkin-eye.left { left: 25px; }
.pumpkin-eye.right { right: 25px; }

.pumpkin-mouth {
  position: absolute;
  bottom: 17px;
  left: 50%;
  width: 48px;
  height: 20px;
  border-radius: 0 0 30px 30px;
  background: var(--purple);
  transform: translateX(-50%);
}

@keyframes float {
  0%, 100% { transform: translateY(8px) rotate(-1deg); }
  50% { transform: translateY(-22px) rotate(1deg); }
}

@keyframes shadow {
  0%, 100% { transform: scaleX(1); opacity: .55; }
  50% { transform: scaleX(.75); opacity: .28; }
}

@keyframes twinkle {
  0%, 100% { opacity: .35; transform: scale(.75) rotate(0); }
  50% { opacity: 1; transform: scale(1.15) rotate(20deg); }
}

@media (max-width: 820px) {
  .wallpaper {
    grid-template-columns: 1fr;
    align-content: center;
    padding: 60px 24px 100px;
    text-align: center;
  }

  .greeting {
    z-index: 4;
    margin: 0 auto;
  }

  .message {
    margin-top: 24px;
  }

  .ghost-wrap {
    min-height: 390px;
    margin-top: 18px;
  }

  .ghost-body {
    width: 220px;
    height: 280px;
  }

  .wallpaper::after {
    bottom: -160px;
    height: 440px;
  }

  .bat-two,
  .star-five {
    display: none;
  }

  .pumpkin-left {
    left: -25px;
  }

  .pumpkin-right {
    right: -20px;
  }
}

@media (max-width: 480px) {
  .wallpaper {
    padding-top: 45px;
  }

  .happy {
    font-size: clamp(4.5rem, 24vw, 6.5rem);
  }

  .halloween {
    font-size: clamp(3rem, 16vw, 4.6rem);
  }

  .eyebrow {
    margin-bottom: 12px;
  }

  .ghost-wrap {
    min-height: 330px;
  }

  .ghost-body {
    width: 175px;
    height: 225px;
    border-width: 5px;
  }

  .ghost-body::after {
    right: -5px;
    left: -5px;
    border-width: 0 5px;
  }

  .arm {
    border-width: 5px;
  }

  .mouth {
    border-width: 0 4px 4px;
  }

  .moon {
    opacity: .48;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
