:root {
  --azul-profundo: #1F3A63;
  --azul-real: #3B5D8F;
  --azul-suave: #C7D9EE;
  --fondo-pagina: #E3ECF5;
  --marfil: #FBF6EC;
  --marfil-sombra: #F1E9D8;
  --oro: #B8944F;
  --texto: #2C3B52;
  --fuente-script: 'Alex Brush', cursive;
  --fuente-display: 'Cormorant Garamond', serif;
  --fuente-cuerpo: 'EB Garamond', serif;
  --fuente-utilidad: 'Jost', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--fuente-cuerpo);
  color: var(--texto);
  background: var(--fondo-pagina);
}

img {
  max-width: 100%;
  display: block;
}

.envelope-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.8rem;
  background: linear-gradient(160deg, var(--azul-profundo), var(--azul-real));
  cursor: pointer;
  transition: opacity 0.6s ease;
}

.envelope-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.envelope {
  position: relative;
  width: clamp(180px, 42vw, 240px);
  aspect-ratio: 3 / 2;
  perspective: 900px;
}

.envelope-body {
  position: absolute;
  inset: 0;
  background: var(--marfil);
  border-radius: 6px;
  box-shadow: 0 25px 55px -20px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 55%;
  background: var(--azul-suave);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform 0.9s ease;
  z-index: 2;
}

.envelope-screen.opening .envelope-flap {
  transform: rotateX(180deg);
}

.envelope-seal {
  width: 32px;
  color: var(--oro);
}

.envelope-text {
  font-family: var(--fuente-utilidad);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--marfil);
}

.site-content {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.site-content.visible {
  opacity: 1;
  transform: translateY(0);
}

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 4rem) 1rem;
  background-image: radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.6) 0%, transparent 45%);
}

.card {
  width: 100%;
  max-width: 640px;
  position: relative;
}

.scallop {
  height: 18px;
  background-image: radial-gradient(circle at 14px 14px, transparent 14px, var(--marfil) 15px);
  background-size: 28px 28px;
  background-repeat: repeat-x;
}

.scallop-top {
  background-position: 0 -6px;
}

.scallop-bottom {
  transform: scaleY(-1);
}

.card-inner {
  background: var(--marfil);
  padding: clamp(2rem, 6vw, 3.5rem);
  box-shadow: 0 30px 60px -30px rgba(31, 58, 99, 0.35);
  text-align: center;
}

.cameo-wrap {
  position: relative;
  width: clamp(160px, 40vw, 210px);
  margin: 0 auto 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rays {
  position: absolute;
  width: 180%;
  height: 180%;
  color: var(--oro);
  opacity: 0.55;
  animation: girar 90s linear infinite;
}

@keyframes girar {
  to { transform: rotate(360deg); }
}

.cameo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 52% 52% 50% 50% / 58% 58% 42% 42%;
  padding: 5px;
  background: var(--azul-real);
  box-shadow: 0 12px 28px -12px rgba(31, 58, 99, 0.45);
}

.cameo-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 52% 52% 50% 50% / 58% 58% 42% 42%;
}

.eyebrow {
  font-family: var(--fuente-utilidad);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--azul-real);
}

.name-script {
  font-family: var(--fuente-script);
  font-size: clamp(3.2rem, 11vw, 4.8rem);
  font-weight: 400;
  color: var(--azul-profundo);
  line-height: 1.1;
  margin-top: 0.4rem;
}

.hero-sub {
  font-family: var(--fuente-display);
  font-style: italic;
  font-size: clamp(1.15rem, 2.6vw, 1.4rem);
  color: var(--azul-real);
  margin-top: 0.2rem;
}

.hero-date {
  font-family: var(--fuente-utilidad);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--texto);
  margin-top: 0.9rem;
}

.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin: 2.4rem 0;
}

.rule::before,
.rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--oro);
  opacity: 0.55;
  max-width: 120px;
}

.rule-icon {
  width: 16px;
  height: 20px;
  color: var(--oro);
}

.phrase {
  font-family: var(--fuente-display);
  font-style: italic;
  font-size: clamp(1.15rem, 2.6vw, 1.4rem);
  line-height: 1.7;
  color: var(--azul-profundo);
}

.phrase-signature {
  font-family: var(--fuente-utilidad);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--azul-real);
  margin-top: 1.1rem;
}

.card-title {
  font-family: var(--fuente-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 4vw, 2rem);
  color: var(--azul-profundo);
  margin-bottom: 1.6rem;
}

