:root {
  --blue: #8aa7bc;
  --blue-deep: #6e8ca3;
  --blue-soft: #c5d4e0;
  --cream: #f6f1e8;
  --ivory: #fbf8f2;
  --gold: #b08d57;
  --gold-soft: #d4bc8b;
  --ink: #3d4a55;
  --muted: #6d7a85;
  --sage: #9aab90;
  --shadow: 0 24px 60px rgba(61, 74, 85, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: #e8eef2;
  line-height: 1.55;
}

img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }

.page-shell {
  width: min(430px, 100%);
  margin: 0 auto;
  min-height: 100svh;
  background: var(--ivory);
  position: relative;
  overflow-x: hidden;
}

/* Envelope */
.envelope-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: #111;
}

.envelope-screen.is-open {
  pointer-events: none;
}

.envelope-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05) brightness(.78);
  transform: scale(1.04);
}

.envelope-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,24,28,.22), rgba(20,24,28,.5));
}

.envelope-stage {
  position: relative;
  z-index: 2;
  width: min(92vw, 400px);
  display: grid;
  justify-items: center;
  gap: 28px;
  padding: 0 12px;
}

.guest-line {
  margin: 0;
  max-width: 16ch;
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.45rem, 6.4vw, 1.85rem);
  line-height: 1.25;
  color: #f4ead6;
  text-shadow: 0 8px 24px rgba(0,0,0,.45);
}

.envelope {
  position: relative;
  display: block;
  width: 100%;
  height: 0;
  padding-bottom: 64.6%;
  border: 0;
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  transform-origin: center 42%;
  filter: drop-shadow(0 22px 28px rgba(0,0,0,.42));
}

.env-photo {
  position: absolute;
  left: -1.4%;
  top: -1.4%;
  width: 102.8%;
  height: 102.8%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.hint {
  margin: 0;
  text-align: center;
  color: rgba(246,241,232,.82);
  letter-spacing: .28em;
  text-transform: uppercase;
  font-size: 11px;
}

.envelope-screen.is-opening .envelope {
  animation: envelopeReveal 1.2s cubic-bezier(.22, .61, .36, 1) forwards;
}

.envelope-screen.is-opening .guest-line,
.envelope-screen.is-opening .hint {
  animation: fadeRise .55s ease forwards;
}

.envelope-screen.is-opening .envelope-bg {
  animation: photoWake 1.15s ease forwards;
}

.envelope-screen.is-opening::after {
  animation: veilLift .9s ease forwards;
}

.envelope-screen.is-open {
  animation: overlayOut .45s ease forwards;
}

@keyframes envelopeReveal {
  0% {
    transform: scale(1) translateY(0);
    filter: drop-shadow(0 22px 28px rgba(0,0,0,.42)) blur(0);
    opacity: 1;
  }
  16% {
    transform: scale(.98) translateY(6px);
  }
  100% {
    transform: scale(1.18) translateY(-36px);
    filter: drop-shadow(0 8px 18px rgba(0,0,0,.18)) blur(12px);
    opacity: 0;
  }
}

@keyframes fadeRise {
  to {
    opacity: 0;
    transform: translateY(-14px);
  }
}

@keyframes photoWake {
  to {
    filter: grayscale(1) contrast(1.05) brightness(1);
    transform: scale(1);
  }
}

@keyframes veilLift {
  to { opacity: 0; }
}

@keyframes overlayOut {
  to { opacity: 0; visibility: hidden; }
}

body.is-locked { overflow: hidden; height: 100svh; }

/* Invitation */
.invitation {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.045);
  transition: opacity 1.05s ease, transform 1.2s cubic-bezier(.22, .61, .36, 1);
}

.invitation.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-copy {
  position: relative;
  padding: 48px 28px 56px;
  background: linear-gradient(180deg, transparent, rgba(20, 24, 28, .72) 42%, rgba(20, 24, 28, .9));
  text-align: center;
}

.kicker {
  font-size: 11px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin: 0 0 14px;
}

.script {
  font-family: "Great Vibes", cursive;
  font-weight: 400;
}

.serif {
  font-family: "Cormorant Garamond", serif;
}

