/* =========================================================
   VARIABLES
========================================================= */

:root {
    --dark: #04343B;
    --dark-soft: #0D545E;

    --paper: #e8d8b9;
    --paper-light: #f1e5cc;
    --paper-dark: #c6ae82;

    --ink: #211d18;
    --muted: #a49b8e;

    --accent: #c79b62;

    --transition: 900ms cubic-bezier(.77,0,.18,1);
}


/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;

    overflow: hidden;
}

body {
    background: var(--dark);
    color: #eee8df;

    font-family: "Cormorant Garamond", serif;
}


/* =========================================================
   FONDO
========================================================= */

.background {
    position: fixed;
    inset: 0;

    z-index: -3;

    background:
        radial-gradient(
            circle at 50% 40%,
            #29231d 0%,
            #171513 42%,
            #0d0c0b 100%
        );
}

.grain {
    position: fixed;
    inset: -50%;

    z-index: 100;

    pointer-events: none;

    opacity: .06;

    background-image:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");

    animation: grain .2s steps(2) infinite;
}

@keyframes grain {

    0% {
        transform: translate(0,0);
    }

    25% {
        transform: translate(2%,-2%);
    }

    50% {
        transform: translate(-2%,2%);
    }

    75% {
        transform: translate(2%,2%);
    }

    100% {
        transform: translate(-2%,-2%);
    }

}


/* =========================================================
   PÁGINAS
========================================================= */

.page {

    position: fixed;
    inset: 0;

    width: 100%;
    height: 100dvh;

    overflow: hidden;

    opacity: 0;
    visibility: hidden;

    transform: translateY(100%);

    transition:
        transform var(--transition),
        opacity var(--transition),
        visibility var(--transition);

}

.page.active {

    opacity: 1;
    visibility: visible;

    transform: translateY(0);

}


/* página que sale */

.page.leaving-up {

    transform: translateY(-100%);

    opacity: 0;

}


/* =========================================================
   TEXTOS GENERALES
========================================================= */

.small-label {

    display: block;

    margin-bottom: 22px;

    color: var(--accent);

    font-family: "DM Mono", monospace;

    font-size: 11px;

    letter-spacing: .2em;

    text-transform: uppercase;

}

.page-number {

    position: absolute;

    top: 30px;
    left: 35px;

    color: #746d63;

    font-family: "DM Mono", monospace;

    font-size: 10px;

    letter-spacing: .15em;

}


/* =========================================================
   PÁGINA 1
========================================================= */

.intro-content {

    position: absolute;

    left: 11%;

    top: 50%;

    transform: translateY(-50%);

}

.intro-content h1 {

    max-width: 750px;

    font-size: clamp(58px, 9vw, 135px);

    font-weight: 500;

    line-height: .82;

    letter-spacing: -.055em;

}

.intro-subtitle {

    margin-top: 40px;

    color: #938b80;

    font-family: "DM Mono", monospace;

    font-size: 11px;

    letter-spacing: .05em;

}

.corner-arrow {

    position: absolute;

    right: 40px;

    bottom: 35px;

    width: 58px;
    height: 58px;

    border: 1px solid #625b52;

    border-radius: 50%;

    background: transparent;

    color: #e8e1d8;

    font-size: 21px;

    cursor: pointer;

    transition:
        background .3s,
        transform .3s,
        border-color .3s;

}

.corner-arrow:hover {

    background: #ffffff12;

    border-color: #a79c8d;

    transform: translateY(5px);

}

.little-note {

    position: absolute;

    bottom: 42px;

    left: 11%;

    color: #655f57;

    font-family: "Kalam", cursive;

    font-size: 14px;

    transform: rotate(-3deg);

}


/* =========================================================
   PÁGINA 2 — PERGAMINO
========================================================= */

.parchment-page {

    background:
        radial-gradient(
            circle at 50% 50%,
            #28231e,
            #121110 75%
        );

}

.parchment-intro {

    position: absolute;

    top: 60px;

    right: 8%;

    width: 280px;

    z-index: 10;

}

.parchment-intro p {

    color: #b0a79b;

    font-size: 20px;

    line-height: 1.2;

}

