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

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  /* overflow: hidden; */
  background: #041d33;
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-weight: 400;
  color: #2f2418;
}

/* ------------------------------ prime ------------------------------ */
.prime {
  padding: 8vh 5vh 5vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  z-index: 1;
  flex: none;
  width: 100%;
  height: 100%;
  background-color: #041d33;
}

.prime::before {
  content: '';
  position: absolute;
  width: 45vh;
  height: 6vh;
  left: 50%;
  top: 1vh;
  transform: translate(-50%, 0);
  background-image: url(../assets/graphic-desktop.webp);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  z-index: 10;
}

.prime__background {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  z-index: -2;
}

.prime__image {
  position: absolute;
  width: 100%;
  height: 100%;
  right: 0;
  top: 0;
  z-index: -1;
}

.prime__background img,
.prime__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.prime__background img ~ img,
.prime__image img ~ img {
  display: none;
}

.prime-wrap__title {
  margin-top: 0;
  margin-bottom: 1.5vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #ffffff;
  line-height: 0.9;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  -webkit-text-stroke: 0.1vh #ffc13c;
  /* text-shadow: -0.4vh 0.4vh 0 #3d5a50; */
  filter: drop-shadow(-0.3vh 0.3vh 0 #3d5a50);
}

.prime-wrap__title > * {
  background: linear-gradient(
    180deg,
    rgba(240, 163, 21, 1) 0%,
    rgba(253, 175, 31, 1) 30%,
    rgba(255, 227, 132, 1) 50%,
    rgba(253, 175, 31, 1) 70%,
    rgba(240, 163, 21, 1) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.prime-wrap__title > .line-first {
  font-size: 11.3vh;
  letter-spacing: 8px;
}
.prime-wrap__title > .line-second {
  font-size: 11vh;
  letter-spacing: 6px;
}
.prime-wrap__title > .line-third {
  font-size: 7vh;
  letter-spacing: 4px;
}

.prime-wrap__desc {
  width: 100%;
  text-align: center;
  text-transform: uppercase;
  font-size: 2.3vh;
  letter-spacing: 1px;
  line-height: 1.3;
  color: #ffffff;
  font-weight: 600;
  filter: drop-shadow(0.1vh -0.1vh 1.5vh rgba(35, 31, 32, 0.58))
    drop-shadow(0.1vh 0.1vh 0.1vh #231f20) drop-shadow(-0.2vh 0.1vh 0 #010100);
}

.prime-wrap__desc p {
  margin: 0;
}

.letter {
  margin: 0;
  flex: 1 1 auto;
  position: relative;
}

/* ---------------------------- parchment ---------------------------- */
.parchment {
  display: flex;
  flex-direction: column;
  position: relative;
}

.parchment-form {
  display: flex;
  flex-direction: column;
  padding: 4vh;
  position: absolute;
  top: 10vh;
  left: 50%;
  transform: translateX(-50%);
  width: 75vh;
  height: 25vh;
  min-height: 0;
}

.parchment-form__input {
  padding: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  resize: none;
  outline: none;
  font-family: 'Cinzel', serif;
  font-weight: 500;
  font-size: 4vh;
  letter-spacing: 2px;
  line-height: 1.2;
  color: #000000;
  text-align: center;
  text-transform: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 110, 40, 0.55) transparent;
}
.parchment-form__input::-webkit-scrollbar {
  width: 0.2vh;
}
.parchment-form__input::-webkit-scrollbar-track {
  background: transparent;
}
.parchment-form__input::-webkit-scrollbar-thumb {
  background: rgba(150, 110, 40, 0.5);
  border-radius: 99px;
}

/* the centred hint that replaces the artwork's baked-in caption */
.parchment-form__hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 4.2vh;
  letter-spacing: 2px;
  line-height: 1.2;
  color: #000000;
  text-align: center;
  transition: opacity 0.22s ease;
}
.parchment-form__input:focus + .parchment-form__hint,
.parchment-form__input:not(:placeholder-shown) + .parchment-form__hint {
  opacity: 0;
}

/* ---------------------------- success ---------------------------- */
.parchment-popup {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 19, 18, 0.8);
  backdrop-filter: blur(2px);
  transform: none;
  z-index: 1000;
  overflow-y: auto;
	overflow-x: hidden;
}
.parchment-popup[hidden] {
  display: none;
  z-index: -100;
}

.parchment-popup__content {
  margin: auto;
  padding: 26vh 5vh 12vh;
  width: 152vh;
  height: 84.5vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #2f2418;
  background-image: url(../assets/popup-desktop.webp);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.parchment-popup__title {
  margin-bottom: 9vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  font-size: 9vh;
  letter-spacing: 5px;
  line-height: 1.2;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  -webkit-text-stroke: 0.1vh #ffc13c;
  filter: drop-shadow(-0.3vh 0.3vh 0 #3d5a50);
}

.parchment-popup__title::after {
  content: '';
  position: absolute;
  width: 62vh;
  height: 5vh;
  left: 50%;
  bottom: -6.5vh;
  transform: translate(-50%, 0);
  background-image: url(../assets/graphic-popup.webp);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  z-index: 10;
}

.parchment-popup__title > span {
  background: linear-gradient(
    180deg,
    rgba(240, 163, 21, 1) 0%,
    rgba(253, 175, 31, 1) 30%,
    rgba(255, 227, 132, 1) 50%,
    rgba(253, 175, 31, 1) 70%,
    rgba(240, 163, 21, 1) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.parchment-popup__text {
  margin: 0;
  font-size: 4.6vh;
  letter-spacing: 3px;
  line-height: 1.35;
  font-weight: 600;
  color: #fff;
  filter: drop-shadow(0.1vh -0.1vh 1.5vh rgba(35, 31, 32, 0.58))
    drop-shadow(-0.2vh 0.1vh 0 #010100);
}

.parchment-popup__text p {
  margin: 0;
}

.parchment-form {
  transition: opacity 0.3s ease;
}
.is-sent .parchment-form {
  opacity: 0;
  pointer-events: none;
}
.parchment-popup__content {
  animation: fadeIn 0.45s 0.12s both ease-out;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------- send button --------------------------- */
.letter__button {
  padding: 0 0 3.5vh;
  position: absolute;
  top: 38vh;
  left: calc(50% - 60vh / 2);
  border: 0;
  width: 60vh;
  height: 16vh;
  font-size: 3.7vh;
  letter-spacing: 2px;
  line-height: 1.2;
  color: #2a1203;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  text-shadow:
    -0.1vh -0.1vh 0 #ffc13c,
    0.1vh -0.1vh 0 #ffc13c,
    -0.1vh 0.1vh 0 #ffc13c,
    0.1vh 0.1vh 0 #ffc13c,
    -0.1vh 0 0 #ffc13c,
    0.1vh 0 0 #ffc13c,
    0 -0.1vh 0 #ffc13c,
    0 0.1vh 0 #ffc13c;
  font-family: 'Cinzel', serif;
  background-color: transparent;
  background-image: url(../assets/button-bg.webp);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.letter__button:hover {
  transform: translateY(-1.5%) scale(1.012);
  filter: brightness(1.06);
}
.letter__button:active {
  transform: translateY(0) scale(0.99);
  filter: brightness(0.96);
}

.letter__button[disabled] {
  cursor: default;
}
.letter__button[disabled]:hover {
  transform: none;
  filter: none;
}
.letter__button[disabled]:hover::before,
.letter__button[disabled]:hover::after {
  opacity: 0;
}

/* =====================================================================
   PORTRAIT / MOBILE artwork
   ===================================================================== */
@media (orientation: portrait) {
  .prime {
    padding: 9.5vw 4vw 6vw;
  }

  .prime::before {
    width: 45vw;
    height: 6vw;
    top: 1vw;
  }

  .prime__image {
    width: 100%;
    height: unset;
    top: 40vw;
  }

  .prime__background img,
  .prime__image img {
    display: none;
  }

  .prime__background img ~ img,
  .prime__image img ~ img {
    display: block;
  }

  .prime-wrap {
    margin-bottom: 40vw;
  }

  .prime-wrap__title {
    margin-bottom: 1.8vw;
    -webkit-text-stroke: 0.1vw #ffc13c;
    filter: drop-shadow(-0.4vw 0.4vw 0 #3d5a50);
  }

  .prime-wrap__title > .line-first {
    font-size: 12.5vw;
    letter-spacing: 1vw;
  }
  .prime-wrap__title > .line-second {
    font-size: 13vw;
    letter-spacing: 0.7vw;
  }
  .prime-wrap__title > .line-third {
    font-size: 8.3vw;
    letter-spacing: 0.5vw;
  }

  .prime-wrap__desc {
    font-size: 2.7vw;
    filter: drop-shadow(0.1vw -0.1vw 1.5vw rgba(35, 31, 32, 0.58))
      drop-shadow(0.1vw 0.1vw 0.1vw #231f20) drop-shadow(-0.2vw 0.1vw 0 #010100);
  }

  .parchment-form {
    padding: 4vw;
    top: 12vw;
    width: 55vw;
    height: 34vw;
  }

  .parchment-form__input {
    font-size: 3vw;
    letter-spacing: 0.2vw;
  }

  .parchment-form__hint {
    font-size: 3.7vw;
    letter-spacing: 0.2vw;
  }

  .letter {
    margin-left: auto;
    margin-right: auto;
    flex: 0 0 auto;
    width: 75vw;
    height: 51vw;
  }

  .letter__button {
    padding: 0 0 4.5vw;
    top: 53vw;
    left: calc(50% - 79vw / 2);
    width: 79vw;
    height: 21vw;
    font-size: 4.9vw;
    letter-spacing: 0.2vw;
    text-shadow:
      -0.1vw -0.1vw 0 #ffc13c,
      0.1vw -0.1vw 0 #ffc13c,
      -0.1vw 0.1vw 0 #ffc13c,
      0.1vw 0.1vw 0 #ffc13c,
      -0.1vw 0 0 #ffc13c,
      0.1vw 0 0 #ffc13c,
      0 -0.1vw 0 #ffc13c,
      0 0.1vw 0 #ffc13c;
  }

  .parchment-popup__content {
    padding: 21vw 5vw 16vw;
    justify-content: flex-start;
    width: 84vw;
    height: 152vw;
    background-image: url(../assets/popup-mobile.webp);
  }

  .parchment-popup__title {
    margin-bottom: 9vw;
    font-size: 6.8vw;
    letter-spacing: 0.4vw;
    -webkit-text-stroke: 0.1vw #ffc13c;
    filter: drop-shadow(-0.3vw 0.3vw 0 #3d5a50);
  }

  .parchment-popup__title::after {
    width: 48vw;
    height: 3.8vw;
    bottom: -6.5vw;
  }

  .parchment-popup__text {
    font-size: 3.5vw;
    letter-spacing: 0.2vw;
    filter: drop-shadow(0.1vw -0.1vw 1.5vw rgba(35, 31, 32, 0.58))
      drop-shadow(-0.2vw 0.1vw 0 #010100);
  }
}

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