:root {
    --bg-color: #0D1117;
    --panel-bg: #121821;
    --panel-hover: #161f2d;
    --accent-blue: #2563EB;
    --text-muted: #6C707D;
    --glow-blue: rgba(37, 99, 235, 0.4);
    --text-main: #FFFFFF;
    --border-color: #212836;
    --youtube-red: #ff0000;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    cursor: none;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Rajdhani', sans-serif;
    overflow-x: hidden;
    position: relative;
}

/* Pantalla de Carga Estilo Pop-Up por Palabra */
#loader-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loader-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    display: flex;
    gap: 15px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 22px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-main);
}

.loader-word {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    animation: popupWord 0.4s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.loader-word:nth-child(1) { animation-delay: 0.1s; }
.loader-word:nth-child(2) { animation-delay: 0.3s; color: var(--accent-blue); text-shadow: 0 0 10px var(--glow-blue); }
.loader-word:nth-child(3) { animation-delay: 0.5s; }
.loader-word:nth-child(4) { animation-delay: 0.7s; color: var(--accent-blue); text-shadow: 0 0 10px var(--glow-blue); }
.loader-word:nth-child(5) { animation-delay: 0.9s; }

@keyframes popupWord {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Custom Cursor Mejorado */
.cursor {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent-blue);
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 12px var(--accent-blue), 0 0 24px var(--accent-blue);
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

.cursor-follower {
    position: fixed;
    width: 32px;
    height: 32px;
    border: 1.5px solid rgba(37, 99, 235, 0.4);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: transform 0.08s ease-out, width 0.2s, height 0.2s, border-color 0.2s;
}

/* Scroll Progress Bar */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), #60a5fa);
    z-index: 10000;
    box-shadow: 0 0 12px var(--accent-blue);
}

/* Fondo Animado */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(37, 99, 235, 0.07) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
        linear-gradient(rgba(33, 40, 54, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(33, 40, 54, 0.08) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 45px 45px, 45px 45px;
    z-index: -1;
}

/* ==========================================
   HEADER & MENÚ HAMBURGUESA RESPONSIVO
   ========================================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(33, 40, 54, 0.8);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tb-logo-badge {
    width: 45px;
    height: 45px;
    border: 2px solid var(--accent-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
    box-shadow: 0 0 15px var(--glow-blue);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tb-logo-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px var(--accent-blue);
}

.brand-text h1 {
    font-size: 24px;
    letter-spacing: 2px;
    font-weight: 700;
    color: var(--text-main);
}

.brand-text h1 span {
    color: var(--accent-blue);
    font-weight: 700;
    font-size: 1.08em;
    text-shadow: 0 0 10px var(--glow-blue);
}

.brand-text span {
    font-size: 11px;
    font-family: 'Share Tech Mono', monospace;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Botón de Menú Hamburguesa (Móviles) */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--accent-blue);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Navegación móvil oculta por defecto */
header nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #161b22;
    border-bottom: 1px solid #30363d;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-in-out;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    z-index: 1000;
}

header nav.active {
    max-height: 400px;
}

header nav ul {
    display: flex;
    flex-direction: column;
    list-style: none;
    padding: 20px;
    margin: 0;
    gap: 15px;
    text-align: center;
}

header nav ul li a {
    display: block;
    padding: 8px;
    font-size: 16px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 6px;
    transition: color 0.3s ease;
}

header nav ul li a:hover {
    color: var(--accent-blue);
}

/* Hero Section */
/* Hero Section */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 150px 20px 110px 20px;
    width: 100%;
    min-height: 85vh;
    background: linear-gradient(
        180deg,
        rgba(13, 17, 23, 0.82), 
        rgba(13, 17, 23, 0.96)
    ), url('assets/img/scara_robot.jpeg'); /* <--- Añade esto de vuelta */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat; /* <--- Y esto */
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.hero h2 {
    font-size: 45px;
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: 1.5px;
    background: linear-gradient(90deg, #FFFFFF, #93c5fd, var(--accent-blue));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    max-width: 900px;
}

.eslogan-bar {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: var(--accent-blue);
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.3);
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 25px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 45px;
    font-family: 'Share Tech Mono', monospace;
    line-height: 1.6;
    max-width: 700px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 2;
}

.cta-btn {
    background: rgba(37, 99, 235, 0.05);
    color: var(--accent-blue);
    border: 2px solid var(--accent-blue);
    padding: 12px 25px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Share Tech Mono', monospace;
    border-radius: 8px;
    cursor: none;
    transition: all 0.35s ease;
    text-decoration: none;
    display: inline-block;
}

.cta-btn:hover {
    background: var(--accent-blue);
    color: #FFFFFF;
    box-shadow: 0 0 30px var(--glow-blue);
    transform: translateY(-4px);
}

