:root {
  color-scheme: light;
  --cream: #fff8f0;
  --paper: rgba(255, 255, 255, 0.86);
  --ink: #53152c;
  --muted: #9f6577;
  --pink: #ffb2c4;
  --pink-deep: #f48ca9;
  --pink-soft: #fff0f4;
  --lilac: #f5edf9;
  --line: #f7d6df;
  --shadow: 0 22px 70px rgba(116, 47, 72, 0.14);
  --round: "M PLUS Rounded 1c", ui-rounded, sans-serif;
  --body: Nunito, ui-sans-serif, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--cream); }
body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--body);
  background-color: var(--cream);
  background-image: radial-gradient(rgba(255, 178, 196, 0.3) 1px, transparent 1px);
  background-size: 24px 24px;
}
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, canvas:focus-visible {
  outline: 3px solid rgba(244, 140, 169, 0.55);
  outline-offset: 3px;
}
img { max-width: 100%; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 32px 16px 24px;
  isolation: isolate;
}

.petals, .celebration {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.petal {
  position: absolute;
  top: -48px;
  font-size: 22px;
  opacity: 0.72;
  animation: fall var(--duration) linear var(--delay) infinite;
  filter: drop-shadow(0 2px 4px rgba(232, 128, 157, 0.18));
}

.heart {
  position: absolute;
  bottom: -60px;
  font-size: 23px;
  opacity: 0;
  animation: rise var(--duration) ease-in var(--delay) infinite;
}

.confetti-dot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 7px;
  height: 12px;
  border-radius: 2px;
  background: var(--color);
  opacity: 0;
  animation: burst 1.2s ease-out var(--delay) both;
}

.card {
  width: min(100%, 672px);
  position: relative;
  overflow: hidden;
  padding: 30px;
  text-align: center;
  background: var(--paper);
  border: 4px solid rgba(255, 178, 196, 0.23);
  border-radius: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(5px);
  animation: pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.card--letter { background: #fff9f1; padding-top: 64px; }
.card--letter::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 70px;
  background: rgba(255, 178, 196, 0.13);
  border-bottom: 2px solid rgba(255, 178, 196, 0.2);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.media {
  width: 192px;
  height: 192px;
  margin: 0 auto 24px;
  overflow: hidden;
  border: 4px solid white;
  border-radius: 42px;
  box-shadow: inset 0 2px 16px rgba(112, 52, 75, 0.12);
  animation: float 3s ease-in-out infinite;
}
.media--wide { width: 200px; height: 150px; }
.media--round { width: 160px; height: 160px; border-radius: 50%; }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; }

h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--round);
  font-size: clamp(2rem, 5vw, 2.55rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.01em;
  text-wrap: balance;
}
.subtitle {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 600;
}

.actions {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  min-height: 106px;
  margin-top: 24px;
}
.button {
  min-height: 56px;
  padding: 14px 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--pink);
  box-shadow: 0 10px 22px rgba(226, 122, 153, 0.22);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.button:hover { transform: translateY(-2px) scale(1.035); box-shadow: 0 14px 28px rgba(226, 122, 153, 0.28); }
.button:active { transform: translateY(1px) scale(0.99); }
.button--secondary { background: #ead4f4; color: #572272; box-shadow: 0 8px 18px rgba(117, 74, 138, 0.15); }
.button--wide { width: 100%; }
.button--small { min-height: 42px; padding: 10px 24px; font-size: 0.88rem; }
.button--bounce { animation: bounce 1.8s ease-in-out infinite; }
.no-wrap { position: absolute; left: 60%; top: 25px; transition: left 150ms ease, top 150ms ease, transform 150ms ease; }

.maker-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding: 6px 11px;
  border: 1px solid rgba(240, 160, 176, 0.5);
  border-radius: 20px;
  color: #d98ca1;
  background: rgba(255, 240, 243, 0.85);
  font-size: 0.7rem;
  font-style: italic;
  opacity: 0.82;
}

.form { display: grid; gap: 18px; margin-top: 26px; text-align: left; }
.field { display: grid; gap: 7px; }
.field label { margin-left: 9px; font-weight: 800; font-size: 0.9rem; }
.field input, .field select {
  width: 100%;
  height: 58px;
  padding: 0 16px;
  border: 2px solid rgba(255, 178, 196, 0.42);
  border-radius: 18px;
  color: #65364f;
  background: rgba(255, 255, 255, 0.84);
  font-size: 1rem;
  box-shadow: 0 3px 0 rgba(156, 89, 110, 0.05);
}

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 20;
  width: min(356px, calc(100% - 32px));
  padding: 16px;
  border: 1px solid #ffd3d8;
  border-radius: 8px;
  color: #b31c2d;
  background: #fff0f1;
  box-shadow: 0 8px 25px rgba(90, 34, 49, 0.13);
  transform: translate(-50%, -20px);
  opacity: 0;
  animation: toast-in 220ms ease forwards;
  font-size: 0.9rem;
  font-weight: 700;
}

