:root {
  color: #293226;
  background: #c8e2ef;
  font: 17px/1.55 system-ui, sans-serif;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: grid;
  place-items: center;
  background: url("forest/sky.svg") center / 100% 100% no-repeat;
}

.invitation {
  box-sizing: border-box;
  width: min(100%, 600px);
  padding: clamp(18px, 5vw, 40px);
}

.back {
  display: inline-block;
  margin-bottom: 16px;
  color: inherit;
  font-weight: 650;
  text-underline-offset: .2em;
}

.back:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.flyer-card {
  position: relative;
  padding: clamp(21px, 6vw, 44px);
  background: #fff6d5;
  border: 2px solid #293226;
  border-radius: 14px 10px 16px 9px;
  box-shadow: 4px 5px 0 #52634b;
}

h1 {
  max-width: 9ch;
  margin: 0;
  padding-inline-end: clamp(40px, 13vw, 76px);
  font: bold clamp(2.85rem, 10vw, 4.8rem)/.98 Georgia, serif;
  letter-spacing: -.055em;
}

.party-bug {
  position: absolute;
  right: clamp(12px, 5vw, 40px);
  top: 19px;
  width: clamp(40px, 13vw, 76px);
  height: auto;
  transform: rotate(12deg);
}

.details p {
  margin: 1rem 0 0;
  max-width: 38ch;
}

.rsvp {
  margin-top: 1.55rem;
  padding-top: 1.25rem;
  border-top: 1px dashed #7e8262;
}

.rsvp h2 {
  margin: 0 0 .8rem;
  font: bold 1.7rem/1.1 Georgia, serif;
}

.rsvp-field {
  display: grid;
  gap: .3rem;
  margin-bottom: 1rem;
  font-weight: 650;
}

.rsvp-field input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: .45rem .65rem;
  border: 1px solid #69704c;
  border-radius: 6px;
  color: inherit;
  background: #fffdf0;
  font: inherit;
}

.rsvp-field input[type="number"] { width: 5.4rem; }

.attendance {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.attendance legend {
  margin-bottom: .5rem;
  padding: 0;
  font-weight: 650;
}

.attendance-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
  max-width: 17rem;
}

.attendance-options label {
  position: relative;
  cursor: pointer;
}

.attendance-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.attendance-card {
  display: grid;
  place-items: center;
  align-content: center;
  gap: .25rem;
  min-height: 100%;
  aspect-ratio: 1;
  box-sizing: border-box;
  padding: .3rem;
  border: 2px solid #818763;
  border-radius: 9px;
  background: #fffdf0;
  text-align: center;
  font-size: .9rem;
  font-weight: 700;
}

.attendance-card img,
.square {
  width: clamp(36px, 13vw, 62px);
  aspect-ratio: 1;
  height: auto;
}

.square {
  box-sizing: border-box;
  scale: .65;
  border: 3px solid #52634b;
  border-radius: 4px 7px 3px 5px;
  transform: rotate(-8deg);
}

.attendance-options input:checked + .attendance-card {
  border-color: #293226;
  background: #f5e69f;
  box-shadow: inset 0 0 0 1px #293226;
}

.attendance-options input:focus-visible + .attendance-card {
  outline: 2px solid #293226;
  outline-offset: 3px;
}

.rsvp-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 1rem;
  padding: .55rem 1rem;
  border: 1px solid #293226;
  border-radius: 7px;
  background: #40533d;
  color: #fffdf0;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.rsvp-submit:disabled { opacity: .65; }

#rsvp-status { margin: .75rem 0 0; }
#rsvp-status:empty { margin: 0; }

.rsvp-note {
  margin: 1rem 0 0;
  color: #49533e;
  font-size: .82rem;
}
