:root {
    /* Cambia el color del cordón aquí */
    --cordon-color: #4a2e1b;
    --cordon-sombra: #2b180d;
    --cordon-luz: #6a442a;
    
    /* Tamaño total del contenedor del cordón */
    --cordon-ancho: 180px;
    --cordon-alto: 700px;
}


* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100dvh;
    overflow: hidden;
    background: #120305;
    font-family: 'Plus Jakarta Sans', sans-serif;
    touch-action: pan-y;
}

.font-serif-title {
    font-family: 'Playfair Display', serif;
}

/* Full Viewport Book Container */
.book-viewport {
    width: 100vw;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at center, #2A090D 0%, #0F0204 100%);
}

.book-container {
    position: relative;
    width: 100vw;
    height: 100%;
    transform-style: preserve-3d;
    transition: all 0.3s ease;
}

/* Spine / Lomo Central */
.book-spine {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 16px;
    transform: translateX(-50%);
    background: linear-gradient(to right, rgba(0,0,0,0.4), rgba(255,255,255,0.05), rgba(0,0,0,0.4));
    z-index: 50;
    pointer-events: none;
}

/* Páginas 3D */
.page {
    position: absolute;
    top: 0;
    width: 50vw;
    height: 100vh;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1.000);
    cursor: pointer;
    user-select: none;
}

.page.right-page {
    right: 0;
    transform-origin: left center;
}

.page.left-page {
    left: 0;
    transform-origin: right center;
}

/* Caras de las Páginas */
.page-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background-color: #FAF6F0;
    background-image: radial-gradient(#E2D5C5 0.7px, transparent 0.7px);
    background-size: 24px 24px;
    border: 1px solid #E5D9CC;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4rem 3.5rem;
}

.page-face.back {
    transform: rotateY(180deg);
}

/* Sombras de Plegado */
.page-face::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    opacity: 0;
}

.page-face.front::after {
    background: linear-gradient(to right, rgba(0,0,0,0.18) 0%, transparent 12%);
}

.page-face.back::after {
    background: linear-gradient(to left, rgba(0,0,0,0.18) 0%, transparent 12%);
}

/* Estado Volteado */
.page.flipped {
    transform: rotateY(-180deg);
}



/* Contenedor principal del cordón */
.cordon-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cordon-svg {
    display: flex;
    filter: drop-shadow(4px 6px 8px rgba(0, 0, 0, 0.5));
    transform: rotate(90deg);
    position: relative;
    left: 0;
    top: 0;
}

