:root {
  --wine: #4E0415;
  --cream: #FFF6D7;
  --rule: rgba(255, 246, 215, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  background: var(--wine);
  color: var(--cream);
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 400;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.left {
  padding: 3.5rem clamp(2rem, 5vw, 4.5rem) 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.masthead {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

h1 {
  font-family: "Mr Bedfort", "Snell Roundhand", cursive;
  font-weight: 400;
  font-style: normal;
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1;
  letter-spacing: 0.005em;
  margin: 0;
  white-space: nowrap;
}

.date {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(28px, 3.75vw, 48px);
  font-weight: 400;
  margin: 0;
}

.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0;
}

.events {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-family: "Instrument Serif", Georgia, serif;
}

.event {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.event__where {
  font-size: clamp(16px, 1.875vw, 24px);
  letter-spacing: 0.01em;
  margin: 0;
  opacity: 0.95;
}

.event__what {
  font-size: clamp(24px, 3.125vw, 40px);
  line-height: 1.15;
  margin: 0;
}

.event__note {
  font-size: clamp(16px, 1.875vw, 24px);
  font-style: italic;
  margin: 0;
  opacity: 0.9;
}

.body {
  font-size: clamp(16px, 1.875vw, 24px);
  line-height: 1.45;
  max-width: 42ch;
  margin: 0;
}

.rsvp-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1.5rem;
  font-size: clamp(16px, 1.875vw, 24px);
}

.rsvp-text sup {
  font-size: 0.65em;
  vertical-align: super;
  line-height: 0;
}

.rsvp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 5.5rem;
  height: 3rem;
  border: none;
  border-radius: 50%;
  background: #F2D3DA;
  color: var(--wine);
  font-family: Georgia, serif;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transform: rotate(-15deg);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.rsvp-btn:hover {
  transform: rotate(-15deg) scale(1.06);
}

.rsvp-btn:active {
  transform: rotate(-15deg) translateY(1px);
}

.rsvp-btn:focus {
  outline: none;
}

.rsvp-btn:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 4px;
}

.right {
  position: relative;
  overflow: hidden;
  background: var(--wine);
}

.photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

#rsvp-modal {
  border: none;
  border-radius: 4px;
  background: var(--wine);
  color: var(--cream);
  padding: 2.25rem 2rem 2rem;
  width: min(480px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  font-family: Georgia, "Times New Roman", Times, serif;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  position: fixed;
  inset: 0;
  margin: auto;
  overflow: visible;
}

#rsvp-modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

#rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
}

#rsvp-modal h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 2.25rem;
  font-weight: 400;
  margin: 0;
}

.modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  background: none;
  border: none;
  color: var(--cream);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
}

.modal__close:hover {
  opacity: 1;
}

.guests {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.guest + .guest {
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
}

.guest {
  position: relative;
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.guest__name-row {
  display: flex;
  align-items: end;
  gap: 0.5rem;
}

.guest__name-row .field {
  flex: 1;
}

.guest__remove {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.4rem;
  background: none;
  border: none;
  color: var(--cream);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
}

.guest__remove:hover {
  opacity: 1;
}

.guest__remove[hidden] {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.95rem;
}

.field--inline {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.field__label {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  opacity: 0.9;
}

.field__optional {
  opacity: 0.6;
  font-size: 0.78rem;
}

.field input[type="text"] {
  background: rgba(255, 246, 215, 0.08);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.55rem 0.7rem;
  color: var(--cream);
  font-family: inherit;
  font-size: 1rem;
}

.field input[type="text"]:focus {
  outline: none;
  border-color: var(--cream);
  background: rgba(255, 246, 215, 0.14);
}

.field input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--cream);
  cursor: pointer;
}

.link-btn {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--cream);
  font-family: inherit;
  font-size: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0;
  opacity: 0.85;
}

.link-btn:hover {
  opacity: 1;
}

.form__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 0.5rem;
}

.form__status {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.85;
  min-height: 1.2em;
}

.form__status[data-state="error"] {
  color: #ffb6b6;
  opacity: 1;
}

.form__status[data-state="success"] {
  opacity: 1;
}

.submit-btn {
  background: #F2D3DA;
  color: var(--wine);
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.5rem;
  font-family: Georgia, serif;
  font-size: 1rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: progress;
}

@media (max-width: 800px) {
  main {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .left {
    padding: 2.5rem 1.5rem 2.5rem;
    gap: 1.5rem;
    order: 2;
  }

  .right {
    order: 1;
    aspect-ratio: 4 / 3;
  }

  .rsvp-row {
    margin-top: 0;
    padding-top: 0.5rem;
  }
}
