:root {
    --bg-dark: #050505;
    --bg-card: rgba(20, 20, 25, 0.7);
    --bg-card-hover: rgba(30, 30, 40, 0.9);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --accent-dark: #0284c7;
    --border: rgba(255, 255, 255, 0.1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-dark);
}

body {
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* FONDO 3D CANVAS */
#network-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    background-color: var(--bg-dark);
}

/* CONTENEDOR GENERAL */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* NAVEGACIÓN */
.nav-bar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: all 0.3s ease;
    background: linear-gradient(to bottom, rgba(5,5,5,0.9), transparent);
}

.nav-bar.scrolled {
    padding: 1rem 0;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-name {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.brand-name .highlight {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

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

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

.btn-nexus {
    border: 1px solid var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    color: var(--accent) !important;
}

.btn-nexus:hover {
    background: var(--accent);
    color: #000 !important;
}

/* HERO SECTION */
.hero-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 0 2rem;
}

.logo-wrapper {
    width: 550px;
    max-width: 90vw;
    height: auto;
    margin: 0 auto 2rem auto;
    animation: fadeInDown 1.2s ease-out;
    display: flex;
    justify-content: center;
}

.hero-logo {
    width: 100%;
    filter: brightness(1.1) contrast(1.1);
    /* Integra el fondo gris del JPG con el negro del sitio */
    mask-image: radial-gradient(circle, black 50%, transparent 70%);
    -webkit-mask-image: radial-gradient(circle, black 50%, transparent 70%);
}

.hero-title {
    display: none;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.btn-primary {
    background: var(--accent);
    color: #000;
    padding: 1rem 2rem;
    text-decoration: none;
    font-weight: 800;
    border-radius: 4px;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #fff;
    box-shadow: 0 0 20px var(--accent);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 1rem 2rem;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.3s;
}

.btn-secondary:hover {
    border-color: var(--text-main);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.5;
    animation: pulse 2s infinite;
}

.scroll-indicator span {
    font-size: 0.7rem;
    letter-spacing: 2px;
}

/* SECCIONES COMUNES */
.content-section {
    padding: 8rem 0;
    position: relative;
    z-index: 10;
}

.bg-darker {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-header {
    margin-bottom: 4rem;
}

.text-center {
    text-align: center;
}

.tag {
    display: inline-block;
    color: var(--accent);
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 3px;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.divider {
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin: 0 auto;
}

.divider.left {
    margin: 0;
}

.section-intro {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin-top: 1.5rem;
}

/* ─── CENTERING: Global section alignment ─────────────────────────────── */

/* All content sections default to centered text */
.content-section .section-header,
.content-section .section-header h2,
.content-section .section-header .tag,
.content-section .section-header p {
    text-align: center;
}

/* Divider always centered in sections */
.divider {
    margin: 0 auto !important;
}

/* Section intro always max-width + centered */
.section-intro {
    max-width: 700px;
    margin: 1.5rem auto 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.8;
}

/* GRID 2 COLUMNAS (EMPRESA) */
.grid-2-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
}

.text-block {
    text-align: left;
}

.text-block h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.text-block p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* ECOSISTEMA GRID */
.ecosystem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.eco-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
}

.eco-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    background: var(--bg-card-hover);
}

.premium-card {
    grid-column: 1 / -1; /* Ocupa todo el ancho si hay espacio */
    border-color: rgba(56, 189, 248, 0.3);
}

.card-glow {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.1), transparent 50%);
    pointer-events: none;
}

.eco-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.eco-content h4 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.status-badge.active { background: rgba(39, 201, 63, 0.2); color: #27c93f; }
.status-badge.dev { background: rgba(255, 189, 46, 0.2); color: #ffbd2e; }

.eco-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    flex-grow: 1;
}

.eco-link {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
}

/* TECH LIST */
.tech-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.tech-item {
    display: flex;
    gap: 2rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
}

.tech-number {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.1);
    line-height: 1;
}

