:root {
  --bg-1: #ffe9f2;
  --bg-2: #ffd4e5;
  --ink: #4c1d2c;
  --muted: #7a4b5f;
  --card-front-1: #ff8db7;
  --card-front-2: #ff6b9f;
  --card-inside: #fff7fb;
  --accent: #ff3f86;
  --shadow: 0 24px 50px rgba(121, 35, 74, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Nunito", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 15%, #fff8fc 0%, rgba(255, 248, 252, 0) 45%),
    radial-gradient(circle at 90% 0%, #ffd2e4 0%, rgba(255, 210, 228, 0) 50%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2));
  display: grid;
  place-items: center;
  overflow-x: hidden;
}

.page-wrap {
  width: min(960px, 94vw);
  padding: clamp(18px, 3vw, 30px);
  text-align: center;
}

.intro h1 {
  margin: 0;
  font-family: "Pacifico", cursive;
  font-size: clamp(2rem, 6vw, 3.3rem);
  color: #d11f6a;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--muted);
  font-size: 0.76rem;
}

.subtitle {
  margin-top: 0.5rem;
  color: #6d3d52;
  font-weight: 700;
}

.card-shell {
  margin-inline: auto;
  margin-top: clamp(14px, 3vw, 24px);
  perspective: 2200px;
  width: min(700px, 100%);
  aspect-ratio: 16 / 11;
  min-height: 360px;
}

.card-book {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 900ms cubic-bezier(0.22, 0.75, 0.2, 1);
  border-radius: 22px;
  outline: none;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.card-book:focus-visible {
  box-shadow: 0 0 0 4px rgba(255, 63, 134, 0.28), var(--shadow);
}

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

.card-front {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.4rem;
  color: #fff;
  background: linear-gradient(145deg, var(--card-front-1), var(--card-front-2));
  border: 2px solid rgba(255, 255, 255, 0.45);
}

.card-front h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3.8vw, 2.2rem);
}

.to-text {
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 0;
  opacity: 0.95;
}

.hint {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.88;
}

.seal {
  margin-top: 0.7rem;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  background: rgba(255, 255, 255, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.4);
  animation: pulse 2.4s ease-in-out infinite;
}

.shine {
  position: absolute;
  inset: -25%;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.27) 50%, transparent 65%);
  transform: translateX(-55%) rotate(10deg);
  animation: sweep 3.8s ease-in-out infinite;
}

.card-inside {
  background:
    radial-gradient(circle at top right, rgba(255, 193, 220, 0.36), transparent 45%),
    var(--card-inside);
  transform: rotateY(180deg);
  border: 2px solid #ffd3e5;
  padding: clamp(18px, 3.5vw, 36px);
  display: grid;
  place-items: center;
}

.inside-content {
  max-width: 40ch;
}

.inside-content h3 {
  margin: 0;
  color: #cc1d66;
  font-size: clamp(1.35rem, 3.3vw, 2rem);
}

.inside-content p {
  color: #60384c;
  line-height: 1.5;
  margin: 0.9rem 0;
  font-size: clamp(1rem, 1.15vw, 1.08rem);
}

.signature span {
  font-family: "Pacifico", cursive;
  color: #d62470;
  font-size: 1.2em;
}

.mini-btn {
  margin-top: 0.35rem;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.62rem 1rem;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(255, 63, 134, 0.25);
}

.mini-btn:hover {
  filter: brightness(1.05);
}

.card-book.is-open {
  transform: rotateY(180deg);
}

.footer-note {
  margin-top: 1rem;
  color: #7d5062;
  font-size: 0.92rem;
}

.bg-hearts {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-hearts span {
  position: absolute;
  bottom: -24px;
  font-size: clamp(16px, 2.5vw, 28px);
  opacity: 0.25;
  animation: floatUp linear infinite;
}

.bg-hearts span:nth-child(1) {
  left: 9%;
  animation-duration: 10s;
}
.bg-hearts span:nth-child(2) {
  left: 28%;
  animation-duration: 14s;
  animation-delay: 0.9s;
}
.bg-hearts span:nth-child(3) {
  left: 50%;
  animation-duration: 12s;
  animation-delay: 0.35s;
}
.bg-hearts span:nth-child(4) {
  left: 72%;
  animation-duration: 15s;
  animation-delay: 1.3s;
}
.bg-hearts span:nth-child(5) {
  left: 88%;
  animation-duration: 11s;
  animation-delay: 0.5s;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes sweep {
  0% {
    transform: translateX(-70%) rotate(10deg);
  }
  45%,
  100% {
    transform: translateX(70%) rotate(10deg);
  }
}

@keyframes floatUp {
  from {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 0.28;
  }
  to {
    transform: translateY(-120vh) rotate(24deg);
    opacity: 0;
  }
}

@media (max-width: 640px) {
  .card-shell {
    aspect-ratio: 7 / 9;
    min-height: 0;
  }

  .page-wrap {
    padding-top: 18px;
  }

  .inside-content {
    max-width: 28ch;
  }
}
