:root {
  --cream: #ffeddc;
  --lavender: #8d89a6;
  --slate: #47697d;
  --teal: #004953;
  --forest: #2c4e31;
  --dark-green: #1b372e;
  --cream-muted: rgba(255, 237, 220, 0.8);
  --cream-rule: rgba(255, 237, 220, 0.25);
  --serif: "Cormorant Garamond", Georgia, serif;
  --script: "Pinyon Script", cursive;
  --sans: Montserrat, sans-serif;
}

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

body {
  background: var(--dark-green);
  color: var(--cream);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

/* Hero: desktop uses the château photo with a soft shade behind each text block */

.hero {
  position: relative;
  min-height: 100svh;
  background: url(../images/chateau.jpg) 50% 65% / cover;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
}

.hero::before {
  background: rgba(27, 55, 46, 0.25);
}

.hero::after {
  display: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 15.8svh 16px 6.4svh;
  text-align: center;
  text-shadow: 0 2px 18px rgba(27, 55, 46, 0.45);
}

.hero-top,
.hero-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-top {
  gap: 28px;
  width: 100%;
}

.hero-bottom {
  gap: 42px;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.hero-buttons .invite-button {
  white-space: nowrap;
}

@media (max-width: 359px) {
  .hero-buttons .invite-button {
    padding: 0 14px 0 calc(14px + 0.3em);
  }
}

.hero-rsvp {
  padding: 12px;
  border: none;
  background: none;
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 7px;
  text-shadow: inherit;
  cursor: pointer;
}

.hero-rsvp:hover {
  filter: brightness(1.15);
}

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

.names,
.date,
.invite-button {
  position: relative;
}

.names::before,
.date::before,
.invite-button::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  pointer-events: none;
}

.names {
  width: 100%;
  font-weight: 300;
  font-size: clamp(40px, 7.5vw, 112px);
  line-height: 1;
  white-space: nowrap;
}

.names::before {
  width: min(1100px, 100vw);
  height: 280%;
  transform: translate(-50%, -56%);
  background: radial-gradient(closest-side, rgba(27, 55, 46, 0.5), rgba(27, 55, 46, 0.275) 50%, rgba(27, 55, 46, 0));
}

.amp {
  font-family: var(--script);
  font-size: 0.6em;
  padding: 0 0.25em;
}

.divider {
  width: 120px;
  height: 1px;
  background: var(--cream);
}

.date {
  padding-left: 0.35em;
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(16px, 2.6vw, 34px);
  letter-spacing: 0.35em;
  line-height: 2;
  text-transform: uppercase;
}

.date::before {
  width: 180%;
  height: 200%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(27, 55, 46, 0.25), rgba(27, 55, 46, 0.1375) 50%, rgba(27, 55, 46, 0));
}

.invite-button {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 0 32px 0 calc(32px + 0.3em);
  border: none;
  background: var(--teal);
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  text-shadow: none;
  box-shadow: 0 8px 24px rgba(27, 55, 46, 0.35);
  cursor: pointer;
  transition: filter 0.2s ease;
}

.invite-button:hover {
  filter: brightness(1.15);
}

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

.invite-button::before {
  width: 170%;
  height: 300%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(27, 55, 46, 0.15), rgba(27, 55, 46, 0.0825) 50%, rgba(27, 55, 46, 0));
}

/* Code entry: replaces the invitation button when this device has no remembered code */

.hero.has-code-form::before {
  background: rgba(27, 55, 46, 0.35);
}

.code-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.code-label {
  padding-left: 0.3em;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.code-row {
  display: flex;
  box-shadow: 0 8px 24px rgba(27, 55, 46, 0.35);
}

.code-row .invite-button {
  padding: 0 28px 0 calc(28px + 0.3em);
  box-shadow: none;
}

.code-field {
  position: relative;
  width: 230px;
  height: 50px;
  background: rgba(27, 55, 46, 0.45);
}

.code-slots {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.code-slot {
  width: 24px;
  height: 32px;
  border-bottom: 1px solid rgba(255, 237, 220, 0.4);
  font-size: 28px;
  line-height: 28px;
  text-align: center;
  transition: border-color 0.2s ease;
}

.code-slot.active {
  border-bottom-color: var(--cream);
}

/* Invisible, but it's what takes focus, typing and paste */
.code-input {
  position: absolute;
  inset: 0;
  width: 100%;
  border: none;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px;
  outline: none;
}

.code-input::selection {
  background: transparent;
}

.code-hint,
.code-error {
  font-style: italic;
  font-size: 19px;
}

.code-hint {
  opacity: 0.85;
}

.code-error:empty {
  display: none;
}

/* Hero on tall screens (phones, portrait tablets): portrait photo, names on top, date and button at the bottom */

@media (max-aspect-ratio: 4/5) {
  .hero {
    background-image: url(../images/portrait.jpg);
    background-position: 50% 50%;
  }

  .hero::before {
    background: rgba(27, 55, 46, 0.1);
  }

  .hero::after {
    display: block;
    background: linear-gradient(to top, rgba(27, 55, 46, 0.5) 0%, rgba(27, 55, 46, 0.5) 30%, rgba(27, 55, 46, 0.225) 38%, rgba(27, 55, 46, 0) 50%);
  }

  .hero-content {
    justify-content: space-between;
    gap: 0;
    padding: 64px 20px 72px;
    text-shadow: 0 2px 14px rgba(27, 55, 46, 0.55);
  }

  .hero-top {
    gap: 18px;
  }

  .hero-bottom {
    gap: 28px;
  }

  .names {
    font-size: clamp(36px, 12.8vw, 50px);
  }

  .amp {
    padding: 0 0.2em;
  }

  .date {
    font-size: 18px;
  }

  .names::before,
  .date::before,
  .invite-button::before {
    display: none;
  }

  .hero.has-code-form::before {
    background: rgba(27, 55, 46, 0.1);
  }

  .hero.has-code-form::after {
    background: linear-gradient(to top, rgba(27, 55, 46, 0.6) 0%, rgba(27, 55, 46, 0.6) 34%, rgba(27, 55, 46, 0.27) 44%, rgba(27, 55, 46, 0) 56%);
  }

  .code-row {
    flex-direction: column;
    gap: 14px;
    box-shadow: none;
  }

  .code-field {
    width: 260px;
    height: 54px;
  }

  .code-row .invite-button {
    justify-content: center;
    padding: 0 0 0 0.3em;
    box-shadow: 0 8px 24px rgba(27, 55, 46, 0.35);
  }

  .code-hint,
  .code-error {
    font-size: 18px;
  }
}

/* Invitation: photo header, greeting, then the household's events as an itinerary */

.invitation-header {
  position: relative;
  height: 460px;
  background: url(../images/chateau.jpg) 50% 62% / cover;
}

.invitation-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(27, 55, 46, 0.25);
}

.invitation-header-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-shadow: 0 2px 18px rgba(27, 55, 46, 0.5);
}

.invitation-names {
  font-weight: 300;
  font-size: clamp(44px, 6.1vw, 88px);
  line-height: 1;
  white-space: nowrap;
}

.invitation-date {
  padding-left: 0.35em;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 18px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
}

.invitation-body {
  max-width: 1080px;
  margin: 0 auto;
  padding: 96px 32px 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 80px;
}

.greeting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.greeting-dear {
  font-family: var(--script);
  font-size: 44px;
  line-height: 1;
  color: var(--lavender);
}

.greeting-names {
  font-weight: 300;
  font-size: 60px;
  line-height: 1.05;
}

.greeting-amp {
  font-family: var(--script);
  font-size: 0.88em;
  padding: 0 0.25em;
}

.greeting-message {
  max-width: 620px;
  font-size: 23px;
  line-height: 1.5;
  color: var(--cream-muted);
}

.greeting-names + .greeting-message {
  margin-top: 10px;
}

.events {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.events-heading {
  padding-left: 0.3em;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-align: center;
}

.events-list {
  width: 100%;
  padding-top: 16px;
  border-top: 1px solid var(--cream-rule);
}

.event {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  padding: 32px 0;
}

.event-when {
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.2em;
  line-height: 1.9;
  text-transform: uppercase;
}

.event-date,
.event-time {
  display: block;
}

.event-time {
  color: var(--cream-muted);
}

.event-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-name {
  font-weight: 300;
  font-size: 46px;
  line-height: 1;
}

.event-the {
  font-family: var(--script);
  font-size: 0.62em;
  color: var(--lavender);
  padding-right: 0.15em;
}

.event-venue,
.event-dress,
.event-notes {
  color: var(--cream-muted);
}

.event-venue {
  font-size: 21px;
  line-height: 1.4;
}

.event-dress,
.event-notes {
  font-size: 19px;
}

.event-label {
  padding-right: 10px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--cream);
}

.event-notes {
  max-width: 520px;
  margin-top: 4px;
  line-height: 1.5;
}

.invitation-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  font-size: 21px;
  color: var(--cream-muted);
  text-align: center;
}

.invitation-footer .divider {
  background: var(--cream-rule);
}

/* Save the date: short header, the category's video filling the left half, its dates on a cream card */

.std-header {
  position: relative;
  height: 280px;
  background: url(../images/chateau.jpg) 50% 56% / cover;
}

.std-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(27, 55, 46, 0.6), rgba(27, 55, 46, 0.3) 35%, rgba(27, 55, 46, 0) 60%);
}

.std-header-content {
  position: relative;
  width: max-content;
  height: 100%;
  padding: 0 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  text-shadow: 0 2px 18px rgba(27, 55, 46, 0.5);
}

.std-names {
  font-weight: 300;
  font-size: 64px;
  line-height: 1;
  white-space: nowrap;
}

/* The logo rides on the rule, so it reaches up into the gap under the names and the rule stays close to them */
.std-names-rule {
  margin-top: -14px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.std-rule-line {
  flex: 1;
  height: 1px;
  background: var(--cream);
}

.std-logo {
  width: 44px;
  height: 44px;
}

.std-side {
  min-height: calc(100svh - 280px);
  padding: 48px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
}

.std-card {
  width: 100%;
  max-width: 620px;
  padding: 52px 64px;
  background: var(--cream);
  color: var(--dark-green);
  border-radius: 2px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  outline: 1px solid rgba(27, 55, 46, 0.2);
  outline-offset: -14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 64px;
  text-align: center;
}

/* The top block, whether greeting or logo divider, has the same margins however tall it is */
.std-event-card {
  gap: 44px;
}

.std-card.std-event-card {
  padding-top: 65px;
}

.std-card-header,
.std-card-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.std-greeting {
  gap: 8px;
}

.std-greeting-inline {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 12px;
}

.std-greeting .greeting-dear {
  font-size: 30px;
  color: var(--teal);
}

.std-greeting .greeting-names {
  font-size: 38px;
  color: var(--teal);
}

.std-logo-rule {
  display: flex;
  align-items: center;
  gap: 12px;
}

.std-logo-rule-line {
  width: 60px;
  height: 1px;
  background: rgba(27, 55, 46, 0.2);
}

.std-card-logo {
  width: 48px;
  height: 48px;
}

.std-plain-rule {
  width: 192px;
  height: 1px;
  background: rgba(27, 55, 46, 0.2);
}

.std-card-rsvp {
  margin-top: 12px;
}

.calendar-link {
  display: inline-block;
  padding: 8px 0;
  text-decoration: none;
}

.std-card-footer .calendar-link {
  margin-top: 4px;
}

/* The video and envelope. Separate fixed layers, so the card can pass between the envelope's back and front */
.page-locked {
  overflow: hidden;
  scrollbar-gutter: stable;
}

.film-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #000;
}

.film-video {
  position: fixed;
  inset: 0;
  z-index: 27;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.film-skip {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: 12px;
  z-index: 28;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
}

.film-layer {
  position: relative;
  z-index: 22;
}

.std-header.film-layer {
  z-index: 26;
}

.film-envelope {
  position: fixed;
}

.film-envelope i {
  display: block;
  width: 100%;
  height: 100%;
}

.film-envelope-back {
  z-index: 21;
  background: #10211b;
}

.film-envelope-pocket {
  z-index: 23;
  filter: drop-shadow(0 -1px 1px rgba(0, 0, 0, 0.45));
}

.film-envelope-pocket i {
  background: var(--dark-green);
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
}

.film-envelope-flap {
  z-index: 24;
  transform-origin: top center;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
}

.film-envelope-flap i {
  background: #234538;
  clip-path: polygon(0 0, 100% 0, 50% 62%);
}

.film-envelope-seal {
  z-index: 25;
  background: var(--cream);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.std-heading {
  font-weight: 300;
  font-size: 62px;
  line-height: 1;
}

.std-the {
  padding-right: 0.2em;
  font-family: var(--script);
  font-weight: 400;
  font-size: 0.55em;
  color: var(--teal);
}

.std-rule {
  width: 120px;
  height: 1px;
  background: rgba(27, 55, 46, 0.2);
}

.std-dates {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.std-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.std-when {
  font-size: 21px;
  line-height: 1.2;
}

.nowrap {
  white-space: nowrap;
}

.std-name {
  padding-left: 0.2em;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--forest);
}

.std-name .std-the {
  padding-right: 0.3em;
  font-size: 22px;
  letter-spacing: 0;
  text-transform: none;
}

.std-where {
  padding-left: 0.25em;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--teal);
}

.std-card-footer {
  font-size: 20px;
  color: rgba(27, 55, 46, 0.75);
}

.std-card-footer p {
  font-style: italic;
}


/* RSVP: the same header and cream card, with a per-person form */

.rsvp {
  padding: 28px 16px 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* The card folds into a strip as the page scrolls */
.rsvp-fold {
  position: sticky;
  top: 0;
  z-index: 2;
  width: 100%;
  max-width: 620px;
  overflow: hidden;
  background: var(--cream);
  color: var(--dark-green);
  border-radius: 2px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.rsvp-fold-card {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(620px, 100%);
  transform: translateX(-50%);
}

.rsvp-fold-card .std-card {
  box-shadow: none;
}

.rsvp-not-you {
  align-self: center;
}

.rsvp-fold-strip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0 20px;
  border: 0;
  background: none;
  color: var(--dark-green);
  font-family: var(--serif);
  text-align: left;
  cursor: pointer;
  opacity: 0;
}

.rsvp-fold-text {
  min-width: 0;
}

.rsvp-fold-greeting {
  display: block;
  overflow: hidden;
  font-weight: 300;
  font-size: 22px;
  color: var(--teal);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rsvp-fold-greeting b {
  padding-right: 0.3em;
  font-family: var(--script);
  font-weight: 400;
}

.rsvp-fold-text small {
  display: block;
  margin-top: 2px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--forest);
}

.rsvp-fold-open {
  flex: none;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--teal);
}

/* Once the RSVP is saved, "Back to the events" below already leads back to the card */
.rsvp:has(.rsvp-thanks) .rsvp-fold-open {
  display: none;
}


.rsvp-card {
  flex: none;
  margin-top: 24px;
  /* Always room to scroll the card fully folded, however short the form */
  min-height: calc(100svh - 96px);
  scroll-margin-top: 90px;
  max-width: 820px;
  padding: 56px 64px;
  align-items: stretch;
  gap: 44px;
  text-align: left;
}

.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.rsvp-row {
  display: flex;
  gap: 24px;
}

.rsvp-field {
  flex: 1;
  min-width: 0;
  display: block;
}

.rsvp-label,
.rsvp-section-label {
  display: block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(27, 55, 46, 0.75);
}

.rsvp-section-label {
  margin-bottom: 4px;
  font-size: 15px;
  letter-spacing: 0.25em;
  color: var(--dark-green);
}

.rsvp-input,
.rsvp-textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  color: var(--dark-green);
  font-family: var(--serif);
  outline: none;
}

.rsvp-input {
  padding: 8px 0;
  border: none;
  border-bottom: 1px solid rgba(27, 55, 46, 0.35);
  background: transparent;
  font-size: 22px;
}

.rsvp-textarea {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(27, 55, 46, 0.25);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
  font-size: 20px;
  line-height: 1.4;
  resize: vertical;
}

.rsvp-input:focus,
.rsvp-textarea:focus {
  border-color: var(--teal);
}

.rsvp-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rsvp-heading .std-the {
  margin-bottom: -0.1em;
  padding: 0;
}

.rsvp-events {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.rsvp-events-note {
  max-width: 560px;
}

/* The same 20px under the heading as "Will you join us at:" has above its table (form gap 32 - 12) */
.rsvp-info-label {
  margin-bottom: -12px;
  text-align: center;
}

/*
 * One column per event. Each column spans the table's three rows (name, date, choices) through
 * subgrid, so names, dates and buttons line up across columns however long each name is.
 */
.rsvp-table {
  width: 100%;
  max-width: calc(var(--events) * 240px);
  display: grid;
  grid-template-columns: repeat(var(--events), minmax(0, 1fr));
  grid-template-rows: auto auto auto;
  border: 1px solid rgba(27, 55, 46, 0.18);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
}

.rsvp-event {
  grid-row: span 3;
  display: grid;
  grid-template-rows: subgrid;
  justify-items: center;
  align-items: center;
  row-gap: 10px;
  padding: 16px 12px;
}

.rsvp-event + .rsvp-event {
  border-left: 1px solid rgba(27, 55, 46, 0.18);
}

.rsvp-event-name {
  align-self: end;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.18em;
  line-height: 1.5;
  text-transform: uppercase;
}

.rsvp-event-name .std-the {
  padding-right: 0.3em;
  font-size: 21px;
  letter-spacing: 0;
  text-transform: none;
}

/* The name's line height leaves extra room above the date, so the space below gets a little more */
.rsvp-event-when {
  align-self: start;
  margin: 6px 0 10px;
  font-size: 14px;
  white-space: nowrap;
  line-height: 1.3;
  color: var(--teal);
}

.rsvp-event .rsvp-choices {
  width: 100%;
  max-width: 210px;
  background: var(--cream);
}

.rsvp-choices {
  display: flex;
  border: 1px solid var(--teal);
  border-radius: 2px;
  overflow: hidden;
}

.rsvp-choice {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.rsvp-choice + .rsvp-choice {
  border-left: 1px solid var(--teal);
}

/* The real radio stays in the layout (invisible) so the browser can point at it if left unanswered */
.rsvp-choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.rsvp-choice:has(input:checked) {
  background: var(--teal);
  color: var(--cream);
}

.rsvp-choice:has(input:focus-visible) {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.rsvp-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.rsvp-party-section,
.rsvp-party-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rsvp-check {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  font-size: 21px;
  cursor: pointer;
}

.rsvp-check input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--teal);
  cursor: pointer;
}

.rsvp-party {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 28px 28px;
  border: 1px solid rgba(27, 55, 46, 0.18);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
}

.rsvp-party-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

/* Inside a guest's box the events sit on the box's own background */
.rsvp-guest-table {
  border: none;
  border-top: 1px solid rgba(27, 55, 46, 0.18);
  border-radius: 0;
  background: none;
  max-width: none;
}

.rsvp-party-title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(27, 55, 46, 0.75);
}

.rsvp-optional {
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
}

/* Padding keeps the tap target tall; the negative margin keeps the gap below it like the form's other gaps */
.rsvp-add {
  align-self: flex-start;
  padding: 8px 0;
  margin-bottom: -8px;
}

.rsvp-party[hidden],
.rsvp-add[hidden] {
  display: none;
}

.rsvp-textarea::placeholder {
  font-size: 15px;
  font-style: italic;
  color: rgba(27, 55, 46, 0.55);
}

.rsvp-deadline {
  text-align: center;
}

.rsvp-note.rsvp-small {
  font-size: 16px;
  line-height: 1.35;
}

.rsvp-note,
.rsvp-thanks {
  font-size: 18px;
  font-style: italic;
  color: rgba(27, 55, 46, 0.75);
}

.rsvp-error {
  font-size: 18px;
  color: #8a2a1b;
}

.rsvp-error:empty {
  display: none;
}

.rsvp-thanks {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  font-size: 20px;
}

.rsvp-thanks-title {
  font-style: normal;
  font-weight: 300;
  font-size: 36px;
  color: var(--dark-green);
}

.rsvp-link {
  border: none;
  background: none;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--teal);
  cursor: pointer;
}

/* Below this the event columns are too narrow for a date range on one line; it wraps at its dash */
@media (max-width: 860px) {
  .rsvp-event-when {
    white-space: normal;
  }
}

