/* --- VARIABLES & SETUP --- */
:root {
    --bg-dark: #121517;
    --bg-card: #1E2326;
    --text-main: #E0E0E0;
    --text-dim: #888888;
    
    /* Colores Sistewa */
    --primary: #FF7F00;      /* Naranja */
    --accent: #FF9F40;       /* Naranja claro */
    --secondary: #1E2326;    
    
    --font-mono: 'Fira Code', monospace;
    --font-sans: 'Space Grotesk', sans-serif;
    
    --gradient-main: linear-gradient(135deg, var(--primary), var(--accent));
}

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

html { scroll-behavior: smooth; }

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

/* --- CURSOR --- */
.cursor-dot, .cursor-outline {
    position: fixed;
    top: 0; left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}
.cursor-dot { width: 8px; height: 8px; background-color: var(--primary); }
.cursor-outline { width: 40px; height: 40px; border: 1px solid var(--primary); transition: width 0.2s, height 0.2s; }

/* --- BACKGROUND --- */
#neural-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; opacity: 0.3; }

/* --- UTILS --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- HEADER FIXED --- */
.glass-header {
    position: fixed;
    width: 100%;
    top: 0;
    padding: 15px 0;
    background: rgba(18, 21, 23, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    z-index: 1000;
}

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

/* --- HEADER FIXED --- */
/* ... resto del header ... */

.logo { 
    display: flex; 
    align-items: center; /* Centrado vertical matemático */
    gap: 12px; /* Un poco más de espacio entre logo y texto */
    z-index: 1001; 
    height: 100%; /* Asegura que ocupe la altura del contenedor padre */
}

.logo img { 
    height: 48px; /* Un pelín más grande para presencia */
    width: auto; 
    object-fit: contain;
    display: block; /* Elimina espacios fantasma debajo de la imagen */
}

.logo-text { 
    font-family: var(--font-mono); 
    font-weight: 700; 
    font-size: 1.5rem; 
    letter-spacing: -1px; 
    color: var(--text-main);
    
    /* TRUCO DE ALINEACIÓN VISUAL */
    line-height: 1; /* Elimina el espacio extra arriba y abajo de la fuente */
    display: flex;
    align-items: center;
    position: relative; 
    top: 2px; /* <--- Esto empuja el texto 2 píxeles hacia abajo para centrarlo con el ojo */
}

.blink { 
    animation: blink 1s infinite; 
    color: var(--primary); 
    margin-left: 2px; /* Separa un poco el guion bajo */
    position: relative;
    top: -2px; /* Ajuste fino para el guion bajo parpadeante */
}

/* Menú PC */
#navbar {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-list { display: flex; gap: 40px; }
.nav-link { font-family: var(--font-mono); font-size: 0.9rem; transition: 0.3s; position: relative; }
.nav-link:hover { color: var(--primary); }
.hash { color: var(--primary); margin-right: 5px; }

/* Botón Header (Arreglado) */
.btn-neon {
    padding: 10px 20px;
    border: 1px solid var(--primary);
    color: var(--primary);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: 0.3s;
    background: rgba(255, 127, 0, 0.05);
    white-space: nowrap; /* Evita que el texto se rompa */
}

.btn-neon:hover {
    background: var(--primary);
    color: var(--bg-dark);
    box-shadow: 0 0 15px var(--primary);
}

/* --- HERO --- */
.hero-section { min-height: 100vh; display: flex; align-items: center; padding-top: 100px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 40px; }

.badge-tech {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(255, 127, 0, 0.1);
    border-radius: 20px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--primary);
    margin-bottom: 20px;
    border: 1px solid var(--primary);
}

h1 { font-size: 3.5rem; line-height: 1.1; margin-bottom: 20px; font-weight: 700; }
.gradient-text { background: var(--gradient-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.typewriter-text { font-size: 1.1rem; color: var(--text-dim); margin-bottom: 40px; font-family: var(--font-mono); min-height: 1.6em; }

.cta-group { display: flex; gap: 20px; flex-wrap: wrap; }

.btn-primary, .btn-secondary { padding: 15px 30px; font-weight: 700; border-radius: 5px; transition: 0.3s; text-align: center; }
.btn-primary { background: var(--primary); color: var(--bg-dark); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(255, 127, 0, 0.3); background: var(--accent); }
.btn-secondary { border: 1px solid rgba(255,255,255,0.2); color: white; }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); background: rgba(255, 127, 0, 0.05); }

