:root {
    --primary: #009eff;
    --primary-rgb: 0, 158, 255;
    --dark: #0a0c10;
    --light: #f8fafc;
    --bg: #0a0c10;
    --text: #ffffff;
    --gray: #94a3b8;
    --bg-image: url('assets/20250725_131835000_iOS.jpeg');
    --bg-image-bottom: url('assets/20241123_134822490_iOS.jpeg');
}

[data-theme="light"] {
    --bg: #ffffff;
    --text: #111827;
    --gray: #4b5563;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    transition: background-color 0.6s cubic-bezier(0.4, 0, 0.2, 1), color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    scroll-behavior: smooth;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Layout Global --- */
/* --- Layout Global --- */
body {
    font-family: 'Outfit', sans-serif;
    color: var(--text);
    transition: background-color 0.6s cubic-bezier(0.4, 0, 0.2, 1), color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    scroll-behavior: smooth;
    
    /* Fondo inmersivo fijo que cubre toda la pantalla para que la sidebar lo pueda difuminar */
    background: linear-gradient(rgba(10,12,16,0.6), rgba(10,12,16,0.6)), var(--bg-image) no-repeat center center fixed;
    background-size: cover;
}

[data-theme="light"] body {
    background: linear-gradient(rgba(255,255,255,0.7), rgba(255,255,255,0.7)), var(--bg-image) no-repeat center center fixed;
    background-size: cover;
}

main, footer {
    margin-left: 300px; /* Desplaza el contenido a la derecha de la sidebar */
    transition: margin-left 0.5s ease;
    /* Al ser elementos de bloque, tomarán el ancho restante automáticamente sin necesidad de calc() */
}

/* --- Sidebar --- */
.sidebar {
    width: 300px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(10, 12, 16, 0.65); /* Más transparente para que se vea el cristal */
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(25px);
    backdrop-filter: blur(25px);
    z-index: 1000;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Para contener el pseudo-elemento de fondo */
}

.sidebar::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* A todo el largo */
    background: url('assets/LogoCables.png') no-repeat center center;
    background-size: cover; /* A todo el ancho y ajustado */
    opacity: 0.06; /* 50% más transparente */
    z-index: -1;
    pointer-events: none;
    filter: brightness(1.5); /* Resaltar en modo oscuro */
    transition: opacity 0.3s ease;
}

[data-theme="light"] .sidebar::after {
    filter: invert(1) brightness(0.2) contrast(1.2); /* Adaptar para fondo claro */
    opacity: 0.04; /* 50% más transparente */
}

[data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, 0.65);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* justify-content: space-between; eliminado para controlar mejor la posición */
}

.logo-container {
    padding: 20px 0 30px; /* Reducido un poco para que no queden muy lejos del logo */
    text-align: center;
}

.scalable-logo {
    height: 140px; /* 2.3x el original (60px) */
    width: auto;
    object-fit: contain;
    border-radius: 12px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
}

.scalable-logo:hover {
    transform: scale(1.08) rotate(2deg);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px; /* Reducido de 15px para que se vean como un grupo cohesionado */
    margin-top: 0;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    padding: 12px 20px; /* Ligeramente más ajustado verticalmente */
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link i {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.nav-link:hover {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    transform: translateX(8px);
}

.nav-link:hover i {
    transform: scale(1.2);
}

.sidebar-footer {
    padding-top: 20px;
    margin-top: auto; /* Empuja el botón hacia el fondo de la barra lateral */
    z-index: 10; /* Asegurar que esté sobre el fondo */
}

.theme-btn {
    width: 100%;
    background: rgba(var(--primary-rgb), 0.05);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    color: var(--text);
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.theme-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 158, 255, 0.3);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    background: transparent; /* El fondo ahora está en el body */
    display: flex;
    align-items: flex-start; /* Subir tarjeta */
    justify-content: center;
    text-align: center;
    padding-top: 18vh; /* Margen superior proporcional */
}

.hero-glass-card {
    background: rgba(10, 12, 16, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4rem 3rem;
    border-radius: 32px;
    max-width: 950px;
    margin: 0 auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUpFade 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="light"] .hero-glass-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.hero h1 {
    color: #ffffff;
    font-size: clamp(2.2rem, 6vw, 4rem);
    margin-bottom: 20px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
}

[data-theme="light"] .hero h1 {
    color: var(--dark);
    text-shadow: none;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.6rem);
    color: #4db8ff;
    max-width: 800px;
    margin: 0 auto 24px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-desc {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: rgba(255, 255, 255, 0.9);
    max-width: 800px;
    margin: 0 auto 3rem;
    line-height: 1.7;
    font-weight: 400;
}

[data-theme="light"] .hero-desc {
    color: var(--gray);
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-button {
    display: inline-block;
    padding: 1.1rem 2.8rem;
    background: var(--primary);
    color: white;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 1.05rem;
    border: 2px solid transparent;
    box-shadow: 0 10px 20px rgba(0, 158, 255, 0.2);
}

.cta-button:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 158, 255, 0.4);
    background: #00b0ff;
}

.cta-button.secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    backdrop-filter: blur(10px);
}

[data-theme="light"] .cta-button.secondary {
    background: transparent;
    border-color: #cbd5e1;
    color: var(--dark);
}

.cta-button.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    transform: translateY(-5px);
}

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

/* --- Apps & Cards --- */
.apps {
    padding: 100px 0;
    background: transparent; /* Fondo transparente para ver el fondo dinámico */
}

