:root {
  --texture: url('Images/Old-Mill-Premium-White.jpg');
  --aggressive-shadow: drop-shadow(-15px 0 15px rgba(0, 0, 0, 0.45));
  --title-gold: linear-gradient(135deg, #d4af37 0%, #f3e1ad 25%, #c5a028 50%, #f3e1ad 75%, #b8860b 100%);
  --paper: #f7f5ef;
  --ink: #24211d;
  --soft-ink: #6b665f;
  --line: rgba(36, 33, 29, 0.22);
}

* {
  box-sizing: border-box;
}

.content-en,
.content-es {
  display: none;
}

.lang-en .content-en,
.lang-es .content-es {
  display: block;
}

body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: var(--paper);
  background-image: var(--texture);
  background-attachment: fixed;
  overflow-x: hidden;
  overflow-y: hidden;
  scroll-behavior: smooth;
}

body {
  opacity: 1;
  transition: opacity 220ms ease;
}

body.is-loading {
  opacity: 0;
}

body:has(.is-open),
body.invitation-open {
  overflow-y: auto;
}

.envelope-wrapper {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 2000px;
  cursor: pointer;
  outline: none;
}

.envelope-wrapper:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(36, 33, 29, 0.45);
}

.is-open {
  pointer-events: none;
}

.envelope {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
  transition: transform 1.5s ease-in-out 0.8s;
  transform-style: preserve-3d;
}

.envelope-back {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: #fff;
  background-image: var(--texture);
  box-shadow: 0 50px 100px rgba(0, 0, 0, 0.6);
  z-index: 0;
}

.card-container {
  position: absolute;
  top: 5%;
  width: 100%;
  height: 85%;
  z-index: 1;
  transition: transform 1.5s ease-in-out 0.8s, z-index 0s step-end 0.8s;
}

.inside-card {
  width: 100%;
  height: 100%;
  object-fit: cover;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

@keyframes bounce-v {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-15px);
  }

  60% {
    transform: translateY(-7px);
  }
}

.scroll-hint-anchor {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  z-index: 210;
  transition: opacity 1s ease 2.5s;
}

.is-open .scroll-hint-anchor {
  opacity: 0.85;
}

.scroll-hint {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.is-open .scroll-hint {
  animation: bounce-v 2s infinite;
}

.scroll-hint::before,
.scroll-hint::after {
  content: '';
  position: absolute;
  width: 45px;
  height: 4px;
  background-color: #000;
  border-radius: 2px;
  filter: drop-shadow(0 0 10px #000) drop-shadow(0 0 20px #000) drop-shadow(0 0 40px #000);
}

.scroll-hint::before {
  transform: translateX(-20px) rotate(25deg);
}

.scroll-hint::after {
  transform: translateX(20px) rotate(-25deg);
}

@keyframes hint {
  0%,
  100% {
    transform: translate(-50%, -50%) rotateY(0deg);
  }

  5% {
    transform: translate(-50%, -50%) rotateY(15deg) scale(1.08);
  }
}

.wax-seal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 128px;
  height: 120px;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 250, 207, 0.95) 0 14%, transparent 34%),
    linear-gradient(135deg, #c99b35 0%, #fff2ae 29%, #aa7b22 55%, #f1d06a 76%, #9b6b18 100%);
  border-radius: 45% 55% 47% 53% / 54% 45% 55% 46%;
  box-shadow: 8px 14px 24px rgba(0, 0, 0, 0.42), inset -8px -10px 16px rgba(99, 67, 12, 0.38), inset 6px 7px 12px rgba(255, 255, 226, 0.52);
  border: 1px solid rgba(255, 252, 210, 0.6);
  animation: hint 2.5s ease-in-out infinite;
}

.wax-seal::before {
  content: '';
  position: absolute;
  width: 82%;
  height: 82%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, rgba(255, 249, 184, 0.72), transparent 38%),
    linear-gradient(145deg, #ecd56e 0%, #b88925 54%, #e5c15c 100%);
  box-shadow: inset 8px 9px 16px rgba(70, 46, 7, 0.42), inset -5px -6px 12px rgba(255, 245, 177, 0.45);
  z-index: -1;
}

.wax-seal::after {
  content: '';
  position: absolute;
  width: 70%;
  height: 70%;
  border: 1px solid rgba(45, 31, 6, 0.26);
  border-radius: 50%;
}

.monogram-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transform: rotate(-3deg) translate(-1px, -1px);
  overflow: visible;
}

.monogram {
  font-family: 'Great Vibes', cursive;
  color: #211704;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 0;
  width: 88px;
  font-weight: 400;
  padding: 12px;
  white-space: nowrap;
  letter-spacing: 0;
  text-shadow: 0 1px 1px rgba(255, 246, 178, 0.35), 0 -1px 1px rgba(39, 25, 3, 0.36), 1px 2px 3px rgba(0, 0, 0, 0.26);
  transform: scaleX(0.72);
  transform-origin: center;
  opacity: 0.92;
}

