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

:root {
    --primary-color: #000000;
    --text-color: #333333;
    --light-bg: #ffffff;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: #000;
    overflow-x: hidden;
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.6;
}

/* Header Styles */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.9);
    transition: var(--transition);
}

/* Navigation Styles */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 40px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav.scrolled {
    padding: 10px 40px;
    background-color: rgba(0, 0, 0, 0.95);
}

.nav img {
    height: 30px;
    filter: brightness(0) invert(1);
    transition: var(--transition);
}

.nav-links {
    display: flex;
    gap: 25px;
    list-style: none;
    justify-content: flex-end;
    grid-column: 3;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    padding: 5px 0;
    transition: var(--transition);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: white;
    transition: var(--transition);
}

.nav-links a:hover {
    color: #ffffff;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 48px;
    height: 48px;
    position: relative;
    z-index: 1101;
    border-radius: 50%;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.menu-toggle:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.menu-toggle .bar {
    display: block;
    width: 28px;
    height: 3px;
    background-color: #fff;
    border-radius: 2px;
    position: absolute;
    left: 10px;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
}

.menu-toggle .bar:nth-child(1) {
    top: 14px;
}

.menu-toggle .bar:nth-child(2) {
    top: 22px;
}

.menu-toggle .bar:nth-child(3) {
    top: 30px;
}

.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0.5);
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.menu-toggle:active {
    background: rgba(255,255,255,0.08);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.menu-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.35s cubic-bezier(0.4,0,0.2,1);
}

.menu-backdrop.active {
    display: block;
    opacity: 1;
}

.proyectos-main {
    height: calc(100vh - 60px);
    width: 100vw;
    overflow: hidden;
    margin-top: 60px;
    padding-top: 0;
}

.proyectos-grid {
    display: flex;
    height: 100%;
    width: 100vw;
}

.proyecto-card {
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
    /* background-size: cover; */
    /* background-position: center; */
    /* filter: grayscale(100%); */
    transition: all 0.5s ease;
    text-decoration: none;
}

.proyecto-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    z-index: 0;
    transition: transform 0.5s ease, filter 0.5s ease;
}

.proyecto-card:hover img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.proyecto-card h2 {
    position: absolute;
    bottom: 2rem;
    width: 100%;
    text-align: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 3px;
    z-index: 2;
    transition: transform 0.3s ease;
}

.proyecto-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.7));
    z-index: 1;
}

@media (max-width: 1200px) {
    .proyectos-grid, .grid-proyectos {
        gap: 0.5rem;
    }
    .proyecto-card, .card-proyecto {
        min-width: 200px;
    }
}

