/* Acabado del libro: una cubierta y una hoja interior continua. */
.cover-stage {
  background:
    radial-gradient(circle at 50% 42%, rgba(137, 160, 134, .32), transparent 48%),
    radial-gradient(circle at 85% 88%, rgba(184, 144, 80, .16), transparent 34%),
    linear-gradient(145deg, #415d49, #213c2d 72%, #192f25);
}
.book-scene { perspective: 2200px; }
.book {
  transition: transform 1.35s cubic-bezier(.32, .05, .23, 1);
  filter: none;
  will-change: transform;
}
.book.open { transform: translateX(6%) scale(.88); }
.book-back {
  inset: 4px -11px 4px 11px;
  border: 1px solid #9c7c4e;
  background: linear-gradient(90deg, #aa8f68, #f5ead7 12%, #e9d7b8 93%, #a98552);
  box-shadow: 7px 5px 0 rgba(111, 85, 48, .36);
}
.page-block {
  inset: 9px -6px 9px 10px;
  border-radius: 13px 28px 28px 13px;
  background: linear-gradient(90deg, #e5d7bc, #fffaf0 8%, #f8f0e1 95%, #d5c4a6);
  box-shadow: 5px 6px 0 rgba(93, 69, 37, .24), inset -8px 0 14px rgba(108, 81, 44, .11);
}
.inner-leaf {
  position: absolute;
  inset: 0 5px 5px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #c1a574;
  border-radius: 12px 26px 24px 12px;
  background: radial-gradient(circle at 68% 24%, #fffdf7, #f7efdf 85%);
  box-shadow: inset 21px 0 28px rgba(82, 65, 39, .12), inset -7px 0 13px rgba(127, 98, 54, .07);
  transition: transform 1.1s cubic-bezier(.32, .05, .23, 1), filter 1.1s ease;
}
.inner-leaf::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(168, 129, 65, .47);
  border-radius: 7px 18px 17px 6px;
  box-shadow: inset 0 0 0 5px rgba(255, 253, 245, .56), 0 0 0 5px rgba(255, 253, 245, .28);
}
.inner-leaf::after {
  content: "";
  position: absolute;
  inset: 26px;
  border: 1px solid rgba(176, 139, 78, .19);
  border-radius: 3px 13px 12px 3px;
}
.inner-leaf-floral {
  position: absolute;
  width: clamp(120px, 38%, 220px);
  opacity: .58;
  filter: saturate(.9);
  pointer-events: none;
}
.inner-leaf-floral-top { top: -31px; right: -30px; transform: scaleX(-1); }
.inner-leaf-floral-bottom { bottom: -31px; left: -31px; transform: scaleY(-1); }
.inner-leaf-kicker,
.inner-leaf-monogram,
.inner-leaf-date { position: relative; z-index: 1; }
.inner-leaf-kicker {
  color: #997541;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.2px;
  text-transform: uppercase;
}
.inner-leaf-monogram {
  margin: 19px 0;
  color: #334e3c;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(66px, 14vw, 105px);
  font-weight: 600;
  line-height: .9;
  text-shadow: 0 1px rgba(255, 255, 255, .85);
}
.inner-leaf-monogram i { color: #ae8850; font-size: .65em; font-weight: 400; }
.inner-leaf-date { color: #8a703f; font-size: 11px; font-weight: 700; letter-spacing: 2px; }
.book.open .inner-leaf { transform: rotateY(-3deg) translateX(4px); filter: brightness(1.04); }

/* Dos caras de una cubierta rígida para mostrar el reverso durante el giro. */
.book-hinge {
  position: absolute;
  inset: 0;
  z-index: 10;
  transform-origin: 1% 50%;
  transform-style: preserve-3d;
  transition: transform 1.35s cubic-bezier(.32, .05, .23, 1);
  will-change: transform;
}
.book-cover,
.cover-lining { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.book-cover {
  z-index: 2;
  transform: translateZ(1px);
  transition: none;
  border: 2px solid #947547;
  background:
    radial-gradient(ellipse at 59% 39%, rgba(255, 255, 255, .94), transparent 65%),
    #efe5d3;
  box-shadow:
    inset 15px 0 18px rgba(32, 44, 30, .22),
    inset -7px 0 16px rgba(108, 80, 41, .15),
    inset 0 0 0 5px rgba(255, 251, 240, .82),
    2px 7px 13px rgba(19, 35, 24, .18);
}
.book-cover::before,
.book-cover::after,
.book-gilded-corners,
.cover-floral { display: block; }
.book-cover::before {
  inset: 15px 17px 15px 29px;
  border-color: rgba(155, 111, 46, .61);
  box-shadow: 0 0 0 4px rgba(255, 251, 240, .3), inset 0 0 0 1px rgba(255, 255, 255, .64);
}
.book-cover::after { inset: 24px 26px 24px 38px; border-color: rgba(166, 123, 58, .25); }
.approved-cover-frame {
  z-index: 1;
  inset: 3px 3px 3px 22px;
  width: calc(100% - 25px);
  height: calc(100% - 6px);
  object-fit: fill;
  opacity: .92;
  filter: saturate(.85) contrast(1.04);
}
.book-spine {
  z-index: 7;
  width: 31px;
  border-right: 1px solid rgba(214, 181, 115, .72);
  background: linear-gradient(90deg, #142c22, #30513b 40%, #48694d 70%, #1c382a);
  box-shadow: inset -4px 0 7px rgba(8, 30, 17, .25), 7px 0 14px rgba(37, 48, 29, .22);
}
.book-gilded-corners { z-index: 3; opacity: .48; }
.cover-floral {
  z-index: 4;
  width: 176px;
  opacity: .78;
  filter: drop-shadow(0 6px 4px rgba(38, 56, 37, .15));
}
.cover-floral-tl { top: -30px; left: -28px; }
.cover-floral-br { right: -25px; bottom: -28px; transform: scale(-1); }
.cover-floral-tr { top: -49px; right: -42px; width: 128px; opacity: .38; transform: scaleX(-1); }
.cover-floral-bl { bottom: -48px; left: -38px; width: 128px; opacity: .38; transform: scaleY(-1); }
.cover-content { z-index: 6; }
.book-spine { overflow: hidden; }
.spine-band {
  position: absolute;
  left: 2px;
  right: 2px;
  height: 9px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .28), rgba(255, 255, 255, .2) 45%, rgba(0, 0, 0, .29));
  box-shadow: 0 1px rgba(255, 255, 255, .12);
}
.spine-band:first-child { top: 22%; }
.spine-band:last-child { bottom: 22%; }
.cover-grain,
.cover-sheen,
.flip-shadow { position: absolute; inset: 0; pointer-events: none; }
.cover-grain {
  z-index: 2;
  opacity: .25;
  mix-blend-mode: multiply;
  background: radial-gradient(ellipse at 38% 22%, rgba(111, 86, 49, .09), transparent 68%);
}
.cover-sheen {
  z-index: 2;
  opacity: .45;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .44), transparent 31%, transparent 68%, rgba(255, 255, 255, .24)),
    radial-gradient(ellipse at 18% 9%, rgba(255, 255, 255, .38), transparent 48%);
  mix-blend-mode: soft-light;
}
.flip-shadow {
  z-index: 7;
  opacity: 0;
  background: linear-gradient(90deg, rgba(22, 31, 23, .36), rgba(22, 31, 23, .07) 48%, transparent 74%);
}
.book.open .flip-shadow { animation: flip-shadow-sweep 1.35s cubic-bezier(.32, .05, .23, 1) both; }
@keyframes flip-shadow-sweep {
  0%, 100% { opacity: 0; }
  40% { opacity: 1; }
  72% { opacity: .42; }
}
.monogram {
  color: #38533f;
  -webkit-text-fill-color: #38533f;
  text-shadow: 0 1px rgba(255, 253, 246, .82), 0 2px 1px rgba(122, 96, 56, .22);
}
.monogram em { -webkit-text-fill-color: #a47d41; }
.book-scene {
  transform: rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg));
  transition: transform .45s cubic-bezier(.22, 1, .36, 1);
}
.cover-lining {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid #98784b;
  border-radius: 20px 38px 38px 20px;
  background: radial-gradient(circle at 55% 40%, #fbf6e9, #e6d8bf 85%);
  box-shadow: inset -15px 0 24px rgba(65, 56, 34, .18), inset 0 0 0 8px rgba(178, 146, 95, .17);
  transform: rotateY(180deg) translateZ(1px);
}
.cover-lining::before {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(173, 133, 67, .62);
  border-radius: 9px 25px 25px 9px;
}
.cover-lining img { position: absolute; right: -27px; bottom: -32px; width: 210px; opacity: .45; transform: rotate(180deg); }
.cover-lining span { color: rgba(73, 99, 77, .48); font-family: "Cormorant Garamond", serif; font-size: 62px; }
.cover-lining i { color: rgba(167, 128, 70, .7); font-size: .7em; }

/* Papel interior, bordes botánicos y relieve sutil. */
body.book-open {
  background: radial-gradient(circle at 50% 7%, #59735d, #284533 75%, #1f392c);
}
main.visible .page { animation: reveal-paper .65s ease both; }
@keyframes reveal-paper {
  from { opacity: .4; transform: translateY(12px) scale(.988); }
  to { opacity: 1; transform: none; }
}
.page {
  padding: 153px 55px 108px;
  border: 0;
  border-radius: 17px;
  background: radial-gradient(circle at 45% 10%, #fffefa, #f6eedf 86%);
  box-shadow: 0 24px 54px rgba(9, 27, 15, .29);
}
.page::before,
.page::after { content: none; }
.page-botanical-border {
  position: absolute;
  inset: 12px;
  z-index: 0;
  border: solid transparent;
  border-width: 87px 55px 91px;
  border-image-source: url('/assets/approved-cover-frame.webp');
  border-image-slice: 178 136 178 136;
  border-image-repeat: stretch round;
  pointer-events: none;
}
.page > .section-card { position: relative; z-index: 1; }
.section-card {
  border-color: rgba(169, 128, 67, .55);
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(255, 254, 249, .97), rgba(248, 241, 228, .95));
  box-shadow: 0 8px 20px rgba(52, 62, 40, .08), inset 0 1px rgba(255, 255, 255, .9);
}
.section-card::before { border-radius: 8px; }
/* Una marca de agua por bloque, detrás del contenido y lejos de las esquinas. */
.section-card::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 50%;
  right: 5%;
  width: clamp(125px, 29%, 190px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  background: url('/assets/cover-bouquet.svg') center / contain no-repeat;
  opacity: .13;
  pointer-events: none;
}
.section-card:nth-of-type(even)::after {
  right: auto;
  left: 5%;
  transform: translateY(-50%) scaleX(-1);
}
.section-card.hero-card::after {
  top: 98px;
  right: 7%;
  left: auto;
  width: 130px;
  transform: none;
  opacity: .1;
}
.section-card.closing-card::after {
  top: 50%;
  right: 50%;
  left: auto;
  width: min(52%, 240px);
  transform: translate(50%, -50%);
  opacity: .11;
}
.adult-card { background: linear-gradient(135deg, #263f32, #3f5f48); }

@media (max-width: 560px) {
  .book.open { transform: translateX(14%) scale(.65); }
  .book-cover { border-radius: 15px 26px 26px 15px; }
  .book-spine { width: 25px; }
  .book-cover::before { inset: 11px 10px 11px 23px; }
  .book-cover::after { inset: 18px 17px 18px 30px; }
  .approved-cover-frame { inset: 2px 2px 2px 18px; width: calc(100% - 20px); height: calc(100% - 4px); }
  .cover-floral { width: 112px; opacity: .68; }
  .cover-floral-tl { top: -22px; left: -18px; }
  .cover-floral-br { right: -17px; bottom: -22px; }
  .cover-floral-tr { top: -28px; right: -26px; width: 77px; opacity: .31; }
  .cover-floral-bl { bottom: -28px; left: -23px; width: 77px; opacity: .31; }
  .cover-lining { border-radius: 15px 26px 26px 15px; }
  .inner-leaf-kicker { font-size: 8px; letter-spacing: 1.3px; }
  .inner-leaf-date { font-size: 9px; letter-spacing: 1.3px; }
  .page { padding: 105px 31px 78px; }
  .page-botanical-border {
    inset: 9px;
    border-width: 59px 34px 62px;
  }
  .section-card::after { width: 115px; opacity: .1; }
  .section-card.hero-card::after { top: 72px; width: 100px; opacity: .09; }
}
@media (hover: none) { .book-scene { transform: none; } }
@media (max-height: 700px) {
  .cover-floral { opacity: .47; }
  .cover-floral-tr,
  .cover-floral-bl { opacity: .2; }
  .inner-leaf-floral { width: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  .book,
  .book-hinge,
  .inner-leaf { transition: none; }
  .book-scene { transform: none; transition: none; }
  .flip-shadow { display: none; }
  main.visible .page { animation: none; }
}
