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

:root {
  --paper: #fffaf4;
  --paper-soft: #f5e9df;
  --rose: #b56b78;
  --rose-dark: #7b404b;
  --wine: #4d3036;
  --ink: #4a383c;
  --line: rgba(123, 64, 75, 0.2);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  background: #2a2023;
}

.page-background {
  position: fixed;
  inset: -20px;
  z-index: -3;
  background:
    linear-gradient(rgba(48, 35, 38, 0.48), rgba(34, 26, 28, 0.82)),
    url("images/pes2.jpeg") center / cover no-repeat;
  filter: brightness(0.56) saturate(0.76);
  transform: scale(1.05);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 244, 231, 0.14), transparent 44%);
}

.love-page {
  position: relative;
  z-index: 1;
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 28px 24px 90px;
}

.back-button {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid rgba(255, 250, 244, 0.5);
  border-radius: 999px;
  color: #fffaf4;
  background: rgba(73, 52, 57, 0.56);
  text-decoration: none;
  backdrop-filter: blur(10px);
  transition:
    transform 0.25s ease,
    background 0.25s ease;
}

.back-button:hover {
  transform: translateX(-4px);
  background: rgba(96, 62, 70, 0.72);
}

.love-header {
  width: min(900px, 100%);
  margin: 42px auto 28px;
  padding: 44px 30px 36px;
  border: 1px solid rgba(255, 250, 244, 0.58);
  border-radius: 26px;
  text-align: center;
  background: rgba(255, 250, 244, 0.8);
  backdrop-filter: blur(18px);
  box-shadow: 0 26px 65px rgba(23, 14, 16, 0.24);
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--rose-dark);
  font-size: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.love-header h1 {
  color: var(--wine);
  font-family: "Great Vibes", cursive;
  font-size: clamp(70px, 10vw, 130px);
  font-weight: 400;
  line-height: 0.95;
}

.intro-text {
  max-width: 760px;
  margin: 18px auto 0;
  color: #6d555b;
  font-size: clamp(21px, 2.5vw, 30px);
  line-height: 1.4;
}

.progress-panel {
  width: min(560px, 100%);
  margin: 0 auto 34px;
  padding: 18px 22px;
  border: 1px solid rgba(255, 250, 244, 0.5);
  border-radius: 18px;
  color: #fffaf4;
  text-align: center;
  background: rgba(73, 52, 57, 0.56);
  backdrop-filter: blur(12px);
}

.progress-panel p {
  margin-bottom: 8px;
  font-size: 19px;
}

.progress-line {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.22);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #e3b9b4;
  transition: width 0.45s ease;
}

.progress-panel span {
  display: block;
  margin-top: 8px;
  font-size: 17px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.reason-card {
  position: relative;
  height: 285px;
  perspective: 1200px;
  cursor: pointer;
  outline: none;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.reason-card.open .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 18px 40px rgba(34, 20, 24, 0.2);
}

.card-front {
  color: var(--rose-dark);
  background:
    linear-gradient(145deg, rgba(255, 250, 244, 0.98), rgba(243, 228, 218, 0.96));
}

.card-front::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(123, 64, 75, 0.16);
  border-radius: 15px;
  pointer-events: none;
}

.card-number {
  margin-bottom: 14px;
  color: #a47b82;
  font-size: 18px;
  letter-spacing: 0.12em;
}

.card-heart {
  margin-bottom: 14px;
  color: var(--rose-dark);
  font-size: 52px;
  line-height: 1;
}

.card-hint {
  font-size: 22px;
  font-weight: 600;
}

.card-back {
  transform: rotateY(180deg);
  color: #fffaf4;
  text-align: center;
  background:
    linear-gradient(145deg, #84505a, #613943);
}

.card-back p {
  font-family: "Great Vibes", cursive;
  font-size: clamp(31px, 3vw, 42px);
  line-height: 1.17;
}

.reason-card:hover .card-inner {
  filter: drop-shadow(0 18px 24px rgba(35, 21, 24, 0.2));
}

.reason-card:not(.open):hover .card-inner {
  transform: translateY(-7px) rotateX(2deg);
}

.reason-card.open:hover .card-inner {
  transform: translateY(-7px) rotateY(180deg);
}

.final-message {
  width: min(820px, 100%);
  margin: 56px auto 0;
  padding: 48px 30px;
  border: 1px solid rgba(255, 250, 244, 0.58);
  border-radius: 24px;
  text-align: center;
  background: rgba(255, 250, 244, 0.84);
  backdrop-filter: blur(18px);
  box-shadow: 0 26px 65px rgba(23, 14, 16, 0.24);
  animation: finalAppear 0.9s ease both;
}

.final-message h2 {
  margin-bottom: 12px;
  color: var(--wine);
  font-family: "Great Vibes", cursive;
  font-size: clamp(52px, 7vw, 86px);
  font-weight: 400;
}

.final-message p:last-child {
  color: #6d555b;
  font-size: 24px;
  line-height: 1.4;
}

.hidden {
  display: none;
}

@keyframes finalAppear {
  from {
    opacity: 0;
    transform: translateY(26px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1050px) {
  .cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .love-page {
    padding: 20px 14px 60px;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .reason-card {
    height: 260px;
  }
}

@media (max-width: 480px) {
  .love-header {
    margin-top: 28px;
    padding: 34px 18px 28px;
    border-radius: 20px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .reason-card {
    height: 250px;
  }
}