.tech-details h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.tech-details p {
    color: var(--text-muted);
}

/* FOOTER */
.main-footer {
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
    background: #000;
    position: relative;
    z-index: 10;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.logo-footer img {
    width: 60px;
    margin-bottom: 1rem;
    filter: brightness(1.2);
}

.footer-brand h3 {
    font-family: var(--font-heading);
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-info h4, .footer-links h4 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.footer-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

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

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* POPULATING ADDITIONS & CENTERING */

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.center-intro { margin: 1.5rem auto; }
.mt-5 { margin-top: 5rem; }
.mb-3 { margin-bottom: 3rem; }

/* Centered Grid variants */
.centered-grid {
    max-width: 1000px;
    margin: 0 auto;
}

/* Navbar Centering */
.nav-container {
    display: flex;
    justify-content: center; /* Center everything */
    align-items: center;
    position: relative;
}
.brand-name {
    position: absolute;
    left: 2rem;
}
.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
}

/* Technical Banner */
.technical-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(56, 189, 248, 0.2);
    padding: 0.5rem 0;
    text-align: center;
    z-index: 1001;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.technical-banner.visible {
    opacity: 1;
    transform: translateY(0);
}

.technical-banner span {
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 2px;
    font-weight: 800;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #27c93f;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px #27c93f;
    animation: pulse 2s infinite;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: rgba(20, 20, 25, 0.5);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 3rem 2rem;
    transition: all 0.4s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    background: rgba(30, 30, 40, 0.8);
}

.service-card .eco-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.service-card h4 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Clients Grid */
.clients-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 3rem;
    margin-top: 3rem;
}

.client-logo {
    opacity: 0.5;
    transition: opacity 0.3s;
    filter: grayscale(100%);
}

.client-logo:hover {
    opacity: 1;
    filter: grayscale(0%);
}

.client-placeholder {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 800;
    letter-spacing: 2px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.02);
}

/* Ensure Logo is perfectly centered */
.logo-wrapper {
    width: 550px;
    max-width: 90vw;
    height: auto;
    margin: 0 auto 2rem auto;
    animation: fadeInDown 1.2s ease-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-logo {
    width: 100%;
    display: block;
    margin: 0 auto;
    filter: brightness(1.1) contrast(1.1);
    mask-image: radial-gradient(circle, black 50%, transparent 70%);
    -webkit-mask-image: radial-gradient(circle, black 50%, transparent 70%);
}

.metrics-bar {
    background: rgba(56, 189, 248, 0.05);
    border-top: 1px solid rgba(56, 189, 248, 0.1);
    border-bottom: 1px solid rgba(56, 189, 248, 0.1);
    padding: 3rem 0;
    position: relative;
    z-index: 10;
}

.metrics-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
    text-align: center;
}

.metric-item h3 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.metric-item p {
    color: var(--text-main);
    font-size: 1.1rem;
    letter-spacing: 1px;
    font-weight: 600;
}

.security-block {
    background: rgba(20, 20, 25, 0.5);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    transition: transform 0.4s ease, border-color 0.4s ease;
}

.security-block:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
}

.security-block .eco-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.security-block h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.security-block p {
    color: var(--text-muted);
    line-height: 1.7;
}

/* ANIMACIONES */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .grid-2-cols { grid-template-columns: 1fr; gap: 2rem; }
    .footer-content { grid-template-columns: 1fr; gap: 2rem; }
    .hero-title { font-size: 2.5rem; }
    .nav-links { display: none; } /* En un caso real llevaría menú hamburguesa */
}

/* --- MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    padding: 3rem;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-header {
    margin-bottom: 2rem;
}

.modal-tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

#modal-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
}

.modal-body p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.modal-tech h4 {
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.modal-tech p {
    color: var(--accent);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.modal-footer {
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    display: flex;
    justify-content: flex-end;
}
