html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0;
  min-height: 100dvh;
  background: #f4c2c2;
}

body.landing {
  position: relative;
  overflow-x: clip;
}

/* HEART LINE */
.heart-line {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  height: clamp(2.75rem, 7.5vw, 4rem);
  display: flex;
  align-items: center;
}

.heart-line--top { top: 0; }
.heart-line--bottom { bottom: 0; }

.heart-line__track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.heart-line--top .heart-line__track {
  animation: heart-marquee-scroll-left 11s linear infinite;
}

.heart-line--bottom .heart-line__track {
  animation: heart-marquee-scroll-right 11s linear infinite;
  animation-delay: -5.5s;
}

.heart-line__segment {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-evenly;
  gap: clamp(0.12rem, 1.1vw, 0.45rem);
  min-width: 100vw;
  box-sizing: content-box;
}

.heart-line__heart {
  display: block;
  font-size: clamp(1.4rem, 5.25vw, 2.35rem);
  line-height: 1;
  color: #cf4a43;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.08));
}

@keyframes heart-marquee-scroll-left {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

@keyframes heart-marquee-scroll-right {
  from { transform: translate3d(-50%, 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .heart-line__track {
    animation: none;
    transform: translate3d(0, 0, 0);
  }
}

/* LETTER LINK */
.letter-link {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  z-index: 2;
}

.letter-link:focus-visible {
  outline: 3px solid #cf4a43;
  outline-offset: 8px;
  border-radius: 6px;
}

/* LETTER IMAGE */
.letter-image {
  --s: clamp(0.6, min(90vw, 90vh, 560px) / 200px, 2.5);
  position: relative;
  width: calc(200px * var(--s));
  height: calc(240px * var(--s));
}

/* ANIMATED MAIL */
.animated-mail {
  position: absolute;
  height: calc(150px * var(--s));
  width: calc(200px * var(--s));
  transition: 0.4s;
}

.animated-mail .body {
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 calc(100px * var(--s)) calc(200px * var(--s));
  border-color: transparent transparent #e95f55 transparent;
  z-index: 2;
}

.animated-mail .top-fold {
  position: absolute;
  top: calc(50px * var(--s));
  width: 0;
  height: 0;
  border-style: solid;
  border-width: calc(50px * var(--s)) calc(100px * var(--s)) 0 calc(100px * var(--s));
  transform-origin: 50% 0%;
  transition: transform 0.4s 0.4s, z-index 0.2s 0.4s;
  border-color: #cf4a43 transparent transparent transparent;
  z-index: 2;
}

.animated-mail .back-fold {
  position: absolute;
  bottom: 0;
  width: calc(200px * var(--s));
  height: calc(100px * var(--s));
  background: #cf4a43;
  z-index: 0;
}

.animated-mail .left-fold {
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: calc(50px * var(--s)) 0 calc(50px * var(--s)) calc(100px * var(--s));
  border-color: transparent transparent transparent #e15349;
  z-index: 2;
}

.animated-mail .letter {
  left: calc(20px * var(--s));
  bottom: 0;
  position: absolute;
  width: calc(160px * var(--s));
  height: calc(60px * var(--s));
  background: white;
  z-index: 1;
  overflow: hidden;
  transition: 0.4s 0.2s;
}

.animated-mail .letter-border {
  height: calc(10px * var(--s));
  width: 100%;
  background: repeating-linear-gradient(
    -45deg,
    #cb5a5e,
    #cb5a5e calc(8px * var(--s)),
    transparent calc(8px * var(--s)),
    transparent calc(18px * var(--s))
  );
}

.animated-mail .letter-title {
  margin-top: calc(10px * var(--s));
  margin-left: calc(5px * var(--s));
  height: calc(10px * var(--s));
  width: 40%;
  background: #cb5a5e;
}

.animated-mail .letter-context {
  margin-top: calc(10px * var(--s));
  margin-left: calc(5px * var(--s));
  height: calc(10px * var(--s));
  width: 20%;
  background: #cb5a5e;
}

.animated-mail .letter-stamp {
  margin-top: calc(30px * var(--s));
  margin-left: calc(120px * var(--s));
  border-radius: 100%;
  height: calc(30px * var(--s));
  width: calc(30px * var(--s));
  background: #cb5a5e;
  opacity: 0.3;
}

/* SHADOW */
.shadow {
  position: absolute;
  top: calc(200px * var(--s));
  left: 50%;
  width: calc(400px * var(--s));
  height: calc(30px * var(--s));
  transition: 0.4s;
  transform: translateX(-50%);
  border-radius: 100%;
  background: radial-gradient(
    rgba(0, 0, 0, 0.5),
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 0)
  );
}

.letter-link:hover .animated-mail,
.letter-link:focus-visible .animated-mail {
  transform: translateY(calc(50px * var(--s)));
}

.letter-link:hover .animated-mail .top-fold,
.letter-link:focus-visible .animated-mail .top-fold {
  transition: transform 0.4s, z-index 0.2s;
  transform: rotateX(180deg);
  z-index: 0;
}

.letter-link:hover .animated-mail .letter,
.letter-link:focus-visible .animated-mail .letter {
  height: calc(180px * var(--s));
}

.letter-link:hover .shadow,
.letter-link:focus-visible .shadow {
  width: calc(250px * var(--s));
}

.courgette-regular {
  font-family: "Courgette", cursive;
  font-weight: 400;
  font-style: normal;
}

.letter-text {
  max-width: 1500px;
  margin: 80px auto;
  line-height: 1.9;
  font-size: 18px;
  white-space: pre-line;
  padding: 0 20px;
  color: #5a2a2a;
}


.letter-text {
  max-width: 1200px;
  margin: 60px auto 20px;
  padding: 0 20px;
  line-height: 1.8;
  white-space: pre-line;
  color: #5a2a2a;
}
.heart-btn {
  display: block;
  margin: 30px auto 60px;
  width: 60px;
  height: 60px;
  background: #5a2a2a;
  transform: rotate(-45deg);
  border: none;
  cursor: pointer;
  position: relative;
}

.heart-btn::before,
.heart-btn::after {
  content: "";
  position: absolute;
  width: 60px;
  height: 60px;
  background: #5a2a2a;
  border-radius: 50%;
}

.heart-btn::before {
  top: -30px;
  left: 0;
}

.heart-btn::after {
  left: 30px;
  top: 0;
}

.heart-btn:active {
  transform: rotate(-45deg) scale(0.9);
}

