/* ============================================================
   palette + base
   ============================================================ */
:root {
  --rose:        #c43a66;
  --rose-deep:   #a82a53;
  --rose-soft:   #e98aa9;
  --ink:         #5b4750;
  --ink-soft:    #8a7680;
  --cream:       #fdf3f0;
  --pink-1:      #ffe7ee;
  --pink-2:      #ffd9e6;
  --card:        #ffffffee;
  --shadow:      0 18px 40px -18px rgba(168, 42, 83, 0.45);
  --radius:      26px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100%;
  font-family: "Quicksand", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% -10%, #fff 0%, var(--cream) 38%, var(--pink-1) 72%, var(--pink-2) 100%);
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  overflow-x: hidden;
}

/* ============================================================
   stage + screens
   ============================================================ */
.stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.screen {
  display: none;
  width: 100%;
  flex-direction: column;
  align-items: center;
  animation: screen-in 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.screen.is-active { display: flex; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   typography
   ============================================================ */
.title {
  font-family: "Playfair Display", serif;
  font-weight: 800;
  font-style: italic;
  color: var(--rose);
  font-size: clamp(1.9rem, 7vw, 3rem);
  line-height: 1.08;
  margin: 0.2em 0 0.5em;
  text-shadow: 0 2px 0 #fff, 0 10px 24px rgba(196, 58, 102, 0.18);
}
.title--card { font-size: clamp(1.6rem, 5.6vw, 2.2rem); }
.title-emoji { font-style: normal; -webkit-text-fill-color: initial; }

.subtitle {
  font-family: "Caveat", cursive;
  font-size: clamp(1.2rem, 4.4vw, 1.6rem);
  color: var(--ink-soft);
  margin: -0.2em 0 1.4em;
}

/* ============================================================
   buttons
   ============================================================ */
.btn {
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  border: none;
  border-radius: 999px;
  padding: 15px 30px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.96); }

.btn--primary {
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-deep) 100%);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 22px 46px -18px rgba(168, 42, 83, 0.6); }

.btn--ghost {
  background: #ffffff;
  color: var(--ink-soft);
  box-shadow: 0 6px 16px -8px rgba(0,0,0,0.25);
  border: 1px solid #f0dfe6;
}

.btn--block { width: 100%; justify-content: center; margin-top: 6px; }

.btn--text {
  background: none;
  box-shadow: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px;
  margin-top: 6px;
}
.btn--text:hover { color: var(--rose); }

.arrow { transition: transform 0.2s ease; }
.btn--primary:hover .arrow { transform: translateX(4px); }

/* ----- the ask: yes / no buttons ----- */
.ask-buttons {
  position: relative;
  width: 100%;
  height: 150px;
  margin-top: 10px;
}
.ask-buttons .btn--primary {
  position: absolute;
  left: 50%;
  top: 70px;
  transform: translateX(-50%);
  font-size: 1.2rem;
  padding: 17px 44px;
}
.ask-buttons .btn--primary:hover { transform: translateX(-50%) translateY(-2px); }

.runaway {
  position: absolute;
  left: 50%;
  top: 6px;
  transform: translateX(-50%);
  transition: left 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              top 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 3;
}
/* once it gives up: stop fleeing and gently invite a click */
.runaway.caught {
  cursor: pointer;
  animation: caught-pulse 1.6s ease-in-out infinite;
}
@keyframes caught-pulse {
  0%, 100% { box-shadow: 0 6px 16px -8px rgba(0,0,0,0.25); }
  50%      { box-shadow: 0 6px 18px -6px rgba(196,58,102,0.4); }
}
.cursor-emoji { font-size: 0.85em; }

/* ----- the "no" outcome screen ----- */
.popper--soft { animation: float 4s ease-in-out infinite; }
.no-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* ----- expired invite screen ----- */
.envelope-faded {
  font-size: 4.5rem;
  filter: grayscale(0.6) opacity(0.55);
  animation: float 4s ease-in-out infinite;
  margin-bottom: 6px;
}

/* ============================================================
   stepper (heart progress)
   ============================================================ */
