:root {
  color-scheme: light;
  --ink: #35272e;
  --muted: #79666f;
  --berry: #d93f70;
  --berry-dark: #b82f5c;
  --rose: #ff8fae;
  --cream: #fff8f8;
  --paper: rgba(255, 255, 255, 0.78);
  --shadow: 0 28px 80px rgba(116, 47, 70, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 169, 193, 0.46), transparent 28%),
    radial-gradient(circle at 88% 82%, rgba(255, 206, 155, 0.43), transparent 31%),
    linear-gradient(145deg, #fffafa 0%, #fff1f4 52%, #fff9ed 100%);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.24;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
}

.page-shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 24px;
}

.love-card {
  position: relative;
  width: min(100%, 620px);
  padding: clamp(38px, 7vw, 72px) clamp(24px, 7vw, 68px) 34px;
  overflow: hidden;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 36px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  animation: card-arrival 800ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.love-card::after {
  position: absolute;
  width: 180px;
  height: 180px;
  right: -72px;
  bottom: -92px;
  content: "";
  border-radius: 50%;
  background: rgba(255, 143, 174, 0.13);
}

.eyebrow {
  margin: 0 0 24px;
  color: var(--berry-dark);
  font-size: 0.73rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.heart-mark {
  position: relative;
  display: grid;
  width: 96px;
  height: 96px;
  margin: 0 auto 24px;
  place-items: center;
  color: white;
  font-size: 2.85rem;
  line-height: 1;
  border-radius: 31px;
  background: linear-gradient(145deg, var(--rose), var(--berry));
  box-shadow: 0 18px 32px rgba(217, 63, 112, 0.29);
  transform: rotate(-6deg);
  animation: gentle-beat 2.4s ease-in-out 1s infinite;
}

.heart-mark > span:first-child {
  transform: rotate(6deg) translateY(-1px);
}

.heart-mark__spark {
  position: absolute;
  color: #efae37;
  font-size: 1.1rem;
  animation: twinkle 1.8s ease-in-out infinite alternate;
}

.heart-mark__spark--one {
  top: -13px;
  right: -18px;
}

.heart-mark__spark--two {
  bottom: -13px;
  left: -16px;
  font-size: 0.75rem;
  animation-delay: 700ms;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.2rem, 12vw, 6.6rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.96;
}

.message {
  min-height: 3.2em;
  max-width: 390px;
  margin: 24px auto 30px;
  color: var(--muted);
  font-size: clamp(1rem, 2.7vw, 1.12rem);
  line-height: 1.65;
  transition: opacity 180ms ease, transform 180ms ease;
}

.message.is-changing {
  opacity: 0;
  transform: translateY(5px);
}

.love-button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 24px;
  color: white;
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: var(--ink);
  box-shadow: 0 12px 24px rgba(53, 39, 46, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.love-button:hover {
  background: #4b353f;
  box-shadow: 0 15px 30px rgba(53, 39, 46, 0.23);
  transform: translateY(-2px);
}

.love-button:active {
  transform: translateY(1px) scale(0.98);
}

.love-button:focus-visible {
  outline: 4px solid rgba(217, 63, 112, 0.26);
  outline-offset: 4px;
}

.signature {
  margin: 34px 0 0;
  color: #a28d96;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
  font-style: italic;
}

.signature span {
  color: var(--berry);
}

.ambient-heart {
  position: fixed;
  z-index: 0;
  color: rgba(217, 63, 112, 0.13);
  font-family: Georgia, serif;
  line-height: 1;
  user-select: none;
  animation: float 8s ease-in-out infinite alternate;
}

.ambient-heart--one {
  top: 11%;
  left: 8%;
  font-size: clamp(4rem, 10vw, 8rem);
  transform: rotate(-18deg);
}

.ambient-heart--two {
  right: 9%;
  bottom: 12%;
  font-size: clamp(5rem, 13vw, 10rem);
  animation-delay: -3s;
  transform: rotate(16deg);
}

.ambient-heart--three {
  top: 16%;
  right: 16%;
  color: rgba(239, 174, 55, 0.13);
  font-size: clamp(1.5rem, 4vw, 3rem);
  animation-delay: -5s;
  transform: rotate(11deg);
}

.burst-heart {
  position: fixed;
  z-index: 3;
  left: var(--left);
  top: var(--top);
  color: var(--color);
  font-size: var(--size);
  pointer-events: none;
  animation: burst 900ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes card-arrival {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
}

@keyframes gentle-beat {
  0%,
  100% {
    transform: rotate(-6deg) scale(1);
  }
  15% {
    transform: rotate(-6deg) scale(1.07);
  }
  27% {
    transform: rotate(-6deg) scale(1);
  }
  39% {
    transform: rotate(-6deg) scale(1.045);
  }
}

@keyframes twinkle {
  from {
    opacity: 0.42;
    transform: rotate(0deg) scale(0.85);
  }
  to {
    opacity: 1;
    transform: rotate(35deg) scale(1.18);
  }
}

@keyframes float {
  from {
    translate: 0 -7px;
  }
  to {
    translate: 5px 12px;
  }
}

@keyframes burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.1)
      rotate(var(--rotate));
  }
}

@media (max-width: 540px) {
  .page-shell {
    padding: 16px;
  }

  .love-card {
    border-radius: 28px;
  }

  .heart-mark {
    width: 84px;
    height: 84px;
    border-radius: 27px;
    font-size: 2.5rem;
  }

  .love-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
