/* One sheet at a time. A sealed envelope opens on load; later sheets slide sideways. */

/* Blacksword (Youssef Habchi, free for personal use): same script as the names. */
@font-face {
    font-family: "Blacksword";
    src: url("../assets/fonts/blacksword.woff") format("woff");
    font-display: swap;
}

:root {
    --tinta: #5c1018;
    --crema: #f6efe6;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    background-color: var(--crema);
    background-image:
        radial-gradient(ellipse at 12% 8%, rgba(214, 176, 118, 0.38), transparent 42%),
        radial-gradient(ellipse at 88% 22%, rgba(196, 150, 104, 0.28), transparent 40%),
        radial-gradient(ellipse at 18% 86%, rgba(232, 210, 184, 0.95), transparent 46%),
        radial-gradient(ellipse at 84% 92%, rgba(176, 132, 90, 0.22), transparent 44%);
    color: var(--tinta);
    font-family: "Segoe UI", sans-serif;
}

#polvo {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.escenario {
    position: relative;
    z-index: 1;
    height: 100%;
    height: 100svh;
}

.hoja {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transform: translateX(12%);
    padding-bottom: 2.4rem;
    transition: opacity 0.6s ease, transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.hoja.activa {
    z-index: 2;
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.hoja.activa.desde-der {
    opacity: 0;
    transform: translateX(12%);
}

.hoja.activa.desde-izq {
    opacity: 0;
    transform: translateX(-12%);
}

.hoja.sale-izq {
    z-index: 1;
    opacity: 0;
    transform: translateX(-12%);
}

.hoja.sale-der {
    z-index: 1;
    opacity: 0;
    transform: translateX(12%);
}

.marco {
    position: relative;
    width: min(100vw, calc((100svh - 2.4rem) * 1080 / 1920));
    aspect-ratio: 1080 / 1920;
}

.marco img,
.arte {
    display: block;
    width: 100%;
    height: 100%;
}

.arte {
    position: relative;
}

.marco img {
    object-fit: contain;
}

.portada {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: min(100%, 34rem);
    height: 100%;
    padding: 0.7rem 1rem 0.2rem;
    text-align: center;
}

.sobre {
    display: none;
}

html.animar .sobre {
    position: absolute;
    z-index: 4;
    left: 50%;
    top: 47%;
    display: block;
    width: min(92vw, 28rem);
    aspect-ratio: 6 / 5;
    height: auto;
    transform: translate(-50%, -50%) rotate(-4deg);
    transition: opacity 0.7s ease 1.35s, transform 0.8s ease 1.2s;
}

html.animar.abierta .sobre {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -58%) rotate(-1.4deg) scale(1.04);
}

.sobre-sombra {
    position: absolute;
    z-index: 0;
    left: 8%;
    right: 4%;
    bottom: -9%;
    height: 16%;
    background: radial-gradient(ellipse at center, rgba(62, 36, 22, 0.4), transparent 70%);
    filter: blur(7px);
}

.sobre-cuerpo {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 16% 78%, rgba(255, 248, 236, 0.42), transparent 46%),
        radial-gradient(ellipse at 84% 24%, rgba(92, 58, 34, 0.18), transparent 42%),
        linear-gradient(168deg, rgba(255, 244, 228, 0.2), rgba(74, 46, 28, 0.16)),
        url("../assets/papel.webp") center / cover;
    clip-path: polygon(0.8% 2.1%, 98.8% 0.5%, 99.6% 97.4%, 0.3% 99.1%);
}

.sobre-cuerpo::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 58%;
    background: linear-gradient(180deg, #f4e7d6 0%, #e6d2bc 72%);
    clip-path: polygon(1% 2%, 99% 0%, 53% 98%, 47% 100%);
}

.pliegue {
    position: absolute;
    top: 0;
    width: 54%;
    height: 72%;
}

.pliegue-izq {
    left: 0;
    background: linear-gradient(125deg, rgba(98, 62, 38, 0.34), rgba(255, 236, 214, 0.02) 64%);
    clip-path: polygon(0 4%, 88% 10%, 6% 100%);
}