.monogram span {
  font-size: 36px;
  line-height: 0.86;
  font-style: normal;
}

.monogram-d {
  transform: translateX(4px);
}

.monogram-j {
  font-size: 34px;
  transform: translateX(-4px);
}

.monogram small {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  margin: 0 1px;
  transform: translateY(-5px);
}

.flap-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.flap {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: var(--texture);
  background-size: cover;
}

.top-wrap {
  z-index: 2;
}

.top-flap {
  clip-path: polygon(0 0, 100% 0, 50% 50%);
  filter: brightness(95%);
}

.bottom-wrap {
  z-index: 2;
}

.bottom-flap {
  clip-path: polygon(0 100%, 100% 100%, 50% 50%);
  filter: brightness(98%);
}

.left-wrap {
  z-index: 3;
  filter: drop-shadow(2px 0 5px rgba(0, 0, 0, 0.25));
}

.left-flap {
  clip-path: polygon(0 0, 50% 50%, 0 100%);
  filter: brightness(92%);
}

.right-wrap {
  z-index: 4;
  filter: var(--aggressive-shadow);
  transition: transform 0.8s ease-in-out;
  transform-origin: right center;
}

.right-flap {
  clip-path: polygon(100% 0, 50% 50%, 100% 100%);
  background-color: #fff;
  position: relative;
}

.wedding-content {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 72px 22px 96px;
  color: var(--ink);
  font-family: 'Cormorant Garamond', Georgia, serif;
  text-align: center;
}

.invitation-section {
  padding: 42px 0;
}

.overline,
.ceremony-label,
.venue,
.location,
.schedule-text,
.block-heading,
.statement,
.invitation-copy,
.rsvp-form,
.text-button {
  letter-spacing: 0.14em;
}

.overline {
  margin: 0 0 14px;
  font-size: clamp(1.15rem, 4vw, 1.6rem);
  text-transform: uppercase;
}

.ceremony-label {
  margin: 0 0 20px;
  font-size: clamp(0.95rem, 3vw, 1.2rem);
  text-transform: uppercase;
}

.date-mark {
  margin: 0;
  font-size: clamp(2rem, 10vw, 4.3rem);
  font-weight: 500;
  letter-spacing: 0.12em;
}

.ornament {
  width: 120px;
  height: 22px;
  margin: 12px auto 42px;
  position: relative;
}

.ornament::before,
.ornament::after {
  content: '';
  position: absolute;
  top: 11px;
  width: 52px;
  height: 1px;
  background: var(--line);
}

.ornament::before {
  left: 0;
}

.ornament::after {
  right: 0;
}

.ornament {
  background:
    radial-gradient(circle at center, var(--ink) 0 3px, transparent 4px),
    radial-gradient(circle at 46% 50%, var(--ink) 0 2px, transparent 3px),
    radial-gradient(circle at 54% 50%, var(--ink) 0 2px, transparent 3px);
}

.invitation-copy,
.statement {
  max-width: 520px;
  margin: 0 auto 42px;
  font-size: clamp(1.15rem, 4.6vw, 1.65rem);
  line-height: 1.45;
  text-transform: uppercase;
}