.family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.4rem;
}

.family-block {
  border: 1px solid var(--azul-suave);
  border-top: 2px solid var(--oro);
  padding: 1.4rem 1.2rem;
  background: var(--marfil-sombra);
}

.family-names {
  font-family: var(--fuente-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--azul-profundo);
  margin-top: 0.5rem;
  line-height: 1.6;
}

.locations {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  text-align: left;
}

.location {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--azul-suave);
  border-top: 2px solid var(--oro);
}

.location-info {
  padding: 1.4rem 1.3rem;
}

.location-map {
  min-height: 180px;
  position: relative;
}

.location-map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  filter: saturate(0.9) contrast(1.02);
}

.note-label {
  font-family: var(--fuente-utilidad);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oro);
}

.note-place {
  font-family: var(--fuente-display);
  font-size: 1.3rem;
  color: var(--azul-profundo);
  margin-top: 0.4rem;
}

.note-line {
  font-size: 0.9rem;
  color: var(--texto);
  margin-top: 0.15rem;
}

.note-link {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  background: var(--azul-profundo);
  font-family: var(--fuente-utilidad);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--marfil);
  text-decoration: none;
  transition: background 0.2s ease;
}

.note-link:hover {
  background: var(--azul-real);
}

.seals {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(0.4rem, 2.4vw, 1rem);
  flex-wrap: nowrap;
}

.seal {
  width: clamp(56px, 18vw, 78px);
  height: clamp(56px, 18vw, 78px);
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--oro);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--marfil-sombra);
  box-shadow: inset 0 0 0 4px var(--marfil);
}

.seal-value {
  font-family: var(--fuente-display);
  font-weight: 600;
  font-size: clamp(1.05rem, 4vw, 1.5rem);
  color: var(--azul-profundo);
}

.seal-label {
  font-family: var(--fuente-utilidad);
  font-size: clamp(0.5rem, 1.6vw, 0.6rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--azul-real);
}

.calendar-btn {
  margin-top: 1.8rem;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  border: 1px solid var(--oro);
  background: transparent;
  color: var(--azul-profundo);
  font-family: var(--fuente-utilidad);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.calendar-btn:hover {
  background: var(--azul-profundo);
  color: var(--marfil);
}

.scrapbook {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.gallery-item {
  aspect-ratio: 1 / 1;
  background: var(--marfil-sombra);
  border: 1px solid var(--azul-suave);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--azul-suave);
  transform: rotate(-2deg);
}

.gallery-item:nth-child(even) {
  transform: rotate(2deg);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rsvp-sub {
  font-family: var(--fuente-utilidad);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--azul-real);
  margin-top: -1.1rem;
  margin-bottom: 1.6rem;
}

.rsvp-form {
  text-align: left;
}

.field {
  margin-bottom: 1.2rem;
}

.field label {
  display: block;
  font-family: var(--fuente-utilidad);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--azul-profundo);
  margin-bottom: 0.4rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--azul-suave);
  background: var(--marfil-sombra);
  font-family: var(--fuente-cuerpo);
  font-size: 0.95rem;
  color: var(--texto);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--azul-real);
  outline-offset: 1px;
}

.submit-btn {
  width: 100%;
  padding: 0.85rem;
  background: var(--azul-profundo);
  color: var(--marfil);
  border: none;
  font-family: var(--fuente-utilidad);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s ease;
}

.submit-btn:hover {
  background: var(--azul-real);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.form-status {
  margin-top: 0.9rem;
  text-align: center;
  font-family: var(--fuente-utilidad);
  font-size: 0.85rem;
  min-height: 1.2em;
}

.form-status.ok {
  color: #2e7a4f;
}

.form-status.err {
  color: #b3352c;
}

.footer-text {
  font-family: var(--fuente-utilidad);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--azul-real);
}

.music-toggle {
  position: fixed;
  bottom: 1.4rem;
  right: 1.4rem;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--oro);
  background: var(--marfil);
  color: var(--azul-profundo);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 25px -10px rgba(31, 58, 99, 0.4);
  transition: transform 0.2s ease;
}

.music-toggle:hover {
  transform: scale(1.06);
}

.music-toggle.playing svg {
  animation: spin 4s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 560px) {
  .scrapbook {
    grid-template-columns: repeat(2, 1fr);
  }
  .location {
    grid-template-columns: 1fr;
  }
  .location-map {
    min-height: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .music-toggle.playing svg,
  .rays {
    animation: none;
  }
}
