/* =========================================
   1. VARIABLES Y GENERALES
========================================= */
:root {
    --carbon: #0D0D0D;
    --obsidiana: #161616;
    --cobre: #B56A3B;
    --arena: #D8B892;
    --ambar: #FF8C42;
    --agave: #355E4B;
    /* EL NUEVO VERDE PREMIUM (Ni muy flúor, ni muy oscuro) */
    --agave-luz: #5CB88F; 
    /* La versión RGB para poder darle opacidad en las sombras */
    --agave-rgb: 92, 184, 143; 
    --fuente-titulos: 'Syne', sans-serif;
    --fuente-texto: 'Space Grotesk', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--carbon);
    color: var(--arena);
    font-family: var(--fuente-texto);
    overflow-x: hidden;
    cursor: url('piedra_mouse.svg') 16 16, auto;
}

a, button, .cyber-btn, .nav-link, .service-card {
    cursor: pointer; 
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--carbon); }
::-webkit-scrollbar-thumb { background: var(--ambar); }

/* =========================================
   2. NAVEGACIÓN
========================================= */
nav {
    position: fixed; top: 0; width: 100%;
    padding: 12px 5%;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 100;
    background: rgba(13, 13, 13, 0.9);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--agave-luz);
}

.logo-container { 
    order: 2; 
    margin: 0; 
    padding: 0;
    flex: 0 0 200px; 
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-svg { 
    width: 220px; 
    height: auto; 
    max-height: 50px; 
    display: block;
    object-fit: contain; 
}

.nav-links { display: flex; gap: 40px; order: 1; }
.nav-link {
    color: var(--arena); text-decoration: none;
    font-size: 14px; font-weight: 800; 
    text-transform: uppercase; letter-spacing: 2px;
    transition: 0.3s;
}
.nav-link:hover { color: var(--ambar); text-shadow: 0 0 10px var(--ambar); }

.menu-toggle { display: none; order: 3; color: var(--ambar); font-size: 24px; cursor: pointer; }

/* =========================================
   3. HERO SECTION
========================================= */
.hero {
    position: relative; width: 100vw; height: 100vh;
    display: flex; justify-content: center; align-items: center;
    overflow: hidden;
    background: radial-gradient(circle at center, var(--obsidiana) 0%, var(--carbon) 80%);
}

#codeCanvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; opacity: 0.8; }

.hero-content {
    position: relative; z-index: 10;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; width: 100%; height: 100%;
    pointer-events: none;
}

.piedra-container {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%); 
    width: 100%; max-width: 725px; 
    display: flex; justify-content: center; align-items: center;
    z-index: 5; transition: transform 0.1s ease-out;
}

.piedra-flotante {
    width: 100%; height: auto;
    animation: levitarPiedra 6s ease-in-out infinite;
    filter: drop-shadow(0 40px 35px rgba(0,0,0,0.9)); 
}

.piedra-glow {
    position: absolute; width: 250px; height: 250px;
    background: radial-gradient(circle, var(--ambar) 0%, transparent 60%);
    z-index: 1; opacity: 0.5; filter: blur(35px);
    animation: latidoPiedra 3s ease-in-out infinite alternate;
}

@keyframes levitarPiedra {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(1deg); } 
}

@keyframes latidoPiedra {
    0% { transform: scale(0.8); opacity: 0.3; }
    100% { transform: scale(1.3); opacity: 0.7; }
}

.hero-title {
    position: relative; z-index: 20;
    font-family: var(--fuente-titulos);
    font-size: clamp(1.8rem, 4vw, 5.4rem); 
    font-weight: 800; color: #ffffff;
    line-height: 1.1; text-transform: uppercase;
    text-shadow: 0 10px 40px rgba(0,0,0,0.9); 
    pointer-events: auto;
}

.texto-forja { 
    /* Creamos el degradado incandescente con tus variables */
    background: linear-gradient(90deg, var(--arena), var(--ambar), var(--cobre), var(--arena));
    background-size: 300% 100%;
    
    /* Recortamos el fondo a la forma del texto */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent; /* Fallback */
    
    /* Llamamos a la animación que ya creamos (10s de loop suave) */
    animation: resplandor-forja 10s ease-in-out infinite;

}

/* =========================================
   4. QUIÉNES SOMOS (TERMINALES)
========================================= */
.about-grid-terminal {
    display: flex; gap: 15px; height: 450px; width: 100%;
}

.terminal-card {
    flex: 1; border: 1px solid var(--agave); background: var(--obsidiana);
    padding: 25px; transition: flex 0.5s ease; position: relative;
    cursor: pointer; display: flex; flex-direction: column; overflow: hidden;
}

.terminal-card:hover { flex: 3; border-color: var(--ambar); }

.terminal-card h3 {
    font-family: var(--fuente-titulos); color: var(--ambar); font-size: 20px;
    margin: 0; transition: 0.4s; writing-mode: vertical-rl; text-orientation: upright;
    white-space: nowrap; height: auto;
}

