/* ==========================================================================
   CSS Variables & Theming
   ========================================================================== */
:root {
    /* Colors */
    --bg-dark: #070913;
    --bg-card: rgba(18, 24, 43, 0.4);
    --primary: #00e0ff;
    --primary-glow: rgba(0, 224, 255, 0.5);
    --secondary: #4a6fff;
    --text-main: #f0f4ff;
    --text-muted: #a0aec0;
    --border-color: rgba(255, 255, 255, 0.08);

    /* Gradients */
    --gradient-brand: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);

    /* Shadows */
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Typography */
    --font-sans: 'Outfit', system-ui, -apple-system, sans-serif;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

/* Background Effects */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-size: 50px 50px;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    z-index: -2;
    mask-image: linear-gradient(to bottom, black 0%, transparent 80%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 80%);
}

.bg-glow {
    position: fixed;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

.bg-glow.top-left {
    top: -20vw;
    left: -20vw;
    background: radial-gradient(circle, var(--primary), transparent);
}

.bg-glow.bottom-right {
    bottom: -20vw;
    right: -20vw;
    background: radial-gradient(circle, var(--secondary), transparent);
}

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* Typography Helpers */
h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
    font-weight: 700;
}

.text-gradient {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-cyan {
    color: var(--primary);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
}

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

.title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
}

/* ==========================================================================
   UI Components (Glassmorphism & Interactive)
   ========================================================================== */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-glass);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-normal);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--gradient-brand);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    box-shadow: 0 0 30px var(--primary-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.interactive-card {
    transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.interactive-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 224, 255, 0.3);
}

.hover-lift {
    transition: transform var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-8px);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 224, 255, 0.1);
    border: 1px solid rgba(0, 224, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.875rem;
    color: var(--primary);
    margin-bottom: 2rem;
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 1.5rem 0; /* Padding más amplio para engordar la barra */
    transition: background-color var(--transition-normal), padding var(--transition-normal);
}

.navbar.scrolled {
    padding: 1rem 0; /* Un poco menos cuando se hace scroll, pero más gorda que antes */
    background: rgba(7, 9, 19, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo-img {
    height: 4rem; /* Base un pelín más grande */
    width: auto;
    object-fit: contain;
    transform: scale(2.5) translateY(-5%); /* Escala fuerte pero centrando verticalmente el sobrante */
    transform-origin: left center; /* Escalado desde el centro en Y */
    margin-left: 2rem;
}

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

.nav-links a:not(.btn) {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

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

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 2rem;
    cursor: pointer;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    min-height: 85vh;
    display: flex;
    align-items: flex-start;
    padding-top: 10rem;
    position: relative;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content h1 {
    font-size: clamp(3rem, 5vw, 4.5rem);
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 500px;
}

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

/* Hero Graphic / 3D Illusion */
.hero-graphic {
    position: relative;
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glass-orb {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(0, 224, 255, 0.4), rgba(74, 111, 255, 0.1));
    box-shadow: inset 0 0 50px rgba(255, 255, 255, 0.1), var(--shadow-glow);
    backdrop-filter: blur(5px);
    animation: float 6s ease-in-out infinite;
}

.hero-floating-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    background: rgba(18, 24, 43, 0.6);
    animation: float-alt 8s ease-in-out infinite;
}

.hero-floating-card h4 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.hero-floating-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.hero-floating-card i {
    font-size: 2rem;
    color: var(--primary);
}

.card-1 {
    top: 15%;
    right: 10%;
    animation-delay: 0s;
}

.card-2 {
    bottom: 20%;
    left: 10%;
    animation-delay: 2s;
    background: rgba(18, 24, 43, 0.8);
}

.card-2 i {
    color: var(--secondary);
}

/* ==========================================================================
   Sections: Why Us & Services
   ========================================================================== */
.why-us {
    position: relative;
    z-index: 10;
    margin-top: 2rem;
}

.why-us-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.why-card {
    text-align: center;
    padding: 3rem 2rem;
}

.icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(0, 224, 255, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
    position: relative;
}

.icon-wrapper.accent {
    background: rgba(74, 111, 255, 0.1);
    color: var(--secondary);
}

.why-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.why-card p {
    color: var(--text-muted);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.service-card {
    padding: 2.5rem 2rem;
}

.service-card:hover .icon-wrapper {
    transform: scale(1.1);
}

.service-card .icon-wrapper {
    margin: 0 0 1.5rem 0;
    transition: transform var(--transition-fast);
}

/* Dynamic Glow Effect on Cards */
.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(255, 255, 255, 0.06), transparent 40%);
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
    z-index: 1;
}

.interactive-card:hover .card-glow {
    opacity: 1;
}

/* ==========================================================================
   Remote Access Section
   ========================================================================== */
.remote-content {
    display: flex;
    gap: 4rem;
    align-items: center;
}

.remote-content.flex-row {
    flex-direction: row;
}

.remote-text {
    flex: 1;
}

.remote-visual {
    flex: 1;
}

.features-list {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    gap: 1rem;
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-main);
    flex-shrink: 0;
}

.feature-item h4 {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

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

/* Glass Panel Terminal Mockup */
.glass-panel {
    background: rgba(10, 15, 26, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-glass);
}

.panel-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background: #ff5f56;
}

.dot.yellow {
    background: #ffbd2e;
}

.dot.green {
    background: #27c93f;
}

.panel-body {
    padding: 2rem;
    font-family: monospace;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.mock-terminal p {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.cursor {
    animation: blink 1s step-end infinite;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
    background: rgba(0, 0, 0, 0.2);
}

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

.footer-desc {
    color: var(--text-muted);
    margin-top: 1rem;
    max-width: 400px;
}

.contact-info h4 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.contact-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-links a {
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: color var(--transition-fast);
}

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

.contact-links i {
    font-size: 1.25rem;
}

.whatsapp-link {
    color: #25D366 !important;
}

.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.875rem;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes float-alt {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-15px) scale(1.02);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Initial Load Animations */
.hidden-on-load {
    opacity: 0;
}

.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-1 {
    transition-delay: 0.2s;
}

.stagger-2 {
    transition-delay: 0.4s;
}

.stagger-3 {
    transition-delay: 0.6s;
}

.stagger-4 {
    transition-delay: 0.8s;
}

/* Scroll Animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-subtitle {
        margin: 1.5rem auto;
    }

    .hero-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero-graphic {
        margin-top: 2rem;
        height: 350px;
    }

    .remote-content.flex-row {
        flex-direction: column;
        gap: 2.5rem;
    }

    .title {
        font-size: 2.2rem;
    }

    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    .hero {
        padding-top: 6rem;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100vw;
        height: 100vh;
        background: rgba(7, 9, 19, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: right var(--transition-normal);
        z-index: 99;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a:not(.btn) {
        font-size: 1.5rem;
    }

    .mobile-menu-btn {
        display: block;
        z-index: 100;
        position: relative;
    }

    .title {
        font-size: 1.8rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .section {
        padding: 3rem 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .glass-orb {
        width: 200px;
        height: 200px;
    }

    .card-1 {
        top: 10%;
        right: 5%;
        padding: 0.75rem 1rem;
    }

    .card-2 {
        bottom: 10%;
        left: 5%;
        padding: 0.75rem 1rem;
    }

    .hero-floating-card h4 {
        font-size: 0.9rem;
    }

    .hero-floating-card i {
        font-size: 1.5rem;
    }
}