/* ==========================================================================
   1. VARIABLES DE ESTILO Y CONFIGURACIÓN INICIAL
   ========================================================================== */
   :root {
    --primary-dark: #1D1D1F;      /* Negro / Antracita principal */
    --brand-green: #37ca37;       /* Verde corporativo TecnicaIE */
    --bg-white: #FFFFFF;          /* Blanco puro */
    --bg-light: #FAFAFA;          /* Gris muy claro para fondos */
    --text-muted: #6f6f6f;        /* Gris para textos secundarios */
    --border-color: #E5E5E5;      /* Color para líneas y bordes */
    --font-inter: 'Inter', sans-serif;
    --font-space: 'Space Grotesk', sans-serif;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
}

/* Fundamental para que el padding no sume ancho extra a los elementos al 100% */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px; /* Espacio extra para que la barra superior no tape el título de la sección */
    font-family: var(--font-inter);
    color: var(--primary-dark);
    background-color: var(--bg-white);
}


/* Selección de texto verde */
::selection {
    background-color: var(--brand-green);
    color: #FFFFFF;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #FFFFFF;
}
::-webkit-scrollbar-thumb {
    background: #E5E5E5;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--brand-green);
}

/* Estilos de texto reutilizables */
.logo-green {
    color: var(--brand-green);
}

.text-muted {
    color: var(--text-muted);
}

/* ==========================================================================
   2. BARRA DE NAVEGACIÓN (HEADER)
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    z-index: 50;
    background-color: rgba(252, 252, 252, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1.75px solid var(--border-color);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-space);
    font-size: 2.35rem;
    font-weight: 600;
    letter-spacing: -0.05em;
    text-decoration: none;
    color: var(--primary-dark);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link {
    text-decoration: none;
    color: #515154;
    font-size: 0.925rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
  
}

.nav-link[aria-current="page"] {
    color: var(--primary-dark);
    position: relative;
}
.nav-link[aria-current="page"]::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--brand-green);
}

.nav-link:hover {
    background-color: var(--brand-green);
    color: #FFFFFF;
}

/* Ocultar elementos del menú móvil en escritorio */
.mobile-menu-btn,
.nav-overlay,
.nav-mobile {
    display: none;
}

/* ==========================================================================
   ESTILOS EXCLUSIVOS MÓVIL
   ========================================================================== */