.terminal-card:hover h3 { writing-mode: horizontal-tb; margin-bottom: 20px; }

.terminal-content {
    opacity: 0; transition: opacity 0.4s ease; color: var(--arena);
    font-size: 16px; line-height: 1.6; margin-top: 10px; flex-grow: 1; overflow-y: auto;
}

.terminal-card:hover .terminal-content { opacity: 1; }

/* =========================================
   5. SERVICIOS Y GRID (CON EFECTO NEÓN VERDE)
========================================= */
section { padding: 100px 10%; }
.section-title { font-family: var(--fuente-titulos); font-size: 48px; color: #fff; margin-bottom: 40px; }

.services-section {
    background-color: var(--obsidiana);
    position: relative;
    overflow: hidden;
}

#networkCanvas {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1; pointer-events: none; 
}

.section-header, .services-grid {
    position: relative; z-index: 2;
}

/* --- EL GRID --- */
.services-grid { 
    display: grid; 
    /* Fuerza 3 columnas en escritorio (mínimo 300px por tarjeta) */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 30px; 
}

/* En pantallas muy grandes forzamos las 3 columnas exactas */
@media (min-width: 1024px) {
    .services-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --- LA TARJETA ENLACE --- */
.service-card { 
    background: var(--carbon); 
    padding: 40px 30px; 
    border: 1px solid var(--agave); 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    position: relative;
    z-index: 10;
    text-decoration: none;
    color: var(--arena);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
}
/* Hover de la Tarjeta Completa */
.service-card:hover {
    transform: translateY(-8px); 
    border-color: var(--agave-luz); 
    box-shadow: 0 10px 30px rgba(53, 94, 75, 0.5), 0 0 15px rgba(var(--agave-rgb), 0.4); 
}

/* Textos de la tarjeta */
.service-card h3 { 
    color: var(--arena); 
    margin-bottom: 15px; 
    font-family: var(--fuente-titulos); 
    transition: 0.3s;
}

.service-card:hover h3 { color: var(--agave-luz); }

/* El título brilla verde al pasar el mouse */
.service-card:hover h3 { color: var(--agave-luz) }

/* --- EL CUADRO DEL ICONO --- */
.icon-box {
    width: 70px;
    height: 70px;
    background: var(--obsidiana);
    border: 1px solid var(--agave);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    color: var(--agave);
    margin-bottom: 25px;
    transition: 0.4s ease;
    /* Luz interna apagada por defecto */
    box-shadow: inset 0 0 10px rgba(53, 94, 75, 0.2); 
}

/* --- MAGIA: Efecto del icono al pasar el mouse por LA TARJETA --- */
.service-card:hover .icon-box {
    color: var(--agave-luz); 
    border-color: var(--agave-luz);
    box-shadow: 0 0 20px rgba(var(--agave-rgb), 0.6), inset 0 0 15px rgba(var(--agave-rgb), 0.4);
    transform: scale(1.1); 
}


/* =========================================
   6. TRABAJOS (GALERÍA)
========================================= */
.work-section { background-color: var(--carbon); overflow: hidden; position: relative; padding: 100px 10%; }
.slider-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; padding: 0 5%; }
.slider-controls { display: flex; gap: 15px; }

.slider-btn {
    background: transparent; border: 1px solid var(--cobre); color: var(--ambar);
    width: 50px; height: 50px; cursor: pointer; transition: 0.3s;
    display: flex; justify-content: center; align-items: center; font-size: 20px;
}
.slider-btn:hover { background: var(--ambar); color: var(--carbon); border-color: var(--ambar); }

.gallery-wrapper { width: 100%; position: relative; overflow: hidden; }
.gallery-track { display: flex; gap: 30px; transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1); }

.gallery-item {
    flex: 0 0 350px; height: 300px; background: var(--obsidiana); position: relative;
    border: 2px solid var(--cobre); overflow: hidden; cursor: pointer;
}

.gallery-item.active { opacity: 1; z-index: 2; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.gallery-item:hover img { transform: scale(1.05); }

.project-info {
    position: absolute; bottom: -100%; left: 0; width: 100%; padding: 25px;
    background: rgba(13, 13, 13, 0.95); border-top: 2px solid var(--ambar);
    transition: bottom 0.4s ease-out; z-index: 3; 
}

.gallery-item:hover .project-info { bottom: 0; }

/* =========================================
   7. FOOTER
========================================= */
footer { 
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
    padding: 40px 10%; 
    text-align: center; 
    border-top: 2px solid var(--agave-luz);
    position: relative;
}

.footer-logo { 
    margin-bottom: 20px; 
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-footer {
    width: 220px; 
    height: auto;
    max-height: 50px; 
    display: block;
    margin: 0 auto; 
    object-fit: contain;
    opacity: 0.85; 
    transition: opacity 0.3s ease;
}

.logo-footer:hover {
    opacity: 1;
}

/* --- TEXTO CON EFECTO DE FORJA INCANDESCENTE --- */
.footer-text { 
    font-size: 13px; 
    letter-spacing: 2px; 
    
    /* Creamos un degradado ancho con tus 3 colores (repetimos arena al final para que el loop sea invisible) */
    background: linear-gradient(90deg, var(--arena), var(--ambar), var(--cobre), var(--arena));
    background-size: 300% 100%;
    
    /* Recortamos el fondo a la forma del texto */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent; /* Fallback */
    
    /* Animación de 8 segundos, suave de ida y vuelta */
    animation: resplandor-forja 10s ease-in-out infinite;
}

/* La instrucción de movimiento para el degradado */
@keyframes resplandor-forja {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

footer::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--agave-luz), transparent);
}

