:root {
  --bg-top: #f7f2ed;
  --bg-mid: #eadfda;
  --bg-bottom: #d7c5c0;
  --heart-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 464'%3E%3Cpath fill='white' d='M256 464c-13-11-26-22-38-31C92 332 12 267 12 159C12 93 62 45 126 45c48 0 97 27 130 71c33-44 82-71 130-71c64 0 114 48 114 114c0 108-80 173-206 274c-12 9-25 20-38 31Z'/%3E%3C/svg%3E");
  --panel: rgba(253, 249, 246, 0.68);
  --panel-border: rgba(98, 63, 74, 0.14);
  --card-base: linear-gradient(180deg, #d3a0a6 0%, #915c69 52%, #4e313d 100%);
  --ink-strong: #3f2732;
  --ink-soft: #68515d;
  --ink-faint: #8e737d;
  --rose: #b67983;
  --rose-deep: #724754;
  --rose-muted: #d7b5b2;
  --button-shadow: rgba(83, 51, 63, 0.22);
  --overlay-shadow: rgba(31, 18, 24, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  color: var(--ink-strong);
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 255, 255, 0.9), transparent 26%),
    radial-gradient(circle at 82% 14%, rgba(238, 220, 215, 0.9), transparent 24%),
    radial-gradient(circle at 72% 78%, rgba(199, 162, 167, 0.36), transparent 22%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 55%, var(--bg-bottom) 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  filter: blur(14px);
}

body::before {
  top: -6rem;
  right: -4rem;
  width: 22rem;
  height: 22rem;
  border-radius: 42% 58% 52% 48%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0));
  opacity: 0.95;
}

body::after {
  bottom: -8rem;
  left: -6rem;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 162, 166, 0.42), rgba(201, 162, 166, 0));
  opacity: 0.72;
}

body > * {
  position: relative;
}

body::selection {
  background: rgba(182, 121, 131, 0.2);
}

button {
  font: inherit;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding:
    calc(2rem + env(safe-area-inset-top))
    1.25rem
    calc(2rem + env(safe-area-inset-bottom));
}

.home-panel {
  position: relative;
  width: min(100%, 29rem);
  overflow: hidden;
  padding: 2.8rem 1.8rem 1.7rem;
  border: 1px solid var(--panel-border);
  border-radius: 2rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(250, 243, 239, 0.5)),
    var(--panel);
  backdrop-filter: blur(26px) saturate(130%);
  box-shadow:
    0 1.8rem 4rem rgba(82, 51, 62, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  text-align: center;
  animation: rise-in 650ms ease both;
}

.home-panel::before {
  content: "";
  position: absolute;
  inset: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 1.45rem;
  pointer-events: none;
}

.home-panel::after {
  content: "";
  position: absolute;
  top: -5.5rem;
  right: -3.5rem;
  width: 13rem;
  height: 13rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0));
  opacity: 0.86;
  pointer-events: none;
}

.panel-glow {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.panel-glow::before,
.panel-glow::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
}

.panel-glow::before {
  top: 1.1rem;
  left: -2.1rem;
  width: 8rem;
  height: 8rem;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
  opacity: 0.9;
}

.panel-glow::after {
  right: -2.8rem;
  bottom: -3rem;
  width: 11rem;
  height: 11rem;
  background: radial-gradient(circle, rgba(219, 188, 186, 0.54), rgba(219, 188, 186, 0));
  opacity: 0.72;
}

.eyebrow {
  position: relative;
  z-index: 1;
  margin: 0 0 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--rose-deep);
}

.whisper {
  position: relative;
  z-index: 1;
  margin: 0 0 1rem;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(0.98rem, 4vw, 1.18rem);
  font-style: italic;
  letter-spacing: 0.01em;
  color: var(--ink-faint);
}

h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 11ch;
  margin-inline: auto;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(2.55rem, 9vw, 3.9rem);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.primary-button,
.back-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.primary-button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: min(100%, 15.6rem);
  margin-top: 1.5rem;
  padding: 1.02rem 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fffaf7;
  letter-spacing: 0.01em;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), transparent 40%),
    linear-gradient(135deg, #82505d, var(--rose));
  box-shadow:
    0 1rem 2rem var(--button-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.primary-button::after {
  content: "\2192";
  font-size: 1rem;
  opacity: 0.84;
}

.primary-button:hover,
.primary-button:focus-visible {
  transform: translateY(-1px);
  box-shadow:
    0 1.25rem 2.3rem rgba(75, 45, 56, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  filter: saturate(1.04);
}

.primary-button:focus-visible,
.back-button:focus-visible {
  outline: 3px solid rgba(114, 71, 84, 0.16);
  outline-offset: 3px;
}

.home-note {
  position: relative;
  z-index: 1;
  margin: 1.15rem auto 0;
  max-width: 18.5rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ink-faint);
}

.message-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding:
    calc(1.25rem + env(safe-area-inset-top))
    1rem
    calc(1.3rem + env(safe-area-inset-bottom));
}

.message-overlay[hidden] {
  display: none;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(250, 245, 242, 0.08), rgba(31, 18, 24, 0.18)),
    rgba(31, 18, 24, 0.28);
  backdrop-filter: blur(12px);
}

