:root {
  color-scheme: light;
  --ink: #583629;
  --paper: #fbf1e2;
  --rose: #e5beb8;
  --edge: #ba8580;
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--rose);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
body.sealed { overflow: hidden; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #733b35; outline-offset: 5px; }
.invitation {
  max-width: 43rem;
  margin: 0 auto;
  background: var(--paper);
  text-align: center;
  box-shadow: 0 0 3rem #61382d26;
}
.invitation header, .invitation section { padding: 4rem clamp(1.4rem, 7vw, 5rem); }
.invitation header { padding-top: clamp(3.75rem, 11vh, 8rem); }
.invitation section { border-top: 1px solid #d9b7a3; }
.eyebrow {
  font: 600 .78rem/1.5 system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .24em;
}
h1, h2 { font-weight: 400; }
h1 { font-size: clamp(3.2rem, 11vw, 6rem); font-style: italic; line-height: .98; margin: 1.25rem 0 2rem; }
h1 span { display: block; font-size: .36em; font-style: normal; margin-top: .55em; }
h2 { font-size: clamp(1.8rem, 6vw, 2.5rem); margin: 0 0 1.2rem; }
p { font-size: 1.13rem; line-height: 1.6; max-width: 29rem; margin: .9rem auto; }
.parents { margin-top: 2rem; font-size: 1.02rem; }
.venue { font-weight: bold; }
.action {
  display: inline-block;
  max-width: 100%;
  border: 1px solid var(--edge);
  border-radius: 3px;
  padding: .8rem 1rem;
  margin-top: .5rem;
  background: #f9e5dc;
  color: var(--ink);
  cursor: pointer;
  font: 600 .9rem/1.35 system-ui, sans-serif;
  text-decoration: none;
}
.action:hover { background: #f1d2c8; }
.envelope { width: min(100%, 26rem); margin: 1.6rem auto 0; }
.envelope summary {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  list-style: none;
  border: 1px solid #c69689;
  border-radius: 4px;
  background: #f5dcd2;
  padding: 4rem 1rem 1.25rem;
  cursor: pointer;
  box-shadow: 0 8px 18px #63382c18;
}
.envelope summary::-webkit-details-marker { display: none; }
.flap {
  position: absolute;
  inset: 0 0 auto;
  height: 5rem;
  background: #e1b3a6;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top;
  transition: transform .45s ease;
  z-index: -1;
}
.envelope[open] .flap { transform: scaleY(.2); }
.envelope i { display: block; font-size: 1.45rem; }
.open-label, .close-label { display: block; margin-top: .5rem; font: .9rem/1.4 system-ui, sans-serif; }
.envelope:not([open]) .close-label, .envelope[open] .open-label { display: none; }
.photos { margin-top: .9rem; }
.envelope[open] .photos { animation: lift .45s ease both; }
figure { margin: .8rem 0; padding: .6rem; background: #fffaf0; box-shadow: 0 4px 14px #63382c18; }
figure img { display: block; width: 100%; height: auto; }
figcaption { margin: .55rem 0 .2rem; font-size: .9rem; }
.gifts { background: #f8e4db; }
.cover {
  position: fixed;
  inset: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #e5bcb7;
}
.cover-art {
  position: relative;
  width: min(100%, calc(100svh * 941 / 1672));
  aspect-ratio: 941 / 1672;
}
.cover-art img { display: block; width: 100%; height: 100%; }
.cover-open {
  position: absolute;
  inset: 54% 0 23%;
  width: 100%;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}
.cover-open:focus-visible { outline-offset: -5px; }
.cover-leaf {
  display: none;
  position: absolute;
  inset: 0;
  background: url('portada.webp') center / 100% 100%;
}
.cover.opening { background: transparent; }
.cover.opening img { visibility: hidden; }
.cover.opening .cover-open { display: none; }
.cover.opening .cover-leaf { display: block; }
.cover.opening .left { clip-path: inset(0 50% 0 0); animation: left .85s ease-in-out both; }
.cover.opening .right { clip-path: inset(0 0 0 50%); animation: right .85s ease-in-out both; }
@keyframes left { to { transform: translateX(-85%) rotate(-5deg); opacity: 0; } }
@keyframes right { to { transform: translateX(85%) rotate(5deg); opacity: 0; } }
@keyframes lift { from { transform: translateY(-.6rem); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

html { scroll-behavior: smooth; }
body { background: #e6c1bb; }
.invitation {
  max-width: 47rem;
  background: #faf0e2;
}
.invitation .dedication {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: min(53rem, 100svh);
  padding: clamp(4rem, 10vh, 7rem) clamp(1.6rem, 8vw, 5rem) 3.2rem;
  background: #f8ead8 url('papel.webp') center / cover;
}
.dedication::before {
  content: '';
  position: absolute;
  pointer-events: none;
  inset: 1.05rem;
  border: 1px solid #905c4b45;
}
.dedication .eyebrow { color: #834b46; }
.dedication h1 {
  font-size: clamp(3.65rem, 12vw, 7.5rem);
  white-space: nowrap;
  letter-spacing: -.068em;
}
.dedication h1 span { letter-spacing: .09em; font-size: .28em; text-transform: uppercase; }
.dedication > p:not(.eyebrow) { max-width: 24rem; }
.dedication .parents strong { font-weight: normal; font-style: italic; font-size: 1.13em; }
.page-turn {
  margin-top: 1.9rem;
  padding: .65rem;
  color: #75443d;
  font: 600 .84rem/1.4 system-ui, sans-serif;
  text-decoration-thickness: 1px;
  text-underline-offset: .3rem;
}
.page-turn span { margin-left: .25rem; }
.invitation .event {
  background: #79464a;
  color: #fff1e7;
  padding-top: 3.7rem;
  padding-bottom: 4rem;
}
.event h2 { font-style: italic; }
.date {
  margin: 1.8rem auto 1.5rem;
  padding: .9rem 1rem;
  border-block: 1px solid #e6bdb487;
  width: min(100%, 17rem);
  display: grid;
  gap: .18rem;
  justify-items: center;
}
.date span {
  font: 500 .78rem/1.4 system-ui, sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.date b { font-size: 5.25rem; font-weight: 400; line-height: 1; }
.action { border-radius: 999px; padding: .85rem 1.25rem; }
.event :focus-visible { outline-color: white; }
.invitation .memory { background: #f9eee3; }
.memory > p { max-width: 20rem; }
.envelope summary {
  border-radius: 2px;
  padding: 5rem 1rem 1.4rem;
  background: #eac7bf;
  box-shadow: 0 12px 24px #63382c28;
}
.flap {
  height: 5.9rem;
  border: 1px solid #ae7b71;
  background: linear-gradient(170deg, #f7ded4, #d5a095);
}
.envelope summary i { color: #713d3b; }
.envelope figure {
  padding: .65rem .65rem 1rem;
  border: 1px solid #ead5c7;
  transform: rotate(-1deg);
}
.invitation .gifts { background: #e8c3bd; padding-inline: clamp(1.25rem, 7vw, 4rem); }
.gift-tag {
  position: relative;
  padding: 3.4rem 1.2rem 2.1rem;
  background: #fcf1e1;
  box-shadow: 0 10px 26px #67403526;
  clip-path: polygon(1.5rem 0, calc(100% - 1.5rem) 0, 100% 1.5rem, 100% 100%, 0 100%, 0 1.5rem);
}
.gift-tag::before {
  content: '';
  position: absolute;
  width: .55rem;
  height: .55rem;
  top: 1.2rem;
  left: calc(50% - .275rem);
  border: 1px solid #a77369;
  background: #e8c3bd;
  border-radius: 50%;
}
.cover-open span {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
}
.cover-art.failed img { visibility: hidden; }
.cover-art.failed .cover-open span {
  position: static;
  width: auto;
  height: auto;
  clip-path: none;
  display: inline-block;
  padding: 1rem 1.4rem;
  background: #fcf1e1;
  color: var(--ink);
  border-radius: 999px;
  font: 600 1rem system-ui, sans-serif;
}
@media (max-width: 355px) {
  .dedication h1 { font-size: 3.05rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
.invitation .event {
  background: #e4b9b6;
  color: #583629;
}
.date { border-color: #985a5578; }
.event .action { background: #fbefdf; }
.event .action:hover { background: #f4dfd0; }
.event :focus-visible { outline-color: #733b35; }
.gift-tag::after {
  content: '';
  position: absolute;
  top: .7rem;
  left: calc(50% - .93rem);
  width: 1.95rem;
  height: .65rem;
  transform: rotate(-13deg);
  border-radius: 70% 20% 70% 20%;
  background: linear-gradient(165deg, #d8a29e, #a96868 60%, #d8a29e);
  box-shadow: 0 2px 3px #68403b40;
}
