/* Reset y variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --paper-cream: #fff8f0;
    --paper-light-blue: #e6f2ff;
    --paper-sky-blue: #d6ebff;
    --paper-mint: #e6fff0;
    --paper-soft-blue: #e6f5ff;
    --paper-yellow: #fff9e6;
    --pin-red: #ff6b6b;
    --pin-light-blue: #87ceeb;
    --pin-navy: #1e3a8a;
    --pin-yellow: #ffd93d;
    --pin-purple: #c8a8ff;
    --clip-silver: #c0c0c0;
    --clip-light-blue: #87ceeb;
    --clip-navy: #1e3a8a;
    --clip-blue: #4a90e2;
    --text-soft: #8b7a6a;
    --text-dark: #6b5a4a;
    --shadow-paper: rgba(0, 0, 0, 0.06);
    --shadow-deep: rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Comic Sans MS', 'Marker Felt', 'Arial', cursive;
    background:
        repeating-linear-gradient(0deg,
            #fef9f4 0px,
            #fef9f4 2px,
            #fff8f0 2px,
            #fff8f0 4px);
    min-height: 100vh;
    overflow: hidden;
    /* Ocultar scroll durante transiciones */
    position: relative;
    color: var(--text-dark);
    line-height: 1.6;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Textura de papel de fondo */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(135, 206, 235, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(74, 144, 226, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(30, 58, 138, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 60% 60%, rgba(214, 235, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Contenedor de secciones - transiciones automáticas */
.sections-container {
    position: relative;
    width: 100%;
    height: 100vh;
    z-index: 1;
    perspective: 1500px;
    perspective-origin: center center;
    overflow: hidden;
}

.section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    opacity: 0;
    transform: translateY(80px) translateZ(-100px) rotateX(10deg) scale(0.95);
    transform-style: preserve-3d;
    transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
    pointer-events: none;
}

.photo-section {
    min-height: 100vh;
    padding: 2rem 1.5rem;
}

.section.active {
    opacity: 1;
    transform: translateY(0) translateZ(0) rotateX(0deg) scale(1);
    pointer-events: auto;
    z-index: 10;
}

.section.visible {
    opacity: 1;
    transform: translateY(0) translateZ(0) rotateX(0deg) scale(1);
}

.section-content {
    text-align: center;
    width: 100%;
    max-width: 600px;
    transform-style: preserve-3d;
    opacity: 0;
    transform: translateY(30px) translateZ(-50px) rotateX(5deg);
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s, opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s;
}

.section:first-child .section-content,
.section.visible .section-content {
    opacity: 1;
    transform: translateY(0) translateZ(0) rotateX(0deg);
}

/* Elementos de papel */
.paper-card {
    position: relative;
    background: var(--paper-cream);
    padding: 2.5rem 2rem;
    border-radius: 0;
    box-shadow:
        0 3px 10px var(--shadow-paper),
        0 6px 20px var(--shadow-paper),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transform: rotate(-1deg);
    border: 2px dashed rgba(135, 206, 235, 0.4);
    margin: 1rem 0;
}

.paper-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px);
    pointer-events: none;
}

.paper-title {
    position: relative;
    display: inline-block;
    padding: 1.5rem 2.5rem;
    background: var(--paper-light-blue);
    box-shadow:
        0 3px 10px var(--shadow-paper),
        0 6px 20px var(--shadow-paper);
    transform: rotate(1deg);
    border: 2px dashed rgba(135, 206, 235, 0.5);
    margin: 1rem 0;
}

.gallery-header {
    padding: 2rem 2.5rem;
}

.paper-note {
    position: relative;
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--paper-yellow);
    box-shadow:
        0 3px 10px var(--shadow-paper),
        0 6px 20px var(--shadow-paper);
    transform: rotate(-0.5deg);
    border: 2px dashed rgba(255, 218, 185, 0.4);
    margin: 1rem 0;
}

/* Chinchetas (Pins) */
.pin {
    position: absolute;
    width: 16px;
    height: 16px;
    z-index: 20;
}

