:root {
  --ink: #2c2320;
  --soft-ink: #6e5a53;
  --muted: #927b70;
  --paper: rgba(255, 250, 246, 0.9);
  --paper-solid: #fffaf6;
  --rose: #b4585b;
  --rose-deep: #893b41;
  --rose-soft: #f1d4cf;
  --gold: #c69a58;
  --line: rgba(139, 92, 75, 0.18);
  --shadow: 0 28px 80px rgba(82, 48, 39, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Inter", Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 225, 214, 0.92), transparent 25rem),
    radial-gradient(circle at 86% 18%, rgba(198, 154, 88, 0.28), transparent 22rem),
    linear-gradient(135deg, #fff7f1 0%, #f5e4db 48%, #ead6cf 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.24) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.ambience {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}

.light,
.petal {
  position: absolute;
  display: block;
}

.light {
  width: 18rem;
  height: 18rem;
  border-radius: 999px;
  filter: blur(14px);
  opacity: 0.52;
  animation: breathe 9s ease-in-out infinite;
}

.light-one {
  top: 7%;
  left: 8%;
  background: rgba(180, 88, 91, 0.24);
}

.light-two {
  right: 7%;
  bottom: 10%;
  background: rgba(198, 154, 88, 0.28);
  animation-delay: -3s;
}

.light-three {
  top: 36%;
  right: 24%;
  width: 12rem;
  height: 12rem;
  background: rgba(255, 255, 255, 0.58);
  animation-delay: -6s;
}

.petal {
  width: 10px;
  height: 18px;
  border-radius: 999px 999px 999px 2px;
  background: linear-gradient(145deg, rgba(180, 88, 91, 0.42), rgba(255, 244, 239, 0.82));
  box-shadow: 0 10px 22px rgba(117, 59, 54, 0.12);
  animation: floatPetal 13s linear infinite;
}

.petal-one {
  left: 10%;
  top: 78%;
}

.petal-two {
  left: 32%;
  top: 88%;
  animation-delay: -4s;
  transform: scale(0.8);
}

.petal-three {
  left: 78%;
  top: 84%;
  animation-delay: -7s;
  transform: scale(1.1);
}

.petal-four {
  left: 90%;
  top: 72%;
  animation-delay: -10s;
  transform: scale(0.72);
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 20px;
}

.westie-scene {
  position: fixed;
  right: max(22px, calc((100vw - 960px) / 2));
  bottom: 76px;
  z-index: 2;
  width: 228px;
  height: 288px;
  margin: 0;
  pointer-events: none;
  transform: translateX(0) scale(1) rotate(0deg);
  transition:
    right 760ms cubic-bezier(0.22, 1, 0.36, 1),
    bottom 760ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 760ms cubic-bezier(0.22, 1, 0.36, 1);
}

.page-form .westie-scene {
  right: max(18px, calc((100vw - 1060px) / 2));
  bottom: 132px;
  transform: translateX(-34px) scale(0.84) rotate(-3deg);
}

.westie-photo-card {
  position: absolute;
  inset: 0 0 auto auto;
  width: 214px;
  height: 246px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: #fff8f3;
  box-shadow:
    0 24px 58px rgba(82, 48, 39, 0.22),
    0 0 0 8px rgba(255, 255, 255, 0.24);
  transform-origin: center bottom;
  animation: photoFloat 5.8s ease-in-out infinite;
  transition: border-color 700ms ease, box-shadow 700ms ease, transform 700ms ease;
}

.page-form .westie-photo-card {
  border-color: rgba(198, 154, 88, 0.55);
  box-shadow:
    0 20px 48px rgba(82, 48, 39, 0.18),
    0 0 0 8px rgba(255, 250, 246, 0.32);
  animation-name: photoFloatForm;
}

.westie-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 44%;
  transform: scale(1.04);
  animation: photoLife 8s ease-in-out infinite;
  transition: object-position 700ms ease, filter 700ms ease;
}

.page-form .westie-photo {
  object-position: 50% 38%;
  filter: saturate(1.04) brightness(1.02);
}

.photo-shine {
  position: absolute;
  inset: -30% auto -30% -55%;
  width: 42%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: rotate(18deg);
  animation: photoShine 7s ease-in-out infinite;
}

.heart {
  position: absolute;
  width: 13px;
  height: 13px;
  opacity: 0;
  transform: rotate(45deg);
  background: rgba(180, 88, 91, 0.46);
  animation: heartRise 5.2s ease-in-out infinite;
}

.heart::before,
.heart::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: inherit;
}

.heart::before {
  left: -7px;
}

.heart::after {
  top: -7px;
}

.heart-one {
  right: 24px;
  bottom: 34px;
}

.heart-two {
  right: 52px;
  bottom: 20px;
  animation-delay: -1.8s;
  transform: rotate(45deg) scale(0.78);
}

.heart-three {
  right: 14px;
  bottom: 76px;
  animation-delay: -3.4s;
  transform: rotate(45deg) scale(0.62);
}

.westie-note {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 214px;
  margin: 0;
  color: rgba(137, 59, 65, 0.72);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  transition: color 700ms ease, transform 700ms ease;
}

.page-form .westie-note {
  color: rgba(137, 59, 65, 0.9);
  transform: translateY(-2px);
}

.paw {
  position: absolute;
  width: 18px;
  height: 16px;
  border-radius: 999px;
  opacity: 0;
  background:
    radial-gradient(circle at 25% 22%, rgba(137, 59, 65, 0.22) 0 2px, transparent 3px),
    radial-gradient(circle at 50% 12%, rgba(137, 59, 65, 0.22) 0 2px, transparent 3px),
    radial-gradient(circle at 75% 22%, rgba(137, 59, 65, 0.22) 0 2px, transparent 3px),
    radial-gradient(ellipse at 50% 70%, rgba(137, 59, 65, 0.22) 0 6px, transparent 7px);
  animation: pawDrift 6.8s ease-in-out infinite;
}

.paw-one {
  left: 12px;
  top: 74px;
}

.paw-two {
  left: 44px;
  top: 36px;
  animation-delay: -2.2s;
}

.paw-three {
  left: 2px;
  top: 18px;
  animation-delay: -4.4s;
}

.paw-four {
  left: 30px;
  top: 112px;
  animation-delay: -5.6s;
}

.screen {
  width: min(100%, 720px);
  display: none;
}

.screen.is-active {
  display: block;
  animation: screenIn 620ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.content {
  position: relative;
  overflow: hidden;
  padding: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 250, 246, 0.9)),
    var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.content::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, var(--rose-deep), #dfa4a0, var(--gold));
}

