:root {
  --page: #f8d8d6;
  --paper: rgba(255, 248, 246, 0.84);
  --paper-solid: #fff8f6;
  --coral: #df6b77;
  --coral-dark: #b84959;
  --olive: #62614a;
  --ink: #3e3736;
  --muted: #846f6c;
  --line: rgba(137, 90, 89, 0.17);
  --shadow: 0 28px 80px rgba(117, 71, 70, 0.18);
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 13% 10%, rgba(255,255,255,.72) 0 5%, transparent 23%),
    radial-gradient(circle at 90% 88%, rgba(227,144,151,.2) 0 8%, transparent 27%),
    linear-gradient(145deg, #fbe4df, var(--page) 52%, #f7d0d3);
  font-family: "Comfortaa", system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .3;
  background-image: radial-gradient(rgba(137, 84, 85, .24) .8px, transparent .8px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.ambient {
  position: fixed;
  width: 34vw;
  height: 34vw;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 50%;
  pointer-events: none;
}
.ambient-one { left: -17vw; top: 19vh; }
.ambient-two { right: -20vw; bottom: -11vw; }

.topline {
  position: fixed;
  z-index: 5;
  top: 24px;
  left: 16px;
  right: 16px;
  text-align: center;
  color: #9b7371;
  font-size: 12px;
  letter-spacing: .16em;
}
.topline strong { color: var(--coral-dark); }

main {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 64px 28px 32px;
}

.invitation {
  position: relative;
  width: min(1060px, 100%);
  min-height: 650px;
  padding: 24px 24px 100px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 38px;
  background: var(--paper);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(18px);
}

.step { display: none; min-height: 524px; }
.step.active {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  align-items: center;
  gap: clamp(28px, 5vw, 70px);
  animation: enter .55s cubic-bezier(.2,.8,.2,1);
}

@keyframes enter {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.visual {
  min-width: 0;
  align-self: stretch;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 28px;
  background: #f7d9d5;
}

.visual img {
  width: 100%;
  height: 100%;
  max-height: 524px;
  object-fit: cover;
  object-position: center;
  mix-blend-mode: multiply;
}

.content { padding: 28px 28px 28px 0; text-align: left; }
h1, h2 { margin: 0; color: var(--ink); line-height: 1.13; letter-spacing: -.04em; }
h1 { font-size: clamp(35px, 4.1vw, 58px); }
h1 span { display: block; color: var(--coral); }
h2 { font-size: clamp(31px, 3.2vw, 46px); }

.lead {
  max-width: 490px;
  margin: 20px 0 26px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.lead span { color: var(--coral); font-size: 20px; }

.step-label {
  margin: 0 0 13px;
  color: var(--coral-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.choice-row { position: relative; display: flex; gap: 13px; min-height: 54px; }
.button {
  min-height: 52px;
  padding: 0 25px;
  border: 0;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 700;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: scale(.97); }
.button:focus-visible, .food:focus-visible, .text-button:focus-visible { outline: 3px solid rgba(184,73,89,.24); outline-offset: 3px; }
.primary {
  color: white;
  background: linear-gradient(135deg, #ed7f87, #d95767);
  box-shadow: 0 12px 28px rgba(202, 74, 92, .26), inset 0 1px 0 rgba(255,255,255,.45);
}
.primary:hover { box-shadow: 0 16px 32px rgba(202, 74, 92, .33); }
.secondary {
  color: #665a58;
  border: 1px solid rgba(116,91,87,.27);
  background: rgba(255,255,255,.48);
}
.smiles { margin: 20px 0 0; color: var(--muted); font-size: 12px; }
.smiles strong { color: var(--coral-dark); }

.compliment {
  margin: 6px 0 13px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: #725455;
  background: rgba(255,255,255,.52);
  font-size: 13px;
  line-height: 1.5;
}
.text-button {
  display: block;
  margin: 0 0 24px;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  color: var(--coral-dark);
  background: none;
  font-size: 12px;
}

.inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.field { color: var(--muted); font-size: 11px; font-weight: 700; }
.field input, .field select {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  color: var(--ink);
  background: rgba(255,255,255,.68);
  font-size: 12px;
}
.field input:focus, .field select:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(223,107,119,.12); }
.promise {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 13px;
  border-radius: 15px;
  color: var(--muted);
  background: rgba(255,255,255,.38);
  font-size: 11px;
  line-height: 1.45;
}
.promise input { width: 17px; height: 17px; margin: 0; accent-color: var(--coral); flex: none; }
.form-error { min-height: 16px; margin: 7px 0 6px; color: var(--coral-dark); font-size: 11px; }

.foods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.food {
  min-height: 78px;
  padding: 8px 5px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: #685b59;
  background: rgba(255,255,255,.55);
  font-size: 11px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.food:hover, .food.selected { transform: translateY(-2px); border-color: var(--coral); box-shadow: 0 9px 20px rgba(164,94,95,.13); }
.food span { display: block; margin-bottom: 5px; font-size: 25px; }

.result {
  margin: 20px 0 0;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: #674c4d;
  background: rgba(255,255,255,.55);
  font-size: 13px;
  line-height: 1.7;
}
.result strong { color: var(--coral-dark); }
.delivery-status { min-height: 17px; margin: 10px 0 -9px; color: var(--olive); font-size: 11px; }

.progress {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 20px;
  width: min(770px, calc(100% - 48px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  transform: translateX(-50%);
}
.progress::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: rgba(117,86,83,.2);
}
.progress button {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  color: #9c8581;
  background: transparent;
  font-size: 9px;
  cursor: default;
}
.progress i {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255,255,255,.75);
  border-radius: 50%;
  color: #a18b87;
  background: #ead7d3;
  box-shadow: 0 2px 5px rgba(102,72,69,.08);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  transition: .25s;
}
.progress button.on { color: var(--coral-dark); }
.progress button.on i { color: white; background: var(--coral); }

.heart {
  position: fixed;
  z-index: 20;
  top: -50px;
  pointer-events: none;
  animation: heart-fall linear forwards;
}
@keyframes heart-fall { to { transform: translateY(115vh) rotate(420deg); opacity: .08; } }
.shake { animation: shake .32s ease; }
@keyframes shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } }

@media (max-width: 800px) {
  body { overflow-y: auto; }
  .topline { top: 17px; font-size: 10px; letter-spacing: .1em; }
  main { min-height: 100svh; padding: 48px 12px 18px; }
  .invitation { min-height: 735px; padding: 12px 12px 86px; border-radius: 27px; }
  .step { min-height: 637px; }
  .step.active { grid-template-columns: 1fr; grid-template-rows: 285px auto; gap: 0; align-content: start; }
  .visual { min-height: 0; border-radius: 21px; }
  .visual img { max-height: 285px; }
  .content { padding: 24px 12px 10px; text-align: center; }
  h1 { font-size: clamp(31px, 10vw, 42px); }
  h2 { font-size: clamp(28px, 8vw, 38px); }
  .lead { margin: 14px auto 18px; font-size: 12px; }
  .choice-row { justify-content: center; }
  .smiles { margin-top: 14px; }
  .text-button { margin-left: auto; margin-right: auto; }
  .inputs, .promise, .form-error { text-align: left; }
  .foods { grid-template-columns: repeat(3, 1fr); }
  .progress { width: calc(100% - 24px); bottom: 14px; }
  .progress span { display: none; }
  .progress::before { top: 15px; }
  .progress i { width: 31px; height: 31px; }
}

@media (max-width: 430px) {
  .step.active { grid-template-rows: 250px auto; }
  .visual img { max-height: 250px; }
  .button { min-height: 48px; padding: 0 18px; font-size: 12px; }
  .inputs { gap: 8px; }
  .foods { gap: 7px; }
}

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