.hero h1 {
  font-family: "Great Vibes", cursive;
  font-size: clamp(3.2rem, 14vw, 4.6rem);
  font-weight: 400;
  margin: 0;
  line-height: .9;
}

.amp {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  color: var(--gold-soft);
  font-size: 2.4rem;
  margin: 4px 0;
}

.quote {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.15rem;
  margin: 0 0 18px;
}

.section {
  padding: 96px 28px;
  text-align: center;
}

.section + .photo-break { margin-top: 0; }

.section h2 {
  font-family: "Great Vibes", cursive;
  font-size: clamp(3.2rem, 14vw, 4.6rem);
  font-weight: 400;
  margin: 0;
  line-height: .9;
}
}

.ornament {
  width: 84px;
  height: 18px;
  margin: 0 auto 18px;
}

.lead {
  color: var(--muted);
  margin: 0 auto;
  max-width: 32ch;
}

.countdown {
  background:
    linear-gradient(180deg, rgba(251,248,242,.92), rgba(246,241,232,.94)),
    url("../assets/hydrangeas.svg") center/280px repeat;
}

.timer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 28px;
}

.timer div {
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(176, 141, 87, .22);
  border-radius: 16px;
  padding: 16px 4px 14px;
}

.timer b {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
  font-weight: 500;
  color: var(--gold);
}

.timer span {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.photo-break {
  margin: 0;
}

.photo-break img {
  width: 100%;
  height: min(78vh, 620px);
  object-fit: cover;
}

.event-card {
  background: #fff;
  border-radius: 28px 28px 22px 22px;
  padding: 8px 8px 32px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.event-card img {
  height: 240px;
  width: 100%;
  object-fit: cover;
  border-radius: 22px;
}

.time {
  font-family: "Cormorant Garamond", serif;
  font-size: 3rem;
  margin: 22px 0 0;
  line-height: 1;
}

.time small {
  display: block;
  font-size: 1rem;
  letter-spacing: .28em;
  color: var(--gold);
}

.place {
  font-family: "Great Vibes", cursive;
  margin: 18px 0 8px;
  font-size: clamp(2rem, 5vw, 2.5rem);
  font-weight: 600;
}

.address {
  font-family: "Cormorant Garamond", serif;
  color: var(--muted);
  font-size: .95rem;
  margin: 0 0 22px;
}

.map-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  text-decoration: none;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: 11px;
}

.info-grid {
  display: grid;
  gap: 18px;
}

.dress-section {
  padding-top: 48px;
}

.silhouettes {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 18px;
  margin-bottom: -42px;
  position: relative;
  z-index: 2;
  color: var(--ink);
}

.silhouette {
  width: 42%;
  max-height: 168px;
}

.silhouette-bride { color: var(--blue-deep); }
.silhouette-groom { color: #2b333a; }

.dress-card {
  position: relative;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(246,241,232,.96)),
    var(--cream);
  border: 1px solid rgba(176, 141, 87, .22);
  border-radius: 28px;
  padding: 56px 24px 32px;
  box-shadow: var(--shadow);
}

.dress-script {
  font-family: "Great Vibes", cursive;
  font-size: 2.1rem;
  color: var(--gold);
  margin: 0 0 2px;
}

.dress-card h2 {
  margin-top: 0;
}

.dress-copy {
  margin-bottom: 22px;
}

.palette-label {
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}

.palette {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink);
}

.swatch i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: block;
  box-shadow: 0 4px 10px rgba(61,74,85,.12);
}

.swatch-white i {
  background: #fff;
  border: 1px solid #d9e0e6;
}

.swatch-beige i { background: #e6d5b8; }
.swatch-blue i { background: #c5d4e0; }

.gifts-section {
  background:
    linear-gradient(180deg, rgba(251,248,242,.92), rgba(246,241,232,.96)),
    url("../assets/hydrangeas.svg") center/280px repeat;
  overflow: hidden;
}

.gift-scene {
  width: 220px;
  height: 220px;
  margin: 36px auto 18px;
  perspective: 900px;
}

.gift-cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-12deg) rotateY(-18deg);
  transition: transform .7s cubic-bezier(.22, .61, .36, 1);
  cursor: grab;
  touch-action: none;
}

