@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #000000;
    --bg-surface: #0A0A0A;
    --panel-bg: rgba(255, 255, 255, 0.03);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-hover: rgba(255, 255, 255, 0.06);
    
    --primary: #FFFFFF;
    --accent: #6366F1; /* Indigo */
    --accent-glow: rgba(99, 102, 241, 0.4);
    --accent-gradient: linear-gradient(135deg, #6366F1 0%, #A855F7 100%);
    
    --text-main: #FFFFFF;
    --text-muted: #888888;
    --text-dark: #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
    
    /* Fondo más atractivo: malla/cuadrícula tecnológica sutil con orbes de luz índigo */
    background-image: 
        radial-gradient(circle at 15% 40%, rgba(99, 102, 241, 0.15), transparent 30%),
        radial-gradient(circle at 85% 70%, rgba(99, 102, 241, 0.12), transparent 30%),
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    background-position: 0 0, 0 0, center center, center center;
    background-attachment: fixed;
}

/* Utils */
.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--panel-border);
}

  /* Scanlines - ¡Efecto de escáner traído de vuelta y potenciado! */
.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.3) 50%);
    background-size: 100% 4px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.45; /* Opacidad alta pero balanceada para lectura */
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: var(--text-dark);
    padding: 0.8rem 1.8rem;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background: #E5E5E5;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255,255,255,0.1);
}

.btn-primary.matrix-back-btn:hover {
    background: rgba(255, 50, 50, 0.05);
    border-color: #FF3232;
    box-shadow: 0 0 20px rgba(255, 50, 50, 0.2);
}

.matrix-back-btn:hover .back-icon {
    transform: translateX(-10px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    padding: 0.8rem 1.8rem;
    border-radius: 6px;
    border: 1px solid var(--panel-border);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background: var(--panel-bg);
    border-color: rgba(255,255,255,0.2);
}

/* Glass Panels (Bento) */
.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--panel-hover);
}

/* Hero Section */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8rem 5% 5rem;
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.hero-badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    padding: 0.4rem 1rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 2rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
    letter-spacing: 0.5px;
}

/* Interactive Matrix Cards */
.matrix-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2.5rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Fondo expandible luminoso al hacer hover */
.matrix-card::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    transition: width 0.5s ease, height 0.5s ease;
    transform: translate(-50%, -50%);
    z-index: -1;
    border-radius: 50%;
}

.matrix-card:hover {
    transform: translateY(-5px) scale(1.03);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5), 0 0 20px rgba(99, 102, 241, 0.2);
}

.matrix-card:hover::before {
    width: 350px;
    height: 350px;
}

/* Orbe de energía para las tarjetas */
.card-orb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow), 0 0 20px var(--accent);
    margin-bottom: 15px;
    transition: all 0.3s ease;
    animation: pulseOrb 2s infinite;
}

@keyframes pulseOrb {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 15px var(--accent-glow), 0 0 30px var(--accent); }
    100% { transform: scale(1); opacity: 0.8; }
}

.matrix-card:hover .card-orb {
    transform: scale(1.5);
    background: #FFF;
    box-shadow: 0 0 20px #FFF, 0 0 40px var(--accent);
}

.matrix-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
    letter-spacing: 0.5px;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--primary);
    letter-spacing: -2px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 700px;
    margin-bottom: 3rem;
    font-weight: 400;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.hero-image-wrapper {
    margin-top: 5rem;
    width: 100%;
    max-width: 1200px;
    position: relative;
    border-radius: 12px;
    padding: 8px;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 100px var(--accent-glow);
}

.hero-image-wrapper img {
    width: 100%;
    border-radius: 8px;
    display: block;
}

/* Interactive Matrix (Services) */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: -1px;
}

.matrix-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    position: relative;
    min-height: 250px;
}

.matrix-card {
    cursor: pointer;
}

.matrix-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    color: var(--primary);
    font-weight: 600;
}

.matrix-card p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
}

.matrix-back-btn {
    border-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.matrix-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Open Source Section */
.os-section {
    padding: 8rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.os-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
}

.os-badge {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-muted);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.os-badge:hover {
    background: var(--panel-hover);
    color: var(--primary);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Footer */
footer {
    border-top: 1px solid var(--panel-border);
    padding: 3rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5rem;
}

.footer-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

/* Contact Page specific */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    padding: 6rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-form {
    position: relative;
    padding: 3rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.1);
    animation: formGlowPulse 4s infinite ease-in-out;
}

@keyframes formGlowPulse {
    0% { box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.1); }
    50% { box-shadow: 0 25px 60px rgba(99, 102, 241, 0.2), inset 0 0 0 1px rgba(99, 102, 241, 0.4); }
    100% { box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.1); }
}

.contact-form::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.1), transparent 50%);
    pointer-events: none;
    border-radius: 16px;
}

.info-card {
    margin-bottom: 2rem;
}

.info-card h4 {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-card div {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input, .form-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.2rem;
    color: var(--primary);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.matrix-fade-out {
    animation: fadeOut 0.3s forwards;
}

.matrix-fade-in {
    animation: fadeIn 0.4s forwards;
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Social Floating Bar */
.social-float {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    padding: 1.5rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 10000;
    border-radius: 30px;
}

.social-icon {
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    justify-content: center;
    align-items: center;
}

.social-icon:hover {
    color: var(--primary);
    transform: scale(1.3) translateX(3px);
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

/* Enhanced WhatsApp Button */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4), 0 0 0 0 rgba(37, 211, 102, 0.7);
    animation: waPulse 2s infinite cubic-bezier(0.66, 0, 0, 1);
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(37, 211, 102, 0.6);
}

@keyframes waPulse {
    to {
        box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4), 0 0 0 20px rgba(37, 211, 102, 0);
    }
}

.wa-tooltip {
    position: absolute;
    right: 85px;
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    padding: 10px 18px;
    border-radius: 8px;
    color: #FFF;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
    pointer-events: none;
    transform: translateX(15px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.whatsapp-float:hover .wa-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

@media (max-width: 1024px) {
    .contact-container { grid-template-columns: 1fr; gap: 3rem; }
}

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 5%;
    }
    .nav-links { 
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
        width: 100%;
    }
    nav .btn-primary { 
        padding: 0.6rem 1rem; 
        font-size: 0.85rem; 
        width: 100%;
        margin-top: 0.5rem;
    }

    .hero { padding: 3rem 5% 3rem; }
    .hero h1 { font-size: 2.5rem; }
    
    .social-float { display: none; }
    
    /* Responsive Trust Metrics */
    div[style*="display: flex; justify-content: center; gap: 6rem; flex-wrap: wrap;"] {
        gap: 3rem !important;
        flex-direction: column;
    }
    .counter { font-size: 3.5rem !important; }
    
    /* Responsive Footer */
    footer { flex-direction: column; text-align: center; gap: 2rem; padding-bottom: 5rem; }
    footer > div { text-align: center !important; justify-content: center; }
    .footer-legal { flex-direction: column; gap: 1rem; }
    
    /* Responsive Form Row */
    .form-row { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 2.2rem; }
    .section-header h2 { font-size: 2rem; }
    .matrix-container { grid-template-columns: 1fr; }
    .contact-form { padding: 2rem 1.5rem; }
}