/* Estilo de las líneas del cordón */
.cordon-linea {
    fill: none;
    stroke: var(--cordon-color);
    stroke-width: 14;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Textura trenzada/relieve del cordón */
.cordon-textura {
    fill: none;
    stroke: var(--cordon-luz);
    stroke-width: 14;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 4, 8; /* Efecto de trenzado */
    opacity: 0.4;
}

.nudo-base {
    fill: var(--cordon-color);
    stroke: var(--cordon-sombra);
    stroke-width: 3;
}

.nudo-trenza {
    fill: none;
    stroke: var(--cordon-luz);
    stroke-width: 4;
    stroke-linecap: round;
    opacity: 0.3;
}

.contain-cordon {
    width: calc(100% - 96px);
    top: 0;
    height: 6rem;
}

.patrick-hand-regular {
  font-family: "Patrick Hand", cursive;
  font-weight: 400;
  font-style: normal;
}





/* RESPONSIVE MOBILE (Adapta a 100vh vertical y ancho adaptable) */
@media (max-width: 768px) {
    .book-spine {
        display: none;
    }

    .page {
        width: 100vw !important;
        height: 100vh !important;
        left: 0 !important;
        right: 0 !important;
    }

    .page-face {
        padding: 2rem;
    }

    .page {
        transform-origin: top center !important;
    }

    .page-face.back {
        transform: rotateX(-180deg);
    }

    .page.flipped {
        transform: rotateX(180deg) !important;
    }

    .text-front-book {
        border-radius: 45%;
    }

    .text-front-book div span {
        font-size: 3.5rem;
        font-weight: bold;
        display: inline-block;
    }

    .text-front-book div:first-child span:nth-child(1) {
        color: #a38337;
        rotate: 15deg;
    }

    .text-front-book div:first-child span:nth-child(2) {
        font-size: 2.75rem;
        rotate: -5deg;
        color: #8f6b6d;
        
    }

    .text-front-book div:first-child span:nth-child(3) {
        color: #c66c52;
        rotate: -5deg;
    }


    .text-front-book div:nth-child(2) span:nth-child(1) {
        color: #8f6b6d;
        rotate: -8deg;
        font-size: 4.5rem;
    }

    .text-front-book div:nth-child(2) span:nth-child(2) {
        color: #c66c52;
        rotate: 8deg;
        transform: translateX(4px);
    }

    .text-front-book div:nth-child(2) span:nth-child(3) {
        color: #a38338;
        rotate: -8deg;
    }

    .text-front-book div:nth-child(2) span:nth-child(4) {
        color: #a9b0ba;
        rotate: 8deg;
    }

    .text-front-book div:nth-child(2) span:nth-child(5) {
        color: #a38337;
        rotate: -8deg;
    }

    .text-front-book div:nth-child(2) span:nth-child(6) {
        color: #aa6c57;
        rotate: 8deg;
    }

    .text-front-book div:nth-child(2) span:nth-child(7) {
        color: #baa47d;
        rotate: 8deg;
    }

    .text-front-book div:nth-child(2) span:nth-child(8) {
        color: #91554c;
        rotate: -8deg;
    }

    .text-front-book div:nth-child(2) span:nth-child(9) {
        color: #af9984;
        rotate: 8deg;
    }



    .text-front-book div:nth-child(3) span {
        color: #af9984;
        rotate: -12deg;
        font-size: 4.75rem;
    }

    .text-front-book div:nth-child(3) span:nth-child(2) {
        rotate: -10deg;
        color: #ad7463;
    }

    .text-front-book div:nth-child(3) span:nth-child(3) {
        rotate: -8deg;
        color: #a9b0ba;
    }

    .text-front-book div:nth-child(3) span:nth-child(4) {
        rotate: -6deg;
        color: #90564b;
    }

    .container-world-front-book {
        position: absolute;
        width: 125px;
        height: 125px;
        left: 50%;
        bottom: -95px;
        transform: translateX(-50%);
    }

    .container-world-front-book img {
        z-index: 5;
    }

    .container-world-front-book .tag {
        width: 90%;
        height: 15px;
        display: inline-block;
        background: linear-gradient(135deg, #ffd389d1, #ffa237f7); /* Color / Degradado */
        color: #ffffff;
        font-family: sans-serif;
        font-weight: bold;
        font-size: 1.2rem;
        padding: 12px 36px; /* Espacio interno para que respire el texto */
        clip-path: polygon(15px 0%, 100% 0%, calc(100% - 15px) 100%, 0% 100%);
        transition: transform 0.2s ease;
        z-index: 10;
        position: absolute;
        left: 50%;
        top: -7px;
        transform: translateX(-50%) rotate(-7deg);
        
    }

    .page-face .portrait {
        position: absolute;
        width: 100%;
        height: 100%;
        left: 0;
        top: 0;
        overflow: hidden;
    }

    .page-face .portrait img {
        position: absolute;
    }

    .page-face .portrait img:first-child {
        width: 115px;
        top: 0;
        rotate: 7deg;
        left: -25px;
    }

    .page-face .portrait img:nth-child(2) {
        width: 185px;
        top: 0;
        rotate: 15deg;
        right: -25px;
    }

    .page-face .portrait img:nth-child(3) {
        width: 115px;
        top: 45%;
        rotate: 7deg;
        right: -25px;
    }

    .page-face .portrait img:nth-child(4) {
        width: 115px;
        rotate: -7deg;
        left: -25px;
        bottom: 0px;
    }

    .page-face .portrait img:nth-child(5) {
        position: absolute;
        width: 200px;
        top: 40%;
        left: -15px;
        rotate: -15deg;
    }

    .page-face .card-message {
        position: absolute;
        z-index: 5;
        background: #fff4e4cc;
        width: 75%;
        height: 80%;
        transform: translate(-50%, -50%);
        top: 50%;
        left: 50%;
        border-radius: 1rem;
        backdrop-filter: blur(200px);
        box-shadow: 0 8px 8px rgba(0,0,0,.1);
    }

    .page-face .card-message * {
        font-family: "Caveat", cursive;
    }


    .page-face .card-message h2 {
        font-size: 1.75rem;
    }

    .page-face .card-message p {
        font-size: 1rem;
        line-height: 1.75rem;
    }

    .page-face .card-message .flower {
        width: 175px;
        position: absolute;
        right: -25px;
        bottom: -15px;
        filter: drop-shadow(0 8px 8px rgba(0,0,0,.25));
    }

    img.mi-guapa1 {
        position: absolute;
        width: 100px;
        right: -15px;
        border-radius: 16px;
        rotate: 16deg;
        bottom: -8px;
    }

    .page-face .card-message img.viaje {
        position: absolute;
        border-radius: 1rem;
        box-shadow: 0 8px 8px rgba(0,0,0,.125);
    }

    .page-face .card-message img.viaje.v1 {
        position: absolute;
        width: 200px;
        right: -25px;
        bottom: -8px;
        rotate: 15deg;
    }

    .page-face .card-message img.viaje.v2 {
        position: absolute;
        width: 150px;
        left: -5px;
        bottom: -4px;
        rotate: -5deg;
    }
}