:root {
  /* Personalización rápida: cambia solo estas variables para cambiar todo el estilo. */
  --ink: #273329;
  --paper: #f8f5ef;
  --paper-dark: #ece5d8;
  --accent: #a76958;
  --accent-dark: #814b3c;
  --line: #d5c7b4;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #d9d0c2; }

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, .4), transparent 25rem),
    linear-gradient(135deg, #c9bdac, #e5ddd0 55%, #c6b8a7);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}

button, a { font: inherit; }
a { color: inherit; }
button { cursor: pointer; }

.book-experience {
  min-height: 100svh;
  padding: clamp(16px, 4vw, 56px);
  display: grid;
  place-items: center;
}

.book-frame {
  width: min(100%, 1100px);
  overflow: hidden;
  border: 1px solid rgba(93, 75, 58, .2);
  border-radius: 4px;
  box-shadow: 0 22px 58px rgba(49, 39, 28, .25), 0 3px 8px rgba(49, 39, 28, .13);
  background: var(--paper);
}

.book-sheet {
  position: relative;
  min-height: min(740px, calc(100svh - 145px));
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(113, 91, 68, .08), transparent 5%, transparent 95%, rgba(113, 91, 68, .07)),
    var(--paper);
  transform-origin: left center;
  perspective: 1800px;
}

.book-sheet::before {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(75, 59, 42, .2) 12%, rgba(75, 59, 42, .2) 88%, transparent);
  box-shadow: 0 0 16px rgba(70, 54, 39, .13);
  content: "";
  pointer-events: none;
}

.book-sheet.is-turning-forward { animation: turn-forward .62s cubic-bezier(.2, .7, .25, 1); }
.book-sheet.is-turning-backward { animation: turn-backward .62s cubic-bezier(.2, .7, .25, 1); }
.book-sheet.is-turning-forward .book-page.is-active { animation: reveal-page-forward .62s cubic-bezier(.2, .7, .25, 1); }
.book-sheet.is-turning-backward .book-page.is-active { animation: reveal-page-backward .62s cubic-bezier(.2, .7, .25, 1); }

.book-page {
  position: relative;
  min-height: inherit;
  padding: clamp(52px, 8vw, 90px) clamp(28px, 8vw, 100px) 62px;
  isolation: isolate;
}

/* Las páginas que no están activas no deben ocupar espacio ni mostrarse. */
.book-page[hidden] { display: none !important; }

.book-page::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(rgba(89, 67, 46, .09) .65px, transparent .65px);
  background-size: 5px 5px;
  content: "";
  opacity: .24;
  pointer-events: none;
}

.page-content { width: min(100%, 900px); margin: 0 auto; }
.narrow-content { max-width: 680px; }
.centered-content { text-align: center; }

.spread-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 470px;
}

