* {
  box-sizing: border-box;
}

@font-face {
  font-family: libreBaskerville;
  src: url(715e9cea90f54d5a4093.ttf);
}

.hide {
  display: none !important;
}

html {
  background: url(96d25d8a1d991759e669.jpg) no-repeat fixed bottom 20% center;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  overflow-x: hidden;
}

body {
  width: 100%;
  margin: 0;
  overflow-x: hidden;
  padding-bottom: 64px;
}

#heading {
  margin-top: 16px;
  margin-bottom: 96px;
  font-family: "Satisfy", cursive;
  text-align: center;
  position: relative;
  font-size: 48px;
  color: white;
  line-height: 64px;
  opacity: 85%;
}

#heading > div {
  position: relative;
}

#heading::before {
  pointer-events: none;
  content: "";
  position: absolute;
  /** #heading has 16px margin **/
  top: -16px;
  left: 50%;
  width: 100%;
  height: 50vw;
  max-height: 200px;
  transform: translateX(-50%);
  background: url(c5c19b0aa8695f5afc64.png) no-repeat center center;
  background-size: contain;
}


.details {
  margin-top: 48px;
  font-family: libreBaskerville, serif;
  color: #6a6357;
  text-align: center;
  font-size: 17px;
}

.details div, .details a {
  display: block;
  margin-bottom: 24px;
  margin-left: auto;
  margin-right: auto;
  width: fit-content;
  text-transform: uppercase;
}

.details > .date {
  font-family: "Satisfy", cursive;
  font-size: 48px;
  margin-bottom: 32px;
}

.details .time {
  position: relative;
}

.details .time::before {
  content: "";
  background: url(324450e5ad3d4d4fbbe0.svg) center center no-repeat;
  background-size: 30px 30px;
  width: 30px;
  height: 30px;
  position: absolute;
  top: -5px;
  left: -40px;
}

.alcohol {
  position: relative;
  font-size: 13px;
}

.date .bar {
  color: #ab8d55;
  margin-left: 24px;
  margin-right: 24px;
}

.location {
  text-decoration: underline;
  color: #6a6357;
  position: relative;
}

.location::before {
  content: "";
  background: url(b3f686ad4955107e8fc2.svg) center center no-repeat;
  background-size: 30px 30px;
  width: 30px;
  height: 30px;
  color: #ab8d55;
  position: absolute;
  top: -5px;
  left: -40px;
}

.instruction {
  position: relative;
  font-size: 13px;
}

.instruction::before {
  content: "";
  background: url(d1fc76618cbc628c8268.svg) center center no-repeat;
  background-size: 30px 30px;
  width: 30px;
  height: 30px;
  color: #ab8d55;
  position: absolute;
  top: -7px;
  left: -40px;
}

.alcohol::before {
  content: "";
  background: url(53812737fb9158faa489.svg) center center no-repeat;
  background-size: 30px 30px;
  width: 30px;
  height: 30px;
  color: #ab8d55;
  position: absolute;
  top: -7px;
  left: -40px;
}


#rsvp {
  margin-top: 32px;
  text-align: center;
  color: #6a6357;
}

input {
  background: rgba(255, 255, 255, 0.4);
  border: none;
  display: block;
  outline: none;
  min-width: 284px;
  height: 48px;
  padding: 16px;
  color: #333;
  border-bottom: 1px solid #ab8d55;
  margin: 0 auto 24px;
  font-family: libreBaskerville, serif;
}

input.invalid {
  background: pink;
  border-color: red;
}

button#update {
  width: fit-content;
  white-space: nowrap;
}

button {
  cursor: pointer;
  outline: 0;
  display: inline-block;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  background-color: transparent;
  border: 1px solid #00778c;
  padding: 6px 12px;
  font-size: 1rem;
  border-radius: .25rem;
  transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
  color: #00778c;
  width: 138px;
}

button:hover {
  color: #fff;
  background-color: #00778c;
  border-color: #00778c;
}

#rsvp.loading button {
  display: none;
}

#rsvp.loading input {
  pointer-events: none;
  background: rgba(255, 255, 255, 0.2);
  color: grey;
}

.loader {
  display: none;
  width: 48px;
  height: 48px;
  border: 5px solid #FFF;
  border-bottom-color: transparent;
  border-radius: 50%;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}

#rsvp.loading .loader {
  display: inline-block;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#error {
  color: red;
  background-color: pink;
  border: 1px solid red;
  border-radius: 8px;
  padding: 8px 16px;
  display: inline-block;
  margin: 32px;
  width: auto;
}

#result {
  font-family: libreBaskerville, serif;
  color: #ab8d55;
  text-align: center;
  margin-top: 24px;
  font-size: 16px;
  padding: 16px;
}

#message {
  margin-bottom: 16px;
}

@media screen and (min-width: 768px) {
  #heading {
    font-size: 72px;
    line-height: 96px;
    margin-bottom: 120px;
  }

  #heading::before {
    width: 800px;
    height: 300px;
    max-height: none;
  }
}

.transport-checkbox-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
}

input[type="checkbox"] {
  min-width: 0;
  width: 24px;
  height: 24px;
  margin: 16px 8px;
}

label {
  color: #41413e;
  font-family: libreBaskerville, serif;
  font-size: 12px;
}

body::after {
  content: "";
  position: fixed;
  background: none;
  transition: background 1s linear;
}

body.modal::after {
  background-color: rgba(0, 0, 0, 0.5);
  top: 0;
  width: 100%;
  height: 100%;
  background-size: 100% 100%;
  transition: background-color 1s linear;
}

