* { font-display: swap; }

:root {
    --bg-dark: #020617;
    --bg-card: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --success: #10b981;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; scroll-behavior: smooth; }

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

/* FONDO DE RED */
.grid-bg {
    position: fixed; inset: 0;
    background-image: linear-gradient(rgba(59, 130, 246, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1; pointer-events: none;
}

/* HERO SECTION */
.hero {
    min-height: 100vh; display: flex; flex-direction: column; 
    justify-content: center; align-items: center; padding: 2rem; text-align: center;
}

.profile-wrapper { position: relative; margin-bottom: 2rem; }
.profile-img {
    width: 280px; height: 280px; border-radius: 50%; object-fit: cover; 
    border: 3px solid var(--accent); box-shadow: 0 0 40px var(--accent-glow); 
    background-color: #000;
    background-image: url('files/foto.webp'); /* RUTA FOTO */
    background-size: cover; background-position: center;
    position: relative; z-index: 2;
}

.status-badge {
    position: absolute; bottom: 10px; right: 10px; background: var(--success); color: white;
    padding: 6px 14px; border-radius: 20px; font-weight: 700; font-size: 0.8rem;
    border: 3px solid var(--bg-dark); z-index: 3;
}

h1 { font-size: 2.8rem; font-weight: 800; margin-bottom: 0.5rem; letter-spacing: -1px; }
h2 { color: var(--accent); font-family: 'JetBrains Mono', monospace; font-size: 1rem; text-transform: uppercase; margin-bottom: 2rem; letter-spacing: 1px; }

.bio-text {
    max-width: 750px;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    /* Añadidos para mejorar la estructura visual */
    line-height: 1.6;        /* Da aire entre líneas */
    text-align: center;      /* Centra el texto (como en tu imagen) */
    margin-left: auto;       /* Centra el contenedor horizontalmente */
    margin-right: auto;      /* Centra el contenedor horizontalmente */
}

.bio-text strong {
    color: white;
    font-weight: 600;
}

/* Espaciado entre los párrafos */
.bio-text p {
    margin-bottom: 1.5rem;   /* Separación visual entre ideas */
}

/* Estilo específico para la frase de disponibilidad final */
.bio-text .availability {
    margin-top: 2rem;        /* Más separación antes de la llamada a la acción */
    color: #e2e8f0;          /* Un blanco un poco más brillante que el texto base */
    font-weight: 500;
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Línea sutil decorativa opcional */
    padding-top: 1.5rem;
}

/* BOTONES */
.cta-group { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; margin-bottom: 4rem; }
.btn { padding: 0.9rem 1.8rem; border-radius: 50px; font-weight: 600; text-decoration: none; display: flex; align-items: center; gap: 10px; transition: 0.3s; cursor: pointer; border: none; font-size: 0.95rem; }
.btn-primary { background: var(--accent); color: white; box-shadow: 0 0 20px var(--accent-glow); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 0 35px var(--accent); }
.btn-secondary { background: transparent; border: 1px solid var(--text-muted); color: var(--text-main); }
.btn-secondary:hover { border-color: white; background: rgba(255,255,255,0.05); }

/* STACK */
.stack-container { display: flex; gap: 2rem; opacity: 0.7; flex-wrap: wrap; justify-content: center; }
.stack-item { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 0.8rem; }
.stack-item i { font-size: 2rem; }

/* --- CHATBOT --- */
.chat-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.85); 
    backdrop-filter: blur(8px); z-index: 9999; display: none; 
    align-items: center; justify-content: center;
}
.chat-overlay.active { display: flex; }

.chat-box {
    width: 90%; max-width: 500px; height: 75vh; background: var(--bg-card); 
    border: 1px solid #334155; border-radius: 16px; display: flex; flex-direction: column;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5); overflow: hidden;
}

.chat-header { padding: 15px 20px; background: #1e293b; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #334155; }
.ai-avatar { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.ai-avatar i { color: var(--accent); }
.close-chat { background: none; border: none; color: #94a3b8; font-size: 1.5rem; cursor: pointer; }

.chat-messages { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.msg { padding: 12px 16px; border-radius: 12px; max-width: 85%; font-size: 0.95rem; line-height: 1.5; }
.msg-ai { background: #1e293b; align-self: flex-start; border: 1px solid #334155; color: #e2e8f0; }
.msg-user { background: var(--accent); align-self: flex-end; color: white; }

.chat-input-area { padding: 15px; border-top: 1px solid #334155; display: flex; gap: 10px; background: #1e293b; }
.chat-input { flex: 1; background: var(--bg-dark); border: 1px solid #334155; color: white; padding: 12px; border-radius: 8px; outline: none; }
.send-btn { background: var(--accent); border: none; color: white; width: 45px; border-radius: 8px; cursor: pointer; }

.chips-container { padding: 0 15px 15px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; font-size: 0.8rem; background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.3); color: var(--accent); border-radius: 20px; cursor: pointer; transition: 0.2s; }
.chip:hover { background: var(--accent); color: white; }

/* --- BANNER RGPD --- */
#rg-gdpr {
    position: fixed; bottom: 20px; right: 20px; max-width: 380px;
    background: white; color: #0f172a; padding: 20px; border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4); z-index: 10000; 
    border-left: 5px solid var(--accent); display: none; font-size: 0.9rem;
}
#rg-gdpr a { color: var(--accent); font-weight: 700; text-decoration: underline; }
.rg-actions { margin-top: 15px; display: flex; gap: 10px; justify-content: flex-end; }
.rg-actions button { padding: 8px 16px; border-radius: 6px; border: none; font-weight: 600; cursor: pointer; }
.rg-accept { background: var(--accent); color: white; }
.rg-decline { background: #f1f5f9; color: #64748b; }

/* --- MODAL DE PRIVACIDAD (ESTILO GLASS) --- */
.modal-backdrop {
    position: fixed; inset: 0; 
    background: rgba(0,0,0,0.7); /* Fondo oscuro detrás */
    backdrop-filter: blur(5px);
    z-index: 20000; display: none; 
    align-items: center; justify-content: center;
}
.modal-backdrop.active { display: flex; animation: fadeIn 0.3s ease; }

.modal-glass {
    width: 80%; /* Ancho amplio */
    max-width: 900px;
    height: 80vh; /* Alto 3/4 partes */
    /* Fondo Glassmorphism: Blanco semitransparente */
    background: rgba(255, 255, 255, 0.95); 
    color: #1e293b; /* Texto oscuro para leer bien */
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    display: flex; flex-direction: column; position: relative;
}

.modal-close {
    position: absolute; top: 15px; right: 20px;
    background: none; border: none; font-size: 2rem; color: #475569;
    cursor: pointer; transition: 0.2s;
}
.modal-close:hover { color: #0f172a; transform: scale(1.1); }

.modal-glass h2 {
    padding: 30px 30px 15px; border-bottom: 1px solid rgba(0,0,0,0.1);
    font-size: 1.8rem; margin: 0;
}

.modal-content-scroll {
    padding: 30px; overflow-y: auto; font-size: 1rem;
}
.modal-content-scroll h3 { color: var(--accent); margin-top: 25px; margin-bottom: 10px; font-size: 1.2rem; }
.modal-content-scroll p { margin-bottom: 15px; }
.modal-content-scroll ul { margin-left: 20px; margin-bottom: 15px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    #rg-gdpr { bottom: 10px; right: 10px; left: 10px; max-width: none; }
    .chat-box { width: 100%; height: 100%; border-radius: 0; }
    .modal-glass { width: 95%; height: 90vh; }
}

/* Animación de entrada suave */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Aplicar la animación al Hero y a las tarjetas de habilidades */
.hero h1, .hero h2, .bio-text, .cta-group, .stack-container {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Efecto Hover en las habilidades (Stack) */
.stack-item {
    transition: transform 0.3s ease, color 0.3s ease;
    cursor: default;
}

.stack-item:hover {
    transform: translateY(-5px) scale(1.1);
    color: var(--accent);
    opacity: 1;
}

/* Mejora del scroll para móviles */
body {
    -webkit-overflow-scrolling: touch;
}