.food-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.food {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 112px;
  padding: 14px;
  border: 4px solid transparent;
  border-radius: 40px;
  color: var(--ink);
  background: rgba(238, 220, 247, 0.48);
  cursor: pointer;
  transition: transform 180ms ease, border 180ms ease, background 180ms ease;
}
.food:hover { transform: scale(1.035); background: rgba(238, 220, 247, 0.75); }
.food[aria-pressed="true"] { transform: scale(1.04); border-color: var(--pink); background: rgba(255, 240, 244, 0.62); }
.food__emoji { font-size: 2.5rem; line-height: 1; }
.food__name { font-weight: 800; }
.food-next { min-height: 72px; margin-top: 16px; }

.letter-copy { margin: 28px 0 0; }
.letter-copy h1 { line-height: 1.55; }
.letter-copy p { margin: 22px auto 0; max-width: 560px; color: var(--muted); font-size: 1rem; font-style: italic; }

.nda-wrap { width: min(100%, 700px); animation: pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.nda {
  padding: 16px 20px 0;
  border: 1px solid #e3e3e3;
  border-radius: 4px;
  color: #272727;
  background: #fff;
  box-shadow: 0 10px 24px rgba(117, 57, 82, 0.16);
  font-family: Georgia, "Times New Roman", serif;
}
.nda header { padding-bottom: 8px; border-bottom: 1px solid #bdbdbd; text-align: center; }
.nda-kicker { margin-bottom: 4px; color: #777; font-size: 0.58rem; letter-spacing: 0.2em; }
.nda h1 { color: #171717; font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; font-weight: 400; letter-spacing: 0.06em; line-height: 1.1; }
.nda-subtitle { margin: 4px 0 0; color: #555; font-size: 0.75rem; font-style: italic; }
.nda-copy { padding-top: 9px; }
.nda-copy p { margin: 0 0 7px; font-size: 0.75rem; line-height: 1.34; }
.signature { margin-top: 8px; padding-top: 8px; border-top: 1px solid #d3d3d3; }
.signature-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 0.72rem; }
.clear-button { border: 1px solid #c9c9c9; border-radius: 3px; background: #f5f5f5; color: #555; font-size: 0.64rem; padding: 3px 7px; cursor: pointer; }
#signature-canvas { display: block; width: 100%; height: 54px; border: 1px solid #999; background: white; cursor: crosshair; touch-action: none; }
.faux-wallets { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 8px; font-family: Arial, sans-serif; font-size: 0.76rem; font-weight: 700; }
.faux-note { margin: 6px 0; color: #8a8a8a; font-family: Arial, sans-serif; font-size: 0.58rem; font-style: italic; text-align: center; }
.faux-fields { display: grid; grid-template-columns: 1.8fr 1fr 0.7fr; gap: 5px; }
.faux-fields input { min-width: 0; padding: 6px; border: 1px solid #d7d7d7; border-radius: 3px; color: #999; background: #f2f2f2; font: 0.6rem Arial, sans-serif; }
.nda-action { margin-top: 9px; text-align: center; }
.signed { margin: 0 0 5px; color: #5d3150; font-family: var(--round); font-size: 0.82rem; font-weight: 800; }

@keyframes pop { from { opacity: 0; transform: scale(0.86); } to { opacity: 1; transform: scale(1); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes fall { 0% { transform: translateY(-10vh) rotate(0deg); } 100% { transform: translateY(115vh) rotate(540deg); } }
@keyframes rise { 0% { opacity: 0; transform: translateY(0) scale(0.7); } 15% { opacity: 0.75; } 100% { opacity: 0; transform: translateY(-120vh) scale(1.15) rotate(18deg); } }
@keyframes burst { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(560deg); } }
@keyframes toast-in { to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 660px) {
  .stage { padding: 18px 12px; align-items: center; }
  .card { padding: 24px 18px; border-radius: 28px; }
  .media { width: 165px; height: 165px; }
  .media--wide { width: 180px; height: 140px; }
  .media--round { width: 145px; height: 145px; }
  h1 { font-size: clamp(1.65rem, 8vw, 2.15rem); }
  .actions { min-height: 132px; }
  .no-wrap { left: 57%; top: 38px; }
  .food-grid { grid-template-columns: repeat(2, 1fr); gap: 11px; }
  .food { min-height: 100px; border-radius: 30px; }
  .nda { padding-inline: 12px; }
  .faux-wallets { gap: 7px; font-size: 0.65rem; flex-wrap: wrap; }
}

@media (max-width: 390px) {
  .button { padding-inline: 22px; }
  .faux-fields { grid-template-columns: 1fr 0.8fr 0.65fr; }
}

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