.pin::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50% 50% 50% 0;
    background: var(--pin-red);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset -2px -2px 0 rgba(0, 0, 0, 0.1);
    transform: rotate(-45deg);
}

.pin::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 6px;
    width: 2px;
    height: 8px;
    background: #333;
    border-radius: 1px;
}

.pin-top-left {
    top: -8px;
    left: -8px;
}

.pin-top-right {
    top: -8px;
    right: -8px;
}

/* Variar colores de chinchetas - azules */
.photo-item:nth-child(1) .pin-top-left::before {
    background: var(--pin-light-blue);
}

.photo-item:nth-child(1) .pin-top-right::before {
    background: var(--pin-navy);
}

.photo-item:nth-child(2) .pin-top-left::before {
    background: var(--pin-yellow);
}

.photo-item:nth-child(2) .pin-top-right::before {
    background: var(--pin-light-blue);
}

.photo-item:nth-child(3) .pin-top-left::before {
    background: var(--pin-navy);
}

.photo-item:nth-child(3) .pin-top-right::before {
    background: var(--pin-yellow);
}

.photo-item:nth-child(4) .pin-top-left::before {
    background: var(--pin-light-blue);
}

.photo-item:nth-child(4) .pin-top-right::before {
    background: var(--pin-navy);
}

.photo-item:nth-child(5) .pin-top-left::before {
    background: var(--pin-yellow);
}

.photo-item:nth-child(5) .pin-top-right::before {
    background: var(--pin-light-blue);
}

.photo-item:nth-child(6) .pin-top-left::before {
    background: var(--pin-navy);
}

.photo-item:nth-child(6) .pin-top-right::before {
    background: var(--pin-light-blue);
}

/* Clips */
.clip {
    position: absolute;
    width: 30px;
    height: 20px;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
}

.clip::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 20px;
    border: 3px solid var(--clip-light-blue);
    border-bottom: none;
    border-radius: 15px 15px 0 0;
    background: linear-gradient(to bottom, #87ceeb 0%, #4a90e2 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.clip-top::before {
    border-color: var(--clip-light-blue);
    background: linear-gradient(to bottom, #87ceeb 0%, #4a90e2 100%);
}

.clip-top {
    top: -12px;
}

/* Timer */
.timer-container {
    margin-bottom: 2rem;
    transform: rotate(-0.5deg);
}

.timer-label {
    font-size: 0.9rem;
    color: var(--text-soft);
    margin-bottom: 1.5rem;
    font-weight: normal;
    letter-spacing: 0.5px;
}

.timer-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.timer-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.timer-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-dark);
    line-height: 1;
    margin-bottom: 0.5rem;
    font-variant-numeric: tabular-nums;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.timer-label-small {
    font-size: 0.7rem;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.timer-separator {
    font-size: 2rem;
    color: var(--text-soft);
    font-weight: bold;
    margin: 0 0.3rem;
    opacity: 0.6;
}

/* Títulos */
.main-title {
    font-size: 3.5rem;
    color: var(--text-dark);
    margin-bottom: 0;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.08);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-soft);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Mensajes */
.message-card {
    background: var(--paper-sky-blue);
    padding: 3rem 2.5rem;
    transform: rotate(0.5deg);
    border: 2px dashed rgba(74, 144, 226, 0.4);
}

.message-text {
    font-size: 1.3rem;
    color: var(--text-dark);
    line-height: 1.8;
    margin: 0.8rem 0;
    font-weight: 600;
}