.scroll-hint {

    display: block;

    margin-top: 22px;

    color: #655f58;

    font-family: "DM Mono", monospace;

    font-size: 9px;

    letter-spacing: .12em;

}


/* zona que recibe el scroll */

.scroll-area {

    position: absolute;

    left: 50%;

    top: 0;

    width: min(760px, 82vw);

    height: 100vh;

    transform: translateX(-50%);

    overflow-y: auto;

    overflow-x: hidden;

    scrollbar-width: none;

    padding-top: 210px;

    padding-bottom: 250px;

}

.scroll-area::-webkit-scrollbar {
    display: none;
}


/* =========================================================
   PERGAMINO
========================================================= */

.parchment-wrapper {

    position: relative;

    width: 100%;

    min-height: 1300px;

}


/* ROLLO SUPERIOR */

.parchment-top {

    position: relative;

    z-index: 5;

    width: 108%;

    margin-left: -4%;

    height: 90px;

    display: flex;

    align-items: center;

    justify-content: center;

    background:
        linear-gradient(
            to bottom,
            #b89b6e,
            #ead9b8 30%,
            #d5bd91 75%,
            #aa8b5e
        );

    border-radius: 50%;

    box-shadow:
        0 15px 30px #0007,
        inset 0 4px 8px #ffffff55,
        inset 0 -8px 15px #715b3e55;

    transform: rotate(-.4deg);

}

.roll-left,
.roll-right {

    position: absolute;

    width: 80px;
    height: 108px;

    border-radius: 50%;

    background:
        linear-gradient(
            to right,
            #9d8055,
            #e2cca4,
            #9c7d50
        );

    box-shadow:
        inset 0 0 15px #604a2f88,
        0 7px 15px #0005;

}

.roll-left {
    left: -35px;
}

.roll-right {
    right: -35px;
}

.paper-top-decoration {

    display: flex;

    gap: 20px;

    color: #776143;

    font-family: "Kalam", cursive;

    font-size: 15px;

}


/* HOJA */

.parchment {

    position: relative;

    min-height: 1050px;

    background:

        radial-gradient(
            ellipse at 15% 20%,
            #ffffff30,
            transparent 30%
        ),

        radial-gradient(
            ellipse at 80% 70%,
            #8d6c3a22,
            transparent 35%
        ),

        linear-gradient(
            90deg,
            #d0b78a,
            #f0dfbe 12%,
            #e9d7b2 88%,
            #c4a979
        );

    color: var(--ink);

    box-shadow:
        0 25px 50px #0008,
        inset 8px 0 15px #80633c25,
        inset -8px 0 15px #80633c25;

}


/* textura */

.parchment::before {

    content: "";

    position: absolute;

    inset: 0;

    opacity: .12;

    background-image:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 3px,
            #6e583922 4px
        );

    pointer-events: none;

}


/* contenido */

.paper-inner {

    position: relative;

    z-index: 2;

    padding:
        75px
        clamp(45px, 9vw, 95px)
        100px;

}

.letter-date {

    margin-bottom: 80px;

    color: #766247;

    font-family: "DM Mono", monospace;

    font-size: 9px;

    letter-spacing: .18em;

}

.paper-inner h2 {

    margin-bottom: 45px;

    font-size: 38px;

    font-weight: 600;

}

.letter-text {

    font-size: 22px;

    line-height: 1.7;

}

.letter-text p {

    margin-bottom: 35px;

}

.letter-ending {

    margin-top: 90px;

    font-family: "Kalam", cursive;

    font-size: 19px;

}

.signature-name {

    margin-top: 10px;

    font-size: 38px;

    transform: rotate(-4deg);

}

.paper-stamp {

    position: absolute;

    right: 60px;

    bottom: 45px;

    width: 50px;
    height: 50px;

    display: grid;
    place-items: center;

    border: 1px solid #927a55;

    border-radius: 50%;

    color: #927a55;

    transform: rotate(12deg);

}


/* PARTE INFERIOR */

.parchment-bottom {

    height: 120px;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 20px;

    color: #8d7755;

    font-family: "Kalam", cursive;

    font-size: 14px;

}

.bottom-line {

    width: 70px;

    height: 1px;

    background: #806b4d;

}


