/* =====================================================
   styles.css — Para ti ♥
   ===================================================== */

:root {
    --red: #e60023;
    --yellow: #ffef5e;
    --cream: #fdf8f0;
    --dark: #1a1a1a;
    --mid: #555;
}

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

html, body {
    font-family: 'DM Sans', sans-serif;
    background: var(--dark);
    color: white;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* ========= CURSOR PERSONALIZADO ========= */
body { cursor: none; }

#cursor {
    position: fixed;
    top: 0; left: 0;
    width: 12px; height: 12px;
    background: var(--red);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    will-change: transform;
    transition: width 0.3s, height 0.3s, background 0.3s;
}

#cursor-ring {
    position: fixed;
    top: 0; left: 0;
    width: 36px; height: 36px;
    border: 1.5px solid rgba(230, 0, 35, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    will-change: transform;
    transition: width 0.3s, height 0.3s;
}

/* =========================================
   NAVBAR — FIX: fondo blur, sin mix-blend
   ========================================= */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 40px;
    /* Fondo semitransparente con blur para que siempre sea legible sobre las fotos */
    background: rgba(253, 248, 240, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    /* Altura fija para calcular el padding del grid */
    height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo svg {
    width: 26px; height: 26px;
    fill: var(--red);   /* Pinterest rojo, visible sobre fondo claro */
}

.nav-logo span {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    color: var(--dark);
    letter-spacing: 1px;
}

.nav-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-right > span {
    font-size: 16px;
    color: var(--red);
}

.btn-nav {
    background: transparent;
    border: 1px solid rgba(26, 26, 26, 0.35);
    color: var(--dark);
    padding: 7px 18px;
    border-radius: 25px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    cursor: none;
    transition: all 0.3s;
}

.btn-nav:hover {
    background: var(--dark);
    color: white;
    border-color: var(--dark);
}

.btn-nav.filled {
    background: var(--red);
    border-color: var(--red);
    color: white;
}

.btn-nav.filled:hover { background: #c0001e; border-color: #c0001e; }

/* ========= SCROLL CONTAINER ========= */
.scroll-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ========= PÁGINAS ========= */
.page {
    min-width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========= PÁGINA 1: HERO MASONRY ========= */
#page-hero { background: var(--cream); }

/* Grid Masonry de fotos */
.masonry-grid {
    position: absolute;
    inset: 0;
    display: flex;
    gap: 10px;
    padding: 10px;
    /* padding-top = altura navbar para que las fotos no se metan debajo */
    padding-top: 64px;
}

.masonry-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Offset vertical de cada columna para efecto masonry */
.masonry-col:nth-child(1) { transform: translateY(-30px); }
.masonry-col:nth-child(2) { transform: translateY(20px); }
.masonry-col:nth-child(3) { transform: translateY(-10px); }
.masonry-col:nth-child(4) { transform: translateY(35px); }
.masonry-col:nth-child(5) { transform: translateY(-20px); }

.masonry-item {
    width: 100%;
    margin-bottom: 12px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: #222; /* Fondo oscuro por si la foto tarda en cargar */
    /* No pongas height aquí para que la foto dicte su altura */
}

.masonry-item::after {
    content: "";
    position: absolute;
    inset: 0;
    /* Degradado sutil para dar profundidad */
    background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.2));
    pointer-events: none;
}

.masonry-item img {
    width: 100%;
    height: 100%;
    /* 1. Evita que se deformen o corten mal */
    object-fit: cover; 
    display: block;
    border-radius: 16px; /* Para que mantengan las esquinas redondeadas */

    /* 2. Filtro de "Vibrancia" */
    /* Ajustamos contraste, saturación y un pelín de brillo */
    filter: contrast(1.1) saturate(1.3) brightness(1.05);
    
    /* Suavizamos el cambio de filtro por si acaso */
    transition: filter 0.3s ease, transform 0.3s ease;
}

.masonry-item img:hover {
    filter: contrast(1.15) saturate(1.5) brightness(1.1);
    transform: scale(1.02);
}

/* Overlay central — gradiente radial para dar legibilidad al texto */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 58% 58% at 50% 52%,
        rgba(253, 248, 240, 0.82) 0%,
        rgba(253, 248, 240, 0.18) 100%
    );
    z-index: 5;
    pointer-events: none;
}

/* Texto central del hero */
.hero-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

.hero-text h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(32px, 4.5vw, 60px);
    color: var(--dark);
    font-weight: 400;
    line-height: 1.1;
}

/* Texto dinámico que cambia entre frases */
#dynamic-text {
    font-family: 'Playfair Display', serif;
    font-size: clamp(28px, 4vw, 52px);
    font-style: italic;
    color: var(--red);
    display: block;
    min-height: 1.3em;
    transition: color 0.4s ease;
}

/* Dots indicadores de frase activa */
.dots-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 18px;
}

.dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.18);
    transition: all 0.3s;
}

.dot.active {
    background: var(--red);
    transform: scale(1.3);
}

/* Scroll hint */
.scroll-hint {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
    animation: bounce 2.5s ease-in-out infinite;
    pointer-events: none;
}

.scroll-hint span {
    display: block;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--mid);
}

.scroll-hint svg {
    display: block;
    margin: 8px auto 0;
    color: var(--mid);
}

/* ========= PÁGINA 2: AMARILLA ========= */
#page-yellow { background: var(--yellow); }

