:root {
    --bg-dark: #050505;
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    --accent: #27ae60;
    --accent-glow: rgba(39, 174, 96, 0.5);
    --text-main: #f0f0f0;
    --text-muted: #888;
}

/* 1. BASE */
html, body {
    margin: 0; padding: 0;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Segoe UI', system-ui, sans-serif;
    overflow-x: hidden; overflow-y: auto; scroll-behavior: smooth;
    overscroll-behavior-y: none;
}
body.modal-open { overflow: hidden !important; height: 100vh; touch-action: none; }

/* 2. LAYOUT */
.grid-container { max-width: 1100px; margin: 0 auto; padding: 80px 20px 60px; min-height: 80vh; }

/* === 3. HERO SECTION (CORREGIDO) === */
#hero {
    margin-bottom: 4rem;
    display: flex; justify-content: center;
    width: 100%;
}

.hero-inner-card {
    position: relative;
    width: 100%; max-width: 1000px;
    /* Quitamos altura mínima fija para que se adapte al contenido en móvil */
    min-height: 500px; 
    background: #000; 
    border: 2px solid var(--accent);
    border-radius: 24px;
    box-shadow: 0 0 40px rgba(39, 174, 96, 0.15);
    overflow: hidden; 
    transform: translateZ(0);
    display: flex; align-items: center; 
    padding: 3rem;
}

/* Canvas: Z-Index 1 para que se vea sobre el fondo negro */
#hero-canvas {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1; pointer-events: none; opacity: 1; /* Opacidad al máximo */
}

.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 70% 50%, transparent 20%, rgba(0,0,0,0.8) 90%);
    z-index: 2; pointer-events: none;
}

/* Contenido: Z-Index 3 para estar encima de la animación */
.hero-content {
    position: relative; z-index: 3;
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; gap: 2rem;
}

.hero-text { flex: 1; }
.hero-visual { flex-shrink: 0; display: flex; justify-content: center; }

/* Estilos de Texto */
.status-badge {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px;
    background: rgba(39, 174, 96, 0.2); color: var(--accent);
    padding: 6px 12px; border-radius: 20px; margin-bottom: 1rem;
    border: 1px solid var(--accent);
}
.pulse-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 10px var(--accent); }
.hero-name { font-size: 3.5rem; line-height: 1; margin: 0 0 10px; font-weight: 800; text-shadow: 0 4px 10px rgba(0,0,0,0.8); }
.hero-role { font-family: monospace; font-size: 1.2rem; color: var(--text-muted); margin-bottom: 20px; }
.slash { color: var(--accent); }
.hero-desc { color: #ccc; line-height: 1.6; max-width: 500px; margin-bottom: 30px; }
.hero-btns { display: flex; gap: 15px; }

/* Botones */
.btn { padding: 12px 30px; border-radius: 50px; text-decoration: none; font-weight: 600; transition: 0.3s; font-size: 0.9rem; text-transform: uppercase; }
.btn-primary { background: var(--accent); color: white; border: 2px solid var(--accent); box-shadow: 0 0 15px rgba(39, 174, 96, 0.4); }
.btn-primary:hover { box-shadow: 0 0 25px rgba(39, 174, 96, 0.7); transform: translateY(-2px); }
.btn-outline { background: transparent; color: white; border: 2px solid rgba(255,255,255,0.2); }
.btn-outline:hover { border-color: white; background: rgba(255,255,255,0.05); }

/* Foto */
.profile-circle {
    width: 280px; height: 280px; border-radius: 50%; padding: 8px;
    border: 2px solid var(--accent);
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.2), transparent);
    box-shadow: 0 0 30px rgba(39, 174, 96, 0.2);
}
.profile-circle img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; filter: grayscale(20%) contrast(110%); }

/* === MEDIA QUERY PARA MÓVIL (SOLUCIÓN DESCUDRE) === */
@media (max-width: 900px) {
    .hero-inner-card {
        padding: 2rem 1.5rem; /* Menos padding */
        min-height: auto; /* Altura automática */
    }
    .hero-content {
        flex-direction: column-reverse; /* Foto arriba, Texto abajo (o al revés) */
        text-align: center;
        gap: 2rem;
    }
    .hero-btns { justify-content: center; }
    .hero-name { font-size: 2.5rem; }
    .profile-circle { width: 220px; height: 220px; }
}

/* === 4. FAB MENU (SOLUCIÓN ALINEACIÓN) === */
.fab-wrapper { position: fixed; bottom: 30px; right: 30px; z-index: 1000; display: flex; flex-direction: column; align-items: flex-end; }