.pliegue-der {
    right: 0;
    background: linear-gradient(235deg, rgba(68, 40, 24, 0.4), rgba(255, 236, 214, 0.03) 66%);
    clip-path: polygon(100% 2%, 12% 8%, 94% 100%);
}

.sobre-flap {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 58%;
    background:
        linear-gradient(180deg, rgba(255, 250, 242, 0.45), transparent 16%),
        linear-gradient(112deg, #f3e4d0 0%, #e5d0b8 48%, #cbb396 100%);
    clip-path: polygon(0% 3%, 8% 0%, 93% 0.6%, 100% 2.4%, 54% 96%, 46.5% 100%);
    transform-origin: center top;
    transform: scaleY(1);
    transition: transform 1.35s cubic-bezier(0.45, 0.05, 0.55, 0.95) 0.42s;
}

.sobre-flap::before {
    content: "";
    position: absolute;
    left: 6%;
    right: 6%;
    top: 0;
    height: 8px;
    background: linear-gradient(180deg, rgba(92, 60, 36, 0.28), transparent);
}

html.animar.abierta .sobre-flap {
    transform: scaleY(0);
}

.sello {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 50%;
    width: 42%;
    height: auto;
    transform: translate(-50%, -42%) rotate(7deg);
    filter: drop-shadow(0 8px 7px rgba(48, 16, 18, 0.32));
    pointer-events: none;
}

html.animar.abierta .sello {
    animation: sello-rompe 0.7s ease forwards;
}

@keyframes sello-rompe {
    0% {
        opacity: 1;
        transform: translate(-50%, -42%) rotate(7deg) scale(1);
    }

    40% {
        opacity: 1;
        transform: translate(-50%, -58%) rotate(1deg) scale(1.05);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -84%) rotate(-8deg) scale(0.84);
    }
}