@media (max-width: 1024px) {
    /* 1. Ocultar menú horizontal de escritorio */
    .nav-links {
        display: none !important;
    }

    /* 2. Mostrar botón hamburguesa */
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: 1px solid var(--border-color, #e0e0e0);
        border-radius: 6px;
        padding: 6px;
        cursor: pointer;
        color: var(--primary-dark, #000);
    }

    /* 3. Fondo oscuro translúcido */
    .nav-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.3);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 998;
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* 4. Panel desplegable lateral */
    .nav-mobile {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        width: 75%;
        max-width: 280px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(12px);
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
        z-index: 999;
        padding: 80px 24px 32px 24px;
        box-sizing: border-box;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    }

    .nav-mobile.active {
        transform: translateX(0);
    }

    /* 5. Botón de cierre (X) */
    .menu-close {
        position: absolute;
        top: 20px;
        right: 20px;
        background: none;
        border: none;
        font-size: 32px;
        font-weight: 300;
        color: #000;
        cursor: pointer;
        line-height: 1;
    }

    /* 6. Quitar viñetas/puntos de la lista */
    .mobile-nav-links,
    .mobile-nav-links li {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .mobile-nav-links {
        display: flex;
        flex-direction: column;
        gap: 16px;
        align-items: flex-end;
    }

    /* 7. Enlaces móviles + HOVER (verde) */
    .mobile-link {
        text-decoration: none;
        color: #515154;
        font-size: 1.1rem;
        font-weight: 500;
        padding: 8px 16px;
        border-radius: 6px;
        transition: all 0.2s ease;
        display: inline-block;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-link:hover {
        background-color: var(--brand-green);
        color: #FFFFFF;
    }

    /* 8. Botón destacado de Contacto */
    .btn-contact-mobile {
        background-color: var(--primary-dark, #1a1a1a) !important;
        color: #ffffff !important;
        padding: 10px 20px;
        border-radius: 8px;
        margin-top: 10px;
    }

    .btn-contact-mobile:hover {
        background-color: var(--primary-dark, #1a1a1a) !important;
        color: #ffffff !important;
    }
}

/* 1. Contenedor invisible con ancho reservado fijo */
.btn-contact-wrapper {
    width: 120px;                /* Espacio total reservado en el menú */
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-start;  /* Alinea el botón a la izquierda de su espacio */
}

/* 2. Botón en estado normal */
.btn-contact {
    text-decoration: none;
    background-color: var(--primary-dark);
    color: #FFFFFF;
    font-size: 0.925rem;
    font-weight: 500;
    height: 34px;
    width: 96px;                /* Ancho inicial (solo texto) */
    padding: 0 16px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    white-space: nowrap;
    overflow: hidden;
    
    /* Transición suave de anchura */
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}

/* 3. Icono del teléfono en estado normal (Oculto) */
.btn-contact .contact-icon {
    opacity: 0;
    margin-left: 0;
    transform: scale(0.5);
    transition: opacity 0.2s ease, margin-left 0.3s ease, transform 0.3s ease;
}

/* 4. Estado HOVER: El botón se expande hacia la derecha dentro del wrapper */
.btn-contact:hover {
    background-color: #333336;
    width: 120px;                /* Se expande hasta llenar el espacio reservado */
}

.btn-contact:hover .contact-icon {
    opacity: 1;
    margin-left: 10px;
    transform: scale(1);
} 

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-dark);
}

/* ==========================================================================
   3. SECCIÓN HERO (PORTADA)
   ========================================================================== */
.hero-section {
    position: relative;
    min-height: 85vh;
    padding: 120px 24px 80px 24px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background-image: 
        linear-gradient(to right, rgba(0, 0, 0, 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
}

.hero-container {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background-color: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    margin-bottom: 32px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background-color: var(--brand-green);
    border-radius: 50%;
}

.badge-text {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #515154;
}

.hero-title {
    font-family: var(--font-space);
    font-size: 5rem;
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-bottom: 32px;
}

.hero-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
}

.hero-description {
    font-size: 1.125rem;
    color: #6E6E73;
    max-width: 580px;
    line-height: 1.6;
    font-weight: 300;
}

/* 1. Botón Principal (Con overflow: hidden para recortar la flecha al salir) */
/* Estado Base del Botón */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    background-color: var(--primary-dark);
    color: #FFFFFF;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 15px;
    border: 1px solid transparent; /* Preparamos un borde invisible */
    
    overflow: hidden;
    
    /* Anti-alias para asegurar máxima nitidez en tipografía */
    -webkit-font-smoothing: antialiased;
    backface-visibility: hidden;
    
    /* Transición suave para todos los efectos visuales */
    transition: background-color 0.3s ease, 
                transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.3s ease, 
                border-color 0.3s ease;
}

/* Estado HOVER: El botón resalta con sombra verde luminosa y elevación crispada */
.btn-primary:hover {
    background-color: #252528;
    transform: translateY(-3px);                          /* Se eleva 3px sin deformar texto */
    border-color: rgba(55, 202, 55, 0.25);                     /* Borde fino verde corporativo */
    box-shadow: 0 10px 25px -5px rgba(55, 202, 55, 0.25);  /* Sombra / Glow verde elegante */
}


/* 2. Animación de Bucle tipo Jitter */
@keyframes arrowLoop {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    40% {
        transform: translateX(180%);  /* 1. Sale volando por la derecha */
        opacity: 0;                   /* Se vuelve invisible */
    }
    45% {
        transform: translateX(-180%); /* 2. Teletransporte invisible a la izquierda */
        opacity: 0;
    }
    100% {
        transform: translateX(0);     /* 3. Reaparece y entra desde la izquierda a su sitio */
        opacity: 1;
    }
}

/* 3. Disparar la animación al hacer HOVER */
.btn-primary:hover .iconify {
    animation: arrowLoop 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ==========================================================================
   4. BANDA DE ESPECIFICACIONES TÉCNICAS
   ========================================================================== */
.specs-bar {
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.specs-grid {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.spec-item {
    padding: 24px 32px;
    border-right: 1px solid var(--border-color);
}

.spec-item:last-child {
    border-right: none;
}

.spec-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.spec-value {
    display: block;
    font-family: var(--font-space);
    font-size: 1rem;
    font-weight: 500;
}

/* ==========================================================================
   5. SECCIÓN DE MÉTRICAS (EXPERIENCIA ACUMULADA)
   ========================================================================== */
.metrics-section {
    padding: 80px 24px;
    border-bottom: 1px solid var(--border-color);
}

.section-container {
    max-width: 1280px;
    margin: 0 auto;
}

.section-header {
    max-width: none;
    margin: 0;
}

.section-header .section-title {
    margin-bottom: 0;
    line-height: 1.1;
}

.section-tag {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--brand-green);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 8px;
}

.section-title {
    font-family: var(--font-space);
    font-size: 2.25rem;
    font-weight: 500;
    letter-spacing: -0.03em;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.metric-card {
    padding: 32px 24px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-light);
    border-radius: 12px;
}

.metric-number {
    display: block;
    font-family: var(--font-space);
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.metric-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.metric-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ==========================================================================
   6. SECCIÓN DE SERVICIOS
   ========================================================================== */
.services-section {
    padding: 80px 24px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.service-card {
    padding: 40px;
    border-right: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.service-card:last-child {
    border-right: none;
}

.service-card:hover {
    background-color: var(--bg-light);
}

.service-number {
    display: block;
    font-family: monospace;
    font-size: 0.875rem;
    color: var(--brand-green);
    margin-bottom: 24px;
}

.service-icon {
    margin-bottom: 24px;
    color: var(--primary-dark);
}

.service-title {
    font-family: var(--font-space);
    font-size: 1.35rem;
    font-weight: 500;
    margin-bottom: 12px;
    line-height: 1.3;
}

.service-card:hover .service-title {
    color: var(--brand-green);
}

.service-desc {
    text-align: justify;
    font-size: 0.875rem;
    color: #6E6E73;
    line-height: 1.6;
    font-weight: 300;
}

/* ==========================================================================
   7. SECCIÓN PORTAFOLIO
   ========================================================================== */
.portfolio-section {
    background-color: #0F0F0F;
    color: #FFFFFF;
    padding: 80px 24px;
}

.portfolio-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.portfolio-tag {
    color: var(--brand-green);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    display: block;
    margin-bottom: 12px;
}

.portfolio-title {
    font-family: var(--font-space);
    font-size: 2.5rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    max-width: 550px;
}

.portfolio-desc {
    color: #A1A1A6;
    font-size: 1rem;
    font-weight: 300;
    max-width: 500px;
}

.portfolio-card-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 24px 32px;
    border: 1px solid #262626;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    text-decoration: none;
    min-width: 300px;
    width: 100%;
    max-width: 400px;
    transition: all 0.3s ease;
}

.portfolio-card-btn:hover {
    background-color: var(--brand-green);
    border-color: var(--brand-green);
}

.portfolio-card-title {
    display: block;
    font-family: var(--font-space);
    font-size: 1.25rem;
    font-weight: 500;
    color: #FFFFFF;
}

.portfolio-card-btn:hover .portfolio-card-title {
    color: #000000;
}

.portfolio-card-subtitle {
    font-size: 0.75rem;
    color: #86868B;
}

.portfolio-card-btn:hover .portfolio-card-subtitle {
    color: rgba(0, 0, 0, 0.7);
}

.portfolio-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
}

.portfolio-card-btn:hover .portfolio-card-icon {
    background-color: rgba(0, 0, 0, 0.2);
    color: #000000;
}

/* ==========================================================================
   8. FOOTER / PIE DE PÁGINA
   ========================================================================== */
.site-footer {
    background-color: var(--bg-light);
    border-top: 1px solid var(--border-color);
    padding: 64px 24px 32px 24px;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 48px;
}

.footer-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 12px;
}

.footer-col-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.footer-person-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.footer-person-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.footer-link-col {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--brand-green);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.footer-link-col:hover {
    text-decoration: underline;
}

.footer-contact-link {
    color: #515154;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.footer-contact-link:hover {
    color: var(--brand-green);
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-btn {
    padding: 8px;
    background-color: var(--border-color);
    border-radius: 8px;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.social-btn:hover {
    background-color: var(--brand-green);
    color: #FFFFFF;
}

.legal-notices {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    font-size: 0.9rem;
    color: var(--brand-green);
    line-height: 1.6;
    transition: .2s ease;
}

.legal-notices p {
    margin-bottom: 8px;
}

.legal-link {
    color: #1d1d1f;
    text-decoration: none;
    transition: .2s ease;

}

.legal-link:hover span:first-child{
    color: var(--brand-green);
    text-decoration: underline;

}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    margin-top: 24px;
    padding-top: 24px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   9. ADAPTABILIDAD A PANTALLAS MÓVILES (RESPONSIVE DESIGN)
   ========================================================================== */
@media (max-width: 1024px) {
    .hero-title { font-size: 3.2rem; }
    .hero-footer { flex-direction: column; align-items: flex-start; }
    .specs-grid { grid-template-columns: repeat(2, 1fr); }
    .spec-item { border-bottom: 1px solid var(--border-color); }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .services-grid { grid-template-columns: 1fr; }
    .service-card { border-right: none; border-bottom: 1px solid var(--border-color); }
    .portfolio-container { flex-direction: column; align-items: flex-start; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    /* Pasar a 1 sola columna */
    .specs-grid,
    .metrics-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    /* Alineación perfecta a 24px del borde (coincidiendo con las secciones superiores) */
    .spec-item {
        padding: 24px;
    }

    /* Ajuste del Hero: Título adaptable y botón inferior ocupando el 100% del ancho */
    .hero-title {
        font-size: 2.75rem; 
        word-break: break-word;
    }
    .hero-footer {
        width: 100%;
        align-items: stretch;
        gap: 20px;
    }
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
}


/* ==========================================================================
   10. GALERÍA DE PROYECTOS (Ajuste de tamaño y filas)
   ========================================================================== */
.projects-page {
    padding-top: 80px;
}

.projects-hero {
    padding: 60px 24px 100px 24px;
}

.projects-hero .section-container {
    max-width: 80.5%;
    margin: 0 auto;
}

.projects-hero .section-header {
    max-width: 77.5%;
    margin-left: auto;
    margin-right: auto;
}

/* RETÍCULA: Espaciado horizontal vs vertical (efecto de tiras) */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 50px; /* Separación horizontal entre tarjetas */
    row-gap: 76px;    /* Separación vertical mucho mayor para marcar la tira de 3 */
    margin-top: 40px;
}

/* TARJETA: Más presencia y contenido más amplio */
.project-card {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    cursor: crosshair;
    
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.35s ease;
}

/* IMAGEN: Aumentada de 230px a 290px de alto */
.card-image-wrapper {
    width: 100%;
    height: 290px; 
    overflow: hidden;
    position: relative;
    background-color: #EAEAEA;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* PIE: Más espacio de relleno en texto (padding) */
.card-info {
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    background-color: var(--bg-light);
    border-top: 1px solid var(--border-color);
    flex-grow: 1;
}

.card-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-title {
    font-family: var(--font-space);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-dark);
    line-height: 1.35;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-date {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    padding-top: 2px;
}

/* HOVER */
.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--brand-green);
    box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.18), 
                0 0 0 1px var(--brand-green);
}



.project-card:hover .card-image {
    transform: scale(1.0325);
}

/* ==========================================================================
   10.1 FALLBACK RESPONSIVE DEL GRID (sin depender de JS)
   ========================================================================== */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .card-image-wrapper {
        height: 260px;
    }
}


/* ==========================================================================
   11. CONMUTADOR DE VISTAS (ANIMACIÓN SIN TOCAR HTML)
   ========================================================================== */
.projects-header-wrapper {
    width: 77.5% !important;
    max-width: 77.5% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
    margin: 0 auto 32px auto !important;
    gap: 20px;
    box-sizing: border-box;
}

.projects-header-wrapper .section-header {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    text-align: left !important;
}

.section-header {
    max-width: none;
    margin: 0;
}

.section-header .section-title {
    margin-bottom: 0;
    line-height: 1.1;
}

/* Base del contenedor */
.view-selector {
    display: inline-flex;
    align-items: center;
    height: 35px;
    background-color: #d9d9d9;
    border: 1px solid #000000;
    border-radius: 8px;
    padding: 0 4px;
    position: relative;
    user-select: none;
    margin-bottom: 3px;
}

/* Texto "Vista" */
.view-label {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: 21px;
    color: #000000;
    line-height: normal;
    padding: 0 10px 0 8px;
    position: relative;
    z-index: 2;
}

/* Línea divisoria */
.view-divider {
    width: 1px;
    height: 35px;
    background-color: #000000;
    position: relative;
    z-index: 2;
}

/* Botones */
.view-btn {
    background: transparent;
    border: none;
    height: 35px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    outline: none;
    z-index: 2;
}

.view-btn:focus-visible {
    outline: 2px solid var(--brand-green);
    outline-offset: 2px;
    border-radius: 4px;
}

.view-btn:active .view-box {
    transform: scale(0.9);
}
.view-box {
    transition: transform 0.15s ease;
}

a:focus-visible,
button:focus-visible,
.project-card:focus-visible {
    outline: 2px solid var(--brand-green);
    outline-offset: 3px;
}

/* Cuadrado gris interno */
.view-box {
    width: 25px;
    height: 25px;
    background-color: #a1a1a1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    position: relative;
    z-index: 2;
}

/* Número interno */
.view-num {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: 21px;
    letter-spacing: 0.0625em;
    color: #242424;
    line-height: 1;
    position: relative;
    z-index: 2;
}

/* Hover suave en botones inactivos */
.view-btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 31px;
    height: 46px;
    background-color: rgba(130, 223, 149, 0.40);
    border-radius: 8px;
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.view-btn:not(.active):hover::before {
    opacity: 1;
}

/* INDICADOR VERDE ANIMADO */
.view-indicator {
    position: absolute;
    top: 50%;
    left: 0;
    width: 31px;
    height: 46px;
    background-color: rgba(130, 223, 149, 0.85);
    border-radius: 8px;
    z-index: 1;
    pointer-events: none;
    transform: translateY(-50%);
    /* Transición suave de deslizamiento */
    transition: left 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}


/* ==========================================================================
   12. VISTAS DINÁMICAS DEL GRID (1, 2, 3 Y 4 COLUMNAS)
   ========================================================================== */

/* Vista 1 Columna: Fotos muy grandes */
.projects-grid.cols-1 {
    grid-template-columns: 1fr;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
.projects-grid.cols-1 .card-image-wrapper {
    height: 480px;
}

/* Vista 2 Columnas: Fotos grandes */
.projects-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}
.projects-grid.cols-2 .card-image-wrapper {
    height: 360px;
}

/* Vista 3 Columnas (Predeterminada) */
.projects-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}
.projects-grid.cols-3 .card-image-wrapper {
    height: 290px;
}

/* Vista 4 Columnas: Compacta sin descripción */
.projects-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
    column-gap: 20px;
    row-gap: 40px;
}
.projects-grid.cols-4 .card-image-wrapper {
    height: 200px;
}

/* Ocultar descripción en la vista de 4 columnas */
.projects-grid.cols-4 .card-desc {
    display: none;
}

/* ==========================================================================
   13. MODAL FICHA TÉCNICA CON EFECTO APILADO
   ========================================================================== */

/* Fondo oscuro con desenfoque */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Contenedor envolvente para el apilado */
.modal-stack-wrapper {
    position: relative;
    width: 90%;
    max-width: 620px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Tarjeta Principal */
.modal-card {
    width: 100%;
    background: #ffffff;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

/* Tarjeta Trasera (Efecto baraja / Siguiente foto) */
.modal-card-bg {
    position: absolute;
    top: -22px;
    right: -27px;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    border-radius: 28px;
    overflow: hidden;
    opacity: 0.35;
    transform: scale(0.95);
    z-index: 1;
    pointer-events: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal-card-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Botón de cierre (X) */
.modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.05);
}

/* Visor de Imagen */
.modal-image-wrapper {
    width: 100%;
    height: 360px;
    background-color: #1a1a1a;
    position: relative;
    overflow: hidden;
}

.modal-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Contador discreto sobre la imagen */
.modal-counter {
    position: absolute;
    bottom: 12px;
    right: 14px;
    background: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    font-family: "Space Grotesk", sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    letter-spacing: 0.05em;
    pointer-events: none;
}

/* Bloque de Información y Texto */
.modal-info {
    padding: 22px 28px 28px 28px;
    background: #fcfcfc;
}

.modal-title {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 22px;
    font-weight: 500;
    color: #1c1c1c;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.modal-title #modal-date-text {
    color: #666666;
    font-weight: 400;
}

/* Caja con Scroll para la Descripción */
.modal-description-scroll {
    max-height: 110px;
    overflow-y: auto;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: #4a4a4a;
    padding-right: 10px;
}

/* Estilo de la barra de scroll */
.modal-description-scroll::-webkit-scrollbar {
    width: 5px;
}

.modal-description-scroll::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.modal-description-scroll::-webkit-scrollbar-thumb {
    background: #555555;
    border-radius: 4px;
}

/* Flechas Flotantes Laterales */
.modal-nav {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 16px;
    opacity: 0.8;
    transition: opacity 0.2s ease, transform 0.15s ease;
    user-select: none;
}

.modal-nav:hover {
    opacity: 1;
    transform: scale(1.15);
}

.prev-btn { margin-right: 20px; }
.next-btn { margin-left: 20px; }

@media (max-width: 640px) {
    .modal-nav { display: none; }
    .modal-stack-wrapper { width: 95%; }
    .modal-image-wrapper { height: 260px; }
}

/* ===================================================
   ESCALADO PARA MONITORES GIGANTES (4K / 5K / iMac)
   =================================================== */
@media (min-width: 2000px) {
    /* 1. Badge "Disponible para nuevos proyectos" */
    .badge-status {
        padding: 8px 20px !important;
    }
    .badge-text {
        font-size: 1.1rem !important;
    }
    .badge-dot {
        width: 10px !important;
        height: 10px !important;
    }

    /* 2. Título principal ("Estructuras fiables...") */
    .hero-title {
        font-size: 5.5rem !important;
        line-height: 1.1 !important;
        margin-bottom: 2rem !important;
    }

    /* 3. Texto descriptivo inferior */
    .hero-description {
        font-size: 1.4rem !important;
        max-width: 720px !important; /* Más ancho para que el texto respire y no quede apretado */
        line-height: 1.6 !important;
    }

    /* 4. Botón "Hablemos de su proyecto" */
    .btn-primary {
        font-size: 1.2rem !important;
        padding: 18px 36px !important;
    }
}


@media (max-width: 425px) {
    /* Pasa el título y el permutador a disposición en columna */
    .projects-header-wrapper {
        display: flex !important;
        flex-direction: column !important;
        align-items: center; /* Centra los bloques (título y permutador) horizontalmente */
        text-align: center;  /* Centra el texto en sí, vital para resoluciones pequeñas como 320px donde rompe en dos líneas */
        gap: 15px;           /* Añade una separación limpia entre el texto y los botones */
    }

    /* Si el contenedor de tus botones es flex, asegúrate de que también centre su contenido interno */
        .view-selector {
            justify-content: center;
            width: 100%; 
        }
    

    /* Ajuste fino de margen para separar los botones del grid de imágenes */
    .projects-header-wrapper > div:last-child {
        margin-top: 4px;
        margin-bottom: 24px;
    }
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--brand-green);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    vertical-align: middle;
    transition: color 0.2s ease;
}
.copy-btn:hover { color: var(--brand-green); }