.content::after {
  content: "";
  position: absolute;
  right: -78px;
  bottom: -98px;
  z-index: 0;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(198, 154, 88, 0.28);
  border-radius: 999px;
}

.content > * {
  position: relative;
  z-index: 1;
}

.ornament {
  position: absolute;
  width: 68px;
  height: 68px;
  border-color: rgba(198, 154, 88, 0.42);
}

.ornament-top {
  top: 22px;
  right: 22px;
  border-top: 1px solid;
  border-right: 1px solid;
}

.ornament-bottom {
  left: 22px;
  bottom: 22px;
  border-bottom: 1px solid;
  border-left: 1px solid;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--rose-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  max-width: 11ch;
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 4.35rem;
  line-height: 0.96;
  font-weight: 700;
}

h2 {
  max-width: 13ch;
  font-size: 3.65rem;
}

p {
  max-width: 59ch;
  margin: 18px 0 0;
  color: var(--soft-ink);
  font-size: 1rem;
  line-height: 1.78;
}

.lead {
  margin-top: 26px;
  color: var(--ink);
  font-size: 1.16rem;
}

.button-row,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button-row {
  margin-top: 34px;
}

.primary-button,
.secondary-button {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 25px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.primary-button {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  box-shadow: 0 16px 34px rgba(180, 88, 91, 0.34);
}

.primary-button::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  transform: translateX(-120%);
  transition: transform 520ms ease;
}