.pareja {
    position: absolute;
    z-index: 0;
    left: 50%;
    bottom: 0.2rem;
    width: 128%;
    max-width: none;
    height: auto;
    transform: translateX(-50%);
    opacity: 0.3;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to top, #000 42%, transparent 100%);
    mask-image: linear-gradient(to top, #000 42%, transparent 100%);
}

.nombres,
.versiculo,
.abrir,
.invita,
.boda,
.fecha,
.lugar,
.hora,
.foto,
.acciones,
.colores,
.nota,
.lluvia,
.trajes,
.sobre-lluvia,
.novios,
.anillos,
.campo,
.aviso,
.cita {
    position: relative;
    z-index: 1;
}

.foto {
    width: min(58vw, 13.2rem);
    height: auto;
    margin: 0 0 0.45rem;
}

.nombres {
    width: min(96%, 26rem);
    height: auto;
}

.versiculo {
    max-width: 23.5rem;
    margin: 0.65rem 0 0.85rem;
    color: #2c241f;
    font-family: "Palatino Linotype", Palatino, Georgia, serif;
    font-size: clamp(0.98rem, 3.65vw, 1.18rem);
    font-style: italic;
    line-height: 1.36;
}

.versiculo cite {
    display: block;
    margin-top: 0.55rem;
    color: #6e1420;
    font-size: 0.92em;
    font-style: normal;
    letter-spacing: 0.02em;
}

html.animar .pareja,
html.animar .nombres,
html.animar .versiculo,
html.animar .abrir {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.75s ease 1.25s, visibility 0s linear 1.25s;
}

html.animar.abierta .nombres,
html.animar.abierta .versiculo,
html.animar.abierta .abrir {
    visibility: visible;
    opacity: 1;
}

html.animar.abierta .pareja {
    visibility: visible;
    opacity: 0.3;
}

.abrir {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 0.85rem;
    padding: 0.55rem 1.7rem;
    border: 0;
    border-radius: 999px;
    background: #6e1420;
    color: var(--crema);
    font-family: "Palatino Linotype", Palatino, Georgia, serif;
    font-size: 1.2rem;
    font-style: italic;
    letter-spacing: 0.03em;
    text-decoration: none;
    cursor: pointer;
}

.invita,
.boda,
.fecha,
.lugar,
.hora {
    margin: 0;
    font-family: "Palatino Linotype", Palatino, Georgia, serif;
}

.invita {
    color: #6e1420;
    font-size: clamp(1.25rem, 4.6vw, 1.55rem);
    font-style: italic;
}

.boda {
    margin: 0.1rem 0 0.85rem;
    color: #5c1018;
    font-size: clamp(2.7rem, 11vw, 3.7rem);
    font-style: italic;
    font-weight: normal;
    line-height: 0.95;
}

.fecha-dia,
.fecha-mes,
.fecha-num {
    display: block;
}

.fecha-dia {
    color: #6e1420;
    font-size: 0.78rem;
    font-style: normal;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.fecha-num {
    color: #5c1018;
    font-size: clamp(3.4rem, 14vw, 4.6rem);
    font-style: italic;
    line-height: 0.82;
}

.fecha-mes {
    margin-top: 0.15rem;
    color: #6e1420;
    font-size: 1.15rem;
    font-style: italic;
}

.lugar {
    max-width: 18rem;
    margin-top: 0.85rem;
    color: #2c241f;
    font-size: 1.05rem;
    font-style: italic;
    line-height: 1.35;
}

.hora {
    margin-top: 0.7rem;
    color: #6e1420;
    font-size: 1.05rem;
    font-style: italic;
}

.hora strong {
    display: block;
    margin-top: 0.1rem;
    font-size: 1.65rem;
    font-weight: normal;
}

.acciones {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
    margin-top: 0.75rem;
}

.acciones .abrir {
    margin-top: 0;
    padding: 0.5rem 1.15rem;
    font-size: 1.08rem;
}

.abrir.destacado {
    background: #861c2b;
    animation: hover-fijo 1.8s ease-in-out infinite;
}

@keyframes hover-fijo {
    0%,
    100% {
        transform: translateY(0);
        box-shadow:
            0 0 0 3px rgba(255, 246, 236, 0.95),
            0 0 0 6px rgba(110, 20, 32, 0.28),
            0 8px 16px rgba(92, 16, 24, 0.26);
    }

    50% {
        transform: translateY(-3px);
        box-shadow:
            0 0 0 3px rgba(255, 246, 236, 1),
            0 0 0 9px rgba(110, 20, 32, 0.14),
            0 14px 22px rgba(92, 16, 24, 0.36);
    }
}

.colores {
    display: flex;
    gap: 0.85rem;
    margin: 0.65rem 0 0;
    padding: 0;
    list-style: none;
}

.colores li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.28rem;
    color: #5c1018;
    font-family: "Palatino Linotype", Palatino, Georgia, serif;
    font-size: 0.78rem;
    font-style: italic;
}

.muestra {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(92, 16, 24, 0.28);
}

.muestra-blanco {
    background: #f4efe8;
}

.muestra-beige {
    background: #e4d0b0;
}

.muestra-vino {
    background: #6e1420;
}

.muestra-cafe {
    background: #6a4630;
}

.nota {
    margin: 0.45rem 0 0;
    color: #6e1420;
    font-family: "Palatino Linotype", Palatino, Georgia, serif;
    font-size: 0.92rem;
    font-style: italic;
}

.lluvia {
    margin: 0.8rem 0 0;
    color: #5c1018;
    font-family: "Palatino Linotype", Palatino, Georgia, serif;
    font-size: clamp(1.45rem, 5vw, 1.8rem);
    font-style: italic;
}

.invita,
.boda,
.lluvia {
    font-family: "Blacksword", "Palatino Linotype", Palatino, Georgia, serif;
    font-style: normal;
    font-synthesis: none;
}

#hoja-indicaciones .portada {
    justify-content: flex-start;
    padding-top: 0.85rem;
}

#hoja-indicaciones .trajes {
    height: 7.4rem;
    width: auto;
    margin: 0 0 0.3rem;
}

