:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #6d665f;
  --paper: #f7f2eb;
  --surface: #fffaf3;
  --line: rgba(23, 23, 23, 0.16);
  --accent: #2f6f62;
  --accent-dark: #1f4f46;
  --clay: #c96e4d;
  --shadow: 0 24px 70px rgba(46, 36, 27, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  background:
    linear-gradient(135deg, rgba(47, 111, 98, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(201, 110, 77, 0.14), transparent 30%),
    var(--paper);
}

button,
input,
select,
textarea {
  font: inherit;
}

.invite-shell {
  width: min(1080px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 56px 0;
}

.hero {
  width: 100%;
  max-width: 760px;
}

.kicker {
  margin: 0 0 16px;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  line-height: 0.95;
}

h1 {
  max-width: 10ch;
  font-size: clamp(4.6rem, 12vw, 9.5rem);
}

h2 {
  font-size: 2.9rem;
}

.details {
  display: grid;
  grid-template-columns: minmax(220px, 360px);
  gap: 14px;
  margin: 34px 0 0;
}

.details > div {
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.58);
}

.detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.detail-actions {
  display: flex;
  gap: 8px;
}

.details span,
label,
legend {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.details strong {
  display: block;
  margin-top: 16px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.45;
}

button,
.choice-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fffaf3;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.detail-icon-link {
  display: inline-flex;
  width: 42px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf9;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.detail-icon-link svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.rsvp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.choice-button {
  --dodge-x: 0px;
  --dodge-y: 0px;
  --dodge-rotate: 0deg;
  min-width: 142px;
  padding: 0 26px;
  font-size: 1rem;
}

.choice-button.is-selected {
  background: var(--accent);
  color: #fffaf3;
  box-shadow: 0 0 0 4px rgba(47, 111, 98, 0.14);
  transform: translateY(-1px);
}

.choice-button-secondary {
  border: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.72);
  color: var(--ink);
}

button:hover,
.choice-button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.detail-icon-link:hover {
  background: var(--accent-dark);
  color: #fffaf3;
  transform: translateY(-1px);
}

.choice-button-secondary:hover {
  color: #fffaf3;
}

.choice-button-secondary.is-dodging {
  transform: translate(var(--dodge-x), var(--dodge-y)) rotate(var(--dodge-rotate));
  transition: transform 280ms cubic-bezier(0.25, 1.4, 0.35, 1), background 160ms ease;
}

.sad-reaction {
  position: fixed;
  top: 44%;
  left: 50%;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  color: var(--clay);
  font-size: 4.4rem;
  filter: drop-shadow(0 16px 18px rgba(46, 36, 27, 0.18));
  transform: translate(-50%, -50%) scale(0.35) rotate(-10deg);
}

.sad-reaction.is-playing {
  animation: sad-pop 980ms cubic-bezier(0.2, 0.78, 0.28, 1) both;
}

.rsvp-dialog {
  width: min(460px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.86);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.rsvp-dialog::backdrop {
  background: rgba(23, 23, 23, 0.42);
  backdrop-filter: blur(8px);
}

form {
  display: grid;
  gap: 14px;
  padding: 28px;
}

.guest-row {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(84px, 1fr);
  gap: 10px;
  align-items: end;
}

.modal-heading {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.modal-heading .kicker {
  margin: 0;
}

.close-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fffdf9;
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
}

.close-button:hover {
  color: #fffaf3;
}

input[type="text"],
select,
textarea {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  color: var(--ink);
  outline: 0;
}

.plus-ones-field {
  letter-spacing: 0;
  text-transform: none;
}

.guest-row input[type="text"] {
  margin-top: 0;
}

.plus-ones-field select {
  margin-top: 0;
}

input[type="text"] {
  height: 48px;
  padding: 0 14px;
}

select {
  height: 48px;
  padding: 0 38px 0 14px;
}

textarea {
  resize: vertical;
  min-height: 96px;
  padding: 12px 14px;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 111, 98, 0.14);
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.choice {
  min-width: 0;
  cursor: pointer;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice span {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf9;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.choice input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

#rsvp-form > button[type="submit"] {
  width: 100%;
  margin-top: 2px;
  overflow: hidden;
  position: relative;
}

#rsvp-form > button[type="submit"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 250, 243, 0.34) 50%, transparent 80%);
  opacity: 0;
  transform: translateX(-100%);
}

#rsvp-form > button[type="submit"].is-sending::after {
  animation: send-shimmer 820ms ease-in-out infinite;
  opacity: 1;
}

#rsvp-form > button[type="submit"].is-sent {
  animation: send-pop 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  background: var(--accent);
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.93rem;
  font-weight: 600;
}

.form-status.is-error {
  color: #9d3d2d;
}

.page-status {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--accent-dark);
  font-size: 0.95rem;
  font-weight: 700;
}

.page-status.is-error {
  color: #9d3d2d;
}

@keyframes sad-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -34%) scale(0.35) rotate(-10deg);
  }

  22% {
    opacity: 1;
    transform: translate(-50%, -62%) scale(1.08) rotate(6deg);
  }

  58% {
    opacity: 1;
    transform: translate(-50%, -72%) scale(0.96) rotate(-4deg);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -96%) scale(0.82) rotate(8deg);
  }
}

@keyframes send-shimmer {
  100% {
    transform: translateX(100%);
  }
}

@keyframes send-pop {
  0% {
    transform: scale(1);
  }

  48% {
    transform: scale(1.035);
  }

  100% {
    transform: scale(1);
  }
}

@media (max-width: 860px) {
  .invite-shell {
    align-items: start;
    padding: 34px 0;
  }

  h1 {
    max-width: 8ch;
    font-size: 5.1rem;
  }

  .rsvp-actions {
    margin-top: 28px;
  }
}

@media (max-width: 560px) {
  .invite-shell {
    width: min(100% - 24px, 1080px);
  }

  h1 {
    font-size: 4.35rem;
  }

  h2 {
    font-size: 2.72rem;
  }

  .details {
    grid-template-columns: 1fr;
  }

  form {
    padding: 22px;
  }

  .choice-button {
    flex: 1 1 130px;
  }
}
