/* Variables y Configuración General */
:root {
    --primary-color: #0072ff;
    --secondary-color: #00c6ff;
    --dark-bg: #0a0f1d;
    --card-bg: #131c31;
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --white: #ffffff;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-color);
    overflow-x: hidden;
}

/* Barra de Navegación */
.navbar {
    background-color: rgba(10, 15, 29, 0.95);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
}

.logo span {
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu li a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 10px 20px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-menu li a:hover, .nav-menu li a.active {
    color: var(--secondary-color);
}

/* Sección Hero */
.hero-section {
    padding: 160px 20px 80px 20px;
    background: radial-gradient(circle at top right, rgba(0, 198, 255, 0.1), transparent);
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 40px;
}

.hero-content {
    flex: 1;
}

.hero-content h1 {
    font-size: 48px;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--white);
}

.hero-content h1 span {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    color: var(--text-muted);
    font-size: 18px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 14px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 114, 255, 0.4);
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 198, 255, 0.6);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hero-image img {
    max-width: 100%;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Sección Servicios */
.services-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 36px;
    color: var(--white);
    margin-bottom: 15px;
}

.section-title p {
    color: var(--text-muted);
    font-size: 16px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 35px;
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: rgba(0, 198, 255, 0.3);
    box-shadow: 0 15px 30px rgba(0, 114, 255, 0.1);
}

.card-icon {
    font-size: 35px;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 22px;
    color: var(--white);
    margin-bottom: 15px;
}

.service-card p {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 25px;
    flex-grow: 1;
}

.card-img-wrapper {
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: 12px;
    margin-top: auto;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.service-card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    background-color: #060912;
    color: var(--text-muted);
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* Animaciones mediante JavaScript (Scroll Reveal) */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive / Adaptabilidad */
@media (max-width: 768px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 36px;
    }
    
    .nav-menu {
        display: none; /* Aquí añadirías lógica para menú hamburguesa móvil */
    }
}

/* Botón Fijo Volver Anterior */
.btn-to-back {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #0072ff, #00c6ff);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0, 114, 255, 0.4);
    z-index: 9999; /* Siempre por encima del contenido */
    
    /* Siempre activo y visible */
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: all 0.3s ease-in-out;
}

/* Efecto Hover (al pasar el mouse) */
.btn-to-back:hover {
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    transform: scale(1.1) translateX(-3px); /* Se agranda un poco y se mueve sutilmente a la izquierda indicando "atrás" */
    box-shadow: 0 6px 20px rgba(0, 198, 255, 0.6);
}

/* Efecto al hacer click */
.btn-to-back:active {
    transform: scale(0.95);
}

/* Sección de Robótica y Software */
.robotics-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 20px;
}

.robotics-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    margin-bottom: 100px;
}

/* Invierte el orden de los bloques en pantallas grandes para el efecto alternado */
.robotics-row.reverse {
    flex-direction: row-reverse;
}

.robotics-text {
    flex: 1;
}

.tag-tech {
    display: inline-block;
    background: rgba(0, 114, 255, 0.15);
    color: var(--secondary-color);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    border: 1px solid rgba(0, 198, 255, 0.3);
}

.robotics-text h3 {
    font-size: 32px;
    color: var(--white);
    margin-bottom: 20px;
    line-height: 1.3;
}

.robotics-text p {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 25px;
}

.tech-list {
    list-style: none;
}

.tech-list li {
    color: var(--text-color);
    font-size: 15px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tech-list li i {
    color: var(--secondary-color);
    font-size: 16px;
}

.robotics-media {
    flex: 1;
    display: flex;
    justify-content: center;
}

.robotics-media img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    transition: var(--transition);
}

.robotics-media img:hover {
    transform: scale(1.02);
    border-color: rgba(0, 114, 255, 0.3);
}

/* Adaptabilidad para Dispositivos Móviles */
@media (max-width: 992px) {
    .robotics-row, .robotics-row.reverse {
        flex-direction: column;
        gap: 40px;
        margin-bottom: 70px;
    }
    
    .robotics-text h3 {
        font-size: 26px;
    }
    
    .robotics-media img {
        max-width: 100%;
    }
}

/* //////////////////////////////////////// */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 40px;
    padding: 0 100px;
}

.card {
    background: var(--gray);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.card:hover { transform: translateY(-10px); }

.card-image { height: 200px; background: #ddd; } /* Aquí irían tus capturas */

.card-content { padding: 20px; }
.link { 
    display: inline-block; 
    margin-top: 15px; 
    color: var(--accent); 
    text-decoration: none; 
    font-weight: bold; 
}

footer { text-align: center; padding: 50px; opacity: 0.6; }

/* Ajuste en la tarjeta para el zoom amigable */
.card {
    background: var(--gray);
    border-radius: 16px;
    overflow: hidden; /* Importante para que el zoom no se salga de los bordes */
    transition: transform 0.5s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.5s ease;
    cursor: pointer;
}

/* Contenedor de la imagen para el zoom */
.card-image {
    height: 220px;
    background-color: #e0e0e0;
    background-size: cover;
    background-position: center;
    transition: transform 0.7s cubic-bezier(0.2, 1, 0.3, 1); /* Zoom más lento y suave */
}

/* --- EFECTO HOVER AMIGABLE --- */

.card:hover {
    transform: translateY(-8px); /* Elevación suave */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08); /* Sombra difuminada */
}

.card:hover .card-image {
    transform: scale(1.1); /* Zoom interno de la imagen */
}

/* Opacidad muy sutil para el resto (opcional, para guiar la vista) */
.grid:hover .card:not(:hover) {
    opacity: 0.85;
}