:root {
  color-scheme: light;
  --vino: #621f32;
  --vino-oscuro: #4e1a2a;
  --tinta: #52343b;
  --oro: #a67a42;
  --fondo: #fbefeb;
  --papel: #fff8f3;
  --serif: Baskerville, "Times New Roman", Georgia, serif;
  --sans: system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--fondo); color: var(--tinta); font: 1rem/1.55 var(--sans); }
p, h1, h2, h3 { margin: 0; }
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--vino); outline-offset: 6px; }
.portada {
  position: sticky;
  top: 0;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: center;
  min-height: 100svh;
  padding: 4.55rem clamp(1.45rem, 7.4vw, 1.8rem) 3.75rem;
  background:
    radial-gradient(ellipse at 70% 36%, #fff8f2 0, transparent 58%),
    radial-gradient(ellipse at 13% 2%, #f5d0ce 0, transparent 53%),
    radial-gradient(ellipse at 99% 97%, #efc0c2 0, transparent 55%),
    #fae9e4;
}
.marco {
  position: absolute;
  z-index: -1;
  inset: clamp(13px, 2.1vw, 32px);
  border: 1px solid #b88b56a8;
  outline: 1px solid #b88b5654;
  outline-offset: -5px;
  pointer-events: none;
}
.flores {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  mix-blend-mode: multiply;
  background-size: 100% 100%;
}
.flores-superiores {
  inset: 0 auto auto 0;
  width: clamp(151px, 38vw, 245px);
  aspect-ratio: 310 / 240;
  background-image: url("assets/flores-superiores.jpeg");
  mask-image: radial-gradient(ellipse 103% 92% at 0 2%, #000 49%, #000d 63%, transparent 92%);
  clip-path: polygon(0 0, 100% 0, 100% 58%, 55% 59%, 35% 100%, 0 100%);
}
.flores-inferiores {
  inset: auto 0 0 auto;
  width: clamp(104px, 26vw, 177px);
  aspect-ratio: 225 / 305;
  background-image: url("assets/flores-inferiores.jpeg");
  mask-image: radial-gradient(ellipse 112% 93% at 98% 100%, #000 44%, #000e 63%, transparent 97%);
}
.portada-interior {
  width: min(100%, 71rem);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.4rem;
  align-items: center;
}
.presentacion { text-align: center; color: var(--vino); }
.rotulo {
  font: 600 .875rem/1.4 var(--sans);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--vino);
}
.presentacion h1 {
  font: italic 400 clamp(2.5rem, 12.3vw, 5rem)/.91 var(--serif);
  letter-spacing: -.06em;
  margin: .16em 0 .12em;
}
.apellido { font: 400 1.65rem/1.1 var(--serif); }
.ornamento {
  display: flex;
  width: 8.25rem;
  align-items: center;
  gap: .65rem;
  margin: 1.45rem auto;
  color: var(--oro);
}
.ornamento::before, .ornamento::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor);
}
.ornamento::after { transform: scaleX(-1); }
.ornamento span { width: .43rem; height: .43rem; border: 1px solid currentColor; transform: rotate(45deg); }
.presentacion .ornamento { margin: .95rem auto; }
.fecha-portada { font: 500 .9rem/1.4 var(--sans); letter-spacing: .08em; }
.entrega { display: flex; justify-content: center; }
.abrir {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  width: min(100%, 22rem);
  text-decoration: none;
  border-radius: 5px;
  -webkit-tap-highlight-color: transparent;
}
.escena {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1.62;
  margin-top: .15rem;
}
.sobre {
  position: absolute;
  inset: 0;
  transition: transform .45s ease;
  container-type: inline-size;
}
@media (hover: hover) and (pointer: fine) {
  .abrir:hover .sobre { transform: translateY(-4px) rotate(-1.2deg); }
}
.sobre-fondo, .solapa, .pliegue { position: absolute; inset: 0; display: block; border-radius: 4px; }
.sobre-fondo {
  background: linear-gradient(158deg, #b8727b, #e6b4b6 57%, #b57580);
  box-shadow: 0 24px 49px -12px #7837446b, 0 5px 11px #823f4727;
}
.solapa {
  z-index: 5;
  height: 64%;
  border-radius: 4px 4px 0 0;
  transform-origin: top;
  background: linear-gradient(140deg, #f9ddda, #eebdbe 64%, #dfaaae);
  clip-path: polygon(0 0, 100% 0, 100% 7%, 53% 97%, 50% 100%, 47% 97%, 0 7%);
  transition: transform .65s cubic-bezier(.37, .04, .26, 1), opacity .35s ease .24s;
}
.solapa::before, .solapa::after {
  position: absolute;
  content: "";
  height: 1px;
  width: 57%;
  background: #fceae5b3;
  top: 10%;
  left: 2%;
  transform: rotate(31deg);
  transform-origin: left;
}
.solapa::after { left: auto; right: 2%; transform: rotate(-31deg); transform-origin: right; }
.pliegue { z-index: 3; }
.pliegue-izquierdo {
  background: linear-gradient(122deg, #f7d5d2, #d7a0a7 49%, #cf959d);
  clip-path: polygon(0 3%, 59% 62%, 0 100%);
}
.pliegue-derecho {
  background: linear-gradient(239deg, #f1cbc8, #d6a0a5 62%, #ca8d97);
  clip-path: polygon(100% 3%, 41% 62%, 100% 100%);
}
.pliegue-inferior {
  background: linear-gradient(128deg, #c5848f, #f0bebf 57%, #e6adb1);
  clip-path: polygon(0 100%, 49% 44%, 51% 44%, 100% 100%);
}
.sello {
  position: absolute;
  z-index: 6;
  display: grid;
  place-items: center;
  left: 50%;
  top: 59%;
  width: clamp(3.35rem, 15cqw, 5rem);
  aspect-ratio: 1;
  border-radius: 47% 51% 44% 52% / 49% 46% 53% 45%;
  transform: translate(-50%, -50%) rotate(-8deg);
  background: radial-gradient(circle at 34% 26%, #f7ddb0 0, #d9ad74 48%, #ae7546 78%, #d0a069 100%);
  box-shadow: inset 1px 1px 2px #fff0cf, inset -1px -2px 3px #73422475, 0 5px 9px #68352f55;
  transition: opacity .3s ease, transform .4s ease;
}
.sello span {
  width: 77%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #96603296;
  box-shadow: 0 0 0 1px #f8d9a581, inset 0 0 0 2px #f8d9a551;
  font: italic 600 clamp(1rem, 5.2cqw, 1.7rem)/1 var(--serif);
  letter-spacing: -.09em;
  padding-right: .08em;
  color: #693b28;
  text-shadow: 0 1px #fff1c393;
}
.carta {
  position: absolute;
  z-index: 2;
  inset: 6% 7% 8%;
  display: grid;
  padding: 3%;
  border-radius: 2px;
  background: linear-gradient(145deg, #fff9f0, #f7e2de);
  color: var(--vino);
  box-shadow: 0 10px 22px #79454f4d;
  opacity: 0;
}
.carta-interior {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: .18em;
  border: 1px solid #bc9360a6;
  text-align: center;
}
.carta-rotulo, .carta-fecha { font: 600 clamp(.75rem, 2.6cqw, .95rem)/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.carta-nombre { font: italic 400 clamp(1.6rem, 8.5cqw, 3.4rem)/1.1 var(--serif); }
.esta-abierta .solapa { z-index: 1; opacity: .6; transform: perspective(60rem) rotateX(155deg) scaleY(.25); }
.esta-abierta .sello { opacity: 0; transform: translate(-50%, -66%) rotate(10deg) scale(.82); }
.esta-abierta .carta {
  z-index: 4;
  opacity: 1;
  transform: translateY(-9%);
  animation: sacar-carta .9s cubic-bezier(.25, .65, .35, 1) .22s backwards;
}

@keyframes sacar-carta {
  0% { z-index: 2; opacity: 0; transform: translateY(14%) scale(.94); }
  26% { z-index: 2; opacity: 1; transform: translateY(-10%) scale(.96); }
  48% { z-index: 2; opacity: 1; transform: translateY(-20%) scale(.97); }
  72% { z-index: 4; opacity: 1; transform: translateY(-22%); }
  100% { z-index: 4; opacity: 1; transform: translateY(-9%); }
}

.boton {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: .75rem 1.65rem;
  border: 1px solid var(--vino);
  border-radius: 100px;
  background: var(--vino);
  color: #fff8f5;
  font: 600 .9rem/1.4 var(--sans);
  letter-spacing: .035em;
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}
.abrir:hover .boton, .boton:hover { background: var(--vino-oscuro); }
.boton-secundario { background: transparent; color: var(--vino); }
.boton-secundario:hover { color: #fff8f5; }

.boton-musica {
  position: fixed;
  z-index: 2;
  right: max(.85rem, env(safe-area-inset-right));
  bottom: max(.85rem, env(safe-area-inset-bottom));
  background: #fff8f5;
  color: var(--vino);
  width: 48px;
  height: 48px;
  padding: 0;
  box-shadow: 0 3px 12px #621f3224;
}
.boton-musica:hover { color: #fff8f5; }
.boton-musica::before {
  content: "";
  width: 15px;
  height: 16px;
  background: currentColor;
  clip-path: polygon(18% 0, 100% 50%, 18% 100%);
}
.boton-musica.reproduciendo::before {
  width: 12px;
  background: transparent;
  border-inline: 4px solid currentColor;
  clip-path: none;
}

.invitacion {
  position: relative;
  z-index: 1;
  width: min(calc(100% - .875rem), 62rem);
  margin: 0 auto;
  padding: clamp(3.75rem, 9vw, 7rem) clamp(1.1rem, 5vw, 3.5rem) 4.5rem;
  border: 1px solid #b58b5e85;
  border-bottom: 0;
  border-radius: clamp(1rem, 4vw, 2rem) clamp(1rem, 4vw, 2rem) 0 0;
  background-color: rgb(255 248 244 / 95%);
  box-shadow: 0 -8px 36px #621f321f, inset 0 1px 0 #fff9;
  text-align: center;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .invitacion {
    background-color: rgb(255 248 244 / 82%);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}
.invitacion:focus { outline: none; }
.mensaje h2, .confirmacion h3, .detalles h3, .despedida p {
  font: italic 400 clamp(2.45rem, 6vw, 4.5rem)/1.02 var(--serif);
  color: var(--vino);
  margin: .16em 0;
}
.mensaje > p:not(.rotulo) {
  margin: .9rem auto 0;
  max-width: 35rem;
  font: 400 clamp(1.12rem, 3vw, 1.37rem)/1.48 var(--serif);
}
.fecha-evento {
  max-width: 35rem;
  margin: 3.6rem auto 0;
  padding: 1.75rem .65rem 1.65rem;
  border-block: 1px solid #b58b5e80;
}
.calendario {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: .2rem auto;
  color: var(--vino);
  font: italic 400 clamp(1rem, 4vw, 1.65rem)/1 var(--serif);
}
.calendario strong {
  font: 400 clamp(5.5rem, 15vw, 8rem)/.9 var(--serif);
  border-inline: 1px solid #c29a6880;
  padding: 0 clamp(.75rem, 4vw, 2rem);
}
.hora { margin-top: .65rem; color: var(--vino); font-size: 1rem; }
.detalles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  max-width: 43rem;
  margin: 2.95rem auto;
}
.detalles section { padding: 0 .75rem; }
.detalles section + section { border-top: 1px solid #b58b5e70; padding-top: 1.5rem; }
.detalles h3, .confirmacion h3 { font-size: clamp(1.9rem, 5vw, 2.7rem); margin-bottom: .6rem; }
.detalles .regalo { margin-top: 1.25rem; font-size: clamp(1.45rem, 3.5vw, 2rem); }
.detalles p + .boton, .confirmacion p + .boton { margin-top: .9rem; }
.confirmacion { margin: 0 auto; padding: 0 .5rem; }
.confirmacion .ornamento { margin-bottom: 1.65rem; }
.despedida { margin-top: 3rem; color: var(--vino); }
.despedida p { max-width: 38rem; margin-inline: auto; font-size: clamp(1.6rem, 4vw, 2.35rem); line-height: 1.2; text-wrap: balance; }

@media (min-width: 35em) {
  .detalles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
  .detalles section + section { border-top: 0; border-left: 1px solid #b58b5e70; padding-top: 0; }
}
@media (min-width: 43em) {
  .portada { padding: 5.5rem 6.5vw; }
  .portada-interior { grid-template-columns: minmax(0, 1fr) minmax(0, 1.13fr); gap: clamp(1.25rem, 5vw, 5rem); }
  .presentacion h1 { font-size: clamp(4.5rem, 8.3vw, 8.5rem); line-height: .79; margin: .22em 0 .16em; }
  .presentacion h1 span { display: block; padding-right: .1em; }
  .apellido { font-size: clamp(1.65rem, 3vw, 2.8rem); }
  .presentacion .ornamento { margin: 1.45rem auto; }
  .abrir { width: min(100%, 33rem); gap: 1.65rem; }
  .escena { margin-top: .75rem; }
  .flores-superiores { width: clamp(176px, 29vw, 425px); }
  .flores-inferiores { width: clamp(120px, 20vw, 290px); }
  .esta-abierta .solapa { transform: perspective(60rem) rotateX(155deg) scaleY(.62); }
}
@media (prefers-reduced-motion: reduce) {
  .portada { position: relative; }
  *, *::before, *::after { transition: none !important; }
  .esta-abierta .carta { animation: none; }
}
