@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Playfair+Display:ital,wght@0,500;0,600;1,500;1,600&display=swap');

/* ==================================================
   PALETA Y CONFIGURACIÓN GENERAL
================================================== */

:root {
    --pink: #c7a8f5;
    --deep: #7650a8;
    --ink: #493d5c;
    --cream: #fbf8ff;
    --lav: #eee6ff;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: 'DM Sans', sans-serif;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.22;
    z-index: -1;
    background:
        radial-gradient(circle at 12% 20%, #d9c4ff 0 2px, transparent 3px),
        radial-gradient(circle at 80% 35%, #bda5ee 0 2px, transparent 3px);
    background-size: 100px 120px;
}

/* ==================================================
   PORTADA
================================================== */

.hero {
    min-height: 100svh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 32px 20px;
    position: relative;
    background: linear-gradient(145deg, #f4edff 0%, #fbf8ff 52%, #e9ddff 100%);
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    width: 340px;
    height: 340px;
    border: 1px solid #cbb6ee;
    border-radius: 50%;
    opacity: 0.45;
    box-shadow: 0 0 0 25px #ffffff33, 0 0 0 55px #ffffff22;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.eyebrow {
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 0.72rem;
    color: var(--deep);
}

h1,
h2,
.poem {
    font-family: 'Playfair Display', serif;
}

h1 {
    font-size: clamp(3rem, 9vw, 6.5rem);
    line-height: 1.02;
    color: #7650a8;
    margin: 18px 0;
}

h1 em {
    font-weight: 500;
}

.subtitle {
    max-width: 520px;
    margin: 0 auto 28px;
    line-height: 1.8;
}

.button {
    border: 0;
    border-radius: 999px;
    background: var(--deep);
    color: #fff;
    padding: 14px 24px;
    font: 600 0.95rem 'DM Sans', sans-serif;
    cursor: pointer;
    box-shadow: 0 8px 24px #7650a833;
    transition: transform 0.25s, box-shadow 0.25s;
}

.button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px #7650a844;
}

.float {
    position: absolute;
    font-size: 24px;
    animation: drift 6s ease-in-out infinite;
    opacity: 0.7;
}

.f1 {
    top: 15%;
    left: 12%;
}

.f2 {
    top: 25%;
    right: 13%;
    animation-delay: 1s;
}

.f3 {
    bottom: 16%;
    left: 17%;
    animation-delay: 2s;
}

.f4 {
    bottom: 20%;
    right: 16%;
    animation-delay: 3s;
}

@keyframes drift {
    50% {
        transform: translateY(-18px) rotate(10deg);
    }
}

/* ==================================================
   SECCIONES Y ENCABEZADOS
================================================== */

section {
    max-width: 980px;
    margin: auto;
    padding: 85px 20px;
}

.section-head {
    text-align: center;
    margin-bottom: 38px;
}

h2 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    color: #7650a8;
    margin: 8px 0;
}

.section-head p {
    line-height: 1.7;
    max-width: 600px;
    margin: auto;
}

/* ==================================================
   HISTORIA Y CAPÍTULOS
================================================== */

.story-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    color: var(--deep);
    font-size: 0.85rem;
}

.text-button {
    border: 0;
    background: transparent;
    color: var(--deep);
    font-weight: 600;
    cursor: pointer;
    padding: 10px;
}

.text-button:hover {
    color: #a17bd4;
}