.photo-placeholder {
  width: 100%;
  background:
    linear-gradient(rgba(247, 245, 239, 0.52), rgba(247, 245, 239, 0.52)),
    var(--texture);
  border: 1px solid rgba(36, 33, 29, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(36, 33, 29, 0.5);
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.photo-frame,
.slideshow,
.wedding-photo {
  box-shadow: 0 18px 42px rgba(36, 33, 29, 0.08);
}

.photo-frame,
.slideshow {
  width: 100%;
  margin: 0;
  padding: clamp(10px, 3vw, 18px);
  border: 1px solid rgba(36, 33, 29, 0.12);
  background:
    linear-gradient(rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.62)),
    var(--texture);
}

.wedding-photo {
  display: block;
  width: 100%;
  border: 1px solid rgba(36, 33, 29, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.36);
  object-fit: cover;
  object-position: center;
}

.hero-photo {
  aspect-ratio: 4 / 5;
}

.wide-photo {
  aspect-ratio: 16 / 10;
}

.wide-frame {
  margin-bottom: 46px;
}

.portrait-photo {
  width: min(100%, 520px);
  aspect-ratio: 4 / 5;
  margin: 0 auto 44px;
}

.slideshow {
  position: relative;
  width: min(100%, 620px);
  margin: 0 auto;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: clamp(10px, 3vw, 18px);
  opacity: 0;
  transition: opacity 1600ms ease;
  z-index: 0;
}

.slide.is-active {
  opacity: 1;
  position: relative;
  inset: auto;
  z-index: 1;
}

.slideshow-photo {
  aspect-ratio: 4 / 5;
  min-height: 360px;
}

.slide-button {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(36, 33, 29, 0.18);
  border-radius: 999px;
  background: rgba(247, 245, 239, 0.82);
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.slide-prev {
  left: 14px;
}

.slide-next {
  right: 14px;
}

.slide-counter {
  margin: 16px 0 0;
  color: var(--soft-ink);
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.script-heading {
  margin: 0 0 18px;
  color: var(--ink);
  font-family: 'Great Vibes', cursive;
  font-size: clamp(3rem, 13vw, 5.5rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.95;
}

.block-heading {
  margin: 0 0 24px;
  font-size: clamp(1.45rem, 5.4vw, 2.2rem);
  font-weight: 600;
  text-transform: uppercase;
}

.venue {
  margin: 0 0 12px;
  font-size: clamp(1.45rem, 5vw, 2.3rem);
  font-weight: 700;
  text-transform: uppercase;
}

.location,
.schedule-text {
  margin: 0 0 12px;
  color: var(--soft-ink);
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  text-transform: uppercase;
}

.text-button,
.rsvp-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 16px;
  padding: 12px 24px;
  border: 0;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 500;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
}

.countdown-grid div {
  min-width: 0;
}

.countdown-grid strong {
  display: block;
  font-size: clamp(1.65rem, 8vw, 3.5rem);
  font-weight: 400;
  line-height: 1;
}

.countdown-grid span {
  display: block;
  margin-top: 10px;
  color: var(--soft-ink);
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: clamp(0.52rem, 2.1vw, 0.72rem);
  text-transform: uppercase;
}

.timeline {
  position: relative;
  width: min(100%, 440px);
  margin: 20px auto 0;
  padding: 8px 0;
  text-align: left;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 42%;
  width: 1px;
  background: var(--ink);
}

.timeline-item {
  display: grid;
  grid-template-columns: 34% 1fr;
  gap: 18%;
  align-items: center;
  min-height: 88px;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 42%;
  top: 50%;
  width: 10px;
  height: 10px;
  background: var(--ink);
  border-radius: 999px;
  transform: translate(-45%, -50%);
}

.timeline-icon {
  justify-self: center;
  font-size: 2rem;
  line-height: 1;
}

.timeline-item strong {
  display: block;
  font-size: 1.3rem;
  letter-spacing: 0.06em;
}

.timeline-item p {
  margin: 2px 0 0;
  color: var(--soft-ink);
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.narrative {
  max-width: 560px;
  margin: 0 auto 20px;
  color: var(--soft-ink);
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.8;
}

.small-note {
  text-transform: uppercase;
}

.rsvp-form {
  display: grid;
  gap: 18px;
  justify-items: center;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.rsvp-form .rsvp-input {
  box-sizing: border-box;
  display: block;
  width: min(100%, 420px);
  max-width: 100%;
  min-height: 48px;
  appearance: none;
  -webkit-appearance: none;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  letter-spacing: inherit;
  text-align: center;
}

.is-hidden {
  display: none !important;
}

.field-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.rsvp-form input[type="checkbox"],
.rsvp-form input[type="radio"] {
  width: 26px;
  height: 26px;
  margin: 0;
  accent-color: var(--ink);
}

.rsvp-options {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.rsvp-options label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.rsvp-choice-group {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 12px 22px;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
}

.rsvp-choice-group legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--ink);
}

.rsvp-form button {
  margin-top: 4px;
}

.rsvp-form button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.form-message {
  min-height: 1.4em;
  margin: 0;
  color: var(--soft-ink);
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thank-you-screen {
  width: min(100%, 620px);
  margin: 24px auto 0;
  padding: clamp(28px, 7vw, 48px);
  border: 1px solid rgba(36, 33, 29, 0.12);
  background:
    linear-gradient(rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.58)),
    var(--texture);
  box-shadow: 0 18px 42px rgba(36, 33, 29, 0.08);
}

.is-open .right-wrap {
  transform: rotateY(180deg);
}

.is-open .wax-seal {
  animation: none;
}

.is-open .envelope {
  transform: translateX(-150vw);
}

.is-open .card-container {
  transform: translateX(150vw);
  z-index: 100;
}

@media (max-width: 560px) {
  .wedding-content {
    padding: 54px 18px 78px;
  }

  .invitation-section {
    padding: 34px 0;
  }

  .timeline::before,
  .timeline-item::before {
    left: 39%;
  }

  .timeline-item {
    grid-template-columns: 30% 1fr;
    gap: 18%;
  }

  .text-button,
  .rsvp-form button {
    width: min(100%, 260px);
  }
}

@media (min-width: 760px) {
  .envelope-wrapper {
    background:
      linear-gradient(rgba(247, 245, 239, 0.28), rgba(247, 245, 239, 0.28)),
      var(--texture);
  }

  .envelope {
    width: min(92vw, 460px);
    height: auto;
    aspect-ratio: 1429 / 2000;
  }

  .envelope-back {
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
  }

  .is-open .envelope {
    transform: translateX(-140vw);
  }

  .is-open .card-container {
    transform: translateX(140vw);
  }
}
