/* --- RESET Y VARIABLES GLOBALES --- */
:root {
    --primary-color: #00aaff;
    --secondary-color: #ffffff;
    --background-color: #010409;
    --text-color: #a0a8b3;
    --heading-color: #f0f6fc;
    --glass-bg: rgba(22, 27, 34, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-bg: #0d1117;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Poppins', sans-serif; background-color: var(--background-color); color: var(--text-color); line-height: 1.7; overflow-x: hidden; cursor: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- CURSOR Y CANVAS --- */
.custom-cursor { position: fixed; width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle, rgba(0,170,255,0.3) 0%, rgba(0,170,255,0) 60%); border: 1px solid rgba(0,170,255,0.5); pointer-events: none; transform: translate(-50%, -50%); transition: width 0.2s ease, height 0.2s ease, transform 0.1s ease; z-index: 9999; }
.cursor-click { transform: translate(-50%, -50%) scale(0.7); }
#hero-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; opacity: 0.5; }

/* --- HEADER Y NAVEGACIÓN --- */
.main-header { padding: 20px 0; position: fixed; width: 100%; z-index: 1000; background: linear-gradient(to bottom, rgba(1, 4, 9, 0.9) 0%, rgba(1, 4, 9, 0) 100%); }
.main-header .container { display: flex; justify-content: space-between; align-items: center; }
.logo img { max-height: 40px; display: block; }
nav a { color: var(--secondary-color); text-decoration: none; margin-left: 25px; font-weight: 400; transition: color 0.3s ease; }
nav a:hover { color: var(--primary-color); }
.btn-contact { border: 1px solid var(--primary-color); padding: 8px 20px; border-radius: 50px; transition: all 0.3s ease; }
.btn-contact:hover { background-color: var(--primary-color); color: var(--background-color); font-weight: 500;}

/* --- HERO --- */
#hero { min-height: 100vh; display: flex; align-items: center; text-align: center; padding-top: 80px;}
#hero h1 { font-family: 'Space Grotesk', sans-serif; font-size: clamp(2.5rem, 5vw, 4.2rem); font-weight: 700; line-height: 1.1; color: var(--heading-color); margin-bottom: 20px; }
#hero .subtitle { font-size: 1.2rem; max-width: 700px; margin: 0 auto 40px auto; }
.btn-primary { background-color: var(--primary-color); color: var(--background-color); padding: 15px 35px; font-weight: 600; text-decoration: none; border-radius: 50px; display: inline-block; transition: transform 0.3s ease, box-shadow 0.3s ease; border: none; cursor: pointer; font-family: 'Poppins', sans-serif; }
.btn-primary:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 170, 255, 0.3); }

/* --- CONSTELACIÓN DE SERVICIOS --- */
.prototype-gallery-wrapper { padding-top: 100px; }
.prototype-case { display: grid; grid-template-columns: 1fr 1.2fr; gap: 50px; align-items: flex-start; min-height: 100vh; }
.sticky-description { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-right: 20px; }
.sticky-description h2 { font-family: 'Space Grotesk', sans-serif; font-size: clamp(2.2rem, 4vw, 2.8rem); color: var(--heading-color); margin-bottom: 20px; text-align: left;}
.sticky-description p { margin-bottom: 15px; text-align: left; margin-left: 0; }
.prototype-viewer-scroll { display: flex; align-items: center; min-height: 100vh; }
.prototype-viewer { width: 100%; height: 60vh; min-height: 450px; perspective: 1500px; }
.ecosystem-container { position: relative; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; transition: transform 0.5s ease, opacity 0.5s ease; }
.ecosystem-center { width: 120px; height: 120px; background-color: var(--secondary-color); border-radius: 50%; display: flex; justify-content: center; align-items: center; text-align: center; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.2rem; color: var(--background-color); position: relative; z-index: 5; box-shadow: 0 0 30px var(--secondary-color), inset 0 0 15px rgba(0,0,0,0.4); }

/* Arreglo del bug de descuadre */
.service-node { position: absolute; width: 120px; height: 120px; z-index: 6; animation: orbit 30s linear infinite; text-decoration: none; transform-style: preserve-3d; }
.service-node-inner { width: 100%; height: 100%; border-radius: 50%; display: flex; justify-content: center; align-items: center; text-align: center; font-size: 0.8rem; color: var(--heading-color); padding: 10px; background: var(--glass-bg); border: 1px solid var(--glass-border); transform: rotateY(var(--rotateY)) rotateX(var(--rotateX)); transition: transform 0.1s linear, box-shadow 0.3s ease, border-color 0.3s ease; }
.service-node:hover .service-node-inner { border-color: var(--primary-color); box-shadow: 0 0 25px rgba(0, 170, 255, 0.7); }
.service-node:hover { animation-play-state: running; }

