/* ==========================================
   COLOR SYSTEM & DESIGN TOKENS
   ========================================== */

:root {
    /* Primary Colors */
    --primary: #ffffff;
    --primary-dark: #f5f5f5;
    
    /* Accent Colors */
    --accent: #00d9ff;
    --accent-dark: #00a8cc;
    
    /* Neutrals */
    --neutral-900: #0a0a0a;
    --neutral-800: #1a1a1a;
    --neutral-700: #2d2d2d;
    --neutral-600: #404040;
    --neutral-400: #888888;
    --neutral-200: #e5e5e5;
    
    /* Semantic */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border: #333333;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* Animation */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ==========================================
   RESET & GLOBAL STYLES
   ========================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'system-ui', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    
    /* Mejoras de legibilidad */
    font-weight: 450;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    
    /* Mejora contraste y tamaño base */
    font-size: 16px;

     /* Mejora para móviles */
    -webkit-tap-highlight-color: transparent;
}
}

/* ==========================================
   BACKGROUND & VIDEO
   ========================================== */

.bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.led-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Combinación de gradiente oscuro + efecto LED */
    background: 
        radial-gradient(circle at center, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.85) 100%),
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.8) 0px,
            rgba(0, 0, 0, 0.8) 1px,
            transparent 1px,
            transparent 3px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.8) 0px,
            rgba(0, 0, 0, 0.8) 1px,
            transparent 1px,
            transparent 3px
        ),
        radial-gradient(circle at 2px 2px, rgba(0, 217, 255, 0.2) 1px, transparent 1px);
    background-blend-mode: overlay;
    background-size: cover, 100% 3px, 3px 100%, 30px 30px;
    background-position: center, 0 0, 0 0, 0 0;
    background-repeat: no-repeat, repeat, repeat, repeat;
    z-index: -1;
    animation: ledPulse 3s ease-in-out infinite;
}

@keyframes ledPulse {
    0%, 100% {
        background: 
            radial-gradient(circle at center, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.85) 100%),
            repeating-linear-gradient(
                0deg,
                rgba(0, 0, 0, 0.8) 0px,
                rgba(0, 0, 0, 0.8) 1px,
                transparent 1px,
                transparent 3px
            ),
            repeating-linear-gradient(
                90deg,
                rgba(0, 0, 0, 0.8) 0px,
                rgba(0, 0, 0, 0.8) 1px,
                transparent 1px,
                transparent 3px
            ),
            radial-gradient(circle at 2px 2px, rgba(0, 217, 255, 0.2) 1px, transparent 1px);
    }
    70% {
        background: 
            radial-gradient(circle at center, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.85) 100%),
            repeating-linear-gradient(
                0deg,
                rgba(0, 0, 0, 0.8) 0px,
                rgba(0, 0, 0, 0.8) 1px,
                transparent 1px,
                transparent 3px
            ),
            repeating-linear-gradient(
                90deg,
                rgba(0, 0, 0, 0.8) 0px,
                rgba(0, 0, 0, 0.8) 1px,
                transparent 1px,
                transparent 3px
            ),
            radial-gradient(circle at 2px 2px, rgba(0, 217, 255, 0.35) 1px, transparent 1px);
    }
}

/* ==========================================
   LOADER (APPLE BOOT STYLE)
   ========================================== */

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    background-color: var(--bg-primary);
    z-index: 9999;
    opacity: 1;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-ring {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* ==========================================
   HEADER
   ========================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-lg) var(--spacing-xl);
    background-color: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform var(--transition-base);
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo-img {
    height: 70px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(0, 217, 255, 0.3));
    transition: filter var(--transition-base);
}

.logo-link:hover .logo-img {
    filter: drop-shadow(0 0 15px rgba(0, 217, 255, 0.6));
}

.nav {
    display: flex;
    gap: var(--spacing-xl);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color var(--transition-base);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width var(--transition-base);
}

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

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

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background-color: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ==========================================
   MAIN CONTENT
   ========================================== */

