/* ==========================================================================
   CSS VARIABLES & DESIGN TOKENS
   ========================================================================== */
:root {
    /* Fondos */
    --bg-primary: #000000;
    --bg-secondary: #09090B;
    --bg-tertiary: #18181B;

    /* Acento Primario: Azul Oscuro Premium (#000020) */
    /* Generamos una escala de azules que combinan con el fondo y permiten glow */
    --primary-50:  #e0e0ff;
    --primary-100: #b3b3ff;
    --primary-200: #8080ff;
    --primary-300: #4d4dff;
    --primary-400: #1a1aff;
    --primary-500: #0000e6; /* Un azul vibrante para destacar sobre el fondo tan oscuro */
    --primary-600: #0000b3;
    --primary-700: #000080;
    --primary-800: #00004d;
    --primary-900: #000020; /* Color base solicitado, se usa para sombras profundas */
    --primary-rgb: 0, 0, 230;

    /* Textos */
    --text-primary: #FFFFFF;
    --text-secondary: #E4E4E7;
    --text-tertiary: #A1A1AA;
    --text-quaternary: #71717A;

    /* Acentos secundarios */
    --success: #22C55E;
    --info: #3B82F6;
    --warning: #F59E0B;
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-primary);
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1 {
    font-size: 76px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

h2 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
}

h3 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
}

.label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary-300);
    display: inline-block;
    margin-bottom: 16px;
}

/* ==========================================================================
   UTILITIES & COMPONENTS
   ========================================================================== */
.glass-card {
    background: linear-gradient(
        135deg,
        rgba(26, 26, 255, 0.05) 0%,
        rgba(0, 0, 32, 0.4) 50%,
        rgba(26, 26, 255, 0.05) 100%
    );
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(128, 128, 255, 0.15);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.3),
        0 2px 4px -2px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    border-color: rgba(128, 128, 255, 0.35);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 230, 0.2);
    transform: translateY(-4px);
}

.text-glow {
    color: var(--text-primary);
    text-shadow: 
        0 0 10px rgba(77, 77, 255, 0.8),
        0 0 20px rgba(0, 0, 230, 0.6),
        0 0 40px rgba(0, 0, 230, 0.4);
}

/* Buttons */
.btn-primary {
    display: inline-block;
    background: linear-gradient(
        135deg,
        var(--primary-600) 0%,
        var(--primary-500) 30%,
        var(--primary-400) 60%,
        var(--primary-500) 100%
    );
    background-size: 200% 200%;
    animation: gradient-shift 4s ease infinite;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    padding: 16px 32px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    text-align: center;
    box-shadow: 
        0 0 0 1px rgba(0, 0, 230, 0.5),
        0 4px 24px rgba(0, 0, 230, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.1);
    box-shadow: 
        0 0 0 2px rgba(77, 77, 255, 0.8),
        0 8px 40px rgba(0, 0, 230, 0.6);
}

.btn-outline {
    display: inline-block;
    background: transparent;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    padding: 16px 32px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-primary);
}

.btn-large {
    font-size: 18px;
    padding: 20px 40px;
}

.full-width {
    width: 100%;
}

.pulse-btn {
    animation: pulse-glow 3s ease-in-out infinite, gradient-shift 4s ease infinite;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(2deg); }
    50% { transform: translateY(-10px) rotate(-2deg); }
    75% { transform: translateY(-30px) rotate(1deg); }
}

@keyframes float-particle {
    0%, 100% { transform: translate(0, 0); opacity: 0.4; }
    25% { transform: translate(100px, -100px); opacity: 0.8; }
    50% { transform: translate(-50px, -200px); opacity: 0.6; }
    75% { transform: translate(-100px, -100px); opacity: 0.8; }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 
            0 0 0 1px rgba(0, 0, 230, 0.5),
            0 4px 24px rgba(0, 0, 230, 0.4),
            0 0 60px rgba(0, 0, 230, 0.3);
    }
    50% {
        box-shadow: 
            0 0 0 2px rgba(77, 77, 255, 0.8),
            0 8px 40px rgba(0, 0, 230, 0.6),
            0 0 80px rgba(0, 0, 230, 0.5);
    }
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fade-in-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   PARTICLES SYSTEM
   ========================================================================== */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(ellipse at top, rgba(0, 0, 230, 0.1) 0%, transparent 50%);
}

.particle {
    position: absolute;
    background: var(--primary-400);
    border-radius: 50%;
    filter: blur(4px);
    animation: float-particle ease-in-out infinite;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 24px 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(26, 26, 255, 0.1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    padding: 16px 0;
}

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

.logo {
    height: 40px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-500);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    transition: 0.3s;
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-header p {
    color: var(--text-tertiary);
    font-size: 20px;
    max-width: 600px;
    margin: 0 auto;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
}

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

.hero-content {
    opacity: 0;
    animation: fade-in-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    animation: fade-in-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    opacity: 0;
}

.hero-ctas {
    display: flex;
    gap: 16px;
    animation: fade-in-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
    opacity: 0;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fade-in-up 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
    opacity: 0;
}

.sphere {
    width: 400px;
    height: 400px;
    position: relative;
    transform-style: preserve-3d;
    animation: float 6s ease-in-out infinite;
}

.sphere-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 230, 0.1) 0%, rgba(0, 0, 230, 0.2) 100%);
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 230, 0.3);
    box-shadow: 
        0 0 60px rgba(0, 0, 230, 0.4),
        0 0 120px rgba(0, 0, 230, 0.3),
        inset 0 0 60px rgba(0, 0, 230, 0.2);
    backdrop-filter: blur(10px);
}