/* =========================================
   8. RESPONSIVIDAD
========================================= */
@media (max-width: 900px) {
    .nav-links { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: var(--carbon); flex-direction: column; align-items: center; padding: 40px 0; gap: 30px; border-bottom: 2px solid var(--cobre); }
    .nav-links.active { display: flex; }
    .logo-container { margin: 0 auto; order: 1; }
    .menu-toggle { display: block; order: 2; }
    .piedra-container { max-width: 80vw; }
    .hero-title { font-size: 2rem; }
    .about-grid-terminal { flex-direction: column; height: auto; }
    .terminal-card { height: 100px; }
    .terminal-card:hover { height: 300px; }
    .terminal-card h3 { writing-mode: horizontal-tb; }
}

/* =========================================
   9. CONTACTO Y FORMULARIO (MODO PRO)
========================================= */
.contact-section { 
    padding: 100px 10%; 
    background-color: var(--carbon); 
    position: relative; 
}

.contact-container { 
    max-width: 650px; 
    margin: 0 auto; 
    background: var(--obsidiana); 
    padding: 50px 40px; 
    border: 1px solid var(--agave); 
    border-top: 3px solid var(--agave-luz);
    border-radius: 8px; 
    box-shadow: 0 15px 40px rgba(0,0,0,0.6); 
}

.cyber-form { display: flex; flex-direction: column; gap: 35px; }

.input-group { position: relative; }

.input-group input, .input-group textarea { 
    width: 100%; padding: 15px; background: transparent; 
    border: 1px solid var(--agave); color: var(--arena); 
    font-family: var(--fuente-texto); font-size: 16px; 
    outline: none; transition: 0.3s; border-radius: 4px; 
}

.input-group label { 
    position: absolute; left: 15px; top: 15px; 
    color: var(--agave); transition: 0.3s ease; pointer-events: none; 
    font-size: 16px; background: var(--obsidiana); padding: 0 5px; 
}

/* Efecto Flotante del Label al enfocar o escribir */
.input-group input:focus, .input-group textarea:focus,
.input-group input:not(:placeholder-shown), .input-group textarea:not(:placeholder-shown) { 
    border-color: var(--agave-luz); 
    box-shadow: 0 0 10px rgba(var(--agave-rgb), 0.15); 
}

.input-group input:focus ~ label, .input-group textarea:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label, .input-group textarea:not(:placeholder-shown) ~ label { 
    top: -12px; font-size: 13px; color: var(--agave-luz); font-weight: bold;
}

/* El Botón Transmitir */
.cyber-btn { 
    background: transparent; color: var(--agave-luz); border: 1px solid var(--agave-luz); 
    padding: 15px 30px; font-family: var(--fuente-titulos); font-size: 18px; 
    text-transform: uppercase; letter-spacing: 2px; cursor: pointer; 
    transition: 0.4s; display: flex; justify-content: center; align-items: center; gap: 15px; 
    border-radius: 4px;
}

.cyber-btn:hover { 
    background: var(--agave-luz); color: var(--carbon); 
    box-shadow: 0 0 20px rgba(var(--agave-rgb), 0.6); 
}

/* =========================================
   10. BOTÓN FLOTANTE WHATSAPP
========================================= */
.btn-whatsapp { 
    position: fixed; bottom: 40px; right: 40px; 
    width: 40px; height: 40px; background-color: #25D366; 
    color: white; border-radius: 50%; display: flex; 
    justify-content: center; align-items: center; font-size: 35px; 
    z-index: 1000; box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4); 
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); text-decoration: none; 
}

.btn-whatsapp:hover { 
    transform: scale(1.15) rotate(-5deg); 
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6); color: white; 
}

/* Ajuste móvil para contacto y botón */
@media (max-width: 768px) {
    .contact-container { padding: 30px 20px; }
    .btn-whatsapp { bottom: 20px; right: 20px; width: 55px; height: 55px; font-size: 30px; }
}

/* =========================================
   11. CLASE PARA ENVENENAR BOTS EN EL CAPTCHA
========================================= */
.fantasma {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}