.main-content {
    position: relative;
    z-index: 1;
    padding-top: 120px;
}

/* ==========================================
   HERO SECTION
   ========================================== */

.hero {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl) var(--spacing-xl);
}

.hero-content {
    max-width: 900px;
    text-align: center;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: var(--spacing-lg);
    letter-spacing: -0.02em;
    animation: fadeInUp 1s ease-out;
}

.highlight {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--spacing-2xl);
    line-height: 1.6;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    justify-content: center;
    animation: fadeInUp 1s ease-out 0.4s both;
}

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

/* ==========================================
   SERVICES SECTION
   ========================================== */

.services {
    padding: var(--spacing-2xl) var(--spacing-xl);
    background-color: rgba(26, 26, 26, 0.5);
    backdrop-filter: blur(10px);
}

.services-container {
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    letter-spacing: -0.02em;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
}

.service-card {
    padding: var(--spacing-xl);
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    transition: all var(--transition-base);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.service-card:hover {
    background-color: rgba(0, 217, 255, 0.1);
    border-color: rgba(0, 217, 255, 0.3);
    transform: translateY(-10px);
}

.service-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
    font-size: 1.75rem;
    color: var(--bg-primary);
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-md);
    font-weight: 700;
}

.service-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ==========================================
   CONTACT SECTION
   ========================================== */

.contact {
    padding: var(--spacing-2xl) var(--spacing-xl);
}

.contact-container {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.contact-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    line-height: 1.6;
}

.email-form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: center;
}

.email-input {
    padding: 0.875rem 1.5rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.95rem;
    min-width: 280px;
    transition: all var(--transition-base);
}

.email-input::placeholder {
    color: var(--text-secondary);
}

.email-input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

/* ==========================================
   FOOTER
   ========================================== */

.footer {
    background-color: rgba(10, 10, 10, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--spacing-2xl) var(--spacing-xl) var(--spacing-lg);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-section h3 {
    margin-bottom: var(--spacing-md);
    font-size: 1rem;
    font-weight: 700;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(0, 217, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    text-decoration: none;
    transition: all var(--transition-base);
    border: 1px solid rgba(0, 217, 255, 0.2);
}

.social-link:hover {
    background-color: var(--accent);
    color: var(--bg-primary);
    transform: translateY(-3px);
}

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

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Escritorio - Video activo por defecto */
.bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.led-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at center, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.85) 100%),
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.8) 0px,
            rgba(0, 0, 0, 0.8) 1px,
            transparent 1px,
            transparent 3px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.8) 0px,
            rgba(0, 0, 0, 0.8) 1px,
            transparent 1px,
            transparent 3px
        ),
        radial-gradient(circle at 2px 2px, rgba(0, 217, 255, 0.2) 1px, transparent 1px);
    background-blend-mode: overlay;
    background-size: cover, 100% 3px, 3px 100%, 30px 30px;
    background-position: center, 0 0, 0 0, 0 0;
    background-repeat: no-repeat, repeat, repeat, repeat;
    z-index: -1;
    animation: ledPulse 3s ease-in-out infinite;
}

/* Tablets y dispositivos medianos (hasta 992px) */
@media (max-width: 992px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xl);
    }
}