.yellow-inner {
    display: flex;
    align-items: center;
    gap: 80px;
    max-width: 1100px;
    padding: 0 60px;
}

/* Pila de 3 fotos */
.card-pile {
    position: relative;
    width: 380px;
    height: 460px;
    flex-shrink: 0;
}

.pile-card {
    position: absolute;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
    background: white;
    transition: transform 0.4s ease;
}

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

.pile-card:nth-child(1) {
    width: 170px; height: 240px;
    top: 110px; left: 0; z-index: 1;
    transform: rotate(-6deg);
}

.pile-card:nth-child(2) {
    width: 240px; height: 340px;
    top: 50px; left: 110px; z-index: 3;
    transform: rotate(0deg);
}

.pile-card:nth-child(3) {
    width: 170px; height: 240px;
    top: 110px; left: 290px; z-index: 2;
    transform: rotate(5deg);
}

.card-pile:hover .pile-card:nth-child(1) { transform: rotate(-10deg) translateX(-10px); }
.card-pile:hover .pile-card:nth-child(3) { transform: rotate(9deg) translateX(10px); }

.yellow-text { flex: 1; }

.yellow-text .tag {
    display: inline-block;
    background: rgba(0, 0, 0, 0.08);
    color: var(--dark);
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 24px;
}

.yellow-text h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(40px, 5vw, 64px);
    color: var(--dark);
    line-height: 1.05;
    margin-bottom: 20px;
}

.yellow-text h2 em { color: #c31952; font-style: italic; }

.yellow-text p {
    font-size: 18px;
    color: #333;
    line-height: 1.6;
    max-width: 380px;
    margin-bottom: 36px;
}

.btn-main {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--dark);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 50px;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: none;
    transition: all 0.3s;
}

.btn-main:hover { background: #c31952; transform: translateY(-2px); }
.btn-main svg { transition: transform 0.3s; }
.btn-main:hover svg { transform: translateX(4px); }

/* ========= PÁGINA 3: TIMELINE OSCURO ========= */
#page-timeline { background: #0d0d0d; }

.timeline-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px 40px;
}

.timeline-header {
    text-align: center;
    margin-bottom: 50px;
}

.timeline-header .eyebrow {
    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 12px;
}

.timeline-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(32px, 4vw, 52px);
    color: white;
    font-weight: 400;
}

.timeline-header h2 em { color: var(--red); font-style: italic; }

.timeline-row {
    display: flex;
    gap: 50px;
    align-items: flex-start;
    width: 100%;
    max-width: 1100px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 20px;
}

.timeline-row::-webkit-scrollbar { display: none; }

.tl-item {
    flex-shrink: 0;
    width: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.tl-item:nth-child(odd) { flex-direction: column-reverse; }
.tl-item.visible { opacity: 1; transform: translateY(0); }

.tl-item:hover { transform: translateY(-8px); }
.tl-item:nth-child(odd):hover { transform: translateY(8px); }
.tl-item:nth-child(odd).visible:hover { transform: translateY(8px); }

.tl-photo {
    width: 200px;
    height: 160px;
    border-radius: 16px;
    overflow: hidden;
    background: #222;
    border: 2px solid rgba(255, 255, 255, 0.05);
    transition: border-color 0.3s;
}

.tl-item:hover .tl-photo { border-color: rgba(230, 0, 35, 0.5); }
.tl-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tl-dot {
    width: 18px; height: 18px;
    background: var(--red);
    border: 3px solid #0d0d0d;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--red);
    flex-shrink: 0;
}

.tl-info { text-align: center; }

.tl-info h3 {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    color: white;
    margin-bottom: 4px;
}

.tl-info span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
}

/* Mensaje final del timeline */
.final-msg {
    margin-top: 40px;
    text-align: center;
    padding: 24px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.final-msg p {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: clamp(18px, 2.5vw, 26px);
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.final-msg p em { color: var(--red); font-style: normal; }

/* ========= PÁGINA 4: MENSAJE FINAL ========= */
#page-final {
    background: #0d0d0d;
    flex-direction: column;
    gap: 0;
}

.final-page-inner {
    text-align: center;
    padding: 40px;
    max-width: 700px;
}

.heart-big {
    font-size: 60px;
    animation: heartbeat 1.2s ease-in-out infinite;
    display: block;
    margin-bottom: 30px;
}

.final-page-inner h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(32px, 5vw, 60px);
    color: white;
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: 24px;
}

.final-page-inner h2 em { font-style: italic; color: var(--red); }

.final-page-inner p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.7;
    margin-bottom: 36px;
}

.btn-special {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--red);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 50px;
    font-family: 'DM Sans', sans-serif;
    font-size: 17px;
    font-weight: 500;
    cursor: none;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-special:hover { background: #c0001e; transform: scale(1.04); }

/* ========= PARTÍCULAS CORAZONES ========= */
#particles-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

/* ========= INDICADOR DE PÁGINAS (lateral derecho) ========= */
.page-dots {
    position: fixed;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 500;
}

.page-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: none;
    transition: all 0.3s;
}

.page-dot.active {
    background: var(--red);
    height: 20px;
    border-radius: 4px;
}

/* ========= ANIMACIONES ========= */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%       { transform: translateX(-50%) translateY(-8px); }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    20%       { transform: scale(1.15); }
    40%       { transform: scale(0.97); }
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}