.message-text-large {
    font-size: 1.8rem;
    color: var(--text-dark);
    line-height: 1.8;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Mensaje largo personalizable */
.long-message-card {
    background: var(--paper-light-blue);
    padding: 3rem 2.5rem;
    transform: rotate(0.3deg);
    border: 2px dashed rgba(74, 144, 226, 0.4);
    max-width: 700px;
    margin: 0 auto;
}

.long-message-text {
    font-size: 1.2rem;
    color: var(--text-dark);
    line-height: 2;
    font-weight: 500;
    text-align: left;
}

.long-message-text p {
    margin: 1rem 0;
    text-align: left;
}

/* Galería de fotos */
.gallery-content {
    max-width: 100%;
    padding: 1rem;
}

.section-title {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Estilo para header de galería */
.gallery-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.gallery-header .section-title {
    margin-bottom: 0;
    margin-top: 0.5rem;
}

/* Ícono de cámara estilizado */
.camera-icon {
    width: 80px;
    height: 60px;
    background: var(--paper-light-blue);
    border-radius: 8px;
    position: relative;
    box-shadow:
        0 4px 12px var(--shadow-paper),
        0 2px 6px var(--shadow-deep);
    border: 3px solid var(--pin-navy);
    transform: rotate(-2deg);
    animation: cameraFloat 3s ease-in-out infinite;
}

.camera-icon::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 12px;
    background: var(--pin-navy);
    border-radius: 4px 4px 0 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.camera-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 35px;
    height: 35px;
    border: 4px solid var(--pin-navy);
    border-radius: 50%;
    background: var(--paper-cream);
    box-shadow:
        inset 0 0 0 3px var(--paper-light-blue),
        0 0 0 2px var(--pin-navy);
}

@keyframes cameraFloat {

    0%,
    100% {
        transform: rotate(-2deg) translateY(0);
    }

    50% {
        transform: rotate(2deg) translateY(-5px);
    }
}

.photo-mosaic {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Contenedor para foto individual */
.photo-single {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* Grid para 4 fotos (2x2) */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

.photo-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 0;
    overflow: visible;
    box-shadow:
        0 6px 16px var(--shadow-paper),
        0 12px 32px var(--shadow-deep);
    cursor: pointer;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease, opacity 0.8s ease;
    background: var(--paper-cream);
    opacity: 0;
    transform: translateY(120px) translateZ(-200px) rotateX(30deg) scale(0.6) rotate(var(--rotation, 0deg));
    transform-style: preserve-3d;
    padding: 8px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    will-change: transform, opacity;
    margin: 0 auto;
}

.photo-item:nth-child(odd) {
    --rotation: -1.5deg;
    background: var(--paper-light-blue);
}

.photo-item:nth-child(even) {
    --rotation: 1.5deg;
    background: var(--paper-sky-blue);
}

.photo-item:nth-child(1) {
    animation-delay: 0.1s;
}

.photo-item:nth-child(2) {
    animation-delay: 0.2s;
}

.photo-item:nth-child(3) {
    animation-delay: 0.3s;
}

.photo-item:nth-child(4) {
    animation-delay: 0.4s;
}

.photo-item:nth-child(5) {
    animation-delay: 0.5s;
}

.photo-item:nth-child(6) {
    animation-delay: 0.6s;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.photo-item:hover {
    transform: rotate(0deg) scale(1.08) translateZ(20px);
    box-shadow:
        0 8px 20px var(--shadow-paper),
        0 16px 40px var(--shadow-deep),
        0 0 30px rgba(135, 206, 235, 0.3);
    z-index: 10;
}

.photo-item:hover img {
    transform: scale(1.05) translateZ(5px);
}

/* Eliminado - ahora se usa photoFloatIn */

/* Sección final */
.final-message {
    position: relative;
    background: var(--paper-soft-blue);
    padding: 4rem 2.5rem;
    border-radius: 0;
    box-shadow:
        0 5px 20px var(--shadow-paper),
        0 10px 40px var(--shadow-deep);
    border: 3px dashed rgba(30, 58, 138, 0.4);
    transform: rotate(-0.5deg);
}

.final-message::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 20px;
    border: 3px solid var(--clip-navy);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(to bottom, #4a90e2 0%, #1e3a8a 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 15;
}

.question-title {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.valentine-title {
    font-size: 3rem;
    color: var(--text-dark);
    margin-bottom: 3rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Botón */
.button-container {
    margin-top: 2rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.action-button {
    position: relative;
    padding: 1.2rem 3.5rem;
    border-radius: 25px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Sans MS', cursive;
    letter-spacing: 1px;
    min-width: 140px;
    min-height: 60px;
    box-shadow:
        0 6px 12px var(--shadow-paper),
        0 3px 6px var(--shadow-paper);
    transform: rotate(-1deg);
    border: 3px solid;
}

.action-button-yes {
    background: linear-gradient(135deg, var(--paper-light-blue) 0%, var(--paper-sky-blue) 100%);
    border-color: var(--pin-navy);
    color: var(--pin-navy);
}

.action-button-yes:hover {
    background: linear-gradient(135deg, var(--paper-sky-blue) 0%, var(--paper-light-blue) 100%);
    transform: rotate(0deg) scale(1.1);
    box-shadow:
        0 8px 16px var(--shadow-paper),
        0 6px 12px var(--shadow-deep);
    border-color: var(--pin-navy);
}

.action-button-no {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border-color: #999;
    color: #666;
    transform: rotate(1deg);
}

.action-button-no:hover {
    background: linear-gradient(135deg, #e0e0e0 0%, #d0d0d0 100%);
    transform: rotate(0deg) scale(1.05);
    box-shadow:
        0 8px 16px var(--shadow-paper),
        0 6px 12px var(--shadow-deep);
    border-color: #777;
}

.action-button:active {
    transform: rotate(0deg) scale(0.98);
}

/* Indicadores de sección - ocultos en scroll */
.section-indicators {
    display: none;
}

/* Flecha indicadora de scroll */
.scroll-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    text-align: center;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.scroll-indicator.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

.scroll-arrow {
    width: 40px;
    height: 40px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 0 0 2px rgba(30, 58, 138, 0.2);
    animation: bounceArrow 2s infinite ease-in-out;
}

.scroll-arrow span {
    font-size: 24px;
    color: var(--pin-navy);
    display: block;
    animation: pulseArrow 2s infinite ease-in-out;
}

.scroll-text {
    font-size: 0.85rem;
    color: var(--text-dark);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    margin: 0;
}

@keyframes bounceArrow {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes pulseArrow {

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

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Stickers flotantes decorativos */
.floating-stickers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.sticker-item {
    position: absolute;
    width: 50px;
    height: 50px;
    opacity: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        0 0 0 2px rgba(255, 255, 255, 0.8),
        inset 0 0 0 1px rgba(0, 0, 0, 0.1);
    transform: translateY(100vh) rotate(var(--sticker-rotation, 0deg));
    animation: floatSticker 15s infinite ease-in-out;
}

.sticker-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sticker-item:nth-child(1) {
    left: 10%;
    animation-delay: 0.5s;
    animation-duration: 14s;
    --sticker-rotation: -5deg;
}

.sticker-item:nth-child(2) {
    left: 25%;
    animation-delay: 1s;
    animation-duration: 13s;
    --sticker-rotation: 8deg;
}

.sticker-item:nth-child(3) {
    left: 45%;
    animation-delay: 1.5s;
    animation-duration: 15s;
    --sticker-rotation: -10deg;
}

.sticker-item:nth-child(4) {
    left: 65%;
    animation-delay: 0.8s;
    animation-duration: 14s;
    --sticker-rotation: 6deg;
}

.sticker-item:nth-child(5) {
    left: 80%;
    animation-delay: 1.2s;
    animation-duration: 16s;
    --sticker-rotation: -7deg;
}

.sticker-item:nth-child(6) {
    left: 15%;
    animation-delay: 2s;
    animation-duration: 17s;
    --sticker-rotation: 9deg;
}

.sticker-item:nth-child(7) {
    left: 55%;
    animation-delay: 1.3s;
    animation-duration: 15s;
    --sticker-rotation: -6deg;
}

.sticker-item:nth-child(8) {
    left: 90%;
    animation-delay: 1.8s;
    animation-duration: 18s;
    --sticker-rotation: 7deg;
}

.sticker-item:nth-child(9) {
    left: 5%;
    animation-delay: 2.2s;
    animation-duration: 16s;
    --sticker-rotation: -8deg;
}

.sticker-item:nth-child(10) {
    left: 35%;
    animation-delay: 0.7s;
    animation-duration: 17s;
    --sticker-rotation: 5deg;
}

.sticker-item:nth-child(11) {
    left: 75%;
    animation-delay: 2.5s;
    animation-duration: 14s;
    --sticker-rotation: -9deg;
}

.sticker-item:nth-child(12) {
    left: 50%;
    animation-delay: 1.6s;
    animation-duration: 19s;
    --sticker-rotation: 6deg;
}

.sticker-item:nth-child(13) {
    left: 95%;
    animation-delay: 2.8s;
    animation-duration: 15s;
    --sticker-rotation: -5deg;
}

@keyframes floatSticker {
    0% {
        transform: translateY(100vh) rotate(var(--sticker-rotation, 0deg));
        opacity: 0;
    }

    5% {
        opacity: 0;
    }

    10% {
        opacity: 0.5;
    }

    90% {
        opacity: 0.5;
    }

    95% {
        opacity: 0;
    }

    100% {
        transform: translateY(-150px) rotate(calc(var(--sticker-rotation, 0deg) + 360deg));
        opacity: 0;
    }
}

/* Confeti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--pin-light-blue);
    animation: confetti-fall 3s linear forwards;
}

.confetti:nth-child(2n) {
    background: var(--pin-yellow);
}

.confetti:nth-child(3n) {
    background: var(--pin-navy);
}

.confetti:nth-child(4n) {
    background: var(--paper-mint);
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Partículas de transición */
.transition-particle {
    position: fixed;
    pointer-events: none;
    z-index: 500;
}

/* Efectos de profundidad adicionales en elementos - activados por scroll */
.paper-card,
.paper-title,
.paper-note,
.message-card,
.final-message {
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    transform: translateY(40px) translateZ(-60px) rotateX(10deg) scale(0.9);
}

.section.visible .paper-card,
.section.visible .paper-title,
.section.visible .paper-note {
    animation: floatIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s both;
}

.section.visible .message-card {
    animation: floatIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s both;
}

.section.visible .final-message {
    animation: floatIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.5s both;
}

@keyframes floatIn {
    0% {
        opacity: 0;
        transform: translateY(40px) translateZ(-60px) rotateX(10deg) scale(0.9);
    }

    60% {
        transform: translateY(-5px) translateZ(10px) rotateX(-2deg) scale(1.02);
    }

    100% {
        opacity: 1;
        transform: translateY(0) translateZ(0) rotateX(0deg) scale(1);
    }
}

/* Animación individual para cada foto - activada por transición */
.photo-section.active .photo-item {
    opacity: 1;
    transform: translateY(0) translateZ(0) rotateX(0deg) scale(1) rotate(var(--rotation, 0deg));
    transition: transform 1.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Efecto de bounce sutil al aparecer */
@keyframes photoAppear {
    0% {
        opacity: 0;
        transform: translateY(120px) translateZ(-200px) rotateX(30deg) scale(0.6) rotate(var(--rotation, 0deg));
    }

    60% {
        transform: translateY(-15px) translateZ(20px) rotateX(-3deg) scale(1.05) rotate(calc(var(--rotation, 0deg) + 3deg));
    }

    100% {
        opacity: 1;
        transform: translateY(0) translateZ(0) rotateX(0deg) scale(1) rotate(var(--rotation, 0deg));
    }
}

.photo-section.active .photo-item {
    animation: photoAppear 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Delays escalonados para las 4 fotos */
.photo-section.active .photo-item:nth-child(1) {
    animation-delay: 0.1s;
}

.photo-section.active .photo-item:nth-child(2) {
    animation-delay: 0.2s;
}

.photo-section.active .photo-item:nth-child(3) {
    animation-delay: 0.3s;
}

.photo-section.active .photo-item:nth-child(4) {
    animation-delay: 0.4s;
}

/* Variar rotaciones para cada foto */
.photo-section:nth-child(odd) .photo-item {
    --rotation: -2deg;
    background: var(--paper-light-blue);
}

.photo-section:nth-child(even) .photo-item {
    --rotation: 2deg;
    background: var(--paper-sky-blue);
}

/* Efecto parallax en elementos durante scroll */
.section.visible .timer-container {
    animation: timerFloatIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both;
}

@keyframes timerFloatIn {
    0% {
        opacity: 0;
        transform: translateY(30px) translateZ(-60px) rotateX(10deg) scale(0.85);
    }

    100% {
        opacity: 1;
        transform: translateY(0) translateZ(0) rotateX(0deg) scale(1);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .sections-container {
        perspective: 1000px;
    }

    .section {
        min-height: 100vh;
        padding: 2rem 1rem;
        transform: translateY(60px) translateZ(-80px) rotateX(8deg) scale(0.97);
    }

    .section.visible {
        transform: translateY(0) translateZ(0) rotateX(0deg) scale(1);
    }

    .main-title {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .message-text {
        font-size: 1.1rem;
    }

    .message-text-large {
        font-size: 1.5rem;
    }

    .valentine-title {
        font-size: 2.2rem;
    }

    .question-title {
        font-size: 1.4rem;
    }

    .camera-icon {
        width: 60px;
        height: 45px;
    }

    .camera-icon::before {
        width: 24px;
        height: 10px;
    }

    .camera-icon::after {
        width: 28px;
        height: 28px;
        border-width: 3px;
    }

    .gallery-header {
        padding: 1.5rem 2rem;
    }

    .timer-value {
        font-size: 2rem;
    }

    .timer-label-small {
        font-size: 0.7rem;
    }

    .photo-item {
        padding: 5px;
    }

    .photo-grid {
        max-width: 95%;
        gap: 1rem;
        padding: 0.5rem;
    }

    .photo-single {
        max-width: 90%;
    }

    .photo-section {
        min-height: 100vh;
        padding: 1rem 0.5rem;
    }

    .long-message-card {
        padding: 2rem 1.5rem;
        max-width: 95%;
    }

    .long-message-text {
        font-size: 1rem;
        line-height: 1.8;
    }

    .long-message-text p {
        margin: 0.8rem 0;
    }

    .gallery-content {
        padding: 0.5rem;
    }

    .section-content {
        padding: 0.5rem;
    }

    .section {
        padding: 2rem 1rem;
    }

    .timer-container {
        padding: 1.5rem;
    }

    .final-message {
        padding: 2.5rem 1.5rem;
    }

    .action-button {
        padding: 0.9rem 2.5rem;
        font-size: 1rem;
        min-width: 120px;
    }

    .button-container {
        gap: 1rem;
        flex-direction: column;
    }

    .pin {
        width: 12px;
        height: 12px;
    }

    .pin::before {
        width: 10px;
        height: 10px;
    }

    .scroll-arrow {
        width: 35px;
        height: 35px;
    }

    .scroll-arrow span {
        font-size: 20px;
    }

    .scroll-text {
        font-size: 0.75rem;
    }

    .scroll-indicator {
        bottom: 20px;
    }
}

/* Loader de precarga */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--paper-cream);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out;
}

.loader-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(30, 58, 138, 0.2);
    border-top-color: var(--pin-navy);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

.loader-text {
    font-size: 1.2rem;
    color: var(--text-dark);
    font-weight: 600;
    text-align: center;
}

.loader-progress {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-soft);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Control de música */
.music-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid var(--pin-navy);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 0 0 2px rgba(30, 58, 138, 0.2);
    transition: all 0.3s ease;
    font-size: 24px;
}

.music-toggle:hover {
    transform: scale(1.1);
    background: var(--paper-light-blue);
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.2),
        0 0 0 3px rgba(30, 58, 138, 0.3);
}

.music-toggle:active {
    transform: scale(0.95);
}

.music-toggle.playing {
    animation: musicPulse 2s ease-in-out infinite;
}

.music-icon {
    display: block;
    line-height: 1;
}

@keyframes musicPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.15),
            0 0 0 2px rgba(30, 58, 138, 0.2);
    }

    50% {
        transform: scale(1.05);
        box-shadow:
            0 6px 16px rgba(30, 58, 138, 0.3),
            0 0 0 3px rgba(30, 58, 138, 0.4);
    }
}

@media (max-width: 480px) {
    .music-toggle {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
        font-size: 20px;
    }
}