/* --- RESET & BASICS --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Archivo', sans-serif;
    background-color: #000;
    color: #fff;
    overflow-x: hidden;
    line-height: 1.5;
}

::selection {
    background-color: #dc2626; /* Rojo */
    color: #000;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* --- TYPOGRAPHY --- */
.text-white { color: #fff; }
.text-black { color: #000; }
.text-red { color: #dc2626; }

.text-outline {
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.8);
    color: transparent;
}

.text-outline-red {
    -webkit-text-stroke: 1px #dc2626;
    color: transparent;
}

/* --- HERO SECTION --- */
.hero-section {
    position: relative;
    height: 100dvh; /* Altura dinámica para móviles */
    width: 100%;
    display: flex;
    flex-direction: column;
    background-color: #000;
    overflow: hidden;
}

/* Barra Superior */

.top-bar {
    position: relative;
    width: 100%;
    z-index: 50;
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 1rem 1.5rem 0.5rem 1.5rem;
    background-color: #000;
    gap: 1rem;
}

@media (min-width: 768px) {
    .top-bar {
        padding: 2rem 2rem 1rem 2rem;
    }
}

@media (min-height: 700px) {
    .top-bar {
        padding: 2rem 2rem 0.5rem 2rem;
    }
}

.top-logo {
    height: 2rem; /* Tamaño para móvil */
    width: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
    margin-top: -20px;
}

.top-logo:hover {
    transform: scale(1.05);
}

@media (min-width: 768px) {
    .top-logo {
        height: 2.5rem; /* Tamaño un poco más grande para escritorio */
    }
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    pointer-events: auto;
    margin-top: -0.5rem;
}

@media (min-width: 768px) {
    .nav-buttons {
        gap: 1.5rem;
    }
}

.btn {
    padding: 0.5rem 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.1em;
    font-size: 10px;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .btn {
        padding: 0.5rem 1.5rem;
        font-size: 0.75rem; /* text-xs */
    }
}

.btn-outline {
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 0.125rem; /* rounded-sm */
}

.btn-outline:hover {
    color: #fff;
    border-color: #fff;
}

@media (min-width: 768px) {
    .btn-outline {
        border: none;
        background: transparent;
        backdrop-filter: none;
    }
}

.btn-solid {
    background-color: #dc2626;
    color: #fff;
    border-radius: 0.125rem;
    box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.4);
    backdrop-filter: blur(4px);
}

.btn-solid:hover {
    background-color: #ef4444; /* Rojo más claro */
}

/* Contenedor Video */
.video-container {
    position: relative;
    flex: 1;
    width: 100%;
    overflow: hidden;
    background-color: #000;
    transition: all 0.5s ease;
}

.video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 1;
    margin-top: -2%;
}

/* Grid Overlay */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    pointer-events: none;
    z-index: 0;
    opacity: 0.3;
}

.grid-line {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    height: 100%;
}

/* Botón Sonido */
.sound-button-container {
    position: absolute;
    bottom: 7rem;
    left: 3rem;
    z-index: 40;
}

@media (max-width: 768px) {
    .sound-button-container {
        bottom: 15%; /* Ajuste móvil */
        left: 1rem;
    }
}

.btn-sound {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 0.5rem;
    filter: drop-shadow(0 10px 8px rgb(0 0 0 / 0.04)) drop-shadow(0 4px 3px rgb(0 0 0 / 0.1));
    pointer-events: auto;
    transition: color 0.3s;
}

.btn-sound:hover {
    color: #ef4444;
}

/* Título Hero */
.hero-title {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    mix-blend-mode: difference;
    pointer-events: none;
    padding: 0 1rem;
    transition: opacity 1s ease;
}

.hero-title h1 {
    font-size: 18vw;
    line-height: 0.85;
    font-weight: 900;
    letter-spacing: -0.05em;
    text-align: center;
    text-transform: uppercase;
    word-break: break-word;
    width: 100%;
}

@media (min-width: 768px) {
    .hero-title h1 {
        font-size: 12vw;
    }
}

.hero-title span {
    display: block;
}

/* Banner Inferior (Marquee Rojo) */
.marquee-bar {
    height: 2rem; /* h-8 */
    background-color: #dc2626;
    display: flex;
    align-items: center;
    overflow: hidden;
    position: relative;
    z-index: 50;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .marquee-bar {
        height: 2.5rem; /* h-10 */
    }
}

@media (min-width: 1024px) {
    .marquee-bar {
        height: 3rem; /* h-12 */
    }
}

.marquee-wrapper {
    width: 100%;
}

.marquee-content {
    display: inline-block;
    white-space: nowrap;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.875rem; /* text-sm */
    letter-spacing: 0.05em;
    line-height: 1;
    padding-top: 0.25rem;
    animation: marquee 40s linear infinite;
}

@media (min-width: 768px) {
    .marquee-content {
        font-size: 1rem; /* text-base */
        padding-top: 0;
    }
}