.stepper {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 6px;
  z-index: 5;
}
.stepper.is-visible { display: flex; }
.step-heart {
  font-size: 1.3rem;
  filter: grayscale(1) opacity(0.4);
  transition: filter 0.4s ease, transform 0.4s ease;
}
.step-heart.done { filter: none; transform: scale(1.12); }
.step-line {
  width: 26px;
  height: 3px;
  border-radius: 3px;
  background: #f0d2dd;
  transition: background 0.4s ease;
}
.step-line.done { background: var(--rose-soft); }

/* ============================================================
   envelope (screen 1)
   ============================================================ */
.envelope {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto 6px;
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.env-body {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 88px;
  background: linear-gradient(150deg, #ffd7e3, #ffc2d5);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.env-pocket {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background:
    linear-gradient(45deg, transparent 49%, #ffb3cb 49% 51%, transparent 51%) bottom left / 50% 70% no-repeat,
    linear-gradient(-45deg, transparent 49%, #ffb3cb 49% 51%, transparent 51%) bottom right / 50% 70% no-repeat;
}
.env-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 65px solid transparent;
  border-right: 65px solid transparent;
  border-top: 46px solid #ffc2d5;
  border-radius: 4px;
  z-index: 2;
  filter: drop-shadow(0 2px 1px rgba(168,42,83,0.12));
}

.env-heart {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 46px;
  height: 46px;
  transform: translateX(-50%) rotate(-45deg);
  background: linear-gradient(135deg, #ffd86b, #ff8fb1 45%, #a98cff 100%);
  border-radius: 0 0 8px 0;
  z-index: 3;
  box-shadow: 0 8px 18px -6px rgba(169, 140, 255, 0.6);
  animation: pop 4s ease-in-out infinite;
}
.env-heart::before,
.env-heart::after {
  content: "";
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: inherit;
}
.env-heart::before { top: -23px; left: 0; }
.env-heart::after  { top: 0; right: -23px; }
@keyframes pop {
  0%, 100% { transform: translateX(-50%) rotate(-45deg) scale(1); }
  50%      { transform: translateX(-50%) rotate(-45deg) scale(1.08); }
}

.spark {
  position: absolute;
  font-size: 1rem;
  animation: twinkle 2.4s ease-in-out infinite;
}
.spark--1 { top: 4px;  left: 16px; animation-delay: 0s;   }
.spark--2 { top: 0;    right: 22px; animation-delay: 0.5s; }
.spark--3 { top: 36px; right: 4px;  animation-delay: 1s;   }
.spark--4 { top: 30px; left: 2px;   animation-delay: 1.5s; }
@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

/* ============================================================
   popper (screen 2)
   ============================================================ */
.popper {
  font-size: 4rem;
  animation: wiggle 1.4s ease-in-out infinite;
}
@keyframes wiggle {
  0%, 100% { transform: rotate(-12deg); }
  50%      { transform: rotate(6deg) scale(1.06); }
}

/* ============================================================
   card (screen 3) + note (screen 5)
   ============================================================ */
.card, .note {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 30px 26px 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.card-icons { font-size: 1.3rem; margin-bottom: 2px; }

.field-label {
  display: block;
  text-align: left;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 16px 2px 7px;
}
.field {
  width: 100%;
  font-family: "Quicksand", sans-serif;
  font-size: 1rem;
  color: var(--ink);
  padding: 13px 15px;
  border: 1.5px solid #f3dde5;
  border-radius: 14px;
  background: #fff;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.field:focus { border-color: var(--rose-soft); box-shadow: 0 0 0 4px rgba(233,138,169,0.18); }
.select-wrap { position: relative; }
select.field { appearance: none; cursor: pointer; }
.select-wrap::after {
  content: "▾";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--rose-soft);
  pointer-events: none;
}

.field-error {
  color: var(--rose);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  margin: 10px 2px 4px;
  min-height: 1em;
  visibility: hidden;
}
.field-error.show { visibility: visible; animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.card .btn--block { margin-top: 18px; }

/* ============================================================
   food grid (screen 4)
   ============================================================ */
.food-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 480px;
  margin: 4px 0 6px;
}
.food-card {
  background: #fff;
  border: 2px solid #f3dde5;
  border-radius: 20px;
  padding: 18px 8px 12px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.food-card:hover { transform: translateY(-3px); box-shadow: 0 14px 26px -16px rgba(168,42,83,0.4); }
.food-card .food-emoji { font-size: 2.6rem; line-height: 1; }
.food-card .food-name { font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.food-card.selected {
  border-color: var(--rose);
  background: linear-gradient(180deg, #fff, #ffeef4);
  box-shadow: 0 14px 28px -14px rgba(196,58,102,0.5);
}
.food-card.selected::after {
  content: "💗";
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.95rem;
}

/* ============================================================
   note / summary (screen 5)
   ============================================================ */
.note {
  position: relative;
  background:
    radial-gradient(#f6dbe4 1.1px, transparent 1.2px) 0 0 / 16px 16px,
    #fffdfd;
  border: 1px solid #f3dde5;
}
.polaroid {
  position: absolute;
  top: -22px;
  right: -10px;
  width: 64px;
  height: 74px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 10px 20px -10px rgba(0,0,0,0.35);
  transform: rotate(8deg);
  padding: 6px 6px 14px;
}
.polaroid-heart {
  width: 100%;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(160deg, #d9ecff, #ffe1ec);
  display: grid;
  place-items: center;
}
.polaroid-heart::after { content: "🤍"; font-size: 1.4rem; }

.note-line {
  font-family: "Caveat", cursive;
  font-size: 1.45rem;
  color: var(--ink);
  margin: 4px 0 10px;
}
.note-ps {
  font-style: italic;
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.summary {
  text-align: left;
  background: #fff;
  border-radius: 18px;
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: inset 0 0 0 1px #f3dde5;
}
.summary-row { display: flex; align-items: center; gap: 12px; }
.summary-row + .summary-row { margin-top: 14px; }
.summary-emoji { font-size: 1.5rem; }
.summary-key {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--ink-soft);
}
.summary-val {
  display: block;
  font-weight: 600;
  color: var(--rose);
  font-size: 1.05rem;
}

/* ============================================================
   personalization bits (invite page)
   ============================================================ */
.ask-note {
  margin: -0.4em 0 1.2em;
  max-width: 22ch;
  font-size: clamp(1.15rem, 4.2vw, 1.5rem);
}
.signature {
  font-family: "Caveat", cursive;
  font-size: 1.25rem;
  color: var(--rose);
  margin: 4px 0 0;
}
.make-cta {
  margin-top: 28px;
  text-align: center;
}
.make-cta a {
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  font-size: 1.02rem;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-deep) 100%);
  padding: 14px 28px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  animation: cta-bob 2.6s ease-in-out infinite;
}
.make-cta a:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 22px 46px -18px rgba(168, 42, 83, 0.6);
  animation-play-state: paused;
}
@keyframes cta-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* ============================================================
   create studio
   ============================================================ */
.create-card { text-align: center; }
.create-card .field-label { display: flex; justify-content: space-between; align-items: baseline; }
.create-card textarea.field { resize: vertical; font-family: "Quicksand", sans-serif; }
.opt { font-weight: 500; font-size: 0.8rem; color: var(--rose-soft); }
.create-card .field-error { text-align: center; }
.create-card .btn--block { margin-top: 16px; }

.link-out {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1.5px dashed #f0d2dd;
  animation: screen-in 0.4s ease;
}
.link-label {
  font-weight: 700;
  color: var(--rose);
  margin: 0 0 10px;
}
.link-row { display: flex; gap: 8px; }
.link-field { font-size: 0.85rem; color: var(--ink-soft); }
.link-row .btn { padding: 13px 18px; }
.share-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.share-row .btn { flex: 1; justify-content: center; font-size: 0.92rem; padding: 12px 10px; }
.link-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 16px 0 0;
  line-height: 1.5;
}
.link-note .muted { font-size: 0.78rem; opacity: 0.8; }

/* ============================================================
   confetti + bg hearts
   ============================================================ */
#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}
.bg-hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-hearts span {
  position: absolute;
  bottom: -40px;
  font-size: 1.2rem;
  opacity: 0.35;
  animation: rise linear infinite;
}
@keyframes rise {
  to { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

/* ============================================================
   small screens
   ============================================================ */
@media (max-width: 420px) {
  .food-grid { gap: 10px; }
  .food-card { border-radius: 16px; padding: 14px 6px 10px; }
  .food-card .food-emoji { font-size: 2.2rem; }
  .card, .note { padding: 26px 20px 24px; }
}

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