.service-node[data-service-id="soporte"] { animation-delay: -5s; }
.service-node[data-service-id="web"] { animation-delay: -10s; }
.service-node[data-service-id="ciberseguridad"] { animation-delay: -15s; }
.service-node[data-service-id="cloud"] { animation-delay: -20s; }
.service-node[data-service-id="consultoria"] { animation-delay: -25s; }
@keyframes orbit { from { transform: rotate(0deg) translateX(240px) rotate(0deg); } to { transform: rotate(360deg) translateX(240px) rotate(-360deg); } }

/* --- VISTA INMERSIVA DINÁMICA --- */
#immersive-view { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 2000; display: flex; justify-content: center; align-items: center; background-color: rgba(1, 4, 9, 0.7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease; padding: 20px;}
body.immersive-active #immersive-view { opacity: 1; visibility: visible; }
body.immersive-active .ecosystem-container { transform: scale(0.8); opacity: 0.3; }
#close-immersive-view { position: absolute; top: 30px; right: 40px; background: transparent; border: none; color: var(--secondary-color); font-size: 2.5rem; cursor: pointer; line-height: 1; transition: transform 0.3s ease, color 0.3s ease; z-index: 10; }
#close-immersive-view:hover { color: var(--primary-color); transform: rotate(90deg); }

.immersive-modal-content { position: relative; max-width: 650px; width: 100%; padding: 40px; border-radius: 20px; overflow: hidden; transform: scale(0.95); opacity: 0; transition: transform 0.4s ease 0.1s, opacity 0.4s ease 0.1s; }
body.immersive-active .immersive-modal-content { transform: scale(1); opacity: 1; }
.immersive-modal-content::before { content: ''; position: absolute; top: 0; left: 0; width: 200%; height: 200%; background: conic-gradient(from 180deg at 50% 50%, var(--primary-color), transparent 50%, transparent); animation: rotate-border 4s linear infinite; transform-origin: center center; z-index: -1; }
@keyframes rotate-border { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

#immersive-content-payload { text-align: center; }
#immersive-content-payload > * { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
.service-icon { font-size: 3rem; margin-bottom: 15px; color: var(--primary-color); }
body.immersive-active .service-icon { opacity: 1; transform: translateY(0); transition-delay: 0.3s; }
body.immersive-active #immersive-content-payload h2 { opacity: 1; transform: translateY(0); transition-delay: 0.4s; }
body.immersive-active #immersive-content-payload p { opacity: 1; transform: translateY(0); transition-delay: 0.5s; }
body.immersive-active #immersive-content-payload ul { opacity: 1; transform: translateY(0); transition-delay: 0.6s; }
body.immersive-active #immersive-content-payload li { opacity: 0; transform: translateY(15px); animation: fadeInListItem 0.5s ease forwards; }
@keyframes fadeInListItem { to { opacity: 1; transform: translateY(0); } }
body.immersive-active #immersive-content-payload li:nth-child(1) { animation-delay: 0.7s; }
body.immersive-active #immersive-content-payload li:nth-child(2) { animation-delay: 0.8s; }
body.immersive-active #immersive-content-payload li:nth-child(3) { animation-delay: 0.9s; }
body.immersive-active #immersive-content-payload li:nth-child(4) { animation-delay: 1.0s; }
body.immersive-active #immersive-content-payload .btn-primary { opacity: 1; transform: translateY(0); transition-delay: 1.2s; }

#immersive-content-payload h2 { font-family: 'Space Grotesk', sans-serif; font-size: clamp(1.8rem, 4vw, 2.5rem); color: var(--primary-color); margin-bottom: 15px; }
#immersive-content-payload p { font-size: clamp(1rem, 2.5vw, 1.1rem); margin-bottom: 25px; }
#immersive-content-payload ul { list-style: none; text-align: left; display: inline-block; margin-bottom: 30px; }
#immersive-content-payload li { margin-bottom: 10px; padding-left: 25px; position: relative; }
#immersive-content-payload li::before { content: '✓'; color: var(--primary-color); position: absolute; left: 0; font-weight: 600; }

/* --- OTRAS SECCIONES --- */
.section-title { text-align: center; margin-bottom: 60px; }
.section-title h2 { font-family: 'Space Grotesk', sans-serif; font-size: clamp(2.2rem, 5vw, 2.8rem); color: var(--heading-color); margin-bottom: 10px; }
#proyectos { padding: 100px 20px; }

/* Proyectos */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.project-card { background-color: var(--card-bg); border: 1px solid var(--glass-border); border-radius: 15px; padding: 30px; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.project-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0, 170, 255, 0.1); }
.project-card .project-image { width: 100%; height: 180px; background: linear-gradient(45deg, var(--primary-color), #333); border-radius: 10px; margin-bottom: 20px; opacity: 0.5; }
.project-card h3 { font-family: 'Space Grotesk', sans-serif; color: var(--heading-color); font-size: 1.5rem; margin-bottom: 10px; }

/* --- NUEVAS SECCIONES DE VALOR --- */
.value-section { padding: 100px 20px; }
.why-us-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; margin-top: 60px; }
.why-us-card { background-color: var(--card-bg); border: 1px solid var(--glass-border); border-radius: 15px; padding: 30px; text-align: center; }
.why-us-card .icon { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 20px; display: block; }
.why-us-card h3 { font-family: 'Space Grotesk', sans-serif; color: var(--heading-color); font-size: 1.5rem; margin-bottom: 10px; }
.methodology-timeline { display: flex; flex-direction: column; gap: 40px; margin-top: 60px; position: relative; padding-left: 30px; border-left: 2px solid var(--glass-border); }
.timeline-step { position: relative; }
.timeline-step::before { content: ''; position: absolute; left: -42px; top: 5px; width: 20px; height: 20px; border-radius: 50%; background-color: var(--background-color); border: 3px solid var(--primary-color); }
.timeline-step h3 { font-family: 'Space Grotesk', sans-serif; color: var(--primary-color); font-size: 1.5rem; }
.timeline-step span { font-size: 0.9rem; color: var(--text-color); display: block; margin-bottom: 10px; }
.tech-stack-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; margin-top: 60px; }
.tech-badge { background-color: var(--card-bg); border: 1px solid var(--glass-border); color: var(--text-color); padding: 10px 20px; border-radius: 50px; font-size: 0.9rem; font-weight: 500; transition: all 0.3s ease; }
.tech-badge:hover { color: var(--primary-color); border-color: var(--primary-color); box-shadow: 0 0 10px rgba(0, 170, 255, 0.3); }

