:root {
  --wax-shadow: rgba(117, 74, 34, 0.35);
  --gold-text: #cba35c;
  --reveal-duration: 900ms;
  --entrance-ease: cubic-bezier(0.18, 0.82, 0.22, 1);
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  background: #f6f2eb;
  color: #344b38;
  font-family:
    "Cormorant Garamond",
    Georgia,
    serif;
}

button {
  font: inherit;
}

.unauthorized-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.76)),
    url("./fondo white.png") center / cover;
  text-align: center;
}

.unauthorized-screen[hidden] {
  display: none;
}

.unauthorized-panel {
  width: min(100%, 360px);
  padding: 34px 24px 30px;
  border: 1px solid rgba(203, 163, 92, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 18px 34px rgba(52, 75, 56, 0.1),
    0 -8px 20px rgba(52, 75, 56, 0.045);
}

.unauthorized-panel h1 {
  margin: 0;
  color: var(--gold-text);
  font-family: "Meow Script", cursive;
  font-size: 48px;
  font-weight: 400;
  line-height: 1;
}

.unauthorized-panel p {
  margin: 22px auto 0;
  color: #344b38;
  font-family: "Lora", Georgia, serif;
  font-size: 16px;
  line-height: 1.45;
}

body.is-unauthorized {
  overflow: hidden;
}

body.is-unauthorized .experience {
  display: none;
}

.experience {
  position: relative;
  width: 100vw;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  background: #f8f6f0;
}

.envelope-scene,
.first-screen,
.invitation-screen {
  position: absolute;
  inset: 0;
}

.envelope-scene {
  z-index: 2;
  display: grid;
  place-items: center;
  transition:
    opacity 700ms ease,
    visibility 700ms ease;
}

.envelope {
  position: relative;
  width: 100vw;
  height: 100svh;
  min-width: 320px;
  min-height: 520px;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #f8f6f0;
  cursor: pointer;
  isolation: isolate;
  animation: envelope-settle 900ms var(--entrance-ease) both;
}

.envelope:focus-visible {
  outline: 3px solid rgba(173, 122, 66, 0.52);
  outline-offset: -8px;
}

.envelope-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("./fondo white.png");
  background-position: center;
  background-size: cover;
  transform: scale(1.02);
}

.envelope-background::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(226, 220, 208, 0.06));
  pointer-events: none;
}

.envelope-triangle {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 50%;
  width: 100vw;
  height: min(54.36vw, 55svh);
  min-height: 255px;
  background-image: url("./polygon.png");
  background-position: top center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  filter:
    drop-shadow(0 22px 18px rgba(58, 52, 43, 0.22))
    drop-shadow(0 2px 1px rgba(255, 255, 255, 0.42));
  transform: translateX(-50%);
  transform-origin: 50% 0;
  transition:
    transform var(--reveal-duration) cubic-bezier(0.22, 0.78, 0.2, 1),
    opacity 460ms ease;
  animation: envelope-flap-glow 2.6s ease-in-out 900ms infinite;
}

.seal {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  width: clamp(92px, 16.8vw, 320px);
  height: auto;
  filter:
    drop-shadow(0 13px 11px var(--wax-shadow))
    drop-shadow(0 2px 1px rgba(88, 53, 25, 0.22));
  transform: translate(-50%, -50%) rotate(-1deg);
  transition:
    opacity 480ms ease,
    transform 760ms cubic-bezier(0.18, 0.82, 0.24, 1);
  user-select: none;
  animation: seal-arrive 950ms var(--entrance-ease) 160ms both;
}

.first-screen {
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  background: #ffffff;
  opacity: 0;
  transform: scale(1.035);
  transition:
    opacity 850ms ease 300ms,
    transform 850ms ease 300ms;
}

.invitation-screen {
  z-index: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: #ffffff;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition:
    opacity 650ms ease,
    visibility 650ms ease,
    transform 650ms ease;
}

.invitation-page {
  position: relative;
  width: min(100%, 768px);
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: #ffffff;
}

.floral {
  position: absolute;
  left: 50%;
  z-index: 0;
  width: min(115%, 530px);
  height: auto;
  pointer-events: none;
  user-select: none;
}

.floral-top {
  top: 0;
  transform: translate(-50%, -9%);
}

.floral-bottom {
  bottom: 0;
  transform: translate(-50%, 9%) rotate(180deg);
}

.welcome-block {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  max-width: 768px;
  margin: 0 auto;
  min-height: 100svh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(158px, 20svh, 198px) 48px clamp(154px, 19svh, 190px);
  text-align: center;
}