.cta-btn.secondary {
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.cta-btn.secondary:hover {
    background: var(--text-muted);
    color: #FFFFFF;
}

/* Contenedores y Secciones */
.section-container {
    max-width: 1100px;
    margin: 80px auto;
    padding: 0 20px;
}

.section-title {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 40px;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--accent-blue);
    border-radius: 2px;
}

.section-title span {
    color: var(--accent-blue);
}

.about-box {
    background: linear-gradient(135deg, var(--panel-bg), #0f1622);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 35px;
    margin-bottom: 40px;
    text-align: center;
    font-size: 16px;
    font-family: 'Share Tech Mono', monospace;
    color: var(--text-muted);
    line-height: 1.8;
}

.timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-top: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.timeline-item {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 10px;
    flex: 1;
    min-width: 200px;
    text-align: center;
}

.timeline-year {
    font-family: 'Share Tech Mono', monospace;
    font-size: 16px;
    color: var(--accent-blue);
    font-weight: bold;
    margin-bottom: 8px;
    background: rgba(37, 99, 235, 0.1);
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
}

.timeline-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.spec-card {
    background: linear-gradient(145deg, var(--panel-bg), #0f151f);
    border: 1px solid var(--border-color);
    padding: 30px 20px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.spec-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-5px);
}

.spec-icon {
    font-size: 38px;
    margin-bottom: 15px;
}

.spec-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #FFFFFF;
}

.spec-card p {
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'Share Tech Mono', monospace;
}

/* Carrusel Infinito */
.tech-carousel {
    overflow: hidden;
    background: linear-gradient(90deg, #090d12, var(--panel-bg), #090d12);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 30px 0;
    white-space: nowrap;
}

.tech-track {
    display: inline-block;
    animation: scrollLoop 28s linear infinite;
}

.tech-item {
    display: inline-block;
    padding: 10px 25px;
    margin: 0 12px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 15px;
    color: var(--accent-blue);
}

@keyframes scrollLoop {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* YouTube Spotlight */
.spotlight-container {
    max-width: 900px;
    margin: 0 auto;
}

.video-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
}

.section-tag {
    background: rgba(13, 17, 23, 0.9);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
}

.live-badge {
    background: var(--youtube-red);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    text-transform: uppercase;
}

.video-content-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    padding: 25px;
    align-items: center;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-info h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: #FFFFFF;
}

.video-info p {
    color: var(--text-muted);
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    margin-bottom: 20px;
}

.watch-yt-btn {
    background: var(--youtube-red);
    color: #FFFFFF;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-family: 'Share Tech Mono', monospace;
    font-weight: bold;
    display: inline-block;
}

/* Lab Widget */
.lab-container {
    background: linear-gradient(145deg, var(--panel-bg), #0d131c);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 30px;
}

.lab-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    font-family: 'Share Tech Mono', monospace;
}

.input-btn {
    background: var(--bg-color);
    color: var(--text-main);
    border: 1px solid var(--accent-blue);
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    cursor: none;
}

.gate-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.gate-status {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    margin: 15px 0 10px 0;
    color: var(--text-muted);
    background: rgba(0,0,0,0.3);
    padding: 4px 12px;
    border-radius: 6px;
}

.gate-status span {
    color: var(--text-main);
}

.led-indicator {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #1a2230;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.led-indicator.active {
    background-color: var(--accent-blue);
    border-color: #ffffff;
    box-shadow: 0 0 15px var(--accent-blue);
}

/* FAQ Grid */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.faq-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 12px;
}

.faq-card h4 {
    font-size: 17px;
    color: var(--accent-blue);
    margin-bottom: 10px;
}

.faq-card p {
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'Share Tech Mono', monospace;
}

/* Contact Box & Footer */
.contact-box {
    background: linear-gradient(135deg, var(--panel-bg), #0f1622);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 40px;
    text-align: center;
}

.contact-box p {
    font-family: 'Share Tech Mono', monospace;
    color: var(--text-muted);
    margin-bottom: 25px;
    font-size: 15px;
}

footer {
    text-align: center;
    padding: 35px 20px;
    border-top: 1px solid var(--border-color);
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    color: var(--text-muted);
    background: rgba(13, 17, 23, 0.95);
}

footer span { 
    color: var(--accent-blue); 
}

/* ==========================================
   MEDIA QUERIES PARA COMPUTADORAS (Desktop)
   ========================================== */
@media (min-width: 768px) {
    .menu-toggle {
        display: none !important; /* Oculta la hamburguesa en PC */
    }

    header {
        padding: 18px 45px;
    }

    header nav {
        position: static;
        max-height: none !important;
        width: auto;
        background: transparent;
        border: none;
        box-shadow: none;
        overflow: visible;
    }

    header nav ul {
        flex-direction: row;
        gap: 30px;
        padding: 0;
    }

    header nav ul li a {
        padding: 5px 0;
    }

    .hero h2 {
        font-size: 54px;
    }
}

@media (max-width: 768px) {
    .video-content-grid { 
        grid-template-columns: 1fr; 
    }
}