#hoja-indicaciones .boda {
    margin-bottom: 0.2rem;
    font-size: clamp(1.85rem, 7.4vw, 2.5rem);
}

#hoja-indicaciones .lugar,
#hoja-indicaciones .lluvia {
    margin-top: 0.35rem;
}

#hoja-indicaciones .colores {
    margin-top: 0.4rem;
    gap: 0.7rem;
}

.sobre-lluvia {
    width: min(56vw, 12.5rem);
    height: auto;
    margin: 0.25rem 0 0.1rem;
}

.novios {
    width: min(70vw, 15rem);
    height: auto;
    margin: 0.15rem 0 0.1rem;
}

.anillos {
    width: 3.6rem;
    height: auto;
    margin-top: 0.35rem;
}

#hoja-confirma .boda {
    margin-bottom: 0.2rem;
    font-size: clamp(1.85rem, 7.4vw, 2.5rem);
}

#hoja-confirma .anillos {
    width: 4.4rem;
    margin: 0 0 0.45rem;
}

.cita {
    margin: 0 0 0.75rem;
    font-family: "Palatino Linotype", Palatino, Georgia, serif;
    font-style: italic;
    line-height: 1.35;
}

.cita span {
    display: block;
}

.cita .cuando {
    color: #6e1420;
    font-size: 1.02rem;
}

.cita .donde {
    color: #2c241f;
    font-size: 0.95rem;
}

.campo {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: min(100%, 20rem);
    margin-top: 0.55rem;
    text-align: left;
}

.campo span {
    margin-bottom: 0.18rem;
    color: #6e1420;
    font-family: "Palatino Linotype", Palatino, Georgia, serif;
    font-size: 0.95rem;
    font-style: italic;
}

.campo input {
    min-height: 44px;
    padding: 0.35rem 0.85rem;
    border: 1px solid rgba(110, 20, 32, 0.35);
    border-radius: 999px;
    background: rgba(255, 252, 248, 0.94);
    color: #2c241f;
    font-family: "Segoe UI", sans-serif;
    font-size: 1rem;
}

.aviso {
    max-width: 20rem;
    margin: 0.55rem 0 0;
    color: #6e1420;
    font-family: "Palatino Linotype", Palatino, Georgia, serif;
    font-size: 0.92rem;
    font-style: italic;
}

@media (max-height: 820px) {
    #hoja-indicaciones .trajes {
        height: 5.6rem;
    }

    #hoja-indicaciones .boda {
        font-size: clamp(1.6rem, 6vw, 2.1rem);
    }

    .sobre-lluvia {
        width: min(48vw, 10.5rem);
    }

    .novios {
        width: min(58vw, 12rem);
    }
}

.abrir:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
}

.zona {
    position: absolute;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: transparent;
    font-size: 1rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
}

.zona:focus-visible,
.paso:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}



.zona-abrir {
    left: 34%;
    top: 75.6%;
    width: 40%;
    height: 6.6%;
}

.zona-mapa {
    left: 16%;
    top: 80.2%;
    width: 74%;
    height: 9%;
}

.zona-confirmar {
    left: 4%;
    top: 81.6%;
    width: 94%;
    height: 8.2%;
}

.pasos {
    position: fixed;
    z-index: 5;
    left: 50%;
    bottom: 0.55rem;
    display: flex;
    gap: 0.7rem;
    margin: 0;
    padding: 0;
    transform: translateX(-50%);
}

.pasos[hidden] {
    display: none;
}

.paso {
    width: 11px;
    height: 11px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(92, 16, 24, 0.35);
    box-shadow: 0 0 0 1px rgba(255, 248, 240, 0.8);
    cursor: pointer;
}

.paso.activo {
    background: var(--tinta);
}

@media (prefers-reduced-motion: reduce) {
    .hoja,
    .sobre,
    .sobre-flap,
    .sello,
    .abrir.destacado {
        transition: none;
        animation: none;
    }

    #polvo {
        display: none;
    }
}
