:root {
  --bg-color: #fdf2f8; /* A very light, soft pink for the background */
  --card-bg: #ffffff; /* White for the card for a clean look */
  --primary-text: #4a044e; /* A deep, rich purple for headings */
  --secondary-text: #585858; /* A slightly softer gray for the body */
  --accent-color: #fbcfe8; /* A gentle pink for accents */
  --shadow-color: #4a044e; /* Updated shadow color to a deep purple */
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--secondary-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 5vmin; /* Use viewport units for responsive padding */
  background-color: var(--bg-color);
  transition: background-color 0.3s ease;
}

.page::before {
  content: '';
  position: absolute;
  inset: -20%;
  background: linear-gradient(45deg, rgba(255, 192, 203, 0.5), rgba(251, 207, 232, 0.6), rgba(255, 221, 221, 0.4), rgba(255, 192, 203, 0.5));
  background-size: 400% 400%;
  filter: blur(35px);
  animation: gradient-flow 8s ease-in-out infinite;
  z-index: 0;
}

.page::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' opacity='0.32'%3E%3Cstyle%3Etext%20%7B%20font-size%3A%2028px;%20%7D%3C/style%3E%3Ctext x='20' y='60'%3E%F0%9F%8D%AB%3C/text%3E%3Ctext x='120' y='40'%3E%F0%9F%8D%93%3C/text%3E%3Ctext x='70' y='150'%3E%E2%9D%A4%EF%B8%8F%3C/text%3E%3Ctext x='170' y='140'%3E%F0%9F%8D%93%3C/text%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260' opacity='0.28'%3E%3Cstyle%3Etext%20%7B%20font-size%3A%2032px;%20%7D%3C/style%3E%3Ctext x='40' y='80'%3E%F0%9F%8D%93%3C/text%3E%3Ctext x='180' y='70'%3E%F0%9F%8D%AB%3C/text%3E%3Ctext x='120' y='190'%3E%E2%9D%A4%EF%B8%8F%3C/text%3E%3Ctext x='220' y='200'%3E%F0%9F%8D%93%3C/text%3E%3C/svg%3E");
  background-repeat: repeat, repeat;
  background-size: 260px 260px, 320px 320px;
  background-position: 0 0, 120px 60px;
  animation: float-emojis 28s ease-in-out infinite;
  opacity: 0.8;
  pointer-events: none;
  z-index: 0;
}

.card {
  max-width: 800px;
  width: 100%;
  background: var(--card-bg);
  border-radius: 24px; /* Softer, more rounded corners */
  padding: 48px 56px; /* More generous padding */
  border: 1px solid rgba(255, 255, 255, 0.8);
  position: relative; /* For potential pseudo-elements */
  overflow: hidden; /* To contain pseudo-elements */
  z-index: 1;
  box-shadow: none;
  animation: none;
}

/* A little heart decoration */
.card::before {
  content: '♥';
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 24px;
  color: var(--accent-color);
  opacity: 0.8;
}

h1 {
  margin: 0 0 24px 0;
  font-family: 'Playfair Display', serif;
  font-size: 42px; /* Larger, more impactful title */
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
  color: var(--primary-text);
  text-shadow: 1px 1px 3px rgba(74, 4, 78, 0.1);
}

.letter {
  white-space: pre-wrap;
  line-height: 1.8; /* Increased line height for better readability */
  font-size: 19px; /* Slightly larger body font */
  padding: 10px 0;
  text-align: justify; /* Justified text for a more formal, book-like feel */
}

.sign {
  white-space: pre-wrap;
  margin-top: 32px; /* More space before the signature */
  text-align: right;
  font-family: 'Playfair Display', serif; /* Use the elegant font for the signature */
  font-size: 22px;
  font-weight: 400;
  color: var(--primary-text);
}

@keyframes gradient-flow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes float-emojis {
  0% {
    background-position: 0 0, 120px 60px;
  }
  18% {
    background-position: 50px -40px, 60px 110px;
  }
  37% {
    background-position: -30px 70px, 170px 0px;
  }
  62% {
    background-position: 30px -10px, 40px -80px;
  }
  82% {
    background-position: -70px 40px, 150px 40px;
  }
  100% {
    background-position: 0 0, 120px 60px;
  }
}
