/* When animation is active, block everything */
body.scroll-locked,
body.scroll-locked html {
    overflow: hidden !important;
    height: 100vh !important;
    position: fixed !important;
    width: 100% !important;
}

/* When unlocked, allow everything */
body.scroll-unlocked,
body.scroll-unlocked html {
    overflow: auto !important;
    height: auto !important;
    position: static !important;
    width: auto !important;
}

/* Animation container - FULL SCREEN */
.animation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1000;
    background-color: #000;
}

/* Individual frame - NO TRANSITIONS */
.frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
    opacity: 0;
    pointer-events: none;
}

.frame.active {
    opacity: 1;
    z-index: 1;
    transition: none !important;
}

/* Title overlay */
.title-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1001;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    color: #000000;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

.scroll-indicator {
    font-size: 2rem;
    animation: bounce 2s infinite;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

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

/* PERMANENT BACKGROUND - Last frame stays fixed */
.permanent-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    object-fit: cover;
    pointer-events: none;
    opacity: 1 !important;
}

/* Main content - Overlays the background */
.content-section {
    position: relative;
    z-index: 1;
    display: none;
    min-height: 100vh;
    padding-top: 100vh;
}

.content-section.visible {
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 2rem;
    position: relative;
    z-index: 2;
}

.welcome-message {
    text-align: center;
    margin-bottom: 4rem;
    padding: 2rem;
    background-color: rgba(44, 36, 22, 0.85);
    border-radius: 15px;
    border-left: 5px solid #ffd166;
    backdrop-filter: blur(5px);
}

.welcome-message h2 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    color: #ffd166;
}

.welcome-message p {
    font-size: 1.3rem;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    color: #f0e6d2;
}

/* Projects grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.project-card {
    background-color: rgba(44, 36, 22, 0.85);
    border-radius: 12px;
    padding: 2rem;
    border: 2px solid #8b7355;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(30px);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #ffd166, #ef476f);
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
    border-color: #ffd166;
    background-color: rgba(59, 47, 31, 0.9);
}

.project-icon {
    font-size: 2.5rem;
    color: #ffd166;
    margin-bottom: 1.2rem;
}

.project-card h3 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: #f0e6d2;
}

.project-card p {
    color: #d4c9b8;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    background-color: rgba(93, 74, 46, 0.8);
    color: #070604;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid #8b7355;
}

/* Footer */
footer {
    text-align: center;
    padding: 2.5rem;
    background-color: rgba(44, 36, 22, 0.9);
    color: #8b7355;
    border-top: 1px solid #5d4a2e;
    font-size: 0.95rem;
    display: none;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(5px);
}

footer.visible {
    display: block;
}

/* MODAL STYLES */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    backdrop-filter: blur(10px);
    overflow-y: auto !important;
}