.message-card {
  width: min(100%, 292px);
  margin: 0;
  padding: 32px 18px 22px;
  border: 1px solid rgba(203, 163, 92, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.34)),
    url("./fondo white.png") center / cover;
  box-shadow:
    0 18px 34px rgba(52, 75, 56, 0.1),
    0 -8px 20px rgba(52, 75, 56, 0.045),
    12px 0 22px rgba(52, 75, 56, 0.055),
    -12px 0 22px rgba(52, 75, 56, 0.055);
}

.message-card,
.divider,
.continue-button,
.detail-hero,
.detail-card {
  will-change: opacity, transform;
}

.message-card p:first-child {
  margin: 0;
  color: var(--gold-text);
  font-family: "Lora", Georgia, serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.42;
  text-transform: uppercase;
}

.couple-signature {
  margin: 32px 0 0;
  color: var(--gold-text);
  font-family: "Meow Script", cursive;
  font-size: 23px;
  line-height: 1;
}

.divider {
  width: 200px;
  height: auto;
  margin: 42px 0 39px;
}

.continue-button {
  width: 151px;
  min-height: 34px;
  padding: 7px 22px 8px;
  border: 1px solid #344b38;
  border-radius: 999px;
  background: transparent;
  color: #344b38;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.2;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.continue-button:hover {
  background: #344b38;
  color: #ffffff;
  transform: translateY(-1px);
}

.continue-button:focus-visible {
  outline: 3px solid rgba(52, 75, 56, 0.25);
  outline-offset: 3px;
}

.invitation-detail {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 54px;
  width: min(100%, 768px);
  min-height: 100%;
  margin: 0 auto;
  padding: 157px 34px 60px;
  overflow: hidden;
  background: #ffffff;
  text-align: center;
}

.detail-floral {
  position: absolute;
  left: 50%;
  z-index: 0;
  width: min(115%, 530px);
  height: auto;
  pointer-events: none;
  user-select: none;
}

.detail-floral-top {
  top: 0;
  transform: translate(-50%, -9%);
}

.detail-hero,
.detail-card {
  position: relative;
  z-index: 1;
}

.detail-hero h1,
.script-title {
  margin: 0;
  color: var(--gold-text);
  font-family: "Meow Script", cursive;
  font-weight: 400;
  line-height: 1;
}

.detail-hero h1 {
  margin-bottom: 32px;
  font-size: clamp(34px, 9.2vw, 84px);
}

.detail-hero > p {
  width: min(100%, 330px);
  margin: 0 auto 32px;
  color: var(--gold-text);
  font-family: "Lora", Georgia, serif;
  font-size: clamp(18px, 5.1vw, 26px);
  line-height: 1.45;
  text-transform: uppercase;
}

.detail-divider {
  width: 200px;
  height: auto;
  margin: 8px 0 28px;
}

.date-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr);
  align-items: center;
  width: min(100%, 302px);
  margin: 0 auto 42px;
  color: #344b38;
  column-gap: 16px;
}

.date-row span {
  padding: 10px 0 8px;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  font-family: "Lora", Georgia, serif;
  font-size: 16px;
}

.date-row strong {
  display: grid;
  gap: 6px;
  color: #344b38;
  font-family: "Lora", Georgia, serif;
  font-size: 34px;
  line-height: 0.9;
}

.date-row small {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.05;
}

.detail-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(400px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  border-radius: 24px;
  box-shadow:
    0 18px 34px rgba(52, 75, 56, 0.1),
    0 -8px 20px rgba(52, 75, 56, 0.045),
    12px 0 22px rgba(52, 75, 56, 0.055),
    -12px 0 22px rgba(52, 75, 56, 0.055);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}

.location-card {
  width: 400px;
  max-width: 100%;
  height: 200px;
  background-image: url("./fondos/locación.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.location-content {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0;
  text-align: center;
}

.recommendations-card {
  width: 400px;
  max-width: 100%;
  height: 400px;
  margin-top: 54px;
  overflow: visible;
  background: none;
}

.recommendations-card::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 24px;
  background: url("./fondos/recomendaciones fondo.png") top center / cover no-repeat;
  content: "";
}

.itinerary-card {
  width: 400px;
  max-width: 100%;
  height: 455px;
  background-image: url("./fondos/itinerario fondo.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.rsvp-card {
  width: min(100%, 401px);
  max-width: 401px;
  min-height: 382px;
  border-radius: 24px;
  padding: 35px 22px 27px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.18)),
    url("./fondo white.png") center / cover;
}