.hero-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    max-width: none;
    border-radius: 20px;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.5));
}

/* Social Proof */
.social-proof {
    padding: 60px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: linear-gradient(90deg, transparent, rgba(26, 26, 255, 0.05), transparent);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
    gap: 24px;
}

.metric h3 {
    font-size: 48px;
    color: var(--primary-400);
    margin-bottom: 8px;
}

.metric p {
    color: var(--text-tertiary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Services */
.services {
    padding: 120px 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.service-card-flip {
    perspective: 1000px;
    height: 400px;
    cursor: pointer;
    opacity: 0; /* Animated in via JS */
}

.service-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.service-card-flip:hover .service-card-inner,
.service-card-flip.flipped .service-card-inner {
    transform: rotateY(180deg);
}

.service-card-front, .service-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 24px;
    overflow: hidden;
}

.service-card-front {
    background-color: var(--bg-tertiary);
}

.service-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.service-card-flip:hover .service-image {
    transform: scale(1.05);
}

.service-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px 24px 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    text-align: left;
}

.service-title-front {
    color: var(--text-primary);
}

.service-card-back {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px;
    text-align: center;
}

.service-title-back {
    margin-bottom: 16px;
    color: var(--primary-300);
}

.service-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.service-features {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.feature-tag {
    background: rgba(26, 26, 255, 0.1);
    color: var(--primary-200);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(26, 26, 255, 0.2);
}

/* Pricing */
.pricing {
    padding: 120px 0;
    background: radial-gradient(circle at center, rgba(0, 0, 230, 0.05) 0%, transparent 70%);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    align-items: center;
}

.pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pricing-card.popular {
    border-color: var(--primary-500);
    box-shadow: 0 0 40px rgba(0, 0, 230, 0.2);
    transform: scale(1.05);
    z-index: 2;
}

.pricing-card.popular:hover {
    transform: scale(1.05) translateY(-4px);
}

.badge {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-500);
    color: white;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 230, 0.4);
}

.pricing-card h3 {
    margin-bottom: 8px;
}

.plan-desc {
    color: var(--text-tertiary);
    margin-bottom: 32px;
    min-height: 48px;
}

.plan-features {
    list-style: none;
    margin-bottom: 40px;
    flex-grow: 1;
}

.plan-features li {
    margin-bottom: 16px;
    position: relative;
    padding-left: 32px;
    color: var(--text-secondary);
}

.plan-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

/* Automation */
.automation {
    padding: 120px 0;
}

.automation-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    padding: 64px !important;
}

.auto-list {
    list-style: none;
    margin: 32px 0;
}

.auto-list li {
    margin-bottom: 16px;
    font-size: 18px;
    color: var(--text-primary);
}

.benefit-highlight {
    font-weight: 600;
    color: var(--primary-300);
    margin-bottom: 32px;
    font-size: 20px;
}

.float-img {
    border-radius: 24px;
    animation: float 8s ease-in-out infinite;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

/* Contact Section */
.contact-section {
    padding: 120px 0;
    background: radial-gradient(circle at center, rgba(0, 0, 230, 0.1) 0%, transparent 70%);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.contact-text h2 {
    margin-bottom: 24px;
}

.contact-text p {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.contact-info {
    margin-top: 48px;
    padding-top: 48px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.contact-info p {
    font-size: 16px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.contact-form-container {
    padding: 40px !important;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px rgba(0, 0, 230, 0.2);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    cursor: pointer;
}

.form-group option {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.form-message {
    margin-top: 16px;
    padding: 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.form-message.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.form-message.error {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Footer */
.footer {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 80px 0 24px;
    background: var(--bg-secondary);
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 64px;
    margin-bottom: 64px;
}

.footer-section h4 {
    margin-bottom: 24px;
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.footer-section p {
    color: var(--text-tertiary);
    max-width: 300px;
}

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

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul li a {
    display: block;
    color: var(--text-tertiary);
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: var(--primary-300);
}

.social-icons {
    display: flex;
    gap: 16px;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background: var(--primary-500);
    transform: translateY(-4px);
}

.social-icons img {
    width: 20px;
    height: 20px;
    filter: invert(1);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: var(--text-tertiary);
    font-size: 14px;
}

.footer-bottom a {
    color: var(--text-primary);
    font-weight: 500;
}

.footer-bottom a:hover {
    color: var(--primary-400);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
    h1 { font-size: 56px; }
    h2 { font-size: 40px; }
    
    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .pricing-card.popular {
        transform: scale(1);
    }
    
    .pricing-card.popular:hover {
        transform: translateY(-4px);
    }
    
    .automation-content {
        padding: 40px !important;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none; /* Idealmente con JS se mostrarían */
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 40px;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .hero-ctas {
        justify-content: center;
    }
    
    .sphere {
        width: 300px;
        height: 300px;
        margin: 0 auto;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .automation-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .auto-list li {
        text-align: left;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .footer-section p {
        margin: 0 auto;
    }

    .social-icons {
        justify-content: center;
    }
}
