:root {
    --oscuro: #1a1a1a;
    --blanco: #ffffff;
    --fuente: 'Montserrat', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--oscuro);
    color: var(--blanco);
    font-family: var(--fuente);
}

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: space-between;
    padding: 2rem 5%;
    align-items: center;
}

.logo h1 { letter-spacing: 5px; font-size: 1.5rem; }
.logo span { display: block; font-size: 0.6rem; letter-spacing: 2px; }

nav ul { display: flex; list-style: none; }
nav ul li { margin-left: 2rem; }
nav ul li a { color: white; text-decoration: none; font-size: 0.8rem; letter-spacing: 2px; opacity: 0.6; }
.active { opacity: 1 !important; border-bottom: 2px solid white; }

/* HEADER */
.services-header {
    padding: 80px 5% 40px;
    text-align: center;
}

.line-text {
    font-size: 0.7rem;
    letter-spacing: 5px;
    color: #888;
    position: relative;
}

.services-header h1 {
    font-size: 3rem;
    letter-spacing: 10px;
    text-transform: uppercase;
    margin-top: 10px;
}

/* GALERÍA DE IMÁGENES */
.services-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columnas */
    gap: 15px;
    padding: 20px 5% 80px;
}

.service-card {
    position: relative;
    height: 400px;
    overflow: hidden; /* Para que la imagen no se salga al hacer zoom */
    cursor: pointer;
}

.service-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.wide {
    grid-column: span 2; /* Ocupa las dos columnas */
    height: 500px;
}

/* CAPA OSCURA SOBRE LA IMAGEN */
.card-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Filtro oscuro inicial */
    display: flex;
    align-items: flex-end; /* Texto abajo */
    padding: 40px;
    transition: background 0.4s ease;
}

.card-text {
    transition: transform 0.4s ease;
}

.card-text i {
    font-size: 2rem;
    margin-bottom: 15px;
    display: block;
}

.card-text h3 {
    font-size: 1.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.card-text p {
    font-weight: 300;
    font-size: 0.9rem;
    max-width: 300px;
    opacity: 0.8;
}

/* EFECTOS HOVER (DINAMISMO) */
.service-card:hover img {
    transform: scale(1.1); /* Zoom a la imagen */
}

.service-card:hover .card-overlay {
    background: rgba(0, 0, 0, 0.7); /* Se oscurece más al pasar el mouse */
}

.service-card:hover .card-text {
    transform: translateY(-10px); /* El texto sube un poco */
}

/* RESPONSIVO */
@media (max-width: 768px) {
    .services-gallery { grid-template-columns: 1fr; }
    .wide { grid-column: span 1; }
    .service-card { height: 300px; }
}
/* ESTILOS DEL MODAL */
.modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Fondo oscuro semitransparente */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px); /* Difumina lo que hay detrás */
    transition: 0.3s;
}

.modal-content {
    background-color: #fff;
    color: #333;
    padding: 50px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
    border-radius: 2px; /* Mantener esquinas rectas para look fino */
    animation: modalScale 0.4s ease;
}

@keyframes modalScale {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.close-btn:hover { color: #000; }

#modalTitle {
    letter-spacing: 5px;
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 15px;
}

.modal-line {
    width: 50px;
    height: 2px;
    background: #000;
    margin: 0 auto 20px;
}

#modalDescription {
    font-weight: 300;
    line-height: 1.8;
    color: #666;
    margin-bottom: 30px;
}

.modal-btn {
    display: inline-block;
    padding: 12px 30px;
    border: 1px solid #000;
    color: #000;
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 2px;
    transition: 0.3s;
}

.modal-btn:hover {
    background: #000;
    color: #fff;
}
/* --- RESPONSIVE DESIGN (PARA CELULARES) --- */

@media (max-width: 768px) {
    /* Ajustes del Menú de Navegación */
    .navbar {
        flex-direction: column; /* El logo arriba, el menú abajo */
        padding: 1.5rem 5%;
        gap: 15px;
    }

    nav ul {
        gap: 10px;
        flex-wrap: wrap; /* Si no caben, se ponen en dos filas */
        justify-content: center;
    }

    nav ul li {
        margin: 0 10px;
    }

    /* Ajustes de Títulos */
    h1 {
        font-size: 2rem !important; /* Títulos más pequeños para que no se corten */
        letter-spacing: 5px !important;
    }

    h2 {
        font-size: 1.8rem !important;
    }

    /* Ajuste de las Grillas (Servicios y Proyectos) */
    .services-gallery, .project-list, .experience-container, .about-section .container {
        grid-template-columns: 1fr !important; /* TODO a una sola columna */
        display: flex;
        flex-direction: column;
        padding: 20px 5%;
    }

    .service-card, .project-item, .card {
        width: 100% !important;
        height: auto !important; /* Que crezcan según el contenido */
        min-height: 350px;
    }

    .wide {
        grid-column: span 1 !important; /* La tarjeta ancha ahora es normal */
    }

    /* Ajuste del Modal (Ventana Emergente) */
    .modal-content {
        width: 95%;
        padding: 30px 20px;
    }

    /* Ajuste de las secciones de texto e imagen alternadas */
    .project-item, .service-block {
        flex-direction: column !important; /* Imagen arriba, texto abajo siempre */
    }

    /* Botones más fáciles de tocar con el dedo */
    .btn, .modal-btn {
        width: 100%;
        text-align: center;
        padding: 15px;
    }
}
/* Esto corrige el amontonamiento en móviles */
@media (max-width: 600px) {
    body, .hero-home { 
        /* Mantener el color gris de base pero ajustar cómo se muestra la imagen */
        background-attachment: scroll; 
        background-image: url('images/topografia.jpg'); 
        background-size: cover; /* Esto hace que la imagen "llene" sin aplastarse */
        background-position: center;
    }

    /* Le damos un poco más de aire al texto para que no choque con las líneas */
    .hero-content h1 {
        padding: 0 10px;
        font-size: 1.8rem !important; 
        line-height: 1.3;
    }
}