/* ================= La notita abierta: un pergamino antiguo con sello de cera ================= */
.nota { --cafe: #3b2410; --cafe-2: #6e4a26; --oro: #b98a3e;
  width: min(94vw, 460px); max-width: none; max-height: 98vh; max-height: 98dvh; overflow: visible; margin: auto; padding: 0; border: 0; background: transparent; color: var(--cafe); }
.nota::backdrop { background: radial-gradient(circle at 50% 45%, rgba(86, 56, 24, .78), rgba(12, 14, 26, .92) 70%); backdrop-filter: blur(6px); }
.nota svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nota .filtros { position: absolute; width: 0; height: 0; }

/* Rayos de luz que giran despacio detrás del pergamino */
.resplandor { position: fixed; z-index: 0; left: 50%; top: 50%; width: 180vmax; height: 180vmax; translate: -50% -50%; pointer-events: none; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 140, .13) 0 7deg, transparent 7deg 20deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, .35) 22%, transparent 42%); mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, .35) 22%, transparent 42%);
  animation: girar 60s linear infinite; }

.pergamino { position: relative; z-index: 1; padding-top: 30px; }

/* Sello de cera con el color del sentimiento */
.sello { position: absolute; z-index: 4; top: 4px; left: 50%; translate: -50% 0; display: grid; place-items: center; width: 70px; height: 70px;
  border-radius: 47% 53% 49% 51% / 52% 47% 53% 48%;
  background: radial-gradient(circle at 32% 26%, color-mix(in srgb, var(--tono, #ffd36e) 35%, #d8584a), color-mix(in srgb, var(--tono, #ffd36e) 22%, #9b2018) 55%, #5c0e0a);
  box-shadow: 0 8px 16px rgba(0, 0, 0, .45), inset 0 2px 3px rgba(255, 255, 255, .35), inset 0 -4px 7px rgba(0, 0, 0, .4); }
.sello > span { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; font-size: 1.75rem; line-height: 1;
  background: radial-gradient(circle at 40% 32%, #fff8e6, #f1d9a8);
  box-shadow: inset 0 3px 6px rgba(70, 20, 5, .45), 0 0 0 2px rgba(255, 220, 160, .35); }

.cerrar { position: absolute; z-index: 5; top: 0; right: 0; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 50%;
  border: 1.5px solid #e8c47c; background: linear-gradient(160deg, #5a3a1d, #2a1809); color: #ffe9bd; box-shadow: 0 4px 10px rgba(0, 0, 0, .45); transition: transform .2s; }
.cerrar:hover { transform: rotate(90deg); }

/* Varillas de madera torneada con remates dorados */
.rodillo { position: relative; z-index: 3; height: 22px; margin: 0 10px; border-radius: 5px;
  background:
    linear-gradient(90deg, transparent 22px, #e9c983 22px 26px, transparent 26px calc(100% - 26px), #e9c983 calc(100% - 26px) calc(100% - 22px), transparent calc(100% - 22px)),
    linear-gradient(#a9713d 0%, #d9a566 18%, #8d572a 52%, #4b2a10 88%, #2f1808 100%);
  box-shadow: 0 7px 14px rgba(0, 0, 0, .5); }
.rodillo::before, .rodillo::after { content: ''; position: absolute; top: -3px; width: 16px; height: 28px;
  background: radial-gradient(circle at 38% 28%, #fff0bd, #d7a548 38%, #8a5f1e 72%, #503408); box-shadow: 0 3px 7px rgba(0, 0, 0, .45); }
.rodillo::before { left: -11px; border-radius: 50% 28% 28% 50%; }
.rodillo::after { right: -11px; border-radius: 28% 50% 50% 28%; }

/* El papiro */
.papiro { position: relative; z-index: 2; margin: -8px 22px; filter: drop-shadow(0 24px 34px rgba(0, 0, 0, .55)); }
.fondo-papiro { position: absolute; inset: 0; filter: url(#rasgado);
  background-color: #f6e5bc;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .27 0 0 0 0 .1 0 0 0 .2 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23g)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 50% 42%, #fffaea 0%, rgba(255, 246, 219, .75) 34%, rgba(246, 229, 188, 0) 68%),
    radial-gradient(circle at 12% 82%, rgba(166, 112, 48, .2), transparent 26%),
    radial-gradient(circle at 88% 20%, rgba(166, 112, 48, .17), transparent 22%);
  box-shadow: inset 0 0 22px rgba(150, 92, 30, .55), inset 0 0 70px rgba(168, 112, 46, .3), inset 0 14px 18px -8px rgba(80, 45, 12, .55), inset 0 -14px 18px -8px rgba(80, 45, 12, .55); }

.hoja-nota { position: relative; max-height: calc(98vh - 86px); max-height: calc(98dvh - 86px); overflow-y: auto; overscroll-behavior: contain; outline: none; scrollbar-width: thin; scrollbar-color: rgba(120, 80, 35, .35) transparent;
  padding: 54px 30px 40px; text-align: center; }
/* Marco dorado doble */
.papiro::after { content: ''; position: absolute; inset: 17px 11px 15px; pointer-events: none; border: 1px solid rgba(160, 112, 45, .55);
  outline: 1px solid rgba(160, 112, 45, .28); outline-offset: 3px; border-radius: 3px; }

/* 1. La cita */
.nota-cita { margin: 0; font: 700 clamp(2.4rem, 11vw, 3.6rem)/1.04 'Cormorant Garamond', var(--titulo); letter-spacing: -.005em; text-wrap: balance;
  color: #4a2a0c; text-shadow: 0 1px 0 rgba(255, 255, 255, .8); }
.nota .adorno { display: block; width: min(240px, 82%); height: 20px; margin: 14px auto 18px; color: var(--oro); stroke-width: 1.3; }
.adorno .lleno { fill: currentColor; stroke: none; }

/* 2. El resumen */
.nota-resumen { margin: 0 0 28px; font: italic 600 clamp(1.4rem, 6.2vw, 1.75rem)/1.36 'Cormorant Garamond', var(--titulo); text-wrap: balance; }
.nota-resumen > span:first-child { display: block; margin-bottom: 8px; font: 800 .64rem/1 var(--cuerpo); letter-spacing: .2em; text-transform: uppercase; color: #8c5a17; }

/* 3. El enlace al texto bíblico */
.leer { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: min(260px, 100%); padding: 14px 26px; overflow: hidden; border-radius: 99px; text-decoration: none; font-weight: 800; font-size: 1rem; color: #ffeec6;
  border: 1.5px solid #d9ab5c; background: linear-gradient(170deg, #6a4320, #3a200b 60%, #2a1606);
  box-shadow: 0 0 0 3px rgba(255, 244, 214, .7), 0 0 0 4px rgba(150, 105, 40, .5), 0 9px 18px rgba(70, 40, 10, .38); transition: transform .15s, filter .15s; }
.leer:hover { transform: translateY(-2px); filter: brightness(1.12); }

/* Destellos que suben al abrirse */
.destellos { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.destellos i { position: absolute; bottom: -20px; opacity: 0; background: var(--color); animation: subir var(--dura) cubic-bezier(.2, .6, .4, 1) var(--espera) forwards;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); }

/* ---------- Animación de apertura ---------- */
.pergamino.abrir .papiro { animation: extender .85s cubic-bezier(.25, .85, .25, 1) both; }
.pergamino.abrir .rodillo.arriba { animation: rodar-arriba .85s cubic-bezier(.25, .85, .25, 1) both; }
.pergamino.abrir .rodillo.abajo { animation: rodar-abajo .85s cubic-bezier(.25, .85, .25, 1) both; }
.pergamino.abrir .sello { animation: sellar .65s cubic-bezier(.3, 1.5, .5, 1) .7s both; }
.pergamino.abrir .cerrar { animation: asomar .4s ease .8s both; }
.pergamino.abrir .nota-cita { animation: revelar .75s ease .5s both; }
.pergamino.abrir .adorno { animation: abrirse .7s ease .7s both; }
.pergamino.abrir .nota-resumen { animation: aparecer .6s ease .85s both; }
.pergamino.abrir .leer { animation: aparecer .6s ease 1.05s both; }
/* Un reflejo recorre el botón cuando ya está todo a la vista */
.pergamino.abrir .leer::after { content: ''; position: absolute; top: 0; bottom: 0; width: 45%; left: -60%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 236, 190, .45), transparent); animation: reflejo 1.1s ease 1.8s; }

@keyframes extender { from { clip-path: inset(50% -60px 50% -60px); } to { clip-path: inset(-10px -60px -60px -60px); } }
@keyframes rodar-arriba { from { transform: translateY(var(--mitad, 200px)); } to { transform: translateY(0); } }
@keyframes rodar-abajo { from { transform: translateY(calc(-1 * var(--mitad, 200px))); } to { transform: translateY(0); } }
@keyframes sellar { from { opacity: 0; transform: scale(2.4) rotate(-25deg); } to { opacity: 1; transform: none; } }
@keyframes asomar { from { opacity: 0; scale: .3; } to { opacity: 1; scale: 1; } }
@keyframes aparecer { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes abrirse { from { opacity: 0; transform: scaleX(.15); } to { opacity: 1; transform: none; } }
@keyframes revelar { from { opacity: 0; filter: blur(9px); transform: scale(1.12); } to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes reflejo { to { left: 130%; } }
@keyframes girar { to { rotate: 360deg; } }
@keyframes subir {
  0% { opacity: 0; transform: translateY(0) rotate(0) scale(.4); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translateY(var(--alto)) rotate(220deg) scale(1.1); } }

@media (max-width: 420px) {
  .papiro { margin-inline: 17px; }
  .hoja-nota { padding-inline: 22px; }
  .papiro::after { inset-inline: 8px; }
}
/* Pantallas bajitas: más compacto para que la notita se vea completa. */
@media (max-height: 640px) {
  .pergamino { padding-top: 22px; }
  .sello { width: 54px; height: 54px; top: 1px; }
  .sello > span { width: 38px; height: 38px; font-size: 1.3rem; }
  .cerrar { width: 32px; height: 32px; }
  .rodillo { height: 17px; }
  .rodillo::before, .rodillo::after { height: 23px; }
  .hoja-nota { max-height: calc(98vh - 66px); max-height: calc(98dvh - 66px); padding-top: 40px; padding-bottom: 28px; }
  .papiro::after { inset-block: 13px 11px; }
  .nota-cita { font-size: 2.35rem; }
  .nota .adorno { height: 16px; margin: 8px auto 12px; }
  .nota-resumen { margin-bottom: 20px; font-size: 1.35rem; line-height: 1.28; }
  .leer { padding: 11px 22px; font-size: .92rem; }
}
@media (prefers-reduced-motion: reduce) {
  .pergamino.abrir *, .destellos i { animation-delay: 0s !important; }
  .resplandor { animation: none; }
}