@media (min-width: 1024px) {
    .marquee-content {
        font-size: 1.125rem; /* text-lg */
    }
}

.separator {
    margin: 0 0.75rem;
    color: #000;
    opacity: 0.5;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- PROJECTS SECTION --- */
.projects-section {
    width: 100%;
    background-color: #000;
    padding-top: 2.5rem;
}

@media (min-width: 768px) {
    .projects-section {
        padding-top: 0;
    }
}

.projects-header {
    display: grid;
    grid-template-columns: 1fr;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

@media (min-width: 768px) {
    .projects-header {
        grid-template-columns: 1fr 1fr;
    }
}

.header-title {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

@media (min-width: 768px) {
    .header-title {
        padding: 3rem;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.2);
    }
}

.header-title h2 {
    font-size: 2.25rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1;
    letter-spacing: -0.05em;
}

@media (min-width: 768px) {
    .header-title h2 {
        font-size: 3.75rem;
    }
}

@media (min-width: 1024px) {
    .header-title h2 {
        font-size: 6rem;
    }
}

.header-desc {
    padding: 1.5rem;
    display: flex;
    align-items: flex-end;
}

@media (min-width: 768px) {
    .header-desc {
        padding: 3rem;
    }
}

.header-desc p {
    font-size: 1rem;
    font-weight: 300;
    color: #9ca3af; /* gray-400 */
    max-width: 28rem;
}

@media (min-width: 768px) {
    .header-desc p {
        font-size: 1.25rem;
    }
}

/* Grid */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.project-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    cursor: pointer;
}

/* Quitar borde derecho en el último elemento de la fila según breakpoint */
@media (min-width: 768px) and (max-width: 1023px) {
    .project-item:nth-child(2n) { border-right: none; }
}
@media (min-width: 1024px) {
    .project-item:nth-child(3n) { border-right: none; }
}

.project-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(0);
    transition: all 0.5s;
}

.project-item:hover img {
    filter: grayscale(100%);
}

.project-overlay {
    position: absolute;
    inset: 0;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s;
}

.project-item:hover .project-overlay {
    opacity: 1;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .project-title {
        font-size: 2.25rem;
    }
}

/* --- LOGOS SECTION --- */
.logos-section {
    width: 100%;
    background-color: #fff;
    padding: 2rem 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    overflow: hidden;
}

@media (min-width: 768px) {
    .logos-section {
        padding: 3rem 0;
    }
}

.logos-content {
    display: flex;
    align-items: center;
    gap: 3rem;
    padding: 0 1rem;
    width: max-content;
    animation: marquee 80s linear infinite;
}

@media (min-width: 768px) {
    .logos-content {
        gap: 6rem;
    }
}

.logos-content img {
    height: 3rem;
    object-fit: contain;
    transition: all 0.3s;
}

@media (min-width: 768px) {
    .logos-content img {
        height: 5rem; /* h-20 */
    }
    .logos-content img.logo-big{
        height: 9rem;
    }

    .logos-content img.logo-small{
    height: 4rem;
    }

}
.logos-content .logo-big{
    height: 4rem;
}
.logos-content .logo-small{
    height: 2rem;
}