.gift-cube.is-dragging {
  cursor: grabbing;
  transition: none;
}

.gift-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  padding: 18px;
  backface-visibility: hidden;
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: inset 0 0 0 6px rgba(176, 141, 87, .18);
}

.gift-front,
.gift-back {
  background: linear-gradient(160deg, #8aa7bc, #6e8ca3);
  color: #f7f4ee;
}

.gift-left,
.gift-right {
  background: linear-gradient(160deg, #f6f1e8, #efe6d6);
  color: var(--ink);
}

.gift-top { background: #d4c4a8; }
.gift-bottom { background: #8aa7bc; }

.gift-front { transform: translateZ(110px); }
.gift-back { transform: rotateY(180deg) translateZ(110px); }
.gift-right { transform: rotateY(90deg) translateZ(110px); }
.gift-left { transform: rotateY(-90deg) translateZ(110px); }
.gift-top { transform: rotateX(90deg) translateZ(110px); }
.gift-bottom { transform: rotateX(-90deg) translateZ(110px); }

.gift-face b {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.7rem;
  font-weight: 500;
}

.gift-face small {
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: 10px;
}

.gift-face a {
  margin-top: 8px;
  color: var(--gold);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.gift-bow-icon {
  width: 56px;
  height: 28px;
  margin: 0 auto 6px;
  color: #f7f4ee;
}

.gift-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.gift-nav button {
  border: 1px solid rgba(176, 141, 87, .35);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 18px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 11px;
  cursor: pointer;
}

.info-card {
  background: var(--blue);
  color: #f7f4ee;
  border-radius: 22px;
  padding: 36px 24px;
}

.info-card h3 {
  margin: 0 0 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
}

.info-card p { margin: 0; color: rgba(255,255,255,.88); }

.gallery {
  display: grid;
  gap: 10px;
  padding: 0 18px 24px;
}

.gallery img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 18px;
}

.gallery img:nth-child(odd) { height: 340px; }

.form-section {
  background: var(--cream);
}

form {
  display: grid;
  gap: 14px;
  text-align: left;
  margin-top: 28px;
}

label span {
  display: block;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--muted);
}

input, textarea, select {
  width: 100%;
  border: 1px solid #d9e0e6;
  background: #fff;
  border-radius: 12px;
  padding: 13px 14px;
}

textarea { min-height: 110px; resize: vertical; }

.choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.choice label {
  border: 1px solid #d9e0e6;
  background: #fff;
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  font-size: 13px;
}

.choice input { display: none; }

.choice label:has(input:checked) {
  border-color: var(--gold);
  background: #f4ecdd;
  color: var(--gold);
}

.hidden { display: none !important; }

#asistencia-si:not(.hidden) {
  display: grid;
  gap: 14px;
}

.submit {
  border: 0;
  background: var(--blue-deep);
  color: #fff;
  border-radius: 999px;
  padding: 14px 18px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: 12px;
  cursor: pointer;
}

.form-msg {
  min-height: 1.4em;
  font-size: 14px;
  text-align: center;
}

.form-msg.ok { color: #2f6b4f; }
.form-msg.err { color: #9a4a4a; }

.footer {
  padding: 72px 28px 48px;
  text-align: center;
  background: #fff;
}

.footer .script {
  font-size: 3rem;
  margin: 0;
}

.footer p { color: var(--muted); }

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s ease, transform .9s ease;
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

.audio-toggle {
  position: fixed;
  right: max(16px, calc(50vw - 199px));
  bottom: 22px;
  z-index: 80;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: rgba(110, 140, 163, 0.94);
  color: #fff;
  box-shadow: 0 10px 28px rgba(61, 74, 85, 0.28);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.audio-toggle svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.audio-toggle .icon-off { display: none; }
.audio-toggle.is-off .icon-on { display: none; }
.audio-toggle.is-off .icon-off { display: block; }

@media (min-width: 900px) {
  body { background: #dfe7ee; }
  .page-shell {
    box-shadow: 0 0 0 12px rgba(255,255,255,.4), var(--shadow);
    margin: 24px auto 48px;
    border-radius: 28px;
  }
  .envelope-screen { border-radius: 0; }
}