#envelope {
  position: relative;
  width: 140px;
  height: 90px;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  margin-left: auto;
  margin-right: auto;
  background-color: #DDD4CA;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  animation: 0.4s ease-in-out bounce infinite alternate;
  z-index: 1;
}

#envelope::after {
  content: "";
  background: url(9252dc923178e00ec94b.svg) center center no-repeat;
  background-size: 50px 50px;
  width: 50px;
  height: 50px;
  position: absolute;
  top: 50%;
  right: -60px;
  transform: rotateZ(-90deg);
}

#envelope.open, #envelope.close {
  animation: 0.2s ease-in-out bounce;
  animation-fill-mode: forwards;
}

.front {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 3;
}

.flap {
  z-index: 4;
  border-left: 70px solid transparent;
  border-right: 70px solid transparent;
  border-bottom: 41px solid transparent; /* a little smaller */
  border-top: 49px solid #ab8d55; /* a little larger */
  transform-origin: top;
  pointer-events: none;
}

.pocket {
  border-left: 70px solid #DDD4CA;
  border-right: 70px solid #DDD4CA;
  border-bottom: 49px solid #D3C8BB;
  border-top: 45px solid transparent;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.letter {
  transform-origin: top;
  position: relative;
  margin-left: auto;
  margin-right: auto;
  width: calc(90% * 20/7);
  height: calc(90% * 20/7);
  top: 5%;
  left: calc((-1 * (((90% * 20/7) / 2) - ((90% * 20/7) * 0.35 / 2))) + 6px);
  border-radius: 16px;
  box-shadow: 0 2px 26px rgba(0, 0, 0, 0.12);
  background-color: #F1EDE9;
  font-size: 32px;
  line-height: 36px;
  padding: 32px;
  font-family: "Nanum Pen Script", cursive;
  overflow-y: hidden;
  color: #6a6357;
  transform: scale(0.35);
}

.letter::before {
  content: "";
  background-image: url(53034881a5cec408f060.png);
  background-size: 400px 400px;
  background-repeat: no-repeat;
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 400px;
  opacity: 0.3;
}

.letter::after {
  content: "X";
  text-align: end;
  width: 16px;
  height: 16px;
  position: absolute;
  top: 4px;
  right: 6px;
}

.letter .content {
  position: relative;
}

.open .flap {
  transform: rotateX(180deg);
  transition: transform 0.4s ease, z-index 0.6s;
  z-index: 1;
}

.close .flap {
  transform: rotateX(0deg);
  transition: transform 0.4s ease, z-index 0.6s;
  transition-delay: 1.5s;
  z-index: 5;
}

.readMode .letter {
  animation: ease-in-out 1.5s openLetter;
  animation-fill-mode: forwards;
  z-index: 2;
}

.close .letter {
  animation: ease-in-out 1.5s closeLetter;
  animation-fill-mode: forwards;
  z-index: 2;
}


@media screen and (min-width: 768px) {
  .readMode .letter {
    animation: ease-in-out 1.5s openLetterLarge;
    animation-fill-mode: forwards;
    z-index: 2;
  }
  .close .letter {
    animation: ease-in-out 1.5s closeLetterLarge;
    animation-fill-mode: forwards;
    z-index: 4;
  }
  .letter {
    transform: scale(0.25);
    width: calc(90% * 4);
    height: calc(90% * 4);
    left: calc((-1 * (((90% * 4) / 2) - ((90% * 4) * 0.25 / 2))) + 8px);
  }
}

@keyframes openLetter {
  0% {
    transform: translateY(0) scale(0.35);
  }
  50% {
    transform: translateY(-35%) scale(0.35);
    z-index: 2;
  }
  60% {
    z-index: 4;
    width: calc(90% * 20/7);
    height: calc(90% * 20/7);
  }
  100% {
    transform: translateY(-10%) scale(1);
    width: calc(90% * 20/7);
    height: 560px;
    z-index: 4;
  }
}

@keyframes openLetterLarge {
  0% {
    transform: translateY(0) scale(0.25);
  }
  50% {
    transform: translateY(-25%) scale(0.25);
    z-index: 2;
  }
  60% {
    z-index: 4;
    width: calc(90% * 4);
    height: calc(90% * 4);
  }
  100% {
    transform: translateY(0) scale(1);
    width: calc(90% * 4);
    height: 480px;
    z-index: 4;
  }
}

@keyframes closeLetter {
  0% {
    transform: translateY(-10%) scale(1);
    width: calc(90% * 20/7);
    height: 560px;
    z-index: 4;
  }
  40% {
    z-index: 4;
    width: calc(90% * 20/7);
    height: 480px;
  }
  50% {
    transform: translateY(-35%) scale(0.35);
    z-index: 2;
  }
  100% {
    transform: translateY(0) scale(0.35);
  }
}

@keyframes closeLetterLarge {
  0% {
    transform: translateY(0) scale(1);
    width: calc(90% * 4);
    height: 480px;
    z-index: 4;
  }
  40% {
    z-index: 4;
    width: calc(90% * 4);
    height: 480px;
  }
  50% {
    transform: translateY(-25%) scale(0.25);
    z-index: 2;
  }
  100% {
    transform: translateY(0) scale(0.25);
    z-index: 1;
  }
}

@keyframes bounce {
  from {
    transform: translateY(4px) rotateY(10deg) rotateZ(1deg);
  }
  to {
    transform: translateY(-4px) rotateY(-10deg) rotateZ(-1deg);
  }
}

