* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root {
  color-scheme: dark;
  --plata: #edf0f6;
  --cinta: linear-gradient(#1e57c1, #0a2d77 62%, #081f50);
  --adorno: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%23d3d9e2%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%3E%3Cpath%20d%3D%22M2%2014V2h12M5%2019C12%206%2022%2010%2030%203M6%2016c9%203%2012%200%2017-3M11%2011C11%206%2015%203%2020%202M7%2016C5%2023%204%2027%202%2029%22%2F%3E%3Cpath%20fill%3D%22%23a6b3c9%22%20d%3D%22M14%209q5-6%2013-5-6%205-13%205m-6%208q6-3%2010-2-4%205-10%202m-3%204q-4%204-3%208%204-4%203-8%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
  --fibra: repeating-linear-gradient(129deg, #ffffff05 0 1px, transparent 1px 4px), repeating-linear-gradient(41deg, #00000010 0 1px, transparent 1px 3px);
  --separador: linear-gradient(90deg, transparent, #c4cfdf 44%, #c4cfdf 56%, transparent);
}
body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(5px, 2vw, 22px);
  background: radial-gradient(ellipse at top, #1f242e, #08090b 74%);
  color: var(--plata);
  font-family: Georgia, 'Times New Roman', serif;
}
.libro {
  width: min(100%, 430px);
  position: relative;
  perspective: 1300px;
  border: 1px solid #7c838f;
  border-radius: 15px 23px 23px 15px;
  background: #0e1015;
  box-shadow: 0 0 0 2px #292e37, 0 18px 50px #000b;
}
.pagina {
  position: relative;
  isolation: isolate;
  min-height: min(730px, 83svh);
  padding: 40px clamp(29px, 8vw, 47px) 33px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  touch-action: pan-y;
  transform-origin: left center;
  border-radius: 14px 22px 2px 3px;
  background:
    var(--fibra),
    linear-gradient(90deg, #000a 0%, #778ba42e 2%, transparent 6%),
    radial-gradient(ellipse at 64% 0%, #2160db 0%, #123a90 23%, #101e40 48%, #101115 76%);
}
.pagina::before, .pagina::after { content: ''; position: absolute; pointer-events: none; }
.pagina::before {
  z-index: -1;
  inset: 16px 13px 12px 15px;
  border: 3px double #c5ccd7;
  border-radius: 12px 11px 11px 10px;
  box-shadow: inset 0 0 0 3px #162744, inset 0 0 0 4px #3f78df;
  background: var(--adorno) 1px 1px / 38px 38px no-repeat;
}
.pagina::after {
  z-index: 2;
  bottom: 0;
  right: 0;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #111d36 44%, #666f80 50%, #f4f6fc 54%, #cdd5e2 62%, #596679 78%, #151c28 93%);
  clip-path: polygon(100% 0, 100% 100%, 0 100%, 23% 91%, 44% 69%, 62% 35%, 78% 16%);
  border-bottom-right-radius: 10px;
}
h1, h2, p { margin: 0; }
.portada h1 {
  width: 100%;
  font-size: clamp(2rem, 9vw, 3.25rem);
  font-weight: normal;
  font-style: italic;
  line-height: 1.08;
  overflow-wrap: anywhere;
}
.portada h1::before {
  content: '';
  display: block;
  width: min(100%, 210px);
  height: 113px;
  margin: 0 auto 18px;
  background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20240%20125%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22s%22%20x2%3D%221%22%20y2%3D%221%22%3E%3Cstop%20stop-color%3D%22%23f4f6ff%22%2F%3E%3Cstop%20offset%3D%22.43%22%20stop-color%3D%22%23d6dbe2%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23697487%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22b%22%20x2%3D%221%22%20y2%3D%221%22%3E%3Cstop%20stop-color%3D%22%239ec6ff%22%2F%3E%3Cstop%20offset%3D%22.6%22%20stop-color%3D%22%233e7cff%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23073493%22%2F%3E%3C%2FlinearGradient%3E%3Cg%20id%3D%22l%22%20fill%3D%22url(%23s)%22%3E%3Cpath%20d%3D%22M94%20104Q44%2098%2017%2055l2-1q26%2041%2076%2048z%22%2F%3E%3Cpath%20d%3D%22M35%2078Q15%2073%2010%2062q16%201%2025%2016m9%207Q28%2070%2029%2058q12%207%2015%2027m13%208Q35%2092%2025%2083q21-2%2032%2010m7%204Q50%2086%2049%2074q13%206%2015%2023m18%204Q60%20106%2043%2099q21-6%2039%202%22%2F%3E%3C%2Fg%3E%3C%2Fdefs%3E%3Cuse%20href%3D%22%23l%22%2F%3E%3Cuse%20href%3D%22%23l%22%20transform%3D%22translate(240)%20scale(-1%201)%22%2F%3E%3Cpath%20d%3D%22M86%2051v23q33%2022%2067%200V51%22%20fill%3D%22url(%23s)%22%20stroke%3D%22%23e1e6ee%22%2F%3E%3Cpath%20d%3D%22M55%2045%20120%2013%20185%2045%20120%2076Z%22%20fill%3D%22%230b1120%22%20transform%3D%22translate(0%204)%22%2F%3E%3Cpath%20d%3D%22M55%2045%20120%2013%20185%2045%20120%2074Z%22%20fill%3D%22url(%23s)%22%20stroke%3D%22%23f0f3fb%22%20stroke-width%3D%221.4%22%2F%3E%3Cpath%20d%3D%22M122%2038q20%201%2039%2010l2%2024%22%20fill%3D%22none%22%20stroke%3D%22url(%23b)%22%20stroke-width%3D%224%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M160%2072h6l8%2031q-11%207-22%200z%22%20fill%3D%22url(%23b)%22%2F%3E%3Ccircle%20cx%3D%22163%22%20cy%3D%2271%22%20r%3D%224%22%20fill%3D%22%23e2e8f2%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
}
.nombre { margin: 18px 0 27px; font-size: clamp(1.45rem, 5.8vw, 2.15rem); line-height: 1.15; }
.nombre::before, .nombre::after, .dedicatoria::before {
  content: '';
  display: block;
  width: min(84%, 146px);
  height: 12px;
  margin: 0 auto 12px;
  background: linear-gradient(45deg, #74a3ff, #1c4eae) center / 7px 7px no-repeat, var(--separador) center / 100% 1px no-repeat;
}
.nombre::after { margin: 12px auto 0; }
button { color: inherit; font: inherit; cursor: pointer; min-height: 44px; }
button:focus-visible { outline: 3px solid #a9c9ff; outline-offset: 3px; }
#abrir, .sobres {
  background: var(--cinta);
  color: #fff;
  border: 1px solid #d0d7e4;
  box-shadow: inset 0 1px 0 #ffffff45, 0 5px 14px #0009;
}
#abrir { padding: 10px 17px; border-radius: 12px; font-size: 1.15rem; font-style: italic; }
#abrir::after { content: ' ›'; }
.etapa { font-weight: normal; font-size: .96rem; margin: 4px 0 12px; color: #d5e4ff; }
.foto {
  position: relative;
  flex: none;
  margin: 0;
  width: 100%;
  height: clamp(145px, 34svh, 295px);
  display: grid;
  place-items: center;
  background: #152645;
  border: 2px solid #dde5f1;
  border-radius: 14px 3px 14px 3px;
  box-shadow: 0 0 0 2px #355ea5, 0 7px 18px #0009;
}
.foto img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: center 35%; border-radius: inherit; }
.foto::after, .portada .nombre::before { pointer-events: none; }
.foto::after {
  content: '';
  position: absolute;
  top: -11px;
  right: 10px;
  width: 22px;
  height: 47px;
  border: 1px solid #83acff;
  background: linear-gradient(90deg, #0b2b78, #497ef0 50%, #173a9d);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 79%, 0 100%);
}
.dedicatoria { margin: 13px 0 7px; font-size: clamp(1.14rem, 4.8vw, 1.6rem); font-style: italic; line-height: 1.32; overflow-wrap: anywhere; }
.dedicatoria::before { margin-bottom: 10px; }
.cierre .foto { height: clamp(135px, 27svh, 235px); }
.cierre h2 { margin-top: 14px; font-size: clamp(1.5rem, 6.1vw, 2.25rem); line-height: 1.08; }
.cierre .dedicatoria { margin-top: 8px; }
#pendiente { margin: 5px 0; }
dl { margin: 4px 0; }
dl div { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
dt { font-weight: bold; }
dd { margin: 0; overflow-wrap: anywhere; }
.sobres { margin-top: 10px; padding: 6px 14px; border-radius: 4px; font-style: italic; font-size: 1.13rem; }
nav { display: flex; align-items: center; justify-content: space-between; padding: 1px 18px 3px; }
nav button { font-size: 1.4rem; min-width: 44px; border: 0; border-radius: 50%; background: transparent; }
nav button:hover:not(:disabled) { background: #1c3262; }
nav button:disabled { opacity: .34; cursor: default; }
.voltear { animation: abrir-pagina 470ms ease-out both; }
@keyframes abrir-pagina {
  from { transform: rotateY(var(--giro, -32deg)); opacity: .55; box-shadow: 14px 4px 25px #0009; }
  to { transform: rotateY(0); opacity: 1; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { .voltear { animation: none; } }

