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

body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: sans-serif;
  background-color: powderblue;
  cursor: url("./heart-icons/red-heart-32.png"), auto;
  /* background: linear-gradient(145deg, #1a1a2e, #16213e); */
}

/* Book */
.book {
  position: relative;
  width: 350px;
  height: 500px;
  transition: transform 0.5s;
}

.paper {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  perspective: 1500px;
}

.front,
.back {
  background-color: white;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  transform-origin: left;
  transition: transform 0.5s;
}
#f1 h1 {
  font-size: 1.5rem;
}
#f1 h2 {
  margin-top: 1rem;
  padding: 0 1rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 400;
  font-family: "Poppins", sans-serif;
}
#f1 p {
  margin-top: 1rem;
  padding: 0 1rem;
  text-align: center;
  margin-top: 1.5rem;
  font-style: italic;
  font-size: 1rem;
}
#f1 b {
  font-size: 1.55rem;
  color: #f5d142;
}
#f1 img {
  filter: drop-shadow(0 0 10px rgba(255, 200, 200, 0.6));
}
@keyframes glow {
  0%,
  100% {
    text-shadow: 0 0 5px #f5d142, 0 0 10px #f5d142;
  }
  50% {
    text-shadow: 0 0 25px #f5d142, 0 0 25px #f5d142;
  }
}
.date {
  font-family: "Poppins", sans-serif;
  opacity: 0;
  transform: translateY(15px);
  animation: dateAppear 2s ease-out 2.5s forwards;
}
@keyframes dateAppear {
  from {
    opacity: 0;
    transform: translateY(15px);
    letter-spacing: 2px;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    letter-spacing: normal;
  }
}
.signature {
  margin-top: 0.5rem;
  opacity: 0;
  filter: drop-shadow(0 0 4px rgba(245, 209, 66, 0.3));
  animation: signatureFade 3s ease-in-out 4s forwards;
}

@keyframes signatureFade {
  0% {
    opacity: 0;
    transform: scale(0.9) rotate(-2deg);
    filter: blur(2px);
  }
  50% {
    opacity: 1;
    transform: scale(1.03) rotate(1deg);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}
#f2 {
  overflow: hidden;
}
#f2 img {
  position: relative;
  top: -27px;
}
#f2 .comparison {
  position: relative;
  top: -25px;
  z-index: 1;
  background-color: white;
}
.comparison {
  font-size: 1rem;
  text-align: justify;
  font-style: italic;
  padding: 5px 5px;
}
.front-content h1 b {
  animation: glow 3s ease-in-out infinite;
}

#f3 img {
  position: relative;
  top: -10px;
}
#f3 .comparison {
  position: relative;
  top: -10px;
}
.front {
  z-index: 1;
  backface-visibility: hidden;
  border-left: 3px solid powderblue;
}

.back {
  z-index: 0;
}

.front-content,
.back-content {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.back-content {
  transform: rotateY(180deg);
}

/* Paper flip effect */
.flipped .front,
.flipped .back {
  transform: rotateY(-180deg);
}

/* Controller Buttons */
button {
  border: none;
  background-color: transparent;
  cursor: url("./heart-icons/heart-16.png"), auto;
  margin: 10px;
  transition: transform 0.5s;
}

button:focus {
  outline: none;
}

button:hover i {
  color: #636363;
}

i {
  font-size: 50px;
  color: gray;
}

.final-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #fff0f5; /* soft romantic background */
}

.image-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 150px);
  gap: 10px;
  width: 100%;
  max-width: 900px;
}

.image-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-panel img:hover {
  transform: scale(1.05) rotate(-1deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.final-text {
  margin-top: 1.5rem;
  text-align: center;
  font-family: "Poppins", sans-serif;
  color: #b23a48;
}

.final-text h2 {
  font-size: 1.5rem;
  line-height: 1.4;
}

/* Paper stack order */
#p1 {
  z-index: 5;
}

#p2 {
  z-index: 4;
}

#p3 {
  z-index: 3;
}
#p4 {
  z-index: 2;
}
#p5 {
  z-index: 1;
}