.rsvp-form-state {
  width: 100%;
}

.card-seal {
  position: absolute;
  top: -36px;
  left: 50%;
  z-index: 2;
  width: 86px;
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 10px rgba(117, 74, 34, 0.28));
}

.recommendations-content {
  position: relative;
  z-index: 1;
}

.script-title {
  font-family: "Meow Script", cursive;
  font-size: 44px;
}

.location-card .script-title {
  margin: 0;
}

.detail-card h2 {
  margin: 0;
  color: #344b38;
  font-size: 24px;
  line-height: 1.22;
  text-transform: uppercase;
}

.location-card h2 {
  font-size: clamp(16px, 4.1vw, 24px);
  white-space: nowrap;
}

.location-copy {
  display: grid;
  gap: 8px;
}

.location-copy p {
  margin: 0;
}

.location-card .location-copy p {
  margin: 0;
}

.location-card .outline-button {
  margin-top: 0;
}

.detail-card p {
  margin: 13px 0 0;
  color: #344b38;
  font-family: "Lora", Georgia, serif;
  font-size: 15px;
  line-height: 1.45;
}

.detail-card .script-title {
  color: var(--gold-text);
  font-family: "Meow Script", cursive;
  font-size: 44px;
  line-height: 1;
}

.outline-button {
  display: inline-grid;
  min-width: 85px;
  min-height: 34px;
  margin-top: 17px;
  place-items: center;
  padding: 7px 16px;
  border: 1px solid #344b38;
  border-radius: 999px;
  color: #344b38;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
}

.recommendations-card .script-title {
  margin-top: 72px;
  margin-bottom: 22px;
}

.itinerary-card .script-title {
  margin-top: 8px;
}

.rings-icon {
  width: 86px;
  height: auto;
  margin-top: 42px;
}

.recommendations-card h2 {
  margin-top: 34px;
  font-size: 17px;
  text-transform: none;
}

.recommendations-card strong {
  display: block;
  margin-top: 18px;
  color: var(--gold-text);
  font-family: "Lora", Georgia, serif;
  font-size: 20px;
  font-weight: 500;
}

.dress-code-copy {
  display: grid;
  gap: 4px;
  margin-top: 26px;
}

.dress-code-copy p {
  margin: 0;
}

.itinerary-list {
  display: grid;
  gap: 19px;
  margin: 31px 0 0;
}

.itinerary-list div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1px;
  align-items: baseline;
  color: #344b38;
  font-size: 22px;
  text-align: left;
}

.itinerary-list dt,
.itinerary-list dd {
  margin: 0;
}

.rsvp-card .script-title {
  font-size: 39px;
}

.rsvp-card h2 {
  margin: 5px 0 28px;
  font-size: 24px;
  text-transform: none;
}

.rsvp-card form {
  width: min(100%, 285px);
  margin: 0 auto;
}

.rsvp-card fieldset {
  display: grid;
  width: 100%;
  gap: 13px;
  margin: 0;
  padding: 0;
  border: 0;
  text-align: left;
}

.rsvp-card legend {
  margin-bottom: 13px;
  color: #344b38;
  font-family: "Lora", Georgia, serif;
  font-size: 15px;
}

.rsvp-card label {
  display: block;
  cursor: pointer;
}

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

.rsvp-card span {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 9px 10px;
  border: 1px solid rgba(52, 75, 56, 0.22);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.76);
  color: #344b38;
  font-family: "Lora", Georgia, serif;
  font-size: 15px;
}

.rsvp-card span::before {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border: 1px solid #344b38;
  border-radius: 999px;
  content: "";
}

.rsvp-card input:checked + span {
  border-color: #344b38;
  box-shadow: inset 0 0 0 1px #344b38;
}