.story {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.chapter {
    display: grid;
    grid-template-columns: minmax(220px, 0.85fr) 1.15fr;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid #e2d5f5;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 12px 35px rgba(100, 65, 145, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.chapter:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(100, 65, 145, 0.14);
}

.chapter-art {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    font-size: 4rem;
    background: linear-gradient(135deg, #e9dcff, #dcd0f5);
    overflow: hidden;
}

.chapter-art img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 15px;
}

/* GIF: conservar proporción y mostrar el fotograma completo */
.chapter-art.chapter-gif {
    height: auto;
    min-height: 260px;
    aspect-ratio: auto;
    padding: 12px;
    overflow: hidden;
    line-height: 0;
    background: linear-gradient(145deg, #eee5ff, #dcd0f5);
}

.chapter-art.chapter-gif img {
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
}

.chapter-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chapter-content small,
.chapter small {
    color: #9874ce;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    font-weight: 700;
    text-transform: uppercase;
}

.chapter-content h3,
.chapter h3 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-style: italic;
    color: #7650a8;
    margin: 12px 0;
}

.chapter p {
    line-height: 1.8;
}

.chapter-intro {
    color: #665675;
    font-size: 0.98rem;
    line-height: 1.8;
    margin: 0;
}

/* Recuerdos desplegables */
.chapter-more {
    margin-top: 15px;
    border-top: 1px solid #eee5f8;
    padding-top: 15px;
}

.chapter-more summary {
    cursor: pointer;
    list-style: none;
    color: #805bb1;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.chapter-more summary::-webkit-details-marker {
    display: none;
}

.chapter-more summary span {
    font-size: 1.3rem;
    transition: transform 0.3s;
}

.chapter-more[open] summary span {
    transform: rotate(45deg);
}

.chapter-full {
    animation: chapterOpen 0.45s ease;
    padding-top: 12px;
}

.chapter-full p {
    color: #62566e;
    line-height: 1.9;
    margin: 0 0 17px;
}

.chapter-ending {
    color: #8054ad !important;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.12rem;
    border-left: 3px solid #b99ae7;
    padding: 12px 0 12px 16px;
}

@keyframes chapterOpen {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Capítulo 04: tarjeta lila */
.chapter-04 {
    background: linear-gradient(135deg, #eee2fa, #e5d2f5, #f1e8fa);
    border: 1px solid #d6b9ed;
    color: #49345f;
}

.chapter-04 .chapter-art {
    background: linear-gradient(145deg, #e5d2f5, #d8c1ec);
}

.chapter-04 .chapter-content,
.chapter-04 .chapter-full {
    color: #49345f;
}

.chapter-04 .chapter-content h3 {
    color: #67438b;
}

.chapter-04 .chapter-content small {
    color: #9265b6;
}

.chapter-04 .chapter-intro {
    color: #74578d;
}

.chapter-04 .chapter-more summary {
    color: #8055a5;
}

.chapter-04 .chapter-full p {
    color: #49345f;
}

.chapter-04 .chapter-ending {
    color: #79519d !important;
}

/* ==================================================
   POEMA
================================================== */

.poem-wrap {
    background: linear-gradient(140deg, #f0e8ff, #e9e0ff);
    border-radius: 30px;
    padding: clamp(28px, 6vw, 60px);
    text-align: center;
    border: 1px solid #dfd1f3;
}

.poem {
    font-size: clamp(1.15rem, 2.4vw, 1.5rem);
    line-height: 2;
    color: #514365;
    white-space: pre-line;
}

.poem strong {
    color: #7650a8;
}

/* ==================================================
   GALERÍA
================================================== */

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.polaroid {
    background: #fff;
    padding: 12px 12px 28px;
    box-shadow: 0 10px 25px #65475b18;
    transform: rotate(var(--rot));
    transition: transform 0.3s;
}

.polaroid:hover {
    transform: rotate(0) translateY(-7px) scale(1.025);
}

.photo {
    aspect-ratio: 4 / 5;
    background: linear-gradient(135deg, #e6d9ff, #dcd4f5);
    display: grid;
    place-items: center;
    color: #8065a8;
    text-align: center;
    padding: 12px;
    overflow: hidden;
}

.photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.polaroid p {
    text-align: center;
    font: italic 1.1rem 'Playfair Display', serif;
    margin: 14px 0 0;
    color: #685080;
}

/* ==================================================
   CONTADOR DE NUESTRA HISTORIA
================================================== */

.love-counter {
    padding-top: 65px;
    padding-bottom: 85px;
}

.counter-card {
    max-width: 750px;
    margin: auto;
    padding: 45px 25px;
    text-align: center;
    border-radius: 30px;
    background: linear-gradient(145deg, #eee5ff, #dcd0f5, #f5efff);
    border: 1px solid #d4c1f0;
    box-shadow: 0 15px 40px #7650a822;
}

.counter-heart {
    font-size: 3rem;
    color: #9874ce;
    animation: heartbeat 1.5s infinite;
}

.counter-caption {
    color: #685080;
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-style: italic;
}

.counter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 30px 0;
}

.counter-item {
    padding: 20px 8px;
    background: #ffffffb8;
    border: 1px solid #d9c9f0;
    border-radius: 18px;
}

.counter-item span {
    display: block;
    font-size: clamp(1.7rem, 5vw, 2.7rem);
    font-weight: 600;
    color: #7650a8;
    font-variant-numeric: tabular-nums;
}

.counter-item small {
    display: block;
    margin-top: 8px;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    color: #8065a8;
}

.counter-message {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-style: italic;
    color: #7650a8;
    margin-top: 25px;
}

.counter-date {
    color: #9874ce;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    margin-top: 20px;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    15% {
        transform: scale(1.15);
    }

    30% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.1);
    }
}

/* ==================================================
   PROMESA Y PIE DE PÁGINA
================================================== */

.promise {
    text-align: center;
    background: #fff;
    border-radius: 28px;
    padding: 45px 25px;
    border: 1px solid #e2d5f5;
}

.promise p {
    font: italic clamp(1.4rem, 3vw, 2rem) 'Playfair Display', serif;
    line-height: 1.7;
    max-width: 680px;
    margin: 18px auto;
}

footer {
    text-align: center;
    padding: 35px 15px;
    color: #8065a8;
    font-size: 0.9rem;
}

/* ==================================================
   MÚSICA Y EFECTOS
================================================== */

.music {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 5;
    border: 1px solid #d8c8f0;
    background: #fff;
    color: #7650a8;
    border-radius: 999px;
    padding: 12px 16px;
    box-shadow: 0 5px 20px #7650a822;
    cursor: pointer;
}

.heart {
    position: fixed;
    pointer-events: none;
    z-index: 10;
    animation: rise 1.7s ease-out forwards;
}

@keyframes rise {
    to {
        transform: translateY(-130px) scale(1.7);
        opacity: 0;
    }
}

/* Animación de aparición al hacer scroll */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s, transform 0.8s;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

/* ==================================================
   MENSAJE DEL DÍA
================================================== */

.daily-message {
    max-width: 700px;
    margin: 70px auto;
    padding: 35px 25px;
    text-align: center;
    border-radius: 25px;
    background: linear-gradient(135deg, rgba(190, 160, 230, 0.18), rgba(120, 80, 170, 0.12));
    border: 1px solid rgba(190, 160, 230, 0.35);
    box-shadow: 0 10px 35px rgba(80, 40, 120, 0.12);
}

.message-decoration {
    display: block;
    color: #c5a4ed;
    font-size: 0.85rem;
    letter-spacing: 3px;
    margin-bottom: 20px;
}

.daily-phrase {
    color: #441c80;
    font-size: 1.3rem;
    line-height: 1.7;
    font-style: italic;
    transition: opacity 0.4s ease;
}

.message-heart {
    display: block;
    margin-top: 15px;
    color: #d9b5ff;
    font-size: 1.8rem;
}


/* Nuestra primera fotografía juntos */
.first-photo {
    max-width: 760px;
    margin: 90px auto;
    padding: 35px 20px;
    text-align: center;
}

.first-photo-subtitle {
    display: block;
    color: #9b70c4;
    font-size: 0.9rem;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.first-photo h2 {
    color: #70449b;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    margin-bottom: 18px;
}

.first-photo-text {
    max-width: 550px;
    margin: 0 auto 30px;
    color: #776783;
    line-height: 1.8;
}

.photo-placeholder {
    max-width: 390px;
    aspect-ratio: 4 / 5;
    margin: 0 auto;
    padding: 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 35px rgba(100, 65, 130, 0.16);
    transform: rotate(-2deg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-placeholder:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 0 16px 40px rgba(100, 65, 130, 0.23);
}

.photo-placeholder-inner {
    width: 100%;
    height: 100%;
    border: 2px dashed #d4b9e9;
    border-radius: 7px;
    background: linear-gradient(145deg, #faf5ff, #eee1fa);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.camera-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 5px rgba(100, 65, 130, 0.15));
}

.photo-placeholder-title {
    color: #8053a7;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 12px;
}

.photo-placeholder-note {
    color: #9b82ac;
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 230px;
}

.photo-placeholder-heart {
    color: #b58ad5;
    font-size: 2rem;
    margin-top: 22px;
}

.first-photo-ending {
    max-width: 450px;
    margin: 30px auto 0;
    color: #896c9e;
    font-style: italic;
    line-height: 1.8;
}

@media (max-width: 480px) {
    .first-photo {
        margin: 60px auto;
        padding: 25px 18px;
    }

    .photo-placeholder {
        max-width: 310px;
    }
}


/* =================================
   RULETA DE MI OSITA
================================= */

.love-wheel {
    max-width: 750px;
    margin: 70px auto;
    padding: 40px 20px;
    text-align: center;
    border-radius: 28px;
    background: linear-gradient(145deg, #f0e5ff, #e3d2f5, #f5edff);
    border: 1px solid #d5bce9;
    box-shadow: 0 12px 35px rgba(100, 65, 145, 0.10);
}

.wheel-subtitle {
    color: #9874ce;
    letter-spacing: 2px;
    font-size: 0.85rem;
}

.love-wheel h2 {
    color: #7650a8;
    margin: 15px 0;
}

.wheel-description {
    color: #685080;
    line-height: 1.7;
}

.wheel-container {
    width: min(320px, 85vw);
    aspect-ratio: 1;
    margin: 45px auto 30px;
    position: relative;
}

.wheel {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 50%;
    border: 8px solid #fff;
    background: conic-gradient(#b994df 0deg 45deg,
            #e5c9f5 45deg 90deg,
            #a984d1 90deg 135deg,
            #ead8fa 135deg 180deg,
            #b994df 180deg 225deg,
            #e5c9f5 225deg 270deg,
            #a984d1 270deg 315deg,
            #ead8fa 315deg 360deg);
    box-shadow:
        0 8px 25px rgba(75, 40, 110, 0.2),
        inset 0 0 0 3px rgba(255, 255, 255, 0.6);
    transition: transform 5s cubic-bezier(0.12, 0.75, 0.15, 1);
}


/* Textos de la ruleta */
.wheel-labels {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.wheel-labels span {
    position: absolute;
    width: 76px;
    text-align: center;
    font-size: 10px;
    line-height: 1.15;
    font-weight: 700;
    white-space: normal;
    overflow-wrap: normal;
    transform: translate(-50%, -50%);
    rotate: 0deg;
}

/* Posición individual de cada premio */
.wheel-labels span:nth-child(1) {
    left: 35%;
    top: 25%;
}

.wheel-labels span:nth-child(2) {
    left: 65%;
    top: 25%;
}

.wheel-labels span:nth-child(3) {
    left: 78%;
    top: 40%;
}

.wheel-labels span:nth-child(4) {
    left: 78%;
    top: 62%;
}

.wheel-labels span:nth-child(5) {
    left: 65%;
    top: 77%;
}

.wheel-labels span:nth-child(6) {
    left: 35%;
    top: 77%;
}

.wheel-labels span:nth-child(7) {
    left: 22%;
    top: 62%;
}

.wheel-labels span:nth-child(8) {
    left: 22%;
    top: 40%;
}

/* Ajuste para pantallas pequeñas */
@media (max-width: 400px) {
    .wheel-labels span {
        width: 62px;
        font-size: 9px;
    }
}


.wheel-center {
    position: absolute;
    width: 55px;
    height: 55px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    border: 4px solid #d5bce9;
    font-size: 1.5rem;
    z-index: 2;
    box-shadow: 0 3px 10px #7650a833;
}

.wheel-pointer {
    position: absolute;
    z-index: 5;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    color: #7650a8;
    font-size: 2rem;
    text-shadow: 0 2px 4px #7650a844;
}

.spin-button {
    padding: 15px 30px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #9c70c9, #70449c);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px #7650a833;
    transition: 0.25s;
}

.spin-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px #7650a844;
}

.spin-button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.wheel-result {
    max-width: 480px;
    min-height: 75px;
    margin: 25px auto 0;
    padding: 15px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.55);
    color: #67438b;
    line-height: 1.7;
    border: 1px solid rgba(190, 155, 220, 0.4);
}

.wheel-result p {
    margin: 0;
}


@media (max-width: 400px) {
    .wheel-labels span {
        width: 76px;
        margin-left: -38px;
        font-size: 0.64rem;
        transform:
            rotate(var(--angle)) translateY(-88px) rotate(calc(-1 * var(--angle)));
    }
}

/* ==================================================
   DISEÑO RESPONSIVE
================================================== */

@media (max-width: 700px) {
    .story {
        gap: 22px;
    }

    .chapter {
        grid-template-columns: 1fr;
    }

    .chapter-art {
        min-height: 150px;
    }

    .chapter-art.chapter-gif {
        min-height: 0;
        height: auto;
    }

    .chapter-art.chapter-gif img {
        height: auto;
        max-height: none;
    }

    .chapter-content {
        padding: 22px;
    }

    .story-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 450px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .polaroid {
        padding: 8px 8px 20px;
    }

    .polaroid p {
        font-size: 0.95rem;
    }

    .counter-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .counter-card {
        padding: 30px 15px;
    }

    .chapter-04 .chapter-content {
        padding: 18px;
    }
}