/* --- CODE CARD --- */
.code-card {
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: perspective(1000px) rotateY(-10deg) rotateX(5deg);
    transition: transform 0.5s;
}
.code-card:hover { transform: perspective(1000px) rotateY(0deg) rotateX(0deg); }
.window-controls { background: #15181a; padding: 10px 15px; display: flex; gap: 8px; }
.window-controls span { width: 12px; height: 12px; border-radius: 50%; display: block; }
.red { background: #ff5f56; } .yellow { background: #ffbd2e; } .green { background: #27c93f; }
.code-content { padding: 25px; font-family: var(--font-mono); font-size: 0.9rem; line-height: 1.8; color: #a9b7c6; }
.c-keyword { color: var(--primary); } .c-variable { color: #E0E0E0; } .c-string { color: #A5D6A7; } .c-type { color: var(--accent); } .c-function { color: #90CAF9; }

/* --- SERVICES --- */
.services-section { padding: 100px 0; background: #0e1113; }
.section-title { margin-bottom: 60px; max-width: 600px; }
.section-title h2 { font-size: 2.5rem; margin-bottom: 15px; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }

.tech-card {
    background: var(--bg-card);
    padding: 40px 30px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
    border: 1px solid rgba(255,255,255,0.05);
}
.tech-card:hover { transform: translateY(-10px); border-color: var(--primary); }
.tech-card:hover .card-border { width: 100%; }
.tech-card:hover .card-icon { color: var(--primary); transform: scale(1.1); }
.card-icon { width: 50px; height: 50px; color: var(--text-dim); margin-bottom: 20px; transition: 0.3s; }
.tech-card h3 { font-size: 1.4rem; margin-bottom: 15px; font-weight: 700; }
.tech-card p { color: var(--text-dim); font-size: 0.95rem; }
.card-border { position: absolute; bottom: 0; left: 0; width: 0; height: 3px; background: var(--primary); transition: 0.4s ease; }

/* --- CONTACT --- */
.contact-section { padding: 100px 0; }
.contact-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.contact-details { margin-top: 30px; font-family: var(--font-mono); color: var(--text-dim); }
.contact-details li { margin-bottom: 15px; font-size: 1.1rem; }
.contact-details span { color: var(--primary); margin-right: 10px; }
.tech-form { background: var(--bg-card); padding: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.05); }
.input-group { margin-bottom: 20px; }
.input-group label { display: block; font-family: var(--font-mono); font-size: 0.8rem; color: var(--primary); margin-bottom: 8px; }
.input-group input, .input-group textarea { width: 100%; background: var(--bg-dark); border: 1px solid #333; padding: 15px; color: white; font-family: var(--font-sans); outline: none; transition: 0.3s; border-radius: 4px; }
.input-group input:focus, .input-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 10px rgba(255, 127, 0, 0.2); }
.btn-submit { width: 100%; padding: 15px; background: transparent; border: 1px solid var(--text-main); color: white; font-weight: 700; letter-spacing: 2px; transition: 0.3s; cursor: pointer; }
.btn-submit:hover { border-color: var(--primary); color: var(--bg-dark); background: var(--primary); box-shadow: 0 0 30px var(--primary); }

/* --- FOOTER --- */
.main-footer { padding: 30px 0; border-top: 1px solid rgba(255,255,255,0.05); text-align: center; font-family: var(--font-mono); font-size: 0.8rem; color: #555; }

/* --- RESPONSIVE / MOBILE (CORREGIDO) --- */
.menu-toggle { display: none; cursor: pointer; z-index: 1002; }
.bar { width: 25px; height: 3px; background: white; margin: 5px 0; transition: 0.3s; }

@media(max-width: 900px) {
    .menu-toggle { display: block; }
    
    /* Navbar móvil estilo cajón lateral */
    #navbar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%; /* No ocupa toda la pantalla */
        max-width: 300px;
        height: 100vh;
        background: var(--bg-card);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 40px;
        transition: 0.4s ease-in-out;
        border-left: 1px solid rgba(255,255,255,0.1);
        box-shadow: -10px 0 30px rgba(0,0,0,0.8);
    }
    
    #navbar.active { right: 0; }

    .nav-list { flex-direction: column; text-align: center; gap: 30px; margin-bottom: 40px; }
    .nav-link { font-size: 1.2rem; }
    
    /* El botón en móvil se adapta */
    .btn-neon { width: 100%; text-align: center; justify-content: center; display: block; }

    .hero-grid, .contact-wrapper { grid-template-columns: 1fr; }
    h1 { font-size: 2.5rem; }
    .hero-visual { display: none; }
}

@keyframes blink { 50% { opacity: 0; } }

/* --- TERMINAL CAPTCHA STYLE --- */
.terminal-captcha {
    background: #000;
    border: 1px solid #333;
    border-radius: 6px;
    font-family: var(--font-mono);
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.terminal-header {
    background: #1a1a1a;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #333;
}

.terminal-title {
    color: #666;
    font-size: 0.7rem;
    margin-left: 10px;
}

.terminal-body {
    padding: 15px;
    font-size: 0.9rem;
    color: #ccc;
}

.prompt { color: #27c93f; margin-right: 8px; }
.cmd { color: var(--primary); }

.terminal-input-line {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.terminal-input-line input {
    background: transparent;
    border: none;
    border-bottom: 1px solid #333;
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 1rem;
    width: 60px;
    padding: 2px 5px;
}

.terminal-input-line input:focus {
    outline: none;
    border-bottom-color: var(--primary);
}

/* Estado de carga del botón */
.btn-submit.loading {
    opacity: 0.7;
    pointer-events: none;
}
/* --- PROJECTS SECTION (TRABAJOS REALIZADOS) - CARROUSEL --- */
.projects-section {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--bg-dark) 0%, #0a0c0e 100%);
    position: relative;
}

/* Contenedor del carrousel */
.projects-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Track con scroll horizontal */
.projects-track {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 20px 10px 40px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.projects-track::-webkit-scrollbar {
    display: none;
}

/* Tarjeta de proyecto */
.project-card {
    flex: 0 0 calc(33.333% - 20px);
    min-width: 320px;
    max-width: 400px;
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    scroll-snap-align: center;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 
                0 0 30px rgba(255, 127, 0, 0.1);
}

/* Imagen del proyecto */
.project-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #0a0c0e;
}

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

.project-card:hover .project-image img {
    transform: scale(1.08);
}

/* Overlay con efecto hover */
.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, 
        rgba(255, 127, 0, 0.1) 0%, 
        rgba(18, 21, 23, 0.95) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.visit-link {
    padding: 12px 25px;
    background: var(--primary);
    color: var(--bg-dark);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 6px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.project-card:hover .visit-link {
    transform: translateY(0);
}

/* Contenido de la tarjeta */
.project-content {
    padding: 25px;
}

/* Etiquetas tecnológicas */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag {
    padding: 4px 10px;
    background: rgba(255, 127, 0, 0.1);
    border: 1px solid rgba(255, 127, 0, 0.3);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Título del proyecto */
.project-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

/* Descripción */
.project-content p {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Características del proyecto */
.project-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.project-features span {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #666;
    transition: color 0.3s ease;
}

.project-card:hover .project-features span {
    color: var(--text-dim);
}

.project-features span::before {
    content: '//';
    color: var(--primary);
    margin-right: 8px;
    opacity: 0.6;
}

/* Controles del carrousel */
.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.carousel-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    cursor: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.carousel-btn:hover {
    background: var(--primary);
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(255, 127, 0, 0.4);
}

.carousel-btn svg {
    width: 24px;
    height: 24px;
}

.carousel-dots {
    display: flex;
    gap: 10px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: none;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

/* Responsive - En móvil muestra 1 card y carrousel */
@media(max-width: 768px) {
    .project-card {
        flex: 0 0 calc(85% - 15px);
        min-width: 280px;
    }
    
    .project-image {
        height: 200px;
    }

    .carousel-controls {
        margin-top: 15px;
    }
}

/* --- FRAMEWA SECTION --- */
.framewa-section {
    padding: 100px 0;
    background: linear-gradient(180deg, #0e1113 0%, var(--bg-dark) 100%);
    position: relative;
    overflow: hidden;
}

/* Efecto de rejilla de fondo sutil */
.framewa-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
    opacity: 0.5;
}

.framewa-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.framewa-content h2 {
    font-size: 3.5rem;
    font-family: var(--font-sans);
    margin-bottom: 5px;
    color: var(--text-main);
    letter-spacing: -1px;
}

.framewa-content h3 {
    font-size: 1.8rem;
    font-family: var(--font-mono);
    margin-bottom: 25px;
    font-weight: 400;
}

.fw-desc {
    color: var(--text-dim);
    margin-bottom: 40px;
    font-size: 1.1rem;
    border-left: 3px solid var(--accent);
    padding-left: 20px;
}

.fw-features {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.fw-item h4 {
    color: var(--text-main);
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.fw-item p {
    font-size: 0.9rem;
    color: #666;
}

/* --- BROWSER MOCKUP & ANIMATION --- */
.framewa-visual {
    position: relative;
}

.browser-mockup {
    background: #000;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(255, 127, 0, 0.1);
    overflow: hidden;
    position: relative;
}

.mockup-header {
    background: #151515;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #222;
}

.address-bar {
    background: #000;
    color: #444;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 4px;
    margin-left: 15px;
    width: 60%;
    border: 1px solid #222;
}

.responsive-anim {
    width: 100%;
    height: auto;
    background: #050505;
    display: block;
}

/* --- ANIMACIONES SVG KEYFRAMES --- */

/* 1. Animación del Cursor */
.cursor-group {
    animation: moveCursor 6s ease-in-out infinite;
    transform-origin: center;
}

@keyframes moveCursor {
    0%, 10% { transform: translate(380px, 150px); } /* Inicio fuera */
    20% { transform: translate(355px, 150px); } /* Agarra el borde */
    50% { transform: translate(160px, 150px); } /* Arrastra a móvil */
    60% { transform: translate(160px, 150px); } /* Pausa en móvil */
    90% { transform: translate(355px, 150px); } /* Vuelve a desktop */
    100% { transform: translate(380px, 150px); } /* Suelta */
}

/* 2. Animación de los Elementos Web (Responsive) */
.layout-header { animation: resizeHeader 6s ease-in-out infinite; }
.layout-hero   { animation: resizeHero 6s ease-in-out infinite; }
.layout-sidebar{ animation: resizeSidebar 6s ease-in-out infinite; }
.layout-text1, .layout-text2, .layout-text3 { animation: resizeText 6s ease-in-out infinite; }

.layout-card1 { animation: cardMove1 6s ease-in-out infinite; }
.layout-card2 { animation: cardMove2 6s ease-in-out infinite; }
.layout-card3 { animation: cardMove3 6s ease-in-out infinite; }

/* Definición de movimientos */
@keyframes resizeHeader {
    0%, 20%, 90%, 100% { width: 360px; } /* Desktop */
    50%, 60% { width: 160px; } /* Mobile */
}

@keyframes resizeHero {
    0%, 20%, 90%, 100% { width: 220px; height: 120px; x: 20px; }
    50%, 60% { width: 160px; height: 80px; x: 20px; } /* Se adapta */
}

/* Sidebar pasa abajo en móvil */
@keyframes resizeSidebar {
    0%, 20%, 90%, 100% { x: 250px; y: 70px; width: 130px; }
    50%, 60% { x: 20px; y: 160px; width: 160px; }
}

@keyframes resizeText {
    0%, 20%, 90%, 100% { x: 250px; transform: translateY(0); }
    50%, 60% { x: 20px; transform: translateY(90px); } /* Baja texto */
}

/* Cards se apilan (stack) en móvil */
@keyframes cardMove1 {
    0%, 20%, 90%, 100% { x: 20px; y: 200px; width: 110px; }
    50%, 60% { x: 20px; y: 300px; width: 160px; } /* Stack 1 */
}
@keyframes cardMove2 {
    0%, 20%, 90%, 100% { x: 145px; y: 200px; width: 110px; }
    50%, 60% { x: 20px; y: 390px; width: 160px; } /* Stack 2 */
}
@keyframes cardMove3 {
    0%, 20%, 90%, 100% { x: 270px; y: 200px; width: 110px; }
    50%, 60% { x: 20px; y: 480px; width: 160px; } /* Stack 3 */
}

/* Responsive de la propia sección Framewa */
@media(max-width: 900px) {
    .framewa-grid { grid-template-columns: 1fr; }
    .framewa-content h2 { font-size: 2.5rem; }
}