.message-dialog {
  position: relative;
  width: min(100%, 25.8rem);
  display: grid;
  justify-items: stretch;
  gap: 0.85rem;
  animation: card-in 260ms ease both;
}

.back-button {
  justify-self: start;
  position: relative;
  z-index: 2;
  padding: 0.65rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.26);
  color: var(--rose-deep);
  background: rgba(255, 250, 247, 0.74);
  box-shadow:
    0 0.75rem 1.25rem rgba(45, 28, 35, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(10px);
}

.message-dialog__title {
  justify-self: center;
  margin: 0;
  position: relative;
  padding-bottom: 0.72rem;
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(97, 60, 71, 0.92);
}

.message-dialog__title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 8rem;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(114, 71, 84, 0.5), transparent);
}

.message-card {
  justify-self: center;
  position: relative;
  width: min(100%, 23rem);
  aspect-ratio: 512 / 568;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.22), transparent 42%),
    var(--card-base);
  box-shadow:
    0 2rem 3.8rem var(--overlay-shadow),
    0 0.7rem 1.5rem rgba(31, 18, 24, 0.12);
  -webkit-mask: var(--heart-mask) center / 100% 100% no-repeat;
  mask: var(--heart-mask) center / 100% 100% no-repeat;
}

.message-photo {
  position: absolute;
  inset: 0;
  background-position: 50% 24%;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0.82;
  transform: scale(1.015);
}

.message-photo[hidden] {
  display: none;
}

.message-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 246, 242, 0.18) 0%, rgba(255, 241, 236, 0.1) 24%, rgba(73, 45, 56, 0.12) 54%, rgba(22, 13, 17, 0.42) 100%),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 45%),
    radial-gradient(circle at 50% 70%, rgba(255, 246, 243, 0.06), rgba(255, 246, 243, 0) 58%);
}

.message-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  box-shadow:
    inset 0 0 0 1px rgba(255, 248, 244, 0.48),
    inset 0 0 4rem rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.card-aura {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.card-aura::before,
.card-aura::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.45;
}

.card-aura::before {
  top: -1rem;
  right: -1.5rem;
  width: 10rem;
  height: 7rem;
  background: radial-gradient(circle, rgba(255, 232, 227, 0.42), rgba(255, 232, 227, 0));
}

.card-aura::after {
  left: -1rem;
  bottom: 2rem;
  width: 8rem;
  height: 8rem;
  background: radial-gradient(circle, rgba(232, 195, 197, 0.28), rgba(232, 195, 197, 0));
}

.message-card__content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
  justify-items: center;
  height: 100%;
  padding: 3rem 3rem 4.4rem;
  text-align: center;
  overflow: hidden;
}

.message-lines {
  display: grid;
  align-self: stretch;
  place-content: center;
  gap: 0.7rem;
  width: min(100%, 14rem);
  min-height: 0;
}

.message-line {
  display: inline-block;
  margin: 0;
  padding: 0;
  max-width: 100%;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(1.42rem, 6vw, 2rem);
  line-height: 1.18;
  color: #fff8f5;
  text-wrap: balance;
  overflow-wrap: anywhere;
  text-shadow:
    0 1px 0 rgba(31, 17, 22, 0.22),
    0 0.9rem 1.7rem rgba(17, 10, 13, 0.44);
}

.heart-ring {
  display: none;
}

.overlay-open .home-panel {
  transform: scale(0.985);
  filter: blur(6px);
}

@media (max-width: 480px) {
  .home-panel {
    padding: 2.35rem 1.25rem 1.5rem;
    border-radius: 1.7rem;
  }

  h1 {
    max-width: 10ch;
    font-size: clamp(2.3rem, 10vw, 3.25rem);
  }

  .primary-button {
    width: min(100%, 14.8rem);
  }

  .message-dialog {
    width: min(100%, 22.9rem);
    gap: 0.72rem;
  }

  .message-dialog__title {
    padding-bottom: 0.62rem;
    font-size: 0.72rem;
    letter-spacing: 0.22em;
  }

  .message-dialog__title::after {
    width: 6.9rem;
  }

  .message-card__content {
    padding: 2.65rem 2.3rem 3.95rem;
  }

  .message-lines {
    width: min(100%, 12.2rem);
  }

  .message-line {
    font-size: clamp(1.3rem, 6vw, 1.76rem);
  }

  .home-note {
    max-width: 17rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

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

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }

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