/* Móviles y tablets pequeñas - Ocultar video y usar fondo sólido */
@media (max-width: 768px) {
    /* Ocultar video en móvil */
    .bg-video {
        display: none;
    }
    
    /* Reemplazar overlay con fondo sólido oscuro en móvil */
    .led-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: var(--bg-primary);
        /* Opcional: mantener un sutil efecto de gradiente */
        background: radial-gradient(circle at center, #1a1a1a 0%, #0a0a0a 100%);
        z-index: -1;
        animation: none; /* Desactivar animación en móvil para mejor rendimiento */
    }
    
    /* Header - Mantener fixed para que el fondo funcione correctamente */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        padding: var(--spacing-md) var(--spacing-lg);
        background-color: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 100;
    }
    
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: var(--spacing-md);
    }
    
    .logo-img {
        height: 50px;
        width: auto;
    }
    
    .nav {
        display: flex;
        gap: var(--spacing-md);
        flex-direction: row;
    }
    
    .nav-link {
        font-size: 0.75rem;
        letter-spacing: 0.05em;
    }
    
    /* Main content */
    .main-content {
        position: relative;
        z-index: 1;
        padding-top: 100px;
    }
    
    /* Hero */
    .hero {
        min-height: auto;
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .hero-title {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }
    
    .hero-subtitle {
        font-size: 1rem;
        padding: 0 var(--spacing-sm);
        margin-bottom: var(--spacing-xl);
    }
    
    .cta-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }
    
    .btn {
        width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
    }
    
    /* Services */
    .services {
        padding: var(--spacing-xl) var(--spacing-md);
        background-color: rgba(26, 26, 26, 0.8);
        backdrop-filter: blur(10px);
    }
    
    .section-title {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
        margin-bottom: var(--spacing-xl);
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .service-card {
        padding: var(--spacing-lg);
        background-color: rgba(255, 255, 255, 0.08);
    }
    
    .service-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin-bottom: var(--spacing-md);
    }
    
    .service-card h3 {
        font-size: 1.125rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .service-card p {
        font-size: 0.875rem;
    }
    
    /* Contact */
    .contact {
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .contact-container {
        padding: 0 var(--spacing-sm);
    }
    
    .contact-text {
        font-size: 1rem;
        margin-bottom: var(--spacing-lg);
    }
    
    .contact-note {
        font-size: 0.75rem;
        line-height: 1.5;
    }
    
    /* Footer */
    .footer {
        padding: var(--spacing-xl) var(--spacing-md) var(--spacing-lg);
        background-color: rgba(10, 10, 10, 0.95);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }
    
    .footer-section h3 {
        font-size: 0.95rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .footer-section p {
        font-size: 0.8125rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-bottom {
        font-size: 0.75rem;
        padding-top: var(--spacing-md);
    }
}

/* Móviles pequeños (hasta 480px) */
@media (max-width: 480px) {
    /* Header */
    .header {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .logo-img {
        height: 40px;
    }
    
    .nav {
        gap: var(--spacing-sm);
    }
    
    .nav-link {
        font-size: 0.7rem;
        letter-spacing: 0.03em;
    }
    
    /* Main content */
    .main-content {
        padding-top: 80px;
    }
    
    /* Hero */
    .hero {
        padding: var(--spacing-lg) var(--spacing-sm);
    }
    
    .hero-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: 0.875rem;
        padding: 0;
    }
    
    .cta-buttons {
        max-width: 280px;
    }
    
    /* Services */
    .services {
        padding: var(--spacing-lg) var(--spacing-sm);
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .service-card {
        padding: var(--spacing-md);
    }
    
    .service-icon {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
    
    .service-card h3 {
        font-size: 1rem;
    }
    
    .service-card p {
        font-size: 0.8125rem;
    }
    
    /* Contact */
    .contact {
        padding: var(--spacing-lg) var(--spacing-sm);
    }
    
    .contact-text {
        font-size: 0.875rem;
    }
    
    .contact-note {
        font-size: 0.7rem;
        line-height: 1.4;
    }
    
    /* Footer */
    .footer {
        padding: var(--spacing-lg) var(--spacing-sm) var(--spacing-md);
    }
    
    .footer-section p {
        font-size: 0.75rem;
    }
    
    .social-link {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }
}

/* Pantallas muy pequeñas (hasta 360px) */
@media (max-width: 360px) {
    .header {
        padding: var(--spacing-sm);
    }
    
    .logo-img {
        height: 35px;
    }
    
    .nav-link {
        font-size: 0.65rem;
    }
    
    .hero-title {
        font-size: 1.25rem;
    }
    
    .hero-subtitle {
        font-size: 0.8125rem;
    }
    
    .service-card h3 {
        font-size: 0.9375rem;
    }
    
    .service-card p {
        font-size: 0.75rem;
    }
}