.fab-main-btn {
    width: 60px; height: 60px; border-radius: 50%; border: none;
    background: var(--accent); color: white; font-size: 1.5rem;
    cursor: pointer; box-shadow: 0 0 20px rgba(39,174,96,0.6);
    transition: all 0.3s ease; display: flex; align-items: center; justify-content: center;
}
.fab-main-btn:hover { transform: scale(1.1); }
.fab-main-btn.active { transform: rotate(45deg); background: #c0392b; box-shadow: 0 0 20px rgba(192, 57, 43, 0.5); }

.fab-glass-container {
    opacity: 0; visibility: hidden; transform: translateY(20px);
    transition: all 0.3s ease; margin-bottom: 15px;
}
.fab-wrapper.active .fab-glass-container { opacity: 1; visibility: visible; transform: translateY(0); }

.fab-list {
    background: rgba(10, 10, 10, 0.9); backdrop-filter: blur(10px);
    padding: 15px; border-radius: 16px; border: 1px solid var(--border-glass);
    display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}

/* ALINEACIÓN PERFECTA DE ITEMS */
.fab-list a {
    display: flex; 
    align-items: center; /* Centrar verticalmente */
    justify-content: flex-end; /* Alinear a la derecha */
    text-decoration: none; 
    color: #fff; font-weight: 600; font-size: 0.9rem; 
    transition: 0.2s;
    width: 100%;
}

.fab-list span { 
    margin-right: 12px; 
    text-transform: uppercase; 
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.mini-fab {
    width: 45px; height: 45px; /* Un poco más grandes */
    background: rgba(255,255,255,0.1);
    border-radius: 50%; 
    display: flex; align-items: center; justify-content: center;
    color: var(--accent); transition: 0.2s;
    font-size: 1.2rem;
    flex-shrink: 0; /* Evita que se aplasten */
}

.fab-list a:hover .mini-fab { background: var(--accent); color: white; transform: scale(1.1); }
.fab-list a:hover span { color: var(--accent); }

/* === RESTO DE ESTILOS === */
.floating-brand { position: fixed; top: 25px; left: 25px; z-index: 500; font-weight: 800; font-size: 1.4rem; color: #fff; text-decoration: none; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); padding: 8px 16px; border-radius: 12px; border: 1px solid var(--border-glass); transition: 0.3s; }
.floating-brand .dot { color: var(--accent); }
.floating-brand:hover { border-color: var(--accent); transform: translateY(-2px); }

.section-block { margin-bottom: 5rem; }
.section-header { display: flex; align-items: center; gap: 15px; margin-bottom: 30px; }
.section-title { font-size: 1.8rem; margin: 0; color: #fff; }
.section-title i { color: var(--accent); margin-right: 10px; }
.section-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-glass), transparent); }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.glass-card { background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: 16px; overflow: hidden; cursor: pointer; transition: 0.3s; }
.glass-card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,0.2); box-shadow: 0 10px 40px rgba(0,0,0,0.5); background: rgba(255,255,255,0.06); }
.card-image { height: 200px; position: relative; overflow: hidden; background: #000; }
.card-image img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; transition: 0.5s; }
.glass-card:hover img { transform: scale(1.05); opacity: 1; }
.science-card { grid-column: span 1; }
.science-view { height: 450px; background: #050505; }
.science-view img { object-fit: contain; width: 100%; height: 100%; opacity: 0.9; }
.hover-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--accent); font-weight: bold; text-transform: uppercase; opacity: 0; transition: 0.3s; backdrop-filter: blur(2px); }
.glass-card:hover .hover-overlay { opacity: 1; }
.card-info { padding: 1.2rem; }
.card-info h4 { margin: 0 0 5px; color: #fff; font-size: 1.1rem; }
.card-info p { margin: 0; color: #888; font-size: 0.9rem; }

.contact-box { background: var(--bg-glass); border: 1px solid var(--border-glass); padding: 3rem; text-align: center; border-radius: 20px; }
.contact-links { display: flex; justify-content: center; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.contact-btn { color: #fff; text-decoration: none; padding: 10px 20px; border: 1px solid rgba(255,255,255,0.2); border-radius: 50px; transition: 0.3s; display: flex; align-items: center; gap: 8px; }
.contact-btn:hover { background: var(--accent); border-color: var(--accent); }
.main-footer { text-align: center; padding: 2rem; color: #555; font-size: 0.8rem; border-top: 1px solid var(--border-glass); margin-top: 4rem; }

.modal-overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,0.95); backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: 0.3s; touch-action: none; overscroll-behavior: contain; }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-content { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; z-index: 2002; }
.lb-header { position: absolute; top: 20px; left: 0; width: 100%; text-align: center; z-index: 2010; pointer-events: none; }
#lb-title { color: var(--accent); margin: 0; text-transform: uppercase; letter-spacing: 2px; }
.zoom-hint { font-size: 0.75rem; color: #aaa; background: rgba(0,0,0,0.5); padding: 2px 8px; border-radius: 10px; margin-top: 5px; display: inline-block; }
.lb-image-wrapper { width: 100%; height: 80vh; overflow: hidden; display: flex; justify-content: center; align-items: center; cursor: grab; touch-action: none; }
.lb-image-wrapper img { max-height: 100%; max-width: 100%; object-fit: contain; }
.modal-close { position: absolute; top: 20px; right: 20px; background: rgba(255,255,255,0.1); border: none; color: #fff; width: 45px; height: 45px; border-radius: 50%; font-size: 30px; cursor: pointer; z-index: 2020; transition: 0.3s; }
.modal-prev, .modal-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); color: #fff; font-size: 24px; padding: 20px 15px; cursor: pointer; border-radius: 8px; z-index: 2020; transition: 0.3s; user-select: none; }
.modal-prev { left: 10px; } .modal-next { right: 10px; }
#lb-counter { position: absolute; bottom: 30px; left: 0; width: 100%; text-align: center; color: #888; font-size: 0.9rem; pointer-events: none; }

.web-mode { flex-direction: column; background: #111; }
.web-bar { width: 100%; padding: 10px 20px; background: #000; border-bottom: 1px solid #333; display: flex; justify-content: space-between; align-items: center; }
.web-actions button { background: #c0392b; color: #fff; border: none; padding: 5px 15px; border-radius: 4px; cursor: pointer; }
.web-actions a { color: #fff; margin-right: 15px; font-size: 1.2rem; }
.iframe-box { width: 100%; height: 100%; flex: 1; }
#web-frame { width: 100%; height: 100%; background: #fff; }

.anim-up { animation: fadeInUp 0.8s ease forwards; opacity: 0; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }