/* RSVP landing composition (03+) + entry animation (04) */

/* RSVP-only table surface background (does not affect other guest pages). */
.guest-page:has(#rsvp-app) {
  background: #3f6995;
}

.rsvp-stage {
  position: relative;
  z-index: 0;
}

/*
 * Use a fixed viewport layer for RSVP background.
 * This prevents mobile seam/split artifacts from page-level background painting.
 */
.rsvp-stage::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: #3f6995;
  background-image:
    linear-gradient(
      180deg,
      rgba(10, 26, 52, 0.14) 0%,
      rgba(10, 26, 52, 0.08) 45%,
      rgba(10, 26, 52, 0.18) 100%
    ),
    url("../img/rose_blue.jpg");
  background-repeat: no-repeat, no-repeat;
  background-position: center center, center center;
  background-size: cover, cover;
  transform: scale(1.12);
  transform-origin: 50% 50%;
  transition: transform 2400ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

/* Zoom out while envelope flies off and keep settled once exited. */
.rsvp-stage[data-envelope-flight="active"]::before,
.rsvp-stage[data-envelope="exited"]::before {
  transform: scale(1);
}

@media (max-width: 639px) {
  .rsvp-stage::before {
    background-position: center top, center top;
    transform: scale(1.06);
  }
}

.rsvp-entry {
  position: fixed;
  inset: 0;
  /* Above letter/form sheets so fountain can drizzle over them; still below sticky CTA / venue overlays. */
  z-index: 20;
  pointer-events: none;
  overflow: hidden;
}

.rsvp-entry__particles {
  position: absolute;
  inset: 0;
}

.rsvp-entry__particle {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--particle-size, 20px);
  height: var(--particle-size, 20px);
  color: var(--particle-color, var(--delft-primary));
  opacity: 0;
  will-change: transform, opacity;
  animation-name: rsvp-particle-fall;
  animation-duration: var(--duration, 4s);
  animation-delay: var(--delay, 0s);
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

.rsvp-entry__particle svg {
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes rsvp-particle-fall {
  0% {
    opacity: 0;
    transform: translate3d(var(--start-x, 50vw), var(--start-y, -8vh), 0)
      scale(var(--scale, 1));
  }
  8% {
    opacity: var(--particle-opacity, 0.45);
  }
  88% {
    opacity: var(--particle-opacity, 0.45);
  }
  100% {
    opacity: 0;
    transform: translate3d(
      calc(var(--start-x, 50vw) + var(--drift, 0px)),
      110vh,
      0
    ) scale(var(--scale, 1));
  }
}

.rsvp-burst__particle {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--particle-size, 20px);
  height: var(--particle-size, 20px);
  color: var(--particle-color, var(--delft-primary));
  opacity: 0;
  will-change: transform, opacity;
  pointer-events: none;
}

.rsvp-burst__particle svg {
  display: block;
  width: 100%;
  height: 100%;
}

.rsvp-landing {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.rsvp-landing::before {
  content: none;
}

.rsvp-landing::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity 420ms ease;
  background: none;
}

.rsvp-landing.is-entering {
  opacity: 0;
}

.rsvp-landing.is-entered {
  opacity: 1;
  transition: opacity 2400ms ease;
}

.rsvp-landing__title {
  position: relative;
  z-index: 1;
  color: #1f3f6d;
  margin: 0 0 var(--space-xl);
  max-height: 12em;
  overflow: hidden;
  text-wrap: balance;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22),
    0 0 18px rgba(246, 251, 255, 0.42);
  transition:
    opacity 350ms ease,
    max-height 1100ms ease,
    margin 1100ms ease,
    visibility 0ms linear 0ms;
}

h1.rsvp-landing__title.type-display-lg {
  font-weight: 600;
  letter-spacing: 0.015em;
}

h1.rsvp-landing__title {
  margin-bottom: var(--space-sm);
}

.rsvp-landing__titles {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  margin: 0 auto var(--space-md);
  padding: clamp(8px, 1.2vw, 14px) clamp(10px, 1.6vw, 18px) clamp(6px, 1vw, 12px);
}

.rsvp-landing__titles::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 44%;
  width: min(86vw, 620px);
  height: clamp(86px, 14vw, 132px);
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: radial-gradient(
    ellipse at center,
    rgba(248, 252, 255, 0.26) 0%,
    rgba(248, 252, 255, 0.08) 58%,
    rgba(248, 252, 255, 0) 100%
  );
  pointer-events: none;
}

.rsvp-landing__titles .type-heading-sm {
  color: #23456f;
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 0;
  max-width: 34ch;
  margin-inline: auto;
}

.rsvp-landing__envelope-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.rsvp-envelope {
  width: min(100%, 280px);
  cursor: pointer;
  perspective: 800px;
  transform-style: preserve-3d;
  transition: width 450ms ease, opacity 450ms ease, transform 450ms ease;
}

@keyframes rsvp-envelope-jiggle {
  0%,
  82%,
  100% {
    transform: rotate(0deg);
  }
  86% {
    transform: rotate(-2deg);
  }
  90% {
    transform: rotate(2deg);
  }
  94% {
    transform: rotate(-1.2deg);
  }
  98% {
    transform: rotate(1.2deg);
  }
}

.rsvp-stage[data-envelope="closed"] .rsvp-envelope {
  animation: rsvp-envelope-jiggle 2s ease-in-out infinite;
  transform-origin: 50% 58%;
}

.rsvp-envelope svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  transform-style: preserve-3d;
}

@media (min-width: 640px) {
  .rsvp-envelope {
    width: 320px;
  }
}

.rsvp-landing__hint {
  margin: var(--space-lg) 0 0;
  color: #3f5573;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.24);
  transition: opacity 300ms ease;
}

@media (max-width: 639px) {
  .rsvp-landing__titles {
    max-width: 35ch;
  }

  .rsvp-landing__title {
    max-height: 13em;
  }
}

/* —— Envelope open + sheet pop-out (05) —— */

.rsvp-stage[data-envelope="opening"] .rsvp-landing__hint,
.rsvp-stage[data-envelope="open"] .rsvp-landing__hint,
.rsvp-stage[data-envelope="exited"] .rsvp-landing__hint {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.rsvp-stage[data-envelope="opening"] .rsvp-landing,
.rsvp-stage[data-envelope="open"] .rsvp-landing {
  position: relative;
  z-index: 1;
}

.rsvp-stage[data-envelope="opening"] .rsvp-landing::before,
.rsvp-stage[data-envelope="open"] .rsvp-landing::before,
.rsvp-stage[data-envelope="exited"] .rsvp-landing::before,
.rsvp-stage[data-envelope="opening"] .rsvp-landing::after,
.rsvp-stage[data-envelope="open"] .rsvp-landing::after,
.rsvp-stage[data-envelope="exited"] .rsvp-landing::after {
  opacity: 0;
}

.rsvp-stage[data-envelope="opening"] .rsvp-landing__titles::before,
.rsvp-stage[data-envelope="open"] .rsvp-landing__titles::before,
.rsvp-stage[data-envelope="exited"] .rsvp-landing__titles::before {
  opacity: 0;
}

/* Phase 1: fade titles while keeping layout space reserved. */
.rsvp-stage[data-envelope="opening"] .rsvp-landing__title {
  opacity: 0;
}

/* Phase 2: collapse titles so the envelope rises into that space. */
.rsvp-stage[data-envelope="open"] .rsvp-landing__title {
  opacity: 0;
  max-height: 0;
  margin: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0ms linear,
    max-height 1100ms ease,
    margin 1100ms ease,
    visibility 0ms linear 0ms;
}

.rsvp-stage[data-envelope="opening"] .rsvp-envelope,
.rsvp-stage[data-envelope="open"] .rsvp-envelope,
.rsvp-stage[data-envelope="exited"] .rsvp-envelope {
  pointer-events: none;
  cursor: default;
}

/* Soft settle while sheets pop; JS then flies the envelope off-screen. */
.rsvp-stage[data-envelope="open"] .rsvp-envelope {
  width: min(100%, 200px);
  opacity: 0.85;
  transform: scale(0.96);
  transition:
    width 1100ms ease,
    opacity 1100ms ease,
    transform 1100ms ease;
}

/* Landing removed from flow so letter + form sit at the top. */
.rsvp-stage[data-envelope="exited"] .rsvp-landing[hidden] {
  display: none !important;
}

.rsvp-stage[data-envelope="exited"] .rsvp-sheets {
  margin-top: 0;
}

@keyframes rsvp-envelope-jet-shake {
  0% {
    transform: scale(var(--jet-shake-scale)) translate(0, 0) rotate(0deg);
  }
  12% {
    transform: scale(var(--jet-shake-scale))
      translate(calc(var(--jet-shake-x) * -1), calc(var(--jet-shake-y) * 0.5))
      rotate(calc(var(--jet-shake-rot) * -1));
  }
  25% {
    transform: scale(var(--jet-shake-scale))
      translate(var(--jet-shake-x), calc(var(--jet-shake-y) * -1))
      rotate(calc(var(--jet-shake-rot) * 0.85));
  }
  37% {
    transform: scale(var(--jet-shake-scale))
      translate(calc(var(--jet-shake-x) * -0.85), calc(var(--jet-shake-y) * -0.75))
      rotate(calc(var(--jet-shake-rot) * -0.85));
  }
  50% {
    transform: scale(var(--jet-shake-scale))
      translate(calc(var(--jet-shake-x) * 1.15), calc(var(--jet-shake-y) * 0.5))
      rotate(var(--jet-shake-rot));
  }
  62% {
    transform: scale(var(--jet-shake-scale))
      translate(calc(var(--jet-shake-x) * -0.65), var(--jet-shake-y))
      rotate(calc(var(--jet-shake-rot) * -0.7));
  }
  75% {
    transform: scale(var(--jet-shake-scale))
      translate(calc(var(--jet-shake-x) * 0.85), calc(var(--jet-shake-y) * -0.5))
      rotate(calc(var(--jet-shake-rot) * 0.85));
  }
  87% {
    transform: scale(var(--jet-shake-scale))
      translate(calc(var(--jet-shake-x) * -1), calc(var(--jet-shake-y) * 0.25))
      rotate(calc(var(--jet-shake-rot) * -0.7));
  }
  100% {
    transform: scale(var(--jet-shake-scale)) translate(0, 0) rotate(0deg);
  }
}

.rsvp-envelope.is-jetting {
  /* Tune jet shake here */
  --jet-shake-scale: 0.92;
  --jet-shake-x: 3px;
  --jet-shake-y: 2px;
  --jet-shake-rot: 3.5deg;
  --jet-shake-duration: 0.28s;

  animation: rsvp-envelope-jet-shake var(--jet-shake-duration) linear infinite;
  transform-origin: 50% 80%;
  transition: none;
}

@media (min-width: 640px) {
  .rsvp-stage[data-envelope="open"] .rsvp-envelope {
    width: 240px;
  }
}

/*
 * Guest shell defaults to a ~600px reading column. Open letter + form need
 * roughly double that on tablet/desktop so the two sheets are not pencil-thin.
 */
@media (min-width: 640px) {
  .guest-page:has(#rsvp-app) .guest-page__main {
    max-width: 1120px;
  }
}

@media (min-width: 1025px) {
  .guest-page:has(#rsvp-app) .guest-page__main {
    max-width: 1200px;
  }
}

/* Invalid-invite 404: Delft wash page, ivory stationery card */
body:has(.rsvp-denied),
.guest-page:has(.rsvp-denied) {
  background-color: #f5f8fc;
}

.guest-page:has(.rsvp-denied) {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
}

.guest-page:has(.rsvp-sorry) {
  display: flex;
  flex-direction: column;
}

.guest-page:has(.rsvp-denied)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: #f5f8fc;
  background-image: url("../img/blue_flower_border.jpg");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

@media (max-width: 639px) {
  .guest-page:has(.rsvp-denied)::before {
    /*
     * Scale by viewport height on mobile and keep natural image width.
     * This preserves vertical fit while allowing side-crop on narrow screens.
     */
    background-size: auto 100dvh;
    background-position: center top;
  }
}

.guest-page:has(.rsvp-denied) .guest-page__main {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
}

.guest-page:has(.rsvp-sorry) .guest-page__main {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
}

.rsvp-denied {
  width: 100%;
  max-width: 400px;
  margin-inline: auto;
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  background: var(--background-ivory);
  border: 1px solid var(--delft-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
}

.rsvp-denied h1 {
  margin: 0 0 var(--space-lg);
  color: var(--text-primary);
}

.rsvp-denied p {
  margin: 0 0 var(--space-md);
  color: var(--text-secondary);
}

.rsvp-denied p:last-child {
  margin-bottom: 0;
}

.rsvp-sheets {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  width: 100%;
  max-width: 720px;
  margin: var(--space-xl) auto 0;
  position: relative;
  z-index: 2;
}

/* Author display:grid must not override the HTML hidden attribute. */
.rsvp-sheets[hidden] {
  display: none !important;
}

@media (min-width: 640px) {
  .rsvp-sheets {
    grid-template-columns: 1fr 1fr;
    max-width: 1120px;
    gap: var(--space-xl);
  }
}

@media (min-width: 1025px) {
  .rsvp-sheets {
    max-width: 1200px;
  }
}

.rsvp-sheet {
  background: var(--surface-white);
  border: 1px solid var(--delft-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  padding: var(--space-lg);
  min-height: 160px;
  text-align: left;
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transition:
    opacity 480ms cubic-bezier(0.2, 0.9, 0.2, 1),
    transform 480ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.rsvp-sheet--letter {
  background: var(--background-ivory);
  overflow: visible;
}

.rsvp-sheet--form {
  background: var(--surface-white);
  transition-delay: 150ms;
}

/* —— Invitation letter content (06) —— */

.invitation-letter {
  color: var(--text-primary);
  text-align: center;
}

.invitation-letter__header {
  margin-bottom: var(--space-md);
}

.invitation-letter__overline {
  margin: 0;
}

.invitation-letter__names {
  position: relative;
  margin: var(--space-2xl) 0 var(--space-lg);
}

.invitation-letter__break {
  display: block;
  width: min(100%, 280px);
  height: auto;
  margin: 0 auto var(--space-lg);
  color: var(--delft-primary);
}

.invitation-letter__name {
  margin: 0;
  font-family: var(--font-script);
  font-size: clamp(2.75rem, 8vw, 3.75rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--delft-primary);
}

.invitation-letter__amp {
  margin: 0;
  padding: var(--space-sm) 0;
  font-family: var(--font-script);
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 400;
  line-height: 1;
  color: var(--delft-primary);
}

.invitation-letter__when {
  margin: 0;
}

.invitation-letter__date,
.invitation-letter__time {
  margin: 0 0 var(--space-xs);
  color: var(--text-primary);
}

.invitation-letter__time {
  margin-bottom: 0;
}

.invitation-letter__dear {
  margin: var(--space-lg) 0 0;
  color: var(--text-primary);
}

/* Tossed porcelain portrait — mid-left, overlaps letter border */
.invitation-letter__portrait {
  display: block;
  box-sizing: border-box;
  width: 88px;
  max-width: 30%;
  padding: 8px;
  margin: 0;
  background: var(--surface-white);
  border: 1px solid var(--delft-line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  position: absolute;
  top: 50%;
  left: calc(-1 * var(--space-lg) - 16px);
  z-index: 2;
  transform: translateY(-50%) rotate(-3.5deg);
  pointer-events: none;
}

.invitation-letter__portrait img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

@media (min-width: 640px) {
  .invitation-letter__portrait {
    width: 136px;
    max-width: 136px;
    left: calc(-1 * var(--space-lg) - 28px);
  }
}

.invitation-letter__venue {
  margin: 0;
  padding-top: var(--space-md);
  position: relative;
}

.invitation-letter__venue-name {
  margin: 0 0 var(--space-xs);
  color: var(--text-primary);
}

.invitation-letter__venue-address {
  margin: 0 0 var(--space-md);
  color: var(--text-secondary);
}

.invitation-letter__directions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  margin-inline: auto;
  padding: var(--space-sm) 0;
  color: var(--delft-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.invitation-letter__directions:hover,
.invitation-letter__directions:focus-visible {
  color: var(--delft-deep);
}

.invitation-letter .type-label {
  color: var(--delft-primary);
}

.rsvp-letter-stage {
  width: 100%;
}

/* —— RSVP form surface (07) —— */

.rsvp-form {
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
}

.rsvp-form__title {
  margin: 0 0 var(--space-md);
  color: var(--delft-primary);
}

.rsvp-form__message {
  margin: 0 0 var(--space-lg);
}

.rsvp-form__deadline {
  margin: 0 0 var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: var(--delft-wash);
  border-radius: var(--radius-sm);
}

.rsvp-form__deadline .type-label {
  margin: 0 0 var(--space-xs);
  color: var(--delft-primary);
}

.rsvp-form__deadline .type-body-sm {
  margin: 0;
  color: var(--text-primary);
}

.rsvp-form__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
}

@media (min-width: 640px) {
  .rsvp-form__actions {
    flex-direction: row;
  }

  .rsvp-form__actions .rsvp-form__btn {
    flex: 1;
  }
}

.rsvp-form__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 16px 32px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: default;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition);
}

.rsvp-form__btn--yes {
  background: var(--rsvp-yes);
  color: #ffffff;
}

.rsvp-form__btn--yes:hover {
  background: var(--rsvp-yes-hover);
}

.rsvp-form__btn--no {
  background: var(--rsvp-no);
  border-color: var(--rsvp-no-border);
  color: var(--rsvp-no-text);
}

.rsvp-form__btn--no:hover {
  border-color: var(--delft-primary);
  color: var(--delft-primary);
}

/* RSVP past due date: greyed out and non-interactive */
.rsvp-form__btn.rsvp-form__btn--closed,
.rsvp-form__btn.rsvp-form__btn--closed:hover {
  background: var(--delft-wash);
  border-color: var(--delft-line);
  color: var(--text-secondary);
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.rsvp-form__closed-banner {
  margin: 0 0 var(--space-lg);
  padding: var(--space-md);
  border: 1px solid var(--delft-line);
  border-radius: var(--radius-sm);
  text-align: center;
  color: var(--text-secondary);
}

/* —— Thank-you confirmation (Accepted page) —— */

.rsvp-thank-you {
  position: relative;
  z-index: 0;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.rsvp-thank-you::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: #3f6995;
  background-image:
    linear-gradient(
      180deg,
      rgba(10, 26, 52, 0.14) 0%,
      rgba(10, 26, 52, 0.08) 45%,
      rgba(10, 26, 52, 0.18) 100%
    ),
    url("../img/rose_blue.jpg");
  background-repeat: no-repeat, no-repeat;
  background-position: center center, center center;
  background-size: cover, cover;
}

@media (max-width: 639px) {
  .rsvp-thank-you::before {
    background-position: center top, center top;
  }
}

.rsvp-thank-you__panel {
  text-align: center;
  background: var(--success-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.rsvp-thank-you__panel .type-heading-md {
  margin: 0 0 var(--space-md);
  color: var(--delft-primary);
}

.rsvp-thank-you__panel .type-body-md {
  margin: 0;
  color: var(--text-primary);
}

.rsvp-event-info {
  margin: 0 0 var(--space-xl);
  padding: var(--space-lg);
  text-align: center;
  background: var(--surface-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.rsvp-event-info__block {
  margin: 0 0 var(--space-lg);
}

.rsvp-event-info__block:last-child {
  margin-bottom: 0;
}

.rsvp-event-info__label {
  margin: 0 0 var(--space-sm);
  color: var(--delft-soft);
}

.rsvp-event-info__when .invitation-letter__date {
  margin-bottom: var(--space-xs);
}

.rsvp-countdown {
  margin: 0 0 var(--space-xl);
  padding: var(--space-lg);
  text-align: center;
  background: rgba(245, 250, 255, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px) saturate(115%);
  -webkit-backdrop-filter: blur(10px) saturate(115%);
}

.rsvp-countdown__static {
  margin: 0;
  color: #17345d;
}

.rsvp-countdown__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
}

.rsvp-countdown__grid[hidden],
.rsvp-countdown__static[hidden] {
  display: none;
}

.rsvp-countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3.5rem;
}

.rsvp-countdown__unit[hidden] {
  display: none !important;
}

.rsvp-countdown__value {
  font-family: var(--font-display);
  font-size: var(--heading-md-size);
  font-weight: var(--heading-md-weight);
  line-height: var(--heading-md-line-height);
  letter-spacing: var(--heading-md-letter-spacing);
  font-variant-numeric: tabular-nums;
  color: #1b3f70;
}

.rsvp-countdown__label {
  margin-top: var(--space-xs);
  color: #395b87;
}

@media (prefers-reduced-motion: reduce) {
  .rsvp-countdown__grid {
    display: none !important;
  }

  .rsvp-countdown__static {
    display: block !important;
  }
}

.rsvp-calendar {
  display: flex;
  justify-content: center;
  margin: 0 0 var(--space-xl);
}

.rsvp-calendar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  box-sizing: border-box;
  min-height: 48px;
  padding: 14px 24px;
  background: transparent;
  border: 1px solid var(--delft-primary);
  border-radius: var(--radius-sm);
  color: var(--delft-primary);
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition);
}

.rsvp-calendar-btn:hover {
  background: var(--delft-wash);
  border-color: var(--delft-deep);
  color: var(--delft-deep);
  text-decoration: none;
}

.rsvp-calendar-btn:focus-visible {
  outline: var(--focus-ring-width) solid var(--delft-primary);
  outline-offset: var(--focus-ring-offset);
}

.rsvp-calendar-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.rsvp-thank-you__partner {
  margin: 0 0 var(--space-xl);
  padding: var(--space-lg);
  background: var(--surface-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.rsvp-thank-you__decline {
  width: 100%;
}

.rsvp-thank-you__decline .rsvp-form__btn {
  cursor: pointer;
}

.rsvp-thank-you__decline .rsvp-form__btn:focus-visible {
  outline: var(--focus-ring-width) solid var(--delft-primary);
  outline-offset: var(--focus-ring-offset);
}

.rsvp-sorry {
  position: relative;
  z-index: 0;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 400px;
  margin-inline: auto;
}

.rsvp-sorry::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: #3f6995;
  background-image:
    linear-gradient(
      180deg,
      rgba(10, 26, 52, 0.14) 0%,
      rgba(10, 26, 52, 0.08) 45%,
      rgba(10, 26, 52, 0.18) 100%
    ),
    url("../img/rose_blue.jpg");
  background-repeat: no-repeat, no-repeat;
  background-position: center center, center center;
  background-size: cover, cover;
}

@media (max-width: 639px) {
  .rsvp-sorry::before {
    background-position: center top, center top;
  }
}

.rsvp-sorry__panel {
  text-align: center;
  background: var(--surface-white);
  border: 1px solid var(--delft-line);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.rsvp-sorry__panel .type-heading-md {
  margin: 0 0 var(--space-md);
  color: var(--delft-primary);
}

.rsvp-sorry__panel .type-heading-md:last-child {
  margin-bottom: 0;
}

.rsvp-sorry__panel .type-body-md {
  margin: 0;
  color: var(--text-secondary);
}

.rsvp-sorry__accept {
  width: 100%;
}

.rsvp-sorry__accept .rsvp-form__btn {
  cursor: pointer;
}

.rsvp-sorry__accept .rsvp-form__btn:focus-visible {
  outline: var(--focus-ring-width) solid var(--delft-primary);
  outline-offset: var(--focus-ring-offset);
}

.rsvp-thank-you__partner .rsvp-partner {
  margin-bottom: var(--space-md);
  padding-bottom: 0;
  border-bottom: 0;
}

.rsvp-partner-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 14px 24px;
  background: transparent;
  border: 1px solid var(--delft-primary);
  border-radius: var(--radius-sm);
  color: var(--delft-primary);
  cursor: pointer;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition);
}

.rsvp-partner-save:hover {
  background: var(--delft-wash);
  border-color: var(--delft-deep);
  color: var(--delft-deep);
}

.rsvp-partner-save:focus-visible {
  outline: var(--focus-ring-width) solid var(--delft-primary);
  outline-offset: var(--focus-ring-offset);
}

/* —— Partner (plus-one) block —— */

.rsvp-partner {
  margin: 0 0 var(--space-lg);
  padding: 0 0 var(--space-lg);
  border: 0;
  border-bottom: 1px solid var(--delft-line);
}

.rsvp-partner__fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.rsvp-partner__legend {
  margin: 0 0 var(--space-xs);
  padding: 0;
  color: var(--delft-primary);
}

.rsvp-partner__toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 44px;
  margin: 0;
  color: var(--text-primary);
  cursor: pointer;
}

.rsvp-partner__toggle input {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  accent-color: var(--delft-primary);
  cursor: pointer;
}

.rsvp-partner__toggle input:focus-visible {
  outline: var(--focus-ring-width) solid var(--delft-primary);
  outline-offset: var(--focus-ring-offset);
}

.rsvp-partner__name {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.rsvp-partner__name[hidden] {
  display: none;
}

/* Hide name when bringing is off (works without JS). */
.rsvp-partner__fields:not(:has([data-partner-toggle]:checked)) .rsvp-partner__name {
  display: none;
}

.rsvp-partner__name-label {
  margin: 0;
  color: var(--delft-soft);
}

.rsvp-partner__name-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--delft-line);
  border-radius: var(--radius-sm);
  background: var(--surface-white);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--body-sm-size);
  line-height: var(--body-sm-line-height);
}

.rsvp-partner__name-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.85;
}

.rsvp-partner__name-input:disabled {
  background: var(--delft-wash);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.rsvp-form--closed .rsvp-form__btn,
.rsvp-form--closed .rsvp-partner__toggle,
.rsvp-form--closed .rsvp-partner__toggle input,
.rsvp-form--closed .rsvp-partner__name-input {
  opacity: 0.5;
  pointer-events: none;
  cursor: default;
}

.rsvp-stage[data-envelope="open"] .rsvp-sheet,
.rsvp-stage[data-envelope="exited"] .rsvp-sheet {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.rsvp-sticky-cta {
  position: fixed;
  right: max(var(--space-md), env(safe-area-inset-right, 0px));
  bottom: max(var(--space-md), env(safe-area-inset-bottom, 0px));
  z-index: 100;
  box-sizing: border-box;
  min-width: 5.5rem;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--delft-primary);
  color: #ffffff;
  box-shadow: var(--shadow-elevated);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity var(--transition),
    visibility var(--transition),
    transform var(--transition),
    background-color var(--transition);
}

.rsvp-sticky-cta.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.rsvp-sticky-cta:hover {
  background: var(--delft-deep);
}

@media (min-width: 640px) {
  .rsvp-sticky-cta {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rsvp-stage[data-envelope="open"] .rsvp-envelope {
    transition: none;
  }

  .rsvp-landing__title {
    transition: none;
  }

  .rsvp-stage[data-envelope="opening"] .rsvp-landing__title,
  .rsvp-stage[data-envelope="open"] .rsvp-landing__title {
    transition: none;
  }

  .rsvp-sheet {
    transition: none;
    transition-delay: 0ms;
  }

  .rsvp-landing__hint {
    transition: none;
  }

  .rsvp-sticky-cta {
    transition: none;
    transform: none;
  }

  .rsvp-sticky-cta.is-visible {
    transform: none;
  }
}