.modal-container {
    background: linear-gradient(135deg, #2c2416 0%, #1a140d 100%);
    border-radius: 15px;
    width: 100%;
    max-width: 900px;
    position: relative;
    border: 2px solid #8b7355;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
    margin: 0 auto;
    display: block;
}

.modal-content {
    padding: 3rem;
    color: #f0e6d2;
}

.modal-content h2 {
    font-size: 2.5rem;
    color: #ffd166;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #8b7355;
}

.modal-content h3 {
    font-size: 1.8rem;
    color: #ffd166;
    margin: 2rem 0 1rem 0;
}

.modal-content p {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.modal-content .video-container {
    margin-bottom: 2rem;
}

.modal-content .video-description {
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid #5d4a2e;
    border-bottom: 1px solid #5d4a2e;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #ffd166;
    font-size: 2.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.modal-close:hover {
    color: #fff;
    background-color: rgba(255, 209, 102, 0.1);
    transform: scale(1.1);
}

/* ============================================
   LIGHTBOX - VERSIÓN ULTRA SIMPLE
   ============================================ */

.storyboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.storyboard-grid img {
    width: 100%;
    height: auto;
    border: 2px solid #8b7355;
    border-radius: 8px;
    cursor: pointer;
}

/* Overlay para cuando la imagen está expandida */
.storyboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    display: none;
    cursor: pointer;
}

.storyboard-overlay.active {
    display: block;
}

/* Imagen expandida */
.storyboard-expanded-img {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-width: 90vw !important;
    max-height: 90vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    z-index: 1000000 !important;
    border: 3px solid #ffd166 !important;
    box-shadow: 0 0 50px rgba(0,0,0,0.9) !important;
    cursor: pointer !important;
}
/* ============================================
   POLAROIDS - REVELADO AL HOVER
   ============================================ */

.polaroid-card {
    background: white;
    padding: 15px 15px 10px 15px;
    border-radius: 4px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    transform: rotate(0deg);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    overflow: hidden;
}

/* Contenedor de la imagen */
.polaroid-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: white;
    overflow: hidden;
    border-bottom: x solid #eee;
}

/* La imagen */
.polaroid-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Overlay de revelado - se desvanece permanentemente al hacer hover */
.polaroid-reveal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 2;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

/* Cuando se hace hover, el overlay se desvanece */
.polaroid-card:hover .polaroid-reveal-overlay {
    opacity: 0;
}

/* Cuando el overlay está oculto permanentemente (después del primer hover) */
.polaroid-card.revealed .polaroid-reveal-overlay {
    opacity: 0;
}
/* Título */
.polaroid-title {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 5px 0;
    text-align: center;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Descripción */
.polaroid-description {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: #444;
    text-align: center;
    margin: 0 0 10px 0;
    font-style: italic;
    line-height: 1.3;
}

/* Tags */
.polaroid-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    margin: 0;
}

.polaroid-tag {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    border: 1px solid #ccc;
}

/* Rotaciones individuales */
.polaroid-card:nth-child(1) { transform: rotate(-0.8deg); }
.polaroid-card:nth-child(2) { transform: rotate(0.7deg); }
.polaroid-card:nth-child(3) { transform: rotate(1.2deg); }
.polaroid-card:nth-child(4) { transform: rotate(-1.1deg); }
.polaroid-card:nth-child(5) { transform: rotate(0.5deg); }
.polaroid-card:nth-child(6) { transform: rotate(-0.6deg); }

/* Hover - se endereza y crece */
.polaroid-card:hover {
    transform: rotate(0deg) scale(1.03);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

/* Grid - 3 columnas */
/* Versión más simple con flexbox */
.projects-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 0;
}

.polaroid-card {
    width: calc(33.333% - 20px);
    max-width: 300px;
}

/* Las 3 primeras en su posición normal */
.polaroid-card:nth-child(1),
.polaroid-card:nth-child(2),
.polaroid-card:nth-child(3) {
    margin-bottom: 30px;
}

/* Contenedor para las dos últimas centradas */
.projects-grid::after {
    content: '';
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: -30px; /* Sube para compensar el margen */
}

/* Las dos últimas dentro del contenedor centrado */
.polaroid-card:nth-child(4),
.polaroid-card:nth-child(5) {
    display: inline-block;
    margin: 0 15px;
}

/* Responsive */
@media (max-width: 900px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 600px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .polaroid-card {
        max-width: 280px;
    }
}
/* ============================================
   AJUSTES FINALES POLAROIDS
   ============================================ */

/* Quitar cualquier borde o línea */
.polaroid-image-container {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Subir la información y quitar espacios */
.polaroid-text-content {
    padding: 5px 15px 15px 15px;  /* Reducido padding superior de 15px a 5px */
    background: white;
    margin-top: -2px;  /* Sube ligeramente el texto */
}

/* Asegurar que no haya bordes en ningún lado */
.polaroid-card {
    border: none;
    outline: none;
}

/* Si hay alguna línea de la imagen, quitarla */
.polaroid-image {
    border: none;
    outline: none;
}
/* ============================================
   TAGS MÁS GRANDES
   ============================================ */

.polaroid-tag {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
    padding: 6px 12px;  /* Aumentado de 4px 10px a 6px 12px */
    border-radius: 16px;  /* Un poco más redondeado */
    font-size: 0.8rem;    /* Aumentado de 0.7rem a 0.8rem */
    font-weight: 600;
    font-family: 'Courier New', monospace;
    border: 1px solid #ccc;
}

/* Si quieres también separarlos un poco más */
.polaroid-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;  /* Aumentado de 5px a 8px */
    justify-content: center;
    margin: 5px 0 0 0;
}
/* ============================================
   POLAROID GIGANTE PARA MODAL - CORREGIDO
   ============================================ */

.modal-overlay {
    background-color: rgba(0, 0, 0, 0.95);
    perspective: 1000px;
}

.modal-container {
    background: transparent;
    border: none;
    box-shadow: none;
    max-width: 1000px;
    width: 95%;
    margin: 20px auto;
    animation: polaroidDrop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes polaroidDrop {
    0% {
        opacity: 0;
        transform: translateY(-100vh) rotate(-5deg);
    }
    60% {
        transform: translateY(20px) rotate(2deg);
    }
    80% {
        transform: translateY(-5px) rotate(-1deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
}

/* La polaroid gigante */
.polaroid-modal {
    background: white;
    padding: 25px 25px 40px 25px;
    border-radius: 8px;
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(255, 255, 255, 0.5) inset;
    position: relative;
    width: 100%;
}

/* La foto (donde va el contenido) */
.polaroid-modal-photo {
    background: #f8f8f8;
    border-radius: 4px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    min-height: 400px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Estilo para el contenido dentro de la foto */
.polaroid-modal-photo h2 {
    font-family: 'Courier New', monospace;
    color: #333 !important;
    border-bottom: 2px solid #ddd !important;
    padding-bottom: 15px;
    margin-top: 0;
}

.polaroid-modal-photo h3 {
    font-family: 'Courier New', monospace;
    color: #555 !important;
}

.polaroid-modal-photo p {
    font-family: 'Courier New', monospace;
    color: #444 !important;
    line-height: 1.6;
}

.polaroid-modal-photo video {
    border: 2px solid #ddd !important;
    border-radius: 4px;
    background: #000;
}

.polaroid-modal-photo .storyboard-grid img {
    border: 2px solid #ddd !important;
}

/* La parte inferior de la polaroid (donde se escribe) */
.polaroid-modal-footer {
    margin-top: 20px;
    padding: 10px 20px;
    font-family: 'Courier New', monospace;
    color: #333;
    font-size: 1rem;
    text-align: center;
    border-top: 1px dashed #ccc;
}

/* El botón de cerrar estilo polaroid */
.modal-close {
    background: white !important;
    color: #333 !important;
    border: 2px solid #ddd !important;
    top: -15px !important;
    right: -15px !important;
    width: 45px !important;
    height: 45px !important;
    font-size: 2rem !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 10001 !important;
    cursor: pointer !important;
}

.modal-close:hover {
    background: #ffd166 !important;
    color: #333 !important;
    border-color: #ffd166 !important;
    transform: scale(1.1) rotate(90deg) !important;
}

/* Scroll personalizado para la foto */
.polaroid-modal-photo::-webkit-scrollbar {
    width: 8px;
}

.polaroid-modal-photo::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.polaroid-modal-photo::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.polaroid-modal-photo::-webkit-scrollbar-thumb:hover {
    background: #999;
}