/* =========================================================
   PÁGINA 3
========================================================= */

.after-letter {

    position: absolute;

    top: 50%;
    left: 50%;

    width: 600px;
    max-width: 80%;

    transform: translate(-50%, -50%);

}

.after-letter h2 {

    font-size: clamp(65px, 10vw, 120px);

    line-height: .8;

    font-weight: 500;

    letter-spacing: -.05em;

}

.thin-line {

    width: 100%;

    height: 1px;

    margin: 45px 0 30px;

    background: #514a42;

}

.after-letter p {

    max-width: 400px;

    color: #9b9388;

    font-size: 23px;

    line-height: 1.2;

}


/* =========================================================
   PÁGINA 4
========================================================= */

.question-page {

    display: flex;

    align-items: center;
    justify-content: center;

}

.question-content {

    text-align: center;

    transition:
        opacity .5s,
        transform .7s;

}

.question-decoration {

    margin: 30px 0;

    color: #625b51;

    font-family: "DM Mono", monospace;

    font-size: 9px;

}

.question-content h2 {

    font-size: clamp(55px, 9vw, 105px);

    font-weight: 500;

    line-height: .85;

    letter-spacing: -.05em;

}

.question-content h2 em {

    color: #d4c5b1;

    font-style: italic;

}

.answer-buttons {

    display: flex;

    justify-content: center;

    gap: 18px;

    margin-top: 55px;

}

.answer {

    min-width: 130px;

    padding: 17px 30px;

    border: 1px solid #5e574f;

    background: transparent;

    color: #e6ded3;

    font-family: "DM Mono", monospace;

    font-size: 11px;

    letter-spacing: .08em;

    cursor: pointer;

    transition: .3s;

}

.answer:hover {

    transform: translateY(-4px);

    background: #ffffff0b;

    border-color: #c7b9a6;

}

.answer.yes:hover {

    background: #d7c19d18;

}

.answer.no {

    color: #8e877e;

}

.no-message {

    height: 25px;

    margin-top: 20px;

    color: #9d8d78;

    font-family: "Kalam", cursive;

    font-size: 17px;

}


/* =========================================================
   PANTALLA "ESTÁS SEGURO"
========================================================= */

.again-screen {

    position: absolute;

    inset: 0;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    text-align: center;

    opacity: 0;

    visibility: hidden;

    transform: scale(.96);

    transition: .7s;

    background: #11100ff2;

}

.again-screen.show {

    opacity: 1;

    visibility: visible;

    transform: scale(1);

}

.again-screen h2 {

    font-size: clamp(60px, 9vw, 110px);

    line-height: .82;

    font-weight: 500;

}

.again-screen p {

    margin-top: 25px;

    color: #999187;

    font-size: 22px;

}

.simple-button {

    margin-top: 40px;

    padding: 15px 25px;

    border: 1px solid #655d53;

    background: transparent;

    color: #ded5c9;

    font-family: "DM Mono", monospace;

    font-size: 10px;

    cursor: pointer;

    transition: .3s;

}

.simple-button:hover {

    background: #ffffff0b;

    transform: translateY(-3px);

}


/* =========================================================
   PÁGINA 5 — SÍ
========================================================= */

.yes-page {

    background:

        radial-gradient(
            circle at center,
            #30271d,
            #11100f 70%
        );

    overflow-y: auto;

}

.yes-content {

    min-height: 100%;

    padding: 100px 25px;

    display: flex;

    flex-direction: column;

    align-items: center;

    text-align: center;

}

.yes-content h2 {

    font-size: clamp(80px, 13vw, 170px);

    line-height: .75;

    font-weight: 500;

    letter-spacing: -.07em;

}

.big-star {

    margin-top: 40px;

    color: var(--accent);

    font-size: 35px;

    animation: starPulse 2s infinite;

}

@keyframes starPulse {

    0%,100% {
        transform: scale(1) rotate(0);
        opacity: .7;
    }

    50% {
        transform: scale(1.25) rotate(20deg);
        opacity: 1;
    }

}

.yes-text {

    margin-top: 25px;

    color: #aaa197;

    font-size: 22px;

}

.small-joke {

    margin-top: 8px;

    color: #645e57;

    font-family: "Kalam", cursive;

    font-size: 14px;

}