@media (max-width: 900px) {
    .proyectos-main {
        height: calc(100vh - 60px);
        margin-top: 60px;
        padding-top: 0;
    }
    .proyectos-grid {
        flex-direction: column;
        height: 100%;
        width: 100vw;
        gap: 0;
    }
    .proyecto-card {
        height: 100%;
        min-height: 0;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .main-header {
        position: fixed;
    }
    
    .nav {
        padding: 12px 20px;
    }

    .nav.scrolled {
        padding: 8px 20px;
    }

    .nav img {
        height: 25px;
    }

    .menu-toggle {
        display: block;
        grid-column: 3;
        justify-self: end;
    }

    .nav-links {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.95);
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        transform: translateY(-150%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        transform: translateY(0);
    }

    .nav-links li {
        opacity: 0;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        margin: 10px 0;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateY(0);
    }

    .nav-links li:nth-child(1) { transition-delay: 0.1s; }
    .nav-links li:nth-child(2) { transition-delay: 0.2s; }
    .nav-links li:nth-child(3) { transition-delay: 0.3s; }
    .nav-links li:nth-child(4) { transition-delay: 0.4s; }

    .proyecto-card h2, .card-proyecto h2 {
        font-size: 1rem;
    }
    .proyecto-card, .card-proyecto {
        height: 20vh;
    }
}

@media (max-width: 576px) {
    .nav {
        padding: 8px 10px;
    }
    
    .nav img {
        height: 22px;
    }
    
    .menu-toggle {
        width: 40px;
        height: 40px;
    }
    
    .menu-toggle .bar {
        width: 22px;
        left: 9px;
    }
    
    .nav-links a {
        font-size: 1.1rem;
        padding: 14px 0;
    }
    
    .proyecto-card h2, .card-proyecto h2 {
        font-size: 0.9rem;
    }
    .proyecto-card, .card-proyecto {
        height: 15vh;
    }
}

@media (max-width: 480px) {
    .main-header {
        position: fixed;
    }
    
    .nav {
        padding: 10px 15px;
    }
    .nav img {
        height: 25px;
    }
    
    /* Asegurar que el menú móvil no tape el contenido */
    .nav-links {
        top: 60px;
        padding: 25px 0;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        gap: 15px;
    }
    
    .nav-links li {
        margin: 18px 0;
    }
    
    .nav-links a {
        padding: 8px 0;
    }
    
    .proyecto-card h2, .card-proyecto h2 {
        font-size: 0.7rem;
    }
    .proyecto-card, .card-proyecto {
        height: 10vh;
    }
}

@media (max-width: 400px) {
    .proyectos-main {
        height: calc(100vh - 45px);
        margin-top: 45px;
    }
    
    .nav {
        height: 45px;
        padding: 6px 8px;
    }
    
    .nav img {
        height: 20px;
    }
    
    .menu-toggle {
        width: 36px;
        height: 36px;
    }
    
    .menu-toggle .bar {
        width: 20px;
        left: 8px;
    }
    
    .nav-links a {
        font-size: 1rem;
        padding: 12px 0;
    }
    
    .nav-links {
        top: 45px;
    }
    
    .proyecto-card h2, .card-proyecto h2 {
        font-size: 0.7rem;
    }
    .proyecto-card, .card-proyecto {
        height: 10vh;
    }
}

/* NUEVO DISEÑO PARA VARIABLES CON NOMBRE NUEVO */
.main-proyectos {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}
.grid-proyectos {
    display: flex;
    height: 100vh;
    width: 100vw;
}
.card-proyecto {
    flex: 1;
    height: 100vh;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    filter: grayscale(100%);
    transition: all 0.5s ease;
    text-decoration: none;
}
.card-proyecto:hover {
    flex: 1.5;
    filter: grayscale(0%);
}
.card-proyecto img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    transition: transform 0.5s ease, filter 0.5s ease;
}
.card-proyecto h2 {
    position: absolute;
    bottom: 2rem;
    width: 100%;
    text-align: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 3px;
    z-index: 2;
    transition: transform 0.3s ease;
}
.card-proyecto::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.7));
    z-index: 1;
}
.card-proyecto:hover img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .main-proyectos {
        height: auto;
    }
    .grid-proyectos {
        flex-direction: column;
        height: auto;
    }
    .card-proyecto {
        height: 25vh;
    }
    .card-proyecto:hover {
        height: 35vh;
    }
    .card-proyecto img {
        height: 100%;
    }
}

/* --- Eliminar scroll horizontal innecesario --- */
body, html {
    overflow-x: hidden;
}

@media (max-width: 600px) {
    .proyectos-main {
        height: calc(100vh - 50px);
        margin-top: 50px;
    }
    .proyectos-grid {
        gap: 10px;
    }
    .proyecto-card {
        height: 100%;
    }
    .proyecto-card h2 {
        font-size: 1rem;
        bottom: 1rem;
    }
    
    /* Ajustes específicos para páginas de descripción */
    .descripcion-container {
        margin-top: 0;
        padding-top: 0;
        height: 100vh;
        min-height: 100vh;
    }
    
    .nav {
        height: 50px;
    }
    
    .nav-links {
        top: 50px;
    }
}

@media (max-width: 400px) {
    .proyecto-card {
        height: 15vh;
        min-height: 80px;
        max-height: 120px;
    }
    .proyecto-card h2 {
        font-size: 0.8rem;
    }
    
    .nav {
        height: 45px;
    }
    
    .nav-links {
        top: 45px;
    }
    
    .proyectos-main {
        height: calc(100vh - 45px);
        margin-top: 45px;
    }
}

