html { 
    scroll-behavior: smooth;
}

/* === REGLA MAESTRA (CORRECCIÓN MENU CORTADO) === */
/* Esto asegura que el padding no aumente el ancho de los elementos */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --bg-color: #0a0f14; /* Dark Slate Grey */
    --text-color: #e0e6ed;
    --accent-python: #ffd43b;
    --accent-android: #3ddc84; /* Neón Verde para acentos */
    --accent-ios: #007aff;
    --font-code: 'Fira Code', monospace;
    --font-main: 'Inter', sans-serif;
}

body {
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow-x: hidden;
}

/* === ANIMACIONES === */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse-glow { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(61, 220, 132, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); } }
@keyframes data-flow { 0% { left: 0; opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-5px); } 100% { transform: translateY(0px); } }
@keyframes blink { 50% { opacity: 0; } }

.cursor { animation: blink 1s infinite; font-weight: bold; color: var(--accent-android); }

/* === LAYOUT GENERAL === */
.hero-section { height: 100vh; display: flex; justify-content: center; align-items: center; position: relative; padding: 0 20px; }

/* === 1. HERO Y CÓDIGO === */
.code-style { font-family: var(--font-code); font-size: 1.2rem; line-height: 1.6; opacity: 1; transition: opacity 0.5s ease-out; }
.keyword { color: #c678dd; } .def { color: #e06c75; } .function { color: #61afef; } .string { color: #98c379; } .comment { color: #5c6370; font-style: italic; }
.line-number { color: #4b5263; margin-right: 15px; user-select: none; }
.hidden { display: none; opacity: 0; }
.visible-hero { display: block; animation: fadeInUp 1s forwards; text-align: center; }

h1 { font-size: 4rem; font-weight: 800; margin: 0; letter-spacing: -2px; background: -webkit-linear-gradient(45deg, var(--accent-python), var(--accent-android), var(--accent-ios)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.subtitle { font-size: 1.5rem; color: #a0aab5; margin-bottom: 2rem; }
.cta-button { font-family: var(--font-code); background: transparent; border: 1px solid var(--accent-android); color: var(--accent-android); padding: 15px 30px; text-decoration: none; font-weight: 700; transition: all 0.3s; }
.cta-button:hover { background: var(--accent-android); color: var(--bg-color); box-shadow: 0 0 15px rgba(61, 220, 132, 0.4); }

/* === 2. MODO DEV (INTERRUPTOR) === */
.mode-toggle { position: absolute; top: 20px; right: 40px; font-family: var(--font-code); font-size: 0.8rem; display: flex; align-items: center; gap: 10px; z-index: 100; }
.toggle-label { cursor: pointer; font-size: 0.9rem; font-weight: bold; color: var(--text-color); transition: color 0.3s; }
.switch { position: relative; display: inline-block; width: 50px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #333; transition: .4s; border-radius: 34px; border: 1px solid #555; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 3px; background-color: #a0aab5; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: rgba(61, 220, 132, 0.2); border-color: var(--accent-android); }
input:checked + .slider:before { transform: translateX(26px); background-color: var(--accent-android); box-shadow: 0 0 10px var(--accent-android); }

/* === 3. SECCIÓN ABOUT & SERVICES (REDISEÑADA FULL WIDTH) === */
.about-section { padding: 80px 20px; max-width: 1100px; margin: 0 auto; }
.section-title { font-family: var(--font-code); color: var(--accent-android); font-size: 2rem; margin-bottom: 40px; text-align: center; }
.class-def { color: #e06c75; } .parent-class { color: #e5c07b; } 

/* Grid: Texto (1fr) a la izquierda, Foto (250px) a la derecha */
.bio-grid-layout { display: grid; grid-template-columns: 1fr 250px; gap: 60px; align-items: center; margin-bottom: 60px; }
.bio-text-column { display: flex; flex-direction: column; }
.main-quote { font-size: 1.2rem; line-height: 1.8; color: #abb2bf; margin-bottom: 30px; font-weight: 300; }
.docstring { color: #98c379; font-style: italic; display: block; }
.text-blocks-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.concept-block { margin-bottom: 25px; border-left: 2px solid #333; padding-left: 15px; }
.concept-title { margin: 0 0 5px 0; font-family: var(--font-code); font-size: 1.1rem; }

/* FOTO GLITCH (LÓGICA INVERTIDA) */
.profile-column { width: 100%; height: 250px; position: relative; margin-top: 20px; }
.glitch-container { position: relative; width: 100%; height: 100%; border-radius: 12px; overflow: hidden; }
.glitch-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; }

/* AHORA: Las capas glitch son VISIBLES por defecto */
.glitch-1 { 
    opacity: 1; 
    mix-blend-mode: hard-light; 
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse; 
    background-color: rgba(255, 0, 0, 0.2); 
    filter: hue-rotate(90deg);
    transition: opacity 0.3s;
}

.glitch-2 { 
    opacity: 1; 
    mix-blend-mode: hard-light; 
    animation: glitch-anim-2 3s infinite linear alternate-reverse; 
    background-color: rgba(0, 0, 255, 0.2); 
    filter: hue-rotate(-90deg);
    transition: opacity 0.3s;
}

/* AHORA: Al pasar el ratón, se OCULTAN (se para el efecto) */
.glitch-container:hover .glitch-1, 
.glitch-container:hover .glitch-2 { 
    opacity: 1; 
}
/* He aumentado los valores de 'translate' de 2px a 10px para que vibre más fuerte */
@keyframes glitch-anim-1 { 
    0% { clip-path: inset(20% 0 80% 0); transform: translate(-10px, 5px); } 
    20% { clip-path: inset(60% 0 10% 0); transform: translate(10px, -5px); } 
    40% { clip-path: inset(40% 0 50% 0); transform: translate(-10px, 10px); } 
    60% { clip-path: inset(80% 0 5% 0); transform: translate(10px, -10px); } 
    80% { clip-path: inset(10% 0 70% 0); transform: translate(-5px, 5px); } 
    100% { clip-path: inset(30% 0 50% 0); transform: translate(5px, -5px); } 
}

@keyframes glitch-anim-2 { 
    0% { clip-path: inset(10% 0 60% 0); transform: translate(10px, -5px); } 
    20% { clip-path: inset(80% 0 5% 0); transform: translate(-10px, 5px); } 
    40% { clip-path: inset(30% 0 20% 0); transform: translate(10px, -10px); } 
    60% { clip-path: inset(15% 0 80% 0); transform: translate(-5px, 10px); } 
    80% { clip-path: inset(55% 0 10% 0); transform: translate(5px, -5px); } 
    100% { clip-path: inset(40% 0 30% 0); transform: translate(-10px, 5px); } 
}

/* DIAGRAMA ANIMADO (Full Width) */
.live-data-diagram { background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 12px; padding: 40px; display: flex; justify-content: space-between; align-items: center; margin: 40px 0; position: relative; overflow: hidden; box-shadow: inset 0 0 50px rgba(0,0,0,0.5); }
.node-wrapper { display: flex; flex-direction: column; align-items: center; z-index: 2; }
.node-label { margin-top: 10px; font-family: var(--font-code); font-size: 0.9rem; color: #888; }
.node-icon-large { font-size: 3rem; margin-bottom: 5px; animation: float 3s ease-in-out infinite; }
.python-glow { color: var(--accent-python); filter: drop-shadow(0 0 10px rgba(255, 212, 59, 0.3)); }
.flutter-glow { color: var(--accent-android); filter: drop-shadow(0 0 10px rgba(61, 220, 132, 0.3)); }
.server-cluster, .device-cluster { position: relative; }
.mini-node, .ui-element { position: absolute; background: rgba(255,255,255,0.1); border-radius: 4px; }
.n1 { width: 10px; height: 10px; top: -5px; right: -15px; } .n2 { width: 8px; height: 8px; bottom: 0; left: -12px; }
.u1 { width: 15px; height: 20px; border: 1px solid rgba(255,255,255,0.2); top: -5px; right: -15px; }
/* Tubería */
.data-pipeline { flex-grow: 1; height: 2px; background: rgba(255,255,255,0.1); margin: 0 40px; position: relative; display: flex; justify-content: center; }
.pipe-label { position: absolute; top: -25px; font-size: 0.7rem; font-family: var(--font-code); color: #5c6370; letter-spacing: 3px; }
.data-packet { position: absolute; width: 8px; height: 8px; background: #fff; border-radius: 50%; box-shadow: 0 0 10px #fff; top: -3px; opacity: 0; }
.p1 { animation: data-flow 2.5s infinite linear; background: var(--accent-python); }
.p2 { animation: data-flow 2.5s infinite linear 1.25s; background: var(--accent-android); }

/* SERVICIOS */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; margin-top: 50px; }
.service-card { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.05); padding: 30px; border-radius: 16px; transition: transform 0.3s, box-shadow 0.3s; backdrop-filter: blur(5px); }
.service-card:hover { transform: translateY(-5px); background: rgba(255, 255, 255, 0.07); border-color: var(--accent-android); box-shadow: 0 10px 30px rgba(61, 220, 132, 0.1); }
.icon-box i { font-size: 2.5rem; margin-bottom: 15px; background: -webkit-linear-gradient(45deg, var(--accent-python), var(--accent-android)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.card-tags { margin-top: 15px; display: flex; flex-wrap: wrap; gap: 8px; }
.tech-tag { font-family: var(--font-code); font-size: 0.75rem; color: #888; background: rgba(255,255,255,0.05); padding: 2px 8px; border-radius: 4px; transition: color 0.3s; }
.service-card:hover .tech-tag { color: var(--accent-android); background: rgba(61, 220, 132, 0.1); }

/* === 4. PORTAFOLIO INTERACTIVO === */
.portfolio-section { padding: 80px 20px; background-color: #0d1218; }
.project-card { max-width: 900px; margin: 0 auto 100px; display: grid; grid-template-columns: 1fr 1.5fr; gap: 30px; align-items: center; }
.project-info h3 { font-size: 1.8rem; margin-bottom: 10px; color: #fff; }
.project-info p { color: #a0aab5; line-height: 1.6; }
.tech-stack { margin-top: 20px; }
.tag { padding: 5px 15px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; margin-right: 10px; font-family: var(--font-code); display: inline-block; }
.tag.python { background: rgba(255, 212, 59, 0.2); color: var(--accent-python); border: 1px solid var(--accent-python); }
.tag.flutter { background: rgba(61, 220, 132, 0.2); color: var(--accent-android); border: 1px solid var(--accent-android); }

.comparison-container { position: relative; width: 100%; height: 350px; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.5); border: 1px solid #2a303c; }
.img-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.ui-layer { 
    background-image: url('img/ejemploApp.jpg'); 
    background-size: cover; background-position: center; 
}
.code-layer { background-color: #0a0f14; width: 50%; border-right: 2px solid var(--accent-android); overflow: hidden; z-index: 2; }
.code-content { width: 100%; padding: 20px; font-family: var(--font-code); color: #a0aab5; font-size: 0.9rem; }
.label-badge { position: absolute; bottom: 10px; padding: 4px 8px; background: #000; color: #fff; font-size: 0.7rem; font-family: var(--font-code); border-radius: 4px; }
.ui-badge { right: 10px; background: var(--accent-ios); }
.code-badge { left: 10px; background: var(--accent-python); }
.slider-range { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: col-resize; z-index: 10; }

/* === 5. CONTACTO TERMINAL === */
.terminal-section { padding: 80px 20px 130px; background-color: var(--bg-color); display: flex; flex-direction: column; align-items: center; }
.terminal-window { width: 100%; max-width: 700px; background-color: #1e1e1e; border-radius: 8px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); overflow: hidden; border: 1px solid #333; font-family: var(--font-code); }
.terminal-header { background-color: #2d2d2d; padding: 10px 15px; display: flex; align-items: center; border-bottom: 1px solid #333; }
.dot { width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; }
.red { background-color: #ff5f56; } .yellow { background-color: #ffbd2e; } .green { background-color: #27c93f; }
.terminal-title { margin-left: 10px; color: #999; font-size: 0.8rem; }
.terminal-body { padding: 20px; color: #e0e6ed; }
.system-msg { margin: 0; color: #5c6370; font-size: 0.9rem; }
.input-line { display: flex; flex-wrap: wrap; align-items: center; margin-bottom: 15px; }
.prompt { color: var(--accent-android); margin-right: 10px; }
.terminal-input { background: transparent; border: none; color: #fff; font-family: var(--font-code); font-size: 1rem; flex-grow: 1; outline: none; border-bottom: 1px solid transparent; transition: border-color 0.3s; }
.terminal-input:focus { border-bottom: 1px solid var(--accent-ios); }
.textarea { width: 100%; margin-top: 10px; resize: vertical; min-height: 80px; }
.execute-btn { background: transparent; border: 1px solid var(--accent-android); color: var(--accent-android); font-family: var(--font-code); padding: 10px 20px; cursor: pointer; font-size: 1rem; transition: all 0.2s; margin-top: 10px; width: 100%; }
.execute-btn:hover { background: var(--accent-android); color: #000; box-shadow: 0 0 15px rgba(61, 220, 132, 0.5); }
.main-footer { margin-top: 50px; color: #5c6370; font-size: 0.8rem; font-family: var(--font-code); }
.command {color: var(--accent-python); margin-right: 10px;}

/* === NAVEGACIÓN === */
/* === NAVEGACIÓN === */
.floating-nav { 
    position: fixed; 
    bottom: 30px; 
    left: 50%; 
    /* Estado inicial: Oculto abajo */
    transform: translateX(-50%) translateY(100px); 
    opacity: 0;
    pointer-events: none; /* No clickable si no se ve */ 
    background: rgba(15, 20, 26, 0.9); 
    backdrop-filter: blur(10px); 
    padding: 10px 20px; 
    border-radius: 50px; 
    border: 1px solid rgba(255,255,255,0.1); 
    z-index: 1000; 
    display: flex; 
    gap: 20px; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.5); 
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Suavidad al entrar */
}

/* Clase para mostrar el menú */
.floating-nav.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.nav-link { color: #a0aab5; text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.3s; }
.nav-link:hover, .nav-link.active, .nav-link.highlight { color: #fff; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .project-card { grid-template-columns: 1fr; }
    h1 { font-size: 2.5rem; }
    .code-style { font-size: 0.9rem; }
    .mode-toggle { top: 10px; right: 10px; transform: scale(0.9); }
    
    /* 2. AJUSTE DEL MENÚ PARA QUE NO SE CORTE EN MÓVIL */
    .floating-nav { 
        width: 90vw; /* Máximo ancho en móvil */
        max-width: 400px; /* Evita que sea enorme en tablets */
        justify-content: center;
        padding: 10px 20px; 
        gap: 12px; /* Menos espacio entre enlaces */
        justify-content: space-evenly;
    }
    .nav-link { font-size: 0.85rem; }

    .bio-grid-layout { grid-template-columns: 1fr; justify-items: center; }
    .bio-text-column { order: 1; }
    .profile-column { order: 2; margin-top: 30px; width: 250px; }
    .text-blocks-wrapper { grid-template-columns: 1fr; }

    /* === SOLUCIÓN TÍTULO GIGANTE === */
    /* Fix título gigante */
    .section-title { font-size: 1.6rem; word-break: break-word; white-space: normal; width: 100%; }
    .parent-class { display: block; margin-top: 5px; font-size: 0.9em; }
}

/* === MODO DEV (THE MATRIX EFFECT) === */
body.dev-mode { background-color: #000 !important; font-family: var(--font-code) !important; }
body.dev-mode * { color: var(--accent-android) !important; border-color: #333 !important; text-shadow: none !important; box-shadow: none !important; background: transparent !important; }
body.dev-mode .hero-section, body.dev-mode .project-card, body.dev-mode .service-card, body.dev-mode .terminal-window, body.dev-mode .floating-nav { border: 1px dashed #333 !important; position: relative; }
body.dev-mode .service-card::before { content: "<ServiceModule />"; position: absolute; top: -10px; left: 10px; background: #000 !important; color: var(--accent-python) !important; font-size: 0.7rem; padding: 0 5px; }
body.dev-mode .project-card::before { content: "<ProjectContainer />"; position: absolute; top: -10px; left: 10px; background: #000 !important; color: var(--accent-python) !important; font-size: 0.7rem; padding: 0 5px; }
body.dev-mode img, body.dev-mode .ui-layer { filter: grayscale(100%) contrast(1.2) opacity(0.5); border: 1px solid var(--accent-android) !important; }
body.dev-mode .slider { background-color: #333 !important; }
body.dev-mode input:checked + .slider { background-color: rgba(61, 220, 132, 0.2) !important; }