/* Testimonios */
#clientes { padding: 100px 20px; }
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 60px; }
.testimonial-card { background-color: var(--card-bg); border: 1px solid var(--glass-border); border-radius: 15px; padding: 30px; display: flex; flex-direction: column; }
.testimonial-card .quote { color: var(--heading-color); font-size: 1.1rem; margin-bottom: auto; font-style: italic; }
.testimonial-card .author { font-family: 'Space Grotesk', sans-serif; color: var(--primary-color); font-weight: 700; margin-top: 20px; }
.testimonial-card .company { font-size: 0.9rem; color: var(--text-color); }

/* Animaciones de Scroll */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Contacto */
#contacto { background-color: var(--card-bg); padding: 100px 20px; }
#contacto h2 { font-family: 'Space Grotesk', sans-serif; font-size: clamp(2.2rem, 5vw, 2.8rem); color: var(--heading-color); margin-bottom: 20px; text-align: center; }
#contacto p { max-width: 600px; margin: 0 auto 50px auto; text-align: center;}
.contact-wrapper { display: flex; flex-wrap: wrap; gap: 40px; max-width: 900px; margin: 0 auto; text-align: left; }
.contact-info, .contact-form { flex: 1; min-width: 300px; }
.contact-info h3, .contact-form h3 { font-family: 'Space Grotesk', sans-serif; color: var(--heading-color); margin-bottom: 20px; font-size: 1.5rem; }
.contact-info p { margin-bottom: 20px; margin-left: 0; max-width: none; }
.contact-info a { color: var(--primary-color); text-decoration: none; font-weight: 600; }
.contact-form input, .contact-form textarea { width: 100%; padding: 15px; background-color: var(--background-color); border: 1px solid var(--glass-border); border-radius: 8px; color: var(--text-color); margin-bottom: 15px; font-family: 'Poppins', sans-serif; font-size: 1rem; }
.contact-form textarea { resize: vertical; }
.contact-form button { width: 100%; }
footer { text-align: center; padding: 30px 20px; border-top: 1px solid var(--glass-border); }

/* --- NOTIFICACIONES TOAST --- */
#notification-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 15px 20px; border-radius: 8px; background-color: var(--card-bg); border: 1px solid var(--glass-border); color: var(--heading-color); font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); border-left: 5px solid var(--primary-color); opacity: 0; transform: translateX(100%); animation: slideIn 0.5s ease forwards; }
.toast--success { border-left-color: #28a745; }
.toast--error { border-left-color: #dc3545; }
@keyframes slideIn { to { opacity: 1; transform: translateX(0); } }
@keyframes slideOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100%); } }

/* --- RESPONSIVE DESIGN 100% --- */
@media (max-width: 900px) {
    .prototype-case { grid-template-columns: 1fr; min-height: auto; }
    .sticky-description { position: relative; height: auto; padding: 50px 0; text-align: center; }
    .sticky-description h2, .sticky-description p { text-align: center; margin-left: auto; margin-right: auto; }
    .prototype-viewer-scroll { min-height: auto; padding-bottom: 100px; }
    .prototype-viewer { height: 60vh; perspective: none; }
    .main-header nav a:not(.btn-contact) { display: none; }
    @keyframes orbit { from { transform: rotate(0deg) translateX(140px) rotate(0deg); } to { transform: rotate(360deg) translateX(140px) rotate(-360deg); } }
    .service-node-inner { transform: none !important; }
}

@media (max-width: 600px) {
    nav a { margin-left: 15px; }
    .btn-contact { padding: 6px 15px; }
    .logo img { max-height: 30px; }
    .contact-wrapper { flex-direction: column; }
    .immersive-modal-content { padding: 30px 20px; }
}