/* =========================================================
   FIRMA
========================================================= */

.signature-section {

    width: min(600px, 90vw);

    margin-top: 80px;

}

.signature-title {

    color: #d5c8b7;

    font-family: "DM Mono", monospace;

    font-size: 12px;

    letter-spacing: .15em;

    text-transform: uppercase;

}

.signature-subtitle {

    margin-top: 8px;

    color: #706960;

    font-size: 14px;

}

.signature-box {

    position: relative;

    width: 100%;

    height: 190px;

    margin-top: 25px;

    border-bottom: 1px solid #6c6256;

    background: #ffffff03;

}

.signature-box canvas {

    width: 100%;

    height: 100%;

    display: block;

    touch-action: none;

    cursor: crosshair;

}

#signaturePlaceholder {

    position: absolute;

    left: 50%;

    top: 50%;

    transform: translate(-50%, -50%);

    color: #4f4942;

    font-family: "Kalam", cursive;

    font-size: 18px;

    pointer-events: none;

}

.signature-buttons {

    display: flex;

    justify-content: center;

    gap: 12px;

    margin-top: 20px;

}

.signature-buttons button {

    padding: 11px 18px;

    border: 1px solid #514b44;

    background: transparent;

    color: #aaa197;

    font-family: "DM Mono", monospace;

    font-size: 9px;

    cursor: pointer;

    transition: .3s;

}

.signature-buttons button:hover {

    border-color: #a89d8e;

    color: #e3d9cb;

}

#signatureMessage {

    min-height: 20px;

    margin-top: 15px;

    color: #9d8d78;

    font-family: "Kalam", cursive;

    font-size: 15px;

}


/* =========================================================
   CONFETI
========================================================= */

.confetti-container {

    position: fixed;

    inset: 0;

    pointer-events: none;

    overflow: hidden;

}

.confetti {

    position: absolute;

    top: -20px;

    width: 7px;
    height: 14px;

    background: #d5c19e;

    animation: fall linear forwards;

}

@keyframes fall {

    to {

        transform:
            translateY(110vh)
            rotate(720deg);

        opacity: 0;

    }

}


/* =========================================================
   MÓVIL
========================================================= */

@media (max-width: 700px) {

    .page-number {

        top: 20px;
        left: 20px;

    }

    .intro-content {

        left: 8%;

        right: 8%;

    }

    .intro-content h1 {

        font-size: clamp(55px, 15vw, 90px);

    }

    .intro-subtitle {

        max-width: 250px;

        line-height: 1.5;

    }

    .corner-arrow {

        right: 20px;
        bottom: 20px;

        width: 50px;
        height: 50px;

    }

    .little-note {

        left: 8%;
        bottom: 30px;

    }

    .parchment-intro {

        top: 55px;

        left: 25px;
        right: auto;

        width: 220px;

    }

    .parchment-intro p {

        font-size: 17px;

    }

    .scroll-area {

        width: 92vw;

        padding-top: 190px;

    }

    .parchment-wrapper {

        min-height: 1450px;

    }

    .parchment {

        min-height: 1200px;

    }

    .paper-inner {

        padding:
            55px
            35px
            80px;

    }

    .letter-date {

        margin-bottom: 55px;

    }

    .paper-inner h2 {

        font-size: 32px;

    }

    .letter-text {

        font-size: 19px;

        line-height: 1.65;

    }

    .letter-text p {

        margin-bottom: 30px;

    }

    .after-letter {

        width: 82%;

    }

    .question-content {

        width: 90%;

    }

    .answer-buttons {

        gap: 10px;

    }

    .answer {

        min-width: 110px;

        padding: 15px 20px;

    }

    .yes-content {

        padding-top: 100px;

    }

    .signature-section {

        margin-top: 60px;

    }
	
	.marriage-image {
    display: block;
    width: min(260px, 40vw);
    max-height: 150px;
    object-fit: contain;
    margin: 0 auto 35px;

    border: 1px solid #665d51;
    box-shadow: 0 15px 35px #0007;

    transform: rotate(-1.5deg);

.scroll-hint {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.scroll-hint:hover {
    text-decoration: underline;
}
}