.leaf {
  min-width: 0;
  padding: clamp(28px, 5vw, 60px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.leaf + .leaf { border-left: 1px solid rgba(104, 83, 62, .14); }
.leaf-page-number { margin: auto 0 0; color: var(--accent-dark); font-family: var(--serif); font-size: .78rem; letter-spacing: .14em; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; }
h2 { margin-bottom: 22px; font-size: clamp(2.15rem, 5vw, 3.55rem); }
h3 { margin-bottom: 14px; font-size: clamp(1.55rem, 3vw, 2.15rem); }

.cover {
  display: grid;
  place-items: center;
  color: #fbf7ed;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(26, 41, 31, .38), rgba(26, 41, 31, .83)),
    radial-gradient(circle at 18% 10%, #a77d64, transparent 44%),
    radial-gradient(circle at 82% 88%, #596d55, transparent 51%),
    #344536;
}

.cover::after { opacity: .1; }
.cover-content { max-width: 760px; }
.cover .eyebrow { color: #fbf7ed; }
.cover h1 { margin-bottom: 19px; font-size: clamp(4.2rem, 10vw, 8.4rem); letter-spacing: -.055em; }
.cover h1 span { display: inline-block; margin-inline: .06em; color: #e9c9a6; font-style: italic; }
.flourish, .chapter-mark { color: var(--accent); font-size: 2rem; }
.cover .flourish { margin-bottom: 20px; color: #e9c9a6; }
.date { margin-bottom: 2px; font-size: 1.1rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.location { margin-bottom: 34px; }

.countdown {
  width: min(100%, 330px);
  margin: 0 auto 34px;
  padding: 14px 22px;
  border-top: 1px solid rgba(255, 255, 255, .38);
  border-bottom: 1px solid rgba(255, 255, 255, .38);
}

.countdown p, .countdown span { margin: 0; font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.countdown strong { display: block; font-family: var(--serif); font-size: 3.55rem; font-weight: 400; line-height: 1.1; }

.text-link {
  padding: 0 0 5px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .7);
  color: #fff;
  background: transparent;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.text-link:hover, .text-link:focus-visible { color: #e9c9a6; border-color: #e9c9a6; }
.text-link:focus-visible, .nav-button:focus-visible, .button:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }

.story { display: grid; place-items: center; }
.story .leaf-title { color: #fbf7ed; background: var(--ink); text-align: center; }
.story .leaf-title .eyebrow { color: #e9c9a6; }
.story .leaf-title .leaf-page-number, .rsvp .leaf-page-number { color: rgba(255, 250, 241, .65); }
.story .leaf-copy { background: rgba(255, 253, 249, .46); }
.story .chapter-mark, .rsvp .chapter-mark { margin: 16px 0 23px; }
.lead { font-size: clamp(1.08rem, 2.2vw, 1.27rem); line-height: 1.7; }

.details-spread { border: 1px solid var(--line); background: rgba(255, 253, 249, .66); }
.detail-card { min-height: 286px; background: rgba(255, 253, 249, .45); }
.detail-icon { display: block; margin-bottom: 20px; color: var(--accent); font-size: 2.15rem; }
.detail-card a { color: var(--accent-dark); font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-decoration: none; text-transform: uppercase; }
.detail-card a:hover, .detail-card a:focus-visible { text-decoration: underline; }

.guide { background: var(--paper-dark); }
.guide-layout { align-items: stretch; }
.schedule-list { margin: 35px 0 0; padding: 0; list-style: none; }
.schedule-list li { display: grid; grid-template-columns: 74px 1fr; padding: 14px 0; border-top: 1px solid var(--line); }
.schedule-list li:last-child { border-bottom: 1px solid var(--line); }
.schedule-list time { color: var(--accent-dark); font-weight: 800; letter-spacing: .06em; }
.guest-notes { display: grid; gap: 27px; }
.guest-notes article { padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.guest-notes article:last-child { border-bottom: 0; }
.guest-notes h3 { margin-bottom: 12px; }
.guest-notes p:last-child { margin-bottom: 0; }

.rsvp { display: grid; place-items: center; color: #fbf7ed; background: var(--ink); }
.rsvp::after { opacity: .08; }
.rsvp .eyebrow { color: #e9c9a6; }
.rsvp .chapter-mark { color: #e9c9a6; }
.rsvp-spread { min-height: 470px; }
.rsvp-main { text-align: center; }
.rsvp-note { color: #d9d8cf; }
.button { display: inline-block; margin-top: 16px; padding: 15px 28px; color: #fffaf1; background: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-decoration: none; text-transform: uppercase; transition: background .2s ease, transform .2s ease; }
.button:hover { background: #c47b66; transform: translateY(-2px); }

footer { position: absolute; right: clamp(28px, 8vw, 100px); bottom: 52px; left: clamp(28px, 8vw, 100px); color: #d9d8cf; font-size: .76rem; }
footer p { margin: 3px; }

.page-number { position: absolute; right: clamp(24px, 4vw, 46px); bottom: 30px; margin: 0; color: var(--accent-dark); font-family: var(--serif); font-size: .84rem; letter-spacing: .16em; }
.cover .page-number, .rsvp .page-number { color: rgba(255, 250, 241, .65); }

.book-navigation {
  min-height: 70px;
  padding: 13px clamp(18px, 4vw, 40px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  background: #fffdf9;
}

.nav-button { padding: 8px 0; border: 0; color: var(--accent-dark); background: transparent; font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nav-button:last-child { justify-self: end; }
.nav-button:hover:not(:disabled) { color: var(--ink); }
.nav-button:disabled { cursor: default; color: #b9b0a3; }
.page-status { margin: 0; color: #71695e; font-size: .72rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }

@keyframes turn-forward {
  0% { transform: perspective(1800px) rotateY(0deg); filter: brightness(1); }
  42% { transform: perspective(1800px) rotateY(-3.5deg) translateX(-8px); filter: brightness(.88); }
  100% { transform: perspective(1800px) rotateY(0deg); filter: brightness(1); }
}

@keyframes turn-backward {
  0% { transform: perspective(1800px) rotateY(0deg); filter: brightness(1); }
  42% { transform: perspective(1800px) rotateY(3.5deg) translateX(8px); filter: brightness(.88); }
  100% { transform: perspective(1800px) rotateY(0deg); filter: brightness(1); }
}

@keyframes reveal-page-forward {
  0% { opacity: .08; transform: perspective(1500px) rotateY(-8deg) translateX(34px); transform-origin: left center; }
  100% { opacity: 1; transform: perspective(1500px) rotateY(0deg) translateX(0); transform-origin: left center; }
}

@keyframes reveal-page-backward {
  0% { opacity: .08; transform: perspective(1500px) rotateY(8deg) translateX(-34px); transform-origin: right center; }
  100% { opacity: 1; transform: perspective(1500px) rotateY(0deg) translateX(0); transform-origin: right center; }
}

@media (max-width: 700px) {
  .book-experience { padding: 0; place-items: stretch; }
  .book-frame { width: 100%; border: 0; border-radius: 0; box-shadow: none; }
  .book-sheet { min-height: calc(100svh - 70px); }
  .book-sheet::before { display: none; }
  .book-page { min-height: calc(100svh - 70px); padding: 54px 26px 62px; }
  .cover h1 { font-size: clamp(3.7rem, 18vw, 5.5rem); }
  .date { font-size: .84rem; }
  /* En móvil el libro se mantiene abierto: las dos hojas no se apilan. */
  .spread-content { grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: calc(100svh - 70px); }
  .leaf { min-height: calc(100svh - 70px); padding: 42px 16px 30px; }
  .leaf + .leaf { border-top: 0; border-left: 1px solid rgba(104, 83, 62, .14); }
  .spread-content h2 { font-size: clamp(1.55rem, 7vw, 2.2rem); }
  .spread-content h3 { font-size: clamp(1.15rem, 5vw, 1.55rem); }
  .spread-content .eyebrow { font-size: .55rem; letter-spacing: .12em; }
  .spread-content p { font-size: .78rem; line-height: 1.55; }
  .spread-content .lead { font-size: .92rem; line-height: 1.6; }
  .spread-content .chapter-mark { margin: 12px 0 18px; font-size: 1.55rem; }
  .detail-icon { margin-bottom: 12px; font-size: 1.65rem; }
  .detail-card a { font-size: .58rem; letter-spacing: .06em; }
  .schedule-list { margin-top: 22px; }
  .schedule-list li { grid-template-columns: 48px 1fr; padding: 10px 0; font-size: .75rem; }
  .guest-notes { gap: 16px; }
  .guest-notes article { padding-bottom: 16px; }
  .button { padding: 12px 10px; font-size: .58rem; letter-spacing: .07em; }
  .rsvp .leaf { padding-bottom: 76px; }
  .rsvp footer { right: 16px; bottom: 38px; left: 16px; font-size: .58rem; }
  .spread-content .leaf-page-number { font-size: .64rem; }
  .detail-card { min-height: auto; }
  .page-number { right: 24px; bottom: 22px; }
  footer { right: 26px; bottom: 44px; left: 26px; }
  .book-navigation { min-height: 70px; }
}

@media (max-width: 410px) {
  .book-navigation { gap: 9px; padding-inline: 16px; }
  .nav-button, .page-status { font-size: .65rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