.primary-button:hover::before {
  transform: translateX(120%);
}

.primary-button:hover {
  box-shadow: 0 20px 42px rgba(180, 88, 91, 0.42);
}

.secondary-button {
  border: 1px solid rgba(180, 88, 91, 0.24);
  color: var(--rose-deep);
  background: rgba(255, 255, 255, 0.72);
}

.secondary-button:hover {
  border-color: rgba(180, 88, 91, 0.4);
  background: rgba(255, 246, 242, 0.94);
  box-shadow: 0 12px 28px rgba(82, 48, 39, 0.1);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(180, 88, 91, 0.28);
  outline-offset: 3px;
}

.move-form {
  display: grid;
  gap: 10px;
  margin-top: 30px;
}

.background-audio {
  width: min(100%, 720px);
  margin-top: 16px;
  opacity: 0.78;
  filter: drop-shadow(0 14px 24px rgba(82, 48, 39, 0.14));
}

label {
  color: var(--ink);
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  margin-bottom: 12px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

input:hover,
textarea:hover,
input:focus,
textarea:focus {
  border-color: rgba(180, 88, 91, 0.42);
  background: #fff;
  box-shadow: 0 12px 28px rgba(82, 48, 39, 0.08);
}

textarea {
  resize: vertical;
}

.form-actions {
  margin-top: 2px;
}

.back-button {
  margin-top: 12px;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }

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

@keyframes breathe {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(16px, -12px, 0) scale(1.08);
  }
}

@keyframes floatPetal {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  12% {
    opacity: 0.72;
  }

  100% {
    opacity: 0;
    transform: translate3d(-48px, -110vh, 0) rotate(280deg);
  }
}

@keyframes pawDrift {
  0% {
    opacity: 0;
    transform: translate3d(0, 18px, 0) rotate(-12deg) scale(0.9);
  }

  22%,
  68% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate3d(-34px, -42px, 0) rotate(14deg) scale(1.06);
  }
}

@keyframes photoFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-1.5deg);
  }

  50% {
    transform: translateY(-9px) rotate(1deg);
  }
}

@keyframes photoFloatForm {
  0%,
  100% {
    transform: translateY(0) rotate(1deg);
  }

  50% {
    transform: translateY(-6px) rotate(-1.2deg);
  }
}

@keyframes photoLife {
  0%,
  100% {
    transform: scale(1.04) translateY(0);
  }

  50% {
    transform: scale(1.075) translateY(-3px);
  }
}

@keyframes photoShine {
  0%,
  58% {
    left: -55%;
    opacity: 0;
  }

  68% {
    opacity: 0.62;
  }

  82%,
  100% {
    left: 118%;
    opacity: 0;
  }
}

@keyframes heartRise {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(45deg) scale(0.58);
  }

  18% {
    opacity: 0.76;
  }

  100% {
    opacity: 0;
    transform: translate3d(-18px, -74px, 0) rotate(45deg) scale(1);
  }
}

@media (max-width: 680px) {
  .page-shell {
    padding: 18px 14px;
  }

  .content {
    padding: 38px 24px;
  }

  h1,
  h2 {
    font-size: 3rem;
  }

  .lead {
    font-size: 1.04rem;
  }

  .button-row,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .ornament {
    width: 46px;
    height: 46px;
  }

  .westie-scene {
    position: relative;
    right: auto;
    bottom: auto;
    order: 2;
    width: 190px;
    height: 248px;
    margin-top: 16px;
    transform: translateX(0) scale(0.9) rotate(0deg);
    transform-origin: top center;
  }

  .page-form .westie-scene {
    right: auto;
    bottom: auto;
    transform: translateX(0) scale(0.82) rotate(-2deg);
  }

  .westie-photo-card,
  .westie-note {
    width: 184px;
  }

  .westie-photo-card {
    height: 210px;
  }

  .background-audio {
    order: 3;
  }
}

@media (max-width: 380px) {
  .content {
    padding: 34px 20px;
  }

  h1,
  h2 {
    font-size: 2.55rem;
  }
}

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