/* --- FOOTER --- */
.main-footer {
    width: 100%;
    background-color: #dc2626;
    color: #000;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    height: 100%;
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.footer-left {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 40vh;
}

@media (min-width: 768px) {
    .footer-left {
        padding: 3rem;
    }
}

@media (min-width: 1024px) {
    .footer-left {
        padding: 4rem;
        border-bottom: none;
        border-right: 1px solid rgba(0, 0, 0, 0.2);
    }
}

.footer-cta {
    margin-bottom: 2rem;
}

.footer-cta h2 {
    font-size: 2.25rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 0.9;
    letter-spacing: -0.05em;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .footer-cta h2 {
        font-size: 3.75rem;
        margin-bottom: 2rem;
    }
}

@media (min-width: 1024px) {
    .footer-cta h2 {
        font-size: 6rem;
    }
}

.email-link {
    font-size: 1.125rem;
    font-weight: 700;
    border-bottom: 2px solid #000;
    display: inline-block;
    transition: color 0.3s, border-color 0.3s;
    word-break: break-all;
}

.email-link:hover {
    color: #fff;
    border-color: #fff;
}

@media (min-width: 768px) {
    .email-link {
        font-size: 1.875rem;
        border-bottom-width: 4px;
        word-break: normal;
    }
}

.footer-socials {
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .footer-socials {
        margin-top: 3rem;
    }
}

.social-title {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.social-icons {
    display: flex;
    gap: 1.5rem;
}

.social-btn {
    padding: 0.5rem;
    border: 1px solid #000;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-btn:hover {
    background-color: #fff;
    border-color: #fff;
    color: #dc2626;
}

.footer-right {
    padding: 2rem;
    background-color: #000;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-right {
        padding: 4rem;
    }
}

.footer-logo {
    width: 100%;
    max-width: 18rem;
    margin-bottom: 2rem;
    object-fit: contain;
}

@media (min-width: 768px) {
    .footer-logo {
        max-width: 30rem;
    }
}

.footer-text {
    color: #9ca3af;
    font-size: 0.75rem;
    font-family: monospace;
    max-width: 20rem;
}

@media (min-width: 768px) {
    .footer-text {
        font-size: 0.875rem;
    }
}

.copyright {
    margin-top: auto;
    padding-top: 3rem;
    font-size: 0.625rem;
    color: #4b5563;
    text-transform: uppercase;
}

@media (min-width: 768px) {
    .copyright {
        font-size: 0.75rem;
    }
}

/* --- LIGHTBOX --- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background-color: rgba(0, 0, 0, 0.98);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none; /* Inicialmente no clickeable */
    transition: opacity 0.3s;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-grid {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1920px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
    .lightbox-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.lightbox-media-col {
    position: relative;
    height: 50vh;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

@media (min-width: 1024px) {
    .lightbox-media-col {
        height: 100%;
        padding: 0;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.lightbox-embed-container {
    width: 100%;
    height: 100%;
    display: block;
}

.lightbox-embed {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.btn-close-mobile {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #fff;
    transition: color 0.3s;
    z-index: 101;
}

.btn-close-mobile:hover { color: #dc2626; }

@media (min-width: 1024px) {
    .btn-close-mobile { display: none; }
}

.btn-nav {
    position: absolute;
    color: #fff;
    transition: all 0.3s;
    z-index: 101;
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 9999px;
}

.btn-nav:hover { color: #dc2626; }

@media (min-width: 1024px) {
    .btn-nav { padding: 1rem; }
}

.btn-prev { left: 0.5rem; }
@media (min-width: 1024px) { .btn-prev { left: 1.5rem; } }

.btn-next { right: 0.5rem; }
@media (min-width: 1024px) { .btn-next { right: 1.5rem; } }

.counter-badge {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-family: monospace;
    letter-spacing: 0.1em;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

.lightbox-info-col {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: #0a0a0a;
    color: #fff;
    overflow-y: auto;
}

@media (min-width: 1024px) {
    .lightbox-info-col {
        grid-column: span 1;
    }
}

.btn-close-desktop {
    display: none;
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: #fff;
    transition: color 0.3s;
    z-index: 101;
}

.btn-close-desktop:hover { color: #dc2626; }

@media (min-width: 1024px) {
    .btn-close-desktop { display: block; }
}

.info-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: fit-content;
}

@media (min-width: 1024px) {
    .info-content {
        padding: 4rem;
        min-height: 100%;
    }
}

.info-tag span {
    color: #dc2626;
    font-family: monospace;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.info-content h3 {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1;
    letter-spacing: -0.05em;
    margin-bottom: 2rem;
    color: #fff;
}

@media (min-width: 1024px) {
    .info-content h3 {
        font-size: 2.25rem;
    }
}

.separator-line {
    width: 3rem;
    height: 0.25rem;
    background-color: #dc2626;
    margin-bottom: 2rem;
}

.info-content p {
    color: #9ca3af;
    font-size: 0.875rem;
    line-height: 1.625;
    font-weight: 300;
}

@media (min-width: 1024px) {
    .info-content p {
        font-size: 1rem;
    }
}

/* Helpers de Iconos */
.icon-sm { width: 1rem; height: 1rem; } /* w-4 h-4 */
.icon-md { width: 1.25rem; height: 1.25rem; } /* w-5 h-5 */
.icon-lg { width: 2rem; height: 2rem; } /* w-8 h-8 */
.icon-xl { width: 2.5rem; height: 2.5rem; } /* w-10 h-10 */

/* Utility Classes para JavaScript */
.hidden { display: none !important; }




/* --- BLOQUEO HORIZONTAL --- */
.landscape-lock {
    display: none; /* Oculto por defecto */
    position: fixed;
    inset: 0;
    background-color: #000;
    z-index: 9998; /* Muy alto, pero MENOR que el video */
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
}

.lock-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.rotate-icon {
    animation: rotate-phone 2s infinite ease-in-out;
}

@keyframes rotate-phone {
    0% { transform: rotate(90deg); }
    50% { transform: rotate(0deg); }
    100% { transform: rotate(90deg); }
}

/* LÓGICA DE VISIBILIDAD */

/* Solo activar si es móvil (max-width alto para pillar tablets) y está en horizontal */
@media screen and (max-width: 900px) and (orientation: landscape) {
    .landscape-lock {
        display: flex;
    }
}

/* IMPORTANTE: Asegurar que el popup del video esté POR ENCIMA del bloqueo */
#hero-mobile-lightbox {
    z-index: 9999 !important; /* Gana al 9998 del bloqueo */
}