[data-theme="light"] .apps {
    background: transparent;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.5rem;
    font-weight: 700;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.card {
    background: rgba(10, 12, 16, 0.4); /* Fondo transparente */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: white;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    transition: transform 0.6s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.6s ease;
    position: relative;
}

[data-theme="light"] .card {
    background: rgba(255, 255, 255, 0.6);
    color: #1e293b;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 40px 80px rgba(0,0,0,0.4);
}

.card:hover .card-img {
    filter: brightness(0.9);
}

.card-img {
    height: 240px;
    background-size: cover;
    background-position: center;
    transition: filter 0.3s ease;
}

.qc-img { background-image: url('assets/20251205_181058895_iOS.jpeg'); }
.rf-img { background-image: url('assets/20260217_161428373_iOS.jpeg'); }
.test-img { background-image: url('assets/test-bg.png'); }
.rigger-img { background-image: url('assets/20241123_134822490_iOS.jpeg'); }

.card-content {
    padding: 35px;
}

.card-features {
    display: flex;
    gap: 8px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.feature-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(0, 158, 255, 0.1);
    border: 1px solid rgba(0, 158, 255, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
}

[data-theme="light"] .feature-tag {
    background: rgba(0, 158, 255, 0.05);
    border-color: rgba(0, 158, 255, 0.2);
}

.card-tag {
    display: inline-block;
    margin-top: 20px;
    color: var(--primary);
    font-weight: 700;
}

.card-content h3 {
    margin-bottom: 12px;
    font-size: 1.5rem;
}

.card-content p {
    color: var(--gray);
    font-size: 1rem;
    line-height: 1.5;
}

/* --- Contact Section --- */
.contact-section {
    padding: 120px 0;
    background: linear-gradient(rgba(10,12,16,0.6), rgba(10,12,16,0.6)), var(--bg-image-bottom) no-repeat center center fixed;
    background-size: cover;
}

[data-theme="light"] .contact-section {
    background: linear-gradient(rgba(255,255,255,0.7), rgba(255,255,255,0.7)), var(--bg-image-bottom) no-repeat center center fixed;
    background-size: cover;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 50px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.contact-card {
    background: rgba(255, 255, 255, 0.05); /* Transparencia base */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    max-width: 420px;
    margin: 0 auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}

[data-theme="light"] .contact-card {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .contact-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.card-icon {
    font-size: 2.4rem;
    margin-bottom: 15px;
}

.contact-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.contact-card p {
    font-size: 1.1rem;
    margin-bottom: 12px;
    line-height: 1.6;
}

.contact-link {
    color: var(--primary);
    text-decoration: none;
    transition: opacity 0.3s;
}

.contact-link:hover {
    opacity: 0.8;
}

.contact-email {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 15px 0;
}

.contact-email a {
    color: var(--primary);
    text-decoration: none;
}

.contact-note {
    font-size: 0.9rem;
    color: var(--gray);
    margin-top: 15px;
}


/* --- Footer --- */
footer {
    padding: 80px 0 40px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: var(--gray);
    background: linear-gradient(rgba(10,12,16,0.8), rgba(10,12,16,0.8)), var(--bg-image-bottom) no-repeat center center fixed;
    background-size: cover;
}

[data-theme="light"] footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: linear-gradient(rgba(255,255,255,0.8), rgba(255,255,255,0.8)), var(--bg-image-bottom) no-repeat center center fixed;
    background-size: cover;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.footer-section {
    text-align: left;
}

.footer-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}

.footer-desc {
    font-size: 1rem;
    line-height: 1.6;
    margin-top: 10px;
}

.footer-section a {
    color: var(--gray);
    text-decoration: none;
    transition: color 0.3s;
    display: block;
    margin-bottom: 8px;
}

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

.social-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gray);
    text-decoration: none;
    transition: color 0.3s;
}

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

.social-icon {
    font-size: 1.2rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 30px;
    text-align: center;
}

[data-theme="light"] .footer-bottom {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer-legal {
    margin-top: 15px;
    font-size: 0.9rem;
}

.footer-legal a {
    color: var(--gray);
    text-decoration: none;
    transition: color 0.3s;
}

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

/* --- Animations --- */
.fade-in {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Stagger utilities */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* Parallax utility */
.parallax-bg {
    transition: transform 0.1s ease-out;
    will-change: transform;
}

/* --- Responsive Layout --- */
@media (max-width: 1024px) {
    .sidebar {
        width: 260px;
    }
    main, footer {
        margin-left: 260px;
    }
    .grid {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    /* Removido body flex-direction */
    
    .sidebar {
        width: 100%;
        height: 70px; /* Altura que ya se veía bien */
        position: fixed;
        top: 0;
        left: 0;
        padding: 0 20px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        max-width: 1100px;
        margin: 0 auto;
    }
    
    .logo-container {
        padding: 0;
    }
    
    .scalable-logo {
        height: 45px; /* Tamaño original para móvil */
        filter: none;
    }
    
    .sidebar-nav {
        flex-direction: row;
        margin-top: 0;
        gap: 15px;
    }
    
    .nav-link {
        padding: 5px 0;
        font-size: 14px;
    }
    
    .nav-link i {
        display: none;
    }
    
    .sidebar-footer {
        padding-top: 0;
    }
    
    .theme-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    main, footer {
        margin-left: 0;
        width: 100%;
    }
    
    .hero {
        padding-top: 100px; /* Espacio para la barra fija */
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
}
