:root {
  --color-background: #d2e6e0;
  --color-circle: #edf4f3;
  --color-envelope: #d94b49;
  --color-fold-side: #ea6159;
  --color-fold-bottom: #ef5350;
  --color-fold-top: #e56f62;
  --color-fold-back: #d94b49;
  --color-letter: #f8f1e5;
  --color-heading: #ac312e;
  --color-text: #616161;
  --animation-delay: 0.25s;
}

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

@font-face {
  font-family: "Sevillana";
  src: url("/assets/fonts/Sevillana-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "Merry Christmas Flake";
  src: url("/assets/fonts/MerryChristmasFlake.ttf") format("truetype");
}

body {
  background-color: var(--color-background);
  justify-content: center;
  align-items: center;
  display: flex;
  height: 100vh;
  width: 100%;
}

.envelope-wrapper {
  transition-delay: var(--animation-delay);
  margin-bottom: 200px;
  transition: all 0.5s;
  padding-top: 200px;
  overflow-y: hidden;
  position: relative;
}

.envelope-wrapper:has(.envelope.open) {
  margin-bottom: 100px;
}

.envelope {
  background-color: var(--color-envelope);
  aspect-ratio: 2 / 1;
  position: relative;
  border-radius: 5px;
  width: 400px;
  cursor: pointer;
  transition: all 0.5s;
  display: flex;
  justify-content: center;
}

.envelope.open {
  border-radius: 0 0 5px 5px;
}

.envelope.open .fold.top {
  transform: rotate3d(1, 0, 0, 180deg);
  border-radius: 0;
  transition-delay: 0s;
  z-index: 0;
}

.fold {
  border: 100px solid transparent;
  position: absolute;
  border-radius: 5px;
  height: 0;
  width: 0;
  z-index: 2;
}

.fold.left {
  border-left: 200px solid var(--color-fold-side);
  border-right: 0;
  left: 0;
}

.fold.right {
  border-right: 200px solid var(--color-fold-side);
  border-left: 0;
  right: 0;
}

.fold.bottom {
  bottom: 0;
  border: 200px solid transparent;
  border-top: 0;
  border-bottom: 100px solid var(--color-fold-bottom);
}

.fold.top {
  transform-origin: 0 0;
  transition: all 0.5s;
  border: 200px solid transparent;
  border-bottom: 0;
  border-top: 115px solid var(--color-fold-top);
  transition-delay: var(--animation-delay);
  z-index: 3;
}

.envelope .snowman {
  position: absolute;
  height: 100px;
  width: 100px;
  right: 15px;
  top: 25%;
  transition: all 0.25s;
  transform-origin: bottom right;
}

/* enable peeking snowman only at 600px and above */
@media only screen and (min-width: 600px) {
  .envelope {
    margin: 0 100px;
  }
  .envelope:hover .snowman {
    transform: rotate(75deg);
  }
}

.letter {
  background-color: var(--color-letter);
  color: var(--color-text);
  font-family: "Sevillana";
  transition: all 0.5s;
  transition-delay: 0s;
  position: absolute;
  border-radius: 5px;
  text-align: center;
  margin-top: 10px;
  font-size: 24px;
  padding: 25px;
  height: 500px;
  width: 350px;
}

.letter h1 {
  font-family: "Merry Christmas Flake";
  font-weight: normal;
  margin-bottom: 25px;
  font-size: 50px;
  color: var(--color-heading);
}

.letter p {
  margin-bottom: 15px;
}

.envelope.open .letter {
  transform: translateY(-200px);
  transition-delay: var(--animation-delay);
}

.envelope-wrapper .hint {
  color: var(--color-text);
  font-family: "Sevillana";
  position: absolute;
  font-size: 20px;
  display: flex;
  right: 150px;
  top: 50px;
}

.hint .arrow {
  transform: rotate(90deg);
  margin: 10px 0 0 5px;
  opacity: 0.6;
  width: 80px;
}

.hint.hidden {
  display: none;
}