.rsvp-card input:checked + span::before {
  background:
    radial-gradient(circle, #344b38 0 42%, transparent 45%),
    #ffffff;
}

.submit-button {
  width: 100%;
  min-height: 34px;
  margin-top: 25px;
  border: 0;
  border-radius: 999px;
  background: #344b38;
  color: #ffffff;
  cursor: pointer;
  font-size: 13px;
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease,
    transform 120ms ease;
}

.submit-button:hover {
  background: #2b3f2f;
  box-shadow: 0 8px 18px rgba(52, 75, 56, 0.2);
  transform: translateY(-1px);
}

.submit-button:active {
  background: #233427;
  box-shadow: 0 3px 8px rgba(52, 75, 56, 0.16);
  transform: translateY(1px) scale(0.99);
}

.submit-button:focus-visible {
  outline: 3px solid rgba(52, 75, 56, 0.25);
  outline-offset: 3px;
}

.rsvp-note {
  width: min(100%, 285px);
  margin: 26px auto 0;
  font-size: 10px;
}

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

.rsvp-success-state {
  display: grid;
  min-height: 320px;
  align-content: start;
  justify-items: center;
  padding: 48px 12px 24px;
  text-align: center;
}

.success-floral {
  width: 190px;
  height: auto;
  margin-bottom: 22px;
}

.rsvp-success-state h2 {
  margin: 0;
  color: var(--gold-text);
  font-family: "Meow Script", cursive;
  font-size: 44px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.rsvp-success-state p {
  width: min(100%, 315px);
  margin: 20px auto 0;
  color: #344b38;
  font-family: "Lora", Georgia, serif;
  font-size: 17px;
  line-height: 1.45;
}

.experience.is-open .envelope-scene {
  visibility: hidden;
  opacity: 0;
  transition-delay: 620ms;
}

.experience.is-open .first-screen {
  opacity: 1;
  transform: scale(1);
}

.experience.is-open .floral-top {
  animation: floral-top-enter 1100ms var(--entrance-ease) 520ms both;
}

.experience.is-open .floral-bottom {
  animation: floral-bottom-enter 1100ms var(--entrance-ease) 600ms both;
}

.experience.is-open .message-card {
  animation: soft-rise-in 860ms var(--entrance-ease) 760ms both;
}

.experience.is-open .divider {
  animation: soft-rise-in 740ms var(--entrance-ease) 940ms both;
}

.experience.is-open .continue-button {
  animation: soft-rise-in 680ms var(--entrance-ease) 1080ms both;
}

.experience.is-invitation .first-screen {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-12px);
  transition-delay: 0ms;
}

.experience.is-invitation .invitation-screen {
  z-index: 3;
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.experience.is-invitation .detail-floral-top {
  animation: detail-floral-enter 1050ms var(--entrance-ease) 100ms both;
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  transition:
    opacity 720ms ease var(--reveal-delay, 0ms),
    transform 720ms var(--entrance-ease) var(--reveal-delay, 0ms);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.experience.is-open .envelope-triangle {
  animation: none;
  opacity: 0;
  transform: translateX(-50%) translateY(-48%) rotateX(60deg) scaleY(0.76);
}

.experience.is-open .seal {
  animation: none;
  opacity: 0;
  transform: translate(-50%, -45%) scale(0.74) rotate(10deg);
}

@keyframes envelope-settle {
  from {
    opacity: 0;
    transform: scale(1.025);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes envelope-flap-glow {
  0%,
  100% {
    filter:
      drop-shadow(0 22px 18px rgba(58, 52, 43, 0.22))
      drop-shadow(0 2px 1px rgba(255, 255, 255, 0.42));
  }

  50% {
    filter:
      drop-shadow(0 27px 23px rgba(58, 52, 43, 0.27))
      drop-shadow(0 2px 1px rgba(255, 255, 255, 0.48));
  }
}

@keyframes seal-arrive {
  from {
    opacity: 0;
    transform: translate(-50%, -47%) scale(0.88) rotate(-8deg);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(-1deg);
  }
}

@keyframes soft-rise-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes floral-top-enter {
  from {
    opacity: 0;
    transform: translate(-50%, -18%) scale(1.035);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -9%) scale(1);
  }
}

@keyframes floral-bottom-enter {
  from {
    opacity: 0;
    transform: translate(-50%, 18%) rotate(180deg) scale(1.035);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 9%) rotate(180deg) scale(1);
  }
}

@keyframes detail-floral-enter {
  from {
    opacity: 0;
    transform: translate(-50%, -18%) scale(1.04);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -9%) scale(1);
  }
}

@keyframes detail-hero-enter {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-rise-in {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-aspect-ratio: 3 / 4) {
  .envelope-background {
    background-size: auto 100%;
  }

  .envelope-triangle {
    width: 100vw;
    height: 49.4svh;
    min-height: 0;
    background-size: auto 100%;
  }

  .seal {
    top: 50%;
    width: clamp(118px, 39vw, 162px);
  }

  .welcome-block {
    padding-right: 49px;
    padding-left: 49px;
  }

  .floral {
    width: 115.4%;
  }

  .invitation-detail {
    padding-right: 34px;
    padding-left: 34px;
  }

  .detail-floral {
    width: 115.4%;
  }

  .detail-card p {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}