@media (max-width: 700px) {
  .invitation-header {
    height: 340px;
    background-image: url(../images/portrait.jpg);
    background-position: 50% 28%;
  }

  .invitation-header::before {
    background: rgba(27, 55, 46, 0.15);
  }

  .invitation-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--dark-green) 0%, rgba(27, 55, 46, 0) 45%);
  }

  .invitation-header-content {
    justify-content: flex-start;
    gap: 16px;
    padding: 56px 20px 0;
    text-shadow: 0 2px 14px rgba(27, 55, 46, 0.55);
  }

  .invitation-names {
    font-size: 44px;
  }

  .invitation-names .amp {
    padding: 0 0.2em;
  }

  .invitation-date {
    display: none;
  }

  .invitation-body {
    padding: 8px 24px 56px;
    gap: 56px;
  }

  .greeting {
    gap: 14px;
  }

  .greeting-dear {
    font-size: 38px;
  }

  .greeting-names {
    font-size: 44px;
  }

  .greeting-message {
    font-size: 20px;
  }

  .events {
    gap: 28px;
  }

  .events-heading {
    font-size: 12px;
  }

  .events-list {
    display: flex;
    flex-direction: column;
    gap: 44px;
    padding-top: 36px;
  }

  /* Stack each event centred: name first, then date and time on one line */
  .event {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 0;
    text-align: center;
  }

  .event-details {
    display: contents;
  }

  .event-name {
    order: -1;
    font-size: 42px;
  }

  .event-when {
    margin: 0;
    padding-left: 0.2em;
    font-size: 12px;
  }

  .event-date,
  .event-time {
    display: inline;
    color: inherit;
  }

  .event-time::before {
    content: " · ";
  }

  .event-venue {
    font-size: 20px;
  }

  .event-dress,
  .event-notes {
    font-size: 18px;
  }

  .invitation-footer {
    gap: 20px;
    font-size: 19px;
  }

  .std-header {
    height: 190px;
    background-position: 50% 65%;
  }

  .std-header::before {
    background: linear-gradient(to right, rgba(27, 55, 46, 0.6), rgba(27, 55, 46, 0.3) 45%, rgba(27, 55, 46, 0) 70%);
  }

  .std-header-content {
    padding: 0 24px;
    gap: 14px;
    text-shadow: 0 2px 14px rgba(27, 55, 46, 0.55);
  }

  .std-names {
    font-size: 36px;
  }

  .std-names-rule {
    margin-top: -10px;
    gap: 10px;
  }

  .std-logo {
    width: 36px;
    height: 36px;
  }

  .std-names .amp {
    padding: 0 0.2em;
  }

  .std-side {
    min-height: calc(100svh - 190px);
    padding: 24px 12px 40px;
  }

  .std-greeting {
    gap: 6px;
  }

  .std-greeting-inline {
    gap: 10px;
  }

  .std-greeting .greeting-dear {
    font-size: 26px;
  }

  .std-greeting .greeting-names {
    font-size: 30px;
  }

  .std-card {
    padding: 48px 28px;
    outline-offset: -10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    gap: 36px;
  }

  .std-card-header,
  .std-card-footer {
    gap: 18px;
  }

  .std-heading {
    font-size: 48px;
  }

  .std-rule {
    width: 100px;
  }

  .std-dates {
    gap: 30px;
  }

  .std-when {
    font-size: 18px;
  }

  .std-name {
    font-size: 14px;
  }

  .std-name .std-the {
    font-size: 20px;
  }

  .std-where {
    font-size: 10px;
  }

  .std-card-footer {
    font-size: 18px;
  }

  .rsvp {
    padding: 24px 12px 90px;
  }

  .rsvp-card {
    padding: 44px 20px;
    gap: 36px;
  }

  .rsvp-row {
    gap: 16px;
  }

  .rsvp-party {
    padding: 20px 16px 24px;
  }

  /* Too narrow for columns: the events stack, one under another */
  .rsvp-table {
    grid-template-columns: minmax(0, 1fr);
  }

  .rsvp-event {
    grid-row: auto;
    grid-template-rows: auto;
    padding: 18px 12px;
  }

  .rsvp-event + .rsvp-event {
    border-left: none;
    border-top: 1px solid rgba(27, 55, 46, 0.18);
  }

  .rsvp-event-when {
    font-size: 15px;
  }
}
