/* --- VARIABLES: 80s OVA / BIO-MECH / GRITTY TECH --- */
:root {
    --bg-base: #06080a;
    --bg-panel: #0d131a;
    --bg-glass: rgba(13, 19, 26, 0.85);

    --bio-red: #d91c1c;
    --bio-flesh: #4a001f;
    --bio-vein: #220033;
    --tech-cyan: #00ffcc;
    --warn-amber: #ffb700;
    --term-green: #00ff33;

    --text-main: #e2eaf0;
    --text-muted: #6b8299;

    --border-thick: #1a2633;
    --border-light: #26384a;

    --shadow-hard: 6px 6px 0px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 10px rgba(0, 255, 204, 0.3);
    --shadow-flesh: inset 0 0 30px #000, 0 0 20px rgba(217, 28, 28, 0.4);

    --transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);

    --font-title: 'Bebas Neue', sans-serif;
    --font-hud: 'VT323', monospace;
    --font-body: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; scroll-behavior: smooth; }

/* Cursor Táctico (Area 88 Style) */
body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: crosshair;
    background-image:
        linear-gradient(rgba(0, 255, 204, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 204, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
}

a, button, .project-card, .pub-card, .edu-card, .guyver-core-wrapper, .gallery-item {
    cursor: crosshair;
}

/* --- TEXTURAS Y BACKGROUND CANVAS --- */
.scanlines {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none; z-index: 9998; opacity: 0.15;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 1) 50%);
    background-size: 100% 4px;
}

.bio-tech-bg {
    position: fixed; top: 10%; right: -10%; width: 80vh; height: 80vh;
    pointer-events: none; z-index: -1; opacity: 0.04;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><path fill="%2300ffcc" d="M231.88,175.08A120.31,120.31,0,0,0,248,128a120,120,0,1,0-218.49,68.42l-15.6,44.57A8,8,0,0,0,21.43,251l44.57-15.6A119.56,119.56,0,0,0,128,248a120.31,120.31,0,0,0,47.08-9.88l39.43,24.47a8,8,0,0,0,11.83-9.52ZM128,232a104,104,0,1,1,104-104A104.12,104.12,0,0,1,128,232Z"/></svg>');
    background-repeat: no-repeat; background-size: contain;
    filter: drop-shadow(0 0 10px var(--tech-cyan));
    animation: radarRotate 60s linear infinite;
}
@keyframes radarRotate { 100% { transform: rotate(360deg); } }

.hero-canvas {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1; opacity: 0.8; pointer-events: none; mix-blend-mode: screen;
}

.cv-canvas {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0; opacity: 0.7; pointer-events: none; mix-blend-mode: screen;
}

/* --- BACKGROUND WINDOWS --- */
.bg-window {
    position: absolute;
    background: rgba(0, 15, 5, 0.85);
    border: 1px solid rgba(0, 255, 51, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 51, 0.1);
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}
.bg-window::before {
    content: 'SYS_OVERRIDE_TERMINAL'; position: absolute; top: 0; left: 0; width: 100%;
    background: rgba(0, 255, 51, 0.2); color: var(--term-green); font-family: var(--font-hud);
    font-size: 0.8rem; padding: 2px 10px; border-bottom: 1px solid rgba(0, 255, 51, 0.3);
    z-index: 2;
}

#terminalWindow {
    top: 10%; right: 2%; width: 350px; height: 500px;
    color: var(--term-green); font-family: var(--font-hud); font-size: 0.95rem;
    padding: 30px 15px 15px; display: flex; flex-direction: column; justify-content: flex-end;
    text-shadow: 0 0 3px var(--term-green); opacity: 0.45;
}

.cnn-window {
    top: 40px; left: 2%; width: 96%; height: 600px; opacity: 0.6;
    background: rgba(13, 19, 26, 0.4); border-color: rgba(0, 255, 204, 0.2);
}
.cnn-window::before { content: 'SYS_EXEC // CNN_ARCHITECTURE_TRAINING'; background: rgba(0, 255, 204, 0.15); color: var(--tech-cyan); border-bottom-color: rgba(0, 255, 204, 0.3);}
#cnnCanvas { width: 100%; height: 100%; margin-top: 10px; filter: drop-shadow(0 0 5px rgba(0,255,204,0.5));}

/* --- FILTRO DE IMÁGENES --- */
.scan-img {
    border: 2px solid var(--border-light);
    filter: grayscale(30%) contrast(140%) sepia(40%) hue-rotate(150deg) brightness(0.85);
    transition: var(--transition);
    display: block; width: 100%;
}
.scan-img:hover {
    filter: grayscale(0%) contrast(110%) sepia(0%) hue-rotate(0deg) brightness(1.1);
    border-color: var(--tech-cyan);
    box-shadow: var(--shadow-glow);
}

/* --- TIPOGRAFÍA Y TÍTULO HERO --- */
h2, h3 { font-family: var(--font-title); letter-spacing: 2px; text-transform: uppercase; }
.hud-text { font-family: var(--font-hud); text-transform: uppercase; letter-spacing: 1px; }

.hero-name-title {
    font-family: var(--font-title);
    font-size: clamp(3.5rem, 7vw, 6.5rem);
    line-height: 0.85;
    margin-bottom: 1.5rem;
    color: #fff;
    -webkit-text-stroke: 2px #000;
    text-shadow:
        4px 4px 0px var(--bio-red),
        8px 8px 0px rgba(0, 255, 204, 0.3);
    letter-spacing: 2px;
    position: relative;
    z-index: 2;
    animation: titleHover 4s ease-in-out infinite alternate;
}
.hero-name-title span {
    color: var(--tech-cyan);
    -webkit-text-stroke: 2px #000;
    text-shadow: 4px 4px 0px #000;
    display: block;
    margin-top: 5px;
}
@keyframes titleHover {
    0% { transform: translateY(0px) scale(1); text-shadow: 4px 4px 0px var(--bio-red), 8px 8px 0px rgba(0, 255, 204, 0.3); }
    100% { transform: translateY(-5px) scale(1.02); text-shadow: 6px 6px 0px var(--bio-red), 12px 12px 0px rgba(0, 255, 204, 0.5); }
}

.hero-quote {
    font-family: var(--font-body); font-style: italic; font-weight: 300;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem); color: rgba(0, 255, 204, 0.35);
    text-shadow: 0 0 20px rgba(0, 255, 204, 0.5); letter-spacing: 1px;
    line-height: 1.4; margin-bottom: 2rem; position: relative; z-index: 2;
    pointer-events: none;
}

/* --- EFECTOS DE CLICK (ACTIVE) Y SCANLINES PARA TARJETAS --- */
.edu-card, .project-card, .pub-card, .gallery-item { overflow: hidden; }

.edu-card::after, .pub-card::after {
    content: ''; position: absolute; top: 0; left: -150%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 204, 0.3), transparent);
    transform: skewX(-20deg); transition: 0s; z-index: 10; pointer-events: none;
}
.edu-card:hover::after, .pub-card:hover::after { left: 150%; transition: 0.6s ease-in-out; }

.edu-card:active, .project-card:active, .pub-card:active, .gallery-item:active, .bio-btn:active, .core-node:active {
    transform: scale(0.96) translateY(5px) !important;
    box-shadow: 0 0 0 transparent !important;
    filter: brightness(1.5) contrast(150%);
    border-color: #fff !important;
}

/* --- INTERFAZ HUD --- */
.hud-overlay { position: fixed; font-family: var(--font-hud); color: var(--bio-red); z-index: 9997; pointer-events: none; font-size: 1.2rem; }
.hud-top-left { top: 90px; left: 2%; display: flex; align-items: center; gap: 8px; border-left: 2px solid var(--bio-red); padding-left: 5px;}
.hud-top-left::before { content: ''; width: 12px; height: 12px; background: var(--bio-red); animation: blink 1.5s infinite; }
.hud-crosshair-center {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 40vw; height: 40vh; border: 1px solid rgba(0, 255, 204, 0.1);
    z-index: 9997; pointer-events: none;
    background:
        linear-gradient(rgba(0, 255, 204, 0.2) 1px, transparent 1px) center / 100% 1px no-repeat,
        linear-gradient(90deg, rgba(0, 255, 204, 0.2) 1px, transparent 1px) center / 1px 100% no-repeat;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* --- NAVEGACIÓN --- */
nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.8rem 4%; background: var(--bg-glass);
    position: fixed; width: 100%; top: 0; z-index: 1000;
    border-bottom: 2px solid var(--tech-cyan);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.8);
}
nav .logo {
    font-size: 2rem; font-weight: 400; color: #fff; text-decoration: none;
    display: flex; align-items: center; gap: 10px; font-family: var(--font-title);
    letter-spacing: 2px;
}
nav .logo i { color: var(--bio-red); font-size: 2.2rem; }

.nav-center { display: flex; align-items: center; gap: 3rem; }
.nav-links { list-style: none; display: flex; gap: 2rem; }
.nav-links li a {
    text-decoration: none; color: var(--text-main); font-size: 1.2rem;
    font-family: var(--font-title); transition: var(--transition); letter-spacing: 1px;
}
.nav-links li a:hover { color: var(--tech-cyan); }

.flag-switcher { display: flex; gap: 10px; background: #000; padding: 6px 10px; border: 1px solid var(--border-light); border-radius: 4px;}
.flag-btn {
    background: transparent; border: 2px solid transparent; width: 32px; height: 22px;
    transition: 0.2s; padding: 0; display: flex; align-items: center; justify-content: center;
    opacity: 0.4; filter: grayscale(100%);
}
.flag-btn.active, .flag-btn:hover { opacity: 1; filter: grayscale(0%); border-color: var(--tech-cyan); }
.flag-btn svg { width: 100%; height: 100%; object-fit: cover; pointer-events: none;}

.mobile-menu-btn { display: none; background: none; border: none; font-size: 2rem; color: var(--tech-cyan); cursor: pointer; }

/* --- HERO SECTION --- */
header { min-height: 100vh; display: flex; align-items: center; padding: 100px 5% 0; max-width: 1400px; margin: 0 auto; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; width: 100%; }

.hero-content p {
    font-size: 1.2rem; color: var(--text-main); margin-bottom: 2.5rem; max-width: 550px;
    background: rgba(0, 255, 204, 0.05); padding: 20px; border: 1px solid var(--border-light);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8); border-left: 4px solid var(--tech-cyan);
}

.hero-btns { display: flex; gap: 1.5rem; flex-wrap: wrap; }

/* --- BOTONES BIO-MECÁNICOS (GUYVER STYLE) --- */
.bio-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 25px; font-family: var(--font-hud); font-size: 1.2rem;
    text-decoration: none; cursor: crosshair; transition: var(--transition);
    border: 2px solid var(--tech-cyan); color: var(--tech-cyan);
    background: transparent; overflow: hidden; box-shadow: var(--shadow-glow);
}
.bio-btn.secondary { border-color: var(--text-muted); color: var(--text-muted); box-shadow: none; }

.bio-btn .armor {
    position: absolute; left: 0; width: 100%; height: 50%;
    background: var(--bg-panel); z-index: 1;
    transition: 0.5s cubic-bezier(0.8, 0, 0.2, 1);
    display: flex; align-items: center; justify-content: center;
}
.bio-btn .armor::before {
    content: ''; position: absolute; width: 100%; height: 100%;
    background: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(255,255,255,0.02) 4px, rgba(255,255,255,0.02) 8px);
}
.bio-btn .armor-top { top: 0; border-bottom: 2px solid var(--tech-cyan); }
.bio-btn .armor-bottom { bottom: 0; border-top: 2px solid var(--tech-cyan); }
.bio-btn.secondary .armor-top { border-bottom-color: var(--text-muted); }
.bio-btn.secondary .armor-bottom { border-top-color: var(--text-muted); }

.bio-btn .flesh {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 50%, #ff1a4a, var(--bio-flesh));
    z-index: 0; opacity: 0; transition: 0.3s;
    animation: fleshPulse 2s infinite alternate;
}
.bio-btn .flesh::after {
    content: ''; position: absolute; inset: 0;
    background: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(0,0,0,0.6) 5px, rgba(0,0,0,0.6) 10px);
    mix-blend-mode: overlay;
}

.bio-btn .mini-tentacle {
    position: absolute; background: var(--bio-vein); border: 1px solid var(--bio-red);
    border-radius: 50px; z-index: 0; box-shadow: 0 0 5px var(--bio-red);
}
.bio-btn .mt-1 { width: 50px; height: 6px; top: 20%; left: -10px; transform: rotate(15deg); animation: wriggle 1s infinite alternate; }
.bio-btn .mt-2 { width: 40px; height: 8px; bottom: 20%; right: -10px; transform: rotate(-10deg); animation: wriggle 1.2s infinite alternate-reverse; }
.bio-btn .mt-3 { width: 60px; height: 5px; top: 50%; left: 20%; transform: rotate(45deg); animation: wriggle 0.8s infinite alternate; }

.bio-btn-text { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; transition: 0.3s; pointer-events: none;}

.bio-btn:hover { border-color: var(--bio-red); box-shadow: 0 0 20px rgba(217, 28, 28, 0.6); }
.bio-btn:hover .armor-top { transform: translateY(-100%); }
.bio-btn:hover .armor-bottom { transform: translateY(100%); }
.bio-btn:hover .flesh { opacity: 1; }
.bio-btn:hover .bio-btn-text { color: #fff; text-shadow: 0 0 8px #fff; }

.hero-dual-images {
    position: relative; display: flex; justify-content: center; align-items: center;
    height: 500px; width: 100%;
}

@keyframes floatPrimary { 0% { transform: translate(-30px, 20px); } 100% { transform: translate(-30px, 0px); } }
@keyframes floatSecondary { 0% { transform: translate(30px, -20px) scale(0.9); } 100% { transform: translate(30px, -40px) scale(0.9); } }

.primary-img {
    position: absolute; z-index: 3; width: 100%; max-width: 320px; aspect-ratio: 3/4;
    animation: floatPrimary 3s ease-in-out infinite alternate;
}

@keyframes floatAvatar {
    0% {
        transform: translate(-50%, -50%) translate(var(--avatar-x), calc(var(--avatar-y) + 8px)) rotate(var(--avatar-rot)) scale(var(--avatar-scale));
    }
    100% {
        transform: translate(-50%, -50%) translate(var(--avatar-x), calc(var(--avatar-y) - 10px)) rotate(calc(var(--avatar-rot) + 2deg)) scale(var(--avatar-scale));
    }
}

.bio-avatar-img {
    position: absolute; left: 50%; top: 50%; z-index: 2;
    width: clamp(120px, 13vw, 190px); aspect-ratio: 1/1;
    filter: brightness(0.58) saturate(1.1); opacity: 0.88;
    --avatar-x: 120px; --avatar-y: -80px; --avatar-rot: -8deg; --avatar-scale: 0.8; --avatar-duration: 4s;
    animation: floatAvatar var(--avatar-duration) ease-in-out infinite alternate;
}
.bio-avatar-img:hover { filter: brightness(1) saturate(1.2); opacity: 1; z-index: 5; }
.bio-avatar-img .bio-tag {
    background: var(--warn-amber); color: #000; border-color: #000; right: -10px; bottom: -12px;
    font-size: 0.95rem; white-space: nowrap;
}

.hero-image-container {
    background: #000; padding: 5px; border: 2px solid var(--border-light);
    box-shadow: var(--shadow-hard); transition: 0.3s;
}
.hero-image-container:hover { box-shadow: 10px 10px 0px rgba(0, 255, 204, 0.5);}
.hero-image-container::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    border: 1px solid var(--tech-cyan); pointer-events: none; box-sizing: border-box;
    background: linear-gradient(rgba(0, 255, 204, 0.2) 1px, transparent 1px) 0 0 / 100% 40px;
    animation: scandown 4s linear infinite;
}
@keyframes scandown { 0% { background-position: 0 -40px; } 100% { background-position: 0 100%; } }

.hero-image-container img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%) contrast(130%) brightness(0.8); }

.bio-tag {
    position: absolute; bottom: -15px; right: -15px; background: var(--bio-red); color: white;
    padding: 5px 15px; font-family: var(--font-hud); font-size: 1.2rem; border: 2px solid #000; z-index: 3;
}

/* --- SECCIONES GENERALES --- */
section { padding: 6rem 5%; max-width: 1400px; margin: 0 auto; position: relative; }
.section-header, .edu-grid, .gallery-grid, .projects-grid, .media-grid, .pub-list { position: relative; z-index: 10; }

.section-header { margin-bottom: 3.5rem; display: flex; flex-direction: column; align-items: flex-start; }
.section-subtitle {
    color: var(--tech-cyan); font-family: var(--font-hud); font-size: 1.2rem; margin-bottom: 0px;
    background: #000; padding: 2px 10px; border: 1px solid var(--tech-cyan);
}
.section-title { font-size: 3.5rem; color: white; margin-top: 5px;}

/* --- BIO ECOSYSTEM WRAPPER --- */
/* Envuelve CV y Campo para que el lienzo abarque ambos y las presas caigan a la zona de caza */
.bio-ecosystem-wrapper {
    position: relative;
    width: 100%;
    border-top: 1px solid var(--border-thick);
    border-bottom: 1px solid var(--border-thick);
    background: var(--bg-base);
    overflow: hidden;
}

/* --- EDUCACIÓN --- */
.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem; }
.edu-card {
    background: var(--bg-panel); padding: 2rem; border: 1px solid var(--border-light);
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5); transition: var(--transition); position: relative;
}
.edu-card:hover { border-color: var(--tech-cyan); background: #101820; transform: translateY(-5px); box-shadow: 5px 5px 0px var(--tech-cyan);}

.edu-card.phd-card { border-left: 4px solid var(--bio-red); }
.edu-card.phd-card::before { content: '[ACTIVE_STATUS]'; position: absolute; top: 10px; right: 10px; color: var(--bio-red); font-family: var(--font-hud); font-size: 1rem; }

.edu-dates { font-family: var(--font-hud); color: var(--tech-cyan); font-size: 1.2rem; margin-bottom: 0.5rem; display: block;}
.edu-title { font-size: 2rem; color: white; margin-bottom: 0.5rem; font-family: var(--font-title); letter-spacing: 1px;}
.edu-meta { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 1rem; margin-bottom: 1.5rem; font-family: var(--font-body);}
.edu-meta a {
    color: var(--text-muted); text-decoration: none; border-bottom: 1px solid rgba(0, 255, 204, 0.28);
    transition: var(--transition);
}
.edu-meta a:hover {
    color: var(--tech-cyan); border-bottom-color: var(--tech-cyan); text-shadow: 0 0 8px rgba(0, 255, 204, 0.45);
}

.supervisor-box {
    background: #000; padding: 1rem; border: 1px dashed var(--border-light);
    display: flex; flex-direction: column; gap: 5px;
}
.supervisor-box h4 { font-size: 1rem; color: var(--text-muted); font-family: var(--font-hud); margin-bottom: 0px;}
.supervisor-box p { font-size: 0.95rem; color: white;}
.supervisor-box a, .supervisor-box-alt a {
    color: var(--text-main); text-decoration: none; border-bottom: 1px solid rgba(0, 255, 204, 0.35);
    transition: var(--transition);
}
.supervisor-box a:hover, .supervisor-box-alt a:hover {
    color: var(--tech-cyan); border-bottom-color: var(--tech-cyan); text-shadow: 0 0 8px rgba(0, 255, 204, 0.5);
}

.supervisor-box-alt { background: rgba(0,0,0,0.5); padding: 0.8rem; border-left: 2px solid var(--text-muted); margin-top: 10px;}
.supervisor-box-alt h4 { font-size: 0.85rem; color: var(--text-muted); font-family: var(--font-hud); margin-bottom: 0px;}
.supervisor-box-alt p { font-size: 0.9rem; color: #aaa;}

/* --- GALERÍA --- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.gallery-item { position: relative; background: #000; padding: 8px; border: 1px solid var(--border-light); transition: 0.2s;}
.gallery-item::before { content:'+'; position:absolute; top:5px; left:5px; color:var(--tech-cyan); font-family:var(--font-hud); z-index:5;}
.gallery-item::after { content:'+'; position:absolute; bottom:5px; right:5px; color:var(--tech-cyan); font-family:var(--font-hud); z-index:5;}
.gallery-item:hover { border-color: var(--tech-cyan); box-shadow: 0 0 15px rgba(0,255,204,0.3);}
.gallery-item .scan-img { aspect-ratio: 16/9; object-fit: cover; }
.gallery-caption {
    position: absolute; bottom: 16px; left: 16px; right: 16px; background: rgba(0,0,0,0.82);
    color: var(--tech-cyan); padding: 5px 8px; font-family: var(--font-hud); font-size: 1rem;
    line-height: 1.1; border: 1px solid var(--tech-cyan); z-index: 5; transition: 0.2s;
}
.gallery-item:hover .gallery-caption { background: var(--tech-cyan); color: #000; transform: translateY(-5px); }

.memory-window {
    position: relative; z-index: 12; width: min(290px, 72vw); aspect-ratio: 4/3;
    margin: 1.25rem 0 0 auto; background: #000; overflow: hidden;
    border: 1px solid rgba(0, 255, 204, 0.75);
    box-shadow: 0 0 24px rgba(0, 255, 204, 0.18), 8px 8px 0 rgba(0,0,0,0.75);
    clip-path: polygon(5% 0, 100% 0, 100% 86%, 91% 100%, 0 100%, 0 12%);
}
.memory-window video {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transform: scale(1.08);
    filter: grayscale(35%) sepia(25%) contrast(135%) saturate(1.25) brightness(0.82);
}
.memory-window::before {
    content: ''; position: absolute; inset: -18px; z-index: 2; pointer-events: none;
    background:
        radial-gradient(circle at center, transparent 46%, rgba(0,0,0,0.72) 80%),
        linear-gradient(rgba(0, 255, 204, 0.16) 1px, transparent 1px);
    background-size: auto, 100% 4px;
    box-shadow: inset 0 0 34px 18px rgba(0,0,0,0.88);
    backdrop-filter: blur(1.5px);
}
.memory-window::after {
    content: 'PAST_FEED // FIELD_MEMORY'; position: absolute; left: 8px; bottom: 7px; z-index: 3;
    color: var(--tech-cyan); background: rgba(0,0,0,0.72); border: 1px solid rgba(0,255,204,0.65);
    padding: 2px 7px; font-family: var(--font-hud); font-size: 0.9rem; letter-spacing: 0.04em;
    text-shadow: 0 0 7px var(--tech-cyan);
}
.memory-fallback {
    position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; z-index: 1;
    color: var(--text-muted); font-family: var(--font-hud); font-size: 1rem; text-align: center;
}

/* --- SOFTWARE Y DEMOS (EFECTO ARMADURA GUYVER) --- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 2.5rem; margin-bottom: 5rem;}
.project-card {
    background: var(--bg-panel); border: 2px solid var(--border-light);
    display: flex; flex-direction: column; transition: 0.4s; position: relative;
}
.project-card:hover,
.project-card:focus-within { border-color: var(--bio-red); box-shadow: 0 0 20px rgba(217, 28, 28, 0.3); transform: translateY(-5px);}

.mech-image-container { position: relative; height: 220px; overflow: hidden; background: #000; border-bottom: 2px solid var(--border-light); }
.mech-image-container img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(80%) sepia(20%) hue-rotate(180deg); transition: 0.5s; }
.project-card:hover .mech-image-container img,
.project-card:focus-within .mech-image-container img { filter: grayscale(0%) contrast(150%) brightness(1.2); animation: bioPulse 2s infinite; }
@keyframes bioPulse { 0%, 100% { filter: grayscale(0%) contrast(120%) brightness(1) sepia(50%) hue-rotate(-20deg); } 50% { filter: grayscale(0%) contrast(150%) brightness(1.3) sepia(80%) hue-rotate(-30deg); } }

.mech-door { position: absolute; left: 0; width: 100%; height: 50%; background: #0d131a; border: 1px solid var(--border-light); z-index: 2; transition: 0.5s cubic-bezier(0.25, 1, 0.5, 1); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.mech-door-top { top: 0; border-bottom: 2px solid var(--bio-red); }
.mech-door-bottom { bottom: 0; border-top: 2px solid var(--bio-red); }
.mech-door::before { content: ''; position: absolute; width: 100%; height: 100%; background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.02) 10px, rgba(255,255,255,0.02) 20px); pointer-events: none;}

.project-card:hover .mech-door-top,
.project-card:focus-within .mech-door-top { transform: translateY(-100%); }
.project-card:hover .mech-door-bottom,
.project-card:focus-within .mech-door-bottom { transform: translateY(100%); }
.project-card:hover .mech-image-container,
.project-card:focus-within .mech-image-container { border-bottom-color: var(--bio-red); }

.project-content { padding: 2rem; display: flex; flex-direction: column; flex-grow: 1; position: relative; z-index: 3;}
.project-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1rem; }
.project-tags span {
    background: #000; color: var(--tech-cyan); font-size: 1rem;
    padding: 2px 8px; font-family: var(--font-hud); border: 1px solid var(--border-thick); transition: 0.3s;
}
.project-card:hover .project-tags span,
.project-card:focus-within .project-tags span { border-color: var(--bio-red); color: #fff; background: rgba(217, 28, 28, 0.2); }

.project-content h3 { font-size: 2.2rem; margin-bottom: 0.5rem; color: white; transition: 0.3s;}
.project-card:hover .project-content h3,
.project-card:focus-within .project-content h3 { color: var(--bio-red); text-shadow: 0 0 10px rgba(217, 28, 28, 0.5);}
.project-content p { font-size: 1rem; color: var(--text-muted); line-height: 1.5; }

.project-links { display: flex; gap: 1rem; margin-top: auto; padding-top: 1.5rem; }
.project-links a {
    display: flex; align-items: center; gap: 8px; font-family: var(--font-hud);
    font-size: 1.1rem; text-decoration: none; color: var(--text-main);
    padding: 6px 12px; border: 1px solid var(--border-light); transition: 0.2s;
}
.project-links a:hover { background: var(--bio-red); color: #fff; border-color: var(--bio-red); box-shadow: 0 0 15px rgba(217, 28, 28, 0.5); }

.media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem; }
.media-container {
    width: 100%; border: 1px solid var(--border-light); overflow: hidden;
    aspect-ratio: 16/9; background: #000; position: relative; transition: var(--transition); display: block;
}
.media-container:hover { border-color: var(--warn-amber); transform: translateY(-5px); box-shadow: 0 0 20px rgba(255,183,0,0.2);}
.media-container iframe, .media-container img { width: 100%; height: 100%; object-fit: cover; position: absolute; top:0; left:0; border: none;}
.media-info { padding: 1rem 0; }
.media-info h3 { font-size: 1.8rem; color: white; margin-bottom: 0; }
.media-info p { font-family: var(--font-hud); font-size: 1.1rem; color: var(--text-muted);}

/* --- ARTÍCULOS CIENTÍFICOS (EFECTO INFECCIÓN ORGÁNICA) --- */
.pub-list { display: flex; flex-direction: column; gap: 1.5rem; max-width: 1000px; }
.pub-card {
    background: #000; padding: 1.5rem; border: 1px solid var(--border-light);
    border-left: 4px solid var(--border-light); transition: 0.4s;
    display: flex; flex-direction: column; gap: 5px; position: relative; overflow: hidden; z-index: 1;
}

.pub-card::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: radial-gradient(ellipse at left, var(--bio-flesh) 0%, var(--bio-vein) 50%, transparent 100%);
    z-index: -1; transition: 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275); opacity: 0;
    background-size: 200% 200%; pointer-events: none;
}

.pub-card:hover { border-color: var(--bio-red); border-left-width: 8px; transform: translateX(10px); box-shadow: 0 0 20px rgba(217, 28, 28, 0.3); }
.pub-card:hover::before { left: 0; opacity: 0.9; animation: organicShift 3s ease-in-out infinite alternate; }
@keyframes organicShift { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }

.pub-title { font-size: 1.1rem; font-weight: 600; color: white; line-height: 1.4; transition: 0.3s; }
.pub-card:hover .pub-title { color: var(--tech-cyan); text-shadow: 0 0 8px var(--tech-cyan); }
.pub-authors { color: var(--text-muted); font-size: 0.95rem; transition: 0.3s;}
.pub-card:hover .pub-authors { color: #fff; }
.pub-journal { color: var(--warn-amber); font-family: var(--font-hud); font-size: 1.1rem; margin-top: 5px; transition: 0.3s;}
.pub-card:hover .pub-journal { color: #fff; text-shadow: 0 0 5px #fff; }

.pub-badges { display: flex; gap: 10px; margin-bottom: 8px; flex-wrap: wrap;}
.badge { font-size: 1rem; padding: 2px 8px; font-family: var(--font-hud); border: 1px solid; transition: 0.3s; background: rgba(0,0,0,0.5);}
.badge-review { border-color: var(--warn-amber); color: var(--warn-amber); }
.badge-accepted { border-color: var(--tech-cyan); color: var(--tech-cyan); background: rgba(0, 255, 204, 0.1); }
.badge-orcid { border-color: #A6CE39; color: #A6CE39; background: rgba(166, 206, 57, 0.1); }
.pub-card:hover .badge { border-color: var(--bio-red); color: #fff; background: var(--bio-red); }

.orcid-loader {
    background: rgba(0,0,0,0.8); border: 1px dashed var(--tech-cyan); padding: 20px;
    font-family: var(--font-hud); color: var(--tech-cyan); font-size: 1.2rem;
    margin-bottom: 1rem; text-shadow: 0 0 5px var(--tech-cyan);
}

/* --- GUYVER BIO-CORE EXTENDIDO --- */
.bio-core-section {
    padding: 8rem 5%; position: relative; border-top: 1px solid var(--border-thick);
    display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 10;
    overflow: hidden;
    background: #000;
}
.bio-core-section::before {
    content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background-image: url('../img/DSC-HX400V4103.webp');
    background-size: 165% auto; background-position: center;
    opacity: 0.48; filter: grayscale(65%) contrast(145%) brightness(1);
    transform: scale(1.18);
}
.bio-core-section::after {
    content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(circle at center, rgba(6, 8, 10, 0.08), rgba(6, 8, 10, 0.78) 76%),
        linear-gradient(rgba(0, 255, 204, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 204, 0.05) 1px, transparent 1px);
    background-size: auto, 32px 32px, 32px 32px;
}
.bio-core-section > * { position: relative; z-index: 1; }
.guyver-core-wrapper { position: relative; width: 350px; height: 350px; margin-top: 2rem; }

.bio-tentacles { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: 0.5s; z-index: 1; pointer-events: none; }
.guyver-core-wrapper:hover .bio-tentacles { opacity: 1; }
.tentacle { position: absolute; background: radial-gradient(circle, var(--bio-red), var(--bio-vein)); border-radius: 50px; box-shadow: 0 0 15px var(--bio-red); }
.t1 { width: 15px; height: 120px; top: -50px; left: 50%; transform: rotate(15deg); animation: wriggle 2s infinite alternate; }
.t2 { width: 15px; height: 150px; bottom: -80px; left: 40%; transform: rotate(-20deg); animation: wriggle 2.5s infinite alternate-reverse; }
.t3 { width: 120px; height: 15px; top: 40%; left: -60px; transform: rotate(10deg); animation: wriggle 1.8s infinite alternate; }
.t4 { width: 140px; height: 15px; top: 60%; right: -80px; transform: rotate(-15deg); animation: wriggle 2.2s infinite alternate-reverse; }
@keyframes wriggle { 0% { border-radius: 50%; } 100% { border-radius: 20%; transform: scale(1.05) skewX(5deg); } }

.organic-mass {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 150px; height: 150px; background:
        radial-gradient(circle at 50% 50%, rgba(255, 26, 74, 0.95), rgba(74, 0, 16, 0.88) 45%, rgba(0, 0, 0, 0.98) 72%),
        radial-gradient(circle at 50% 50%, #000, #000);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    box-shadow: inset 0 0 52px #000, inset 0 0 18px rgba(255, 26, 74, 0.55), 0 0 36px rgba(217, 28, 28, 0.45);
    animation: mutate 3s ease-in-out infinite alternate;
    transition: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex; align-items: center; justify-content: center; z-index: 2;
}
.organic-mass::after {
    content: ''; position: absolute; inset: -72px; z-index: -1; pointer-events: none;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(0,0,0,0.98) 0 32%, rgba(217,28,28,0.48) 48%, rgba(217,28,28,0.12) 62%, transparent 78%),
        conic-gradient(from 20deg, rgba(0,0,0,0.85), rgba(217,28,28,0.34), rgba(0,0,0,0.95), rgba(0,255,204,0.1), rgba(0,0,0,0.85));
    filter: blur(8px);
    transform: scale(0.86);
    opacity: 0.82;
    transition: 0.7s ease;
}
.organic-mass::before {
    content:''; position: absolute; width: 100%; height: 100%; border-radius: 50%;
    background-image: radial-gradient(transparent 40%, rgba(0,0,0,0.8) 50%, transparent 60%);
    background-size: 15px 15px; opacity: 0.6; pointer-events: none; mix-blend-mode: overlay;
}

.glowing-orb {
    width: 40px; height: 40px; background: var(--tech-cyan); border-radius: 50%;
    box-shadow: 0 0 20px var(--tech-cyan), 0 0 40px #fff; animation: orbPulse 2s infinite; transition: 0.4s;
}

.armor-plate {
    position: absolute; left: 50%; transform: translateX(-50%); width: 240px; height: 150px;
    background:
        radial-gradient(circle at 50% 68%, rgba(217, 28, 28, 0.24), transparent 45%),
        linear-gradient(135deg, rgba(0, 255, 204, 0.12), rgba(6, 8, 10, 0.18) 48%, rgba(0, 0, 0, 0.6)),
        rgba(0, 255, 204, 0.04);
    -webkit-backdrop-filter: blur(2.5px) contrast(1.9) saturate(1.18) brightness(1.08);
    backdrop-filter: blur(2.5px) contrast(1.9) saturate(1.18) brightness(1.08);
    border: 0; z-index: 3;
    transition: 0.6s cubic-bezier(0.8, 0, 0.2, 1); display: flex; align-items: center;
    justify-content: center; overflow: hidden;
    box-shadow: inset 0 0 34px rgba(0,0,0,0.68), inset 0 0 18px rgba(0,255,204,0.14), 0 10px 30px rgba(0,0,0,0.8);
    pointer-events: none; opacity: 0.94;
}
.armor-plate::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
        linear-gradient(90deg, rgba(0,0,0,0.34), transparent 28%, rgba(255,255,255,0.1) 48%, transparent 70%, rgba(0,0,0,0.38)),
        linear-gradient(rgba(0, 255, 204, 0.11) 1px, transparent 1px),
        url('../img/DSC-HX400V4103.webp') center / 165% auto;
    background-size: 100% 100%, 100% 5px, 165% auto;
    opacity: 0.22; mix-blend-mode: screen; filter: contrast(1.45) blur(0.6px);
}
.armor-plate::after {
    content: ''; position: absolute; inset: -1px; pointer-events: none;
    background:
        linear-gradient(180deg, rgba(0,255,204,0.44), rgba(0,255,204,0.04) 10%, transparent 30%, transparent 70%, rgba(0,255,204,0.05) 90%, rgba(0,255,204,0.34)),
        linear-gradient(90deg, rgba(0,0,0,0.48), transparent 18%, transparent 82%, rgba(0,0,0,0.48));
    opacity: 0.58; filter: blur(1.2px); mix-blend-mode: screen;
}
.armor-plate.armor-top {
    top: 25px; clip-path: polygon(0 0, 100% 0, 80% 100%, 50% 85%, 20% 100%);
}
.armor-plate.armor-bottom {
    bottom: 25px; clip-path: polygon(20% 0, 50% 15%, 80% 0, 100% 100%, 0 100%);
}

.core-links {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    display: flex; gap: 15px; z-index: 4; opacity: 0; pointer-events: none; transition: 0.4s; transition-delay: 0.1s;
}

.guyver-core-wrapper:hover .armor-plate.armor-top { top: -80px; }
.guyver-core-wrapper:hover .armor-plate.armor-bottom { bottom: -80px; }
.guyver-core-wrapper:hover .organic-mass {
    width: 320px; height: 320px; filter: brightness(1.22);
    box-shadow: inset 0 0 82px #000, inset 0 0 28px rgba(255, 26, 74, 0.72), 0 0 110px rgba(217, 28, 28, 0.9);
}
.guyver-core-wrapper:hover .organic-mass::after { transform: scale(1.18); opacity: 1; filter: blur(12px); }
.guyver-core-wrapper:hover .glowing-orb { transform: scale(5); opacity: 0.15; background: var(--bio-red); box-shadow: 0 0 50px var(--bio-red); }
.guyver-core-wrapper:hover .core-links { opacity: 1; pointer-events: auto; }

.core-node {
    background: rgba(0,0,0,0.9); border: 2px solid var(--tech-cyan); padding: 15px 20px;
    color: var(--tech-cyan); text-decoration: none; font-family: var(--font-hud); font-size: 1.2rem;
    display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: 0 0 20px rgba(0,255,204,0.3); transition: 0.2s;
}
.core-node:hover { background: var(--tech-cyan); color: #000; box-shadow: 0 0 30px var(--tech-cyan); transform: scale(1.1); }
.core-node.zenodo { border-color: var(--warn-amber); color: var(--warn-amber); box-shadow: 0 0 20px rgba(255,183,0,0.3);}
.core-node.zenodo:hover { background: var(--warn-amber); color: #000; box-shadow: 0 0 30px var(--warn-amber); }

@keyframes mutate { 0% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; } 100% { border-radius: 70% 30% 50% 50% / 30% 70% 40% 60%; } }
@keyframes orbPulse { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 30px var(--tech-cyan), 0 0 60px #fff;} }

/* --- FOOTER --- */
footer {
    background: #000; padding: 4rem 5% 2rem; text-align: center; border-top: 2px solid var(--border-light);
    position: relative; overflow: hidden;
}
footer h3 { font-size: 3rem; margin-bottom: 2rem; color: white; font-family: var(--font-hud); }
.footer-archive {
    position: relative; width: 100%; max-width: 900px; margin: 0 auto 3rem; min-height: 390px;
    display: flex; align-items: center; justify-content: center;
}
.footer-main-image {
    position: relative; z-index: 2; width: min(800px, 88%); border: 0;
    padding: 0; background: transparent; box-shadow: none; overflow: hidden;
}
.footer-main-image img {
    display: block;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 58%, rgba(0,0,0,0.88) 75%, transparent 100%);
    mask-image: radial-gradient(ellipse at center, #000 58%, rgba(0,0,0,0.88) 75%, transparent 100%);
}
.footer-main-image::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    box-shadow: inset 0 0 78px 54px #000;
    background: linear-gradient(90deg, #000 0%, transparent 12%, transparent 88%, #000 100%),
                linear-gradient(180deg, #000 0%, transparent 14%, transparent 84%, #000 100%);
    mix-blend-mode: multiply;
}
.footer-stamp {
    position: absolute; z-index: 4; width: clamp(82px, 11vw, 132px); aspect-ratio: 4/5;
    object-fit: cover; opacity: 0.95;
    filter: sepia(18%) saturate(0.95) contrast(1.12) brightness(0.95) drop-shadow(0 8px 10px rgba(0,0,0,0.72));
    border: 0; box-shadow: none; background: transparent;
    pointer-events: none;
}
.footer-stamp-wide {
    width: clamp(122px, 16vw, 188px); aspect-ratio: 16/10; object-fit: contain;
    background: transparent; padding: 0;
}
.stamp-bananas { left: 3%; top: 4%; transform: rotate(-10deg); }
.stamp-onycho { right: 2%; top: 6%; transform: rotate(9deg); }
.stamp-loon { left: 50%; top: -4%; transform: translateX(-50%) rotate(2deg); }
.stamp-yugo1 { left: 5%; bottom: 3%; transform: rotate(6deg); }
.stamp-yugo2 { right: 6%; bottom: 0; transform: rotate(-7deg); }
.stamp-yugo3 { right: 24%; bottom: -5%; transform: rotate(5deg); }
.social-links { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.social-links a {
    display: flex; align-items: center; justify-content: center; width: 50px; height: 50px;
    border: 1px solid var(--text-muted); color: var(--text-muted); text-decoration: none;
    font-size: 1.8rem; transition: var(--transition);
}
.social-links a:hover { border-color: var(--tech-cyan); color: var(--tech-cyan); transform: translateY(-5px) scale(1.1); box-shadow: 0 5px 15px rgba(0,255,204,0.3);}
.footer-copy { color: var(--text-muted); font-size: 1rem; font-family: var(--font-hud); }

/* Responsividad */
@media (max-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr; padding-top: 130px; }
    .hero-content p { margin-bottom: 2.5rem; }
    .hero-dual-images { order: -1; margin: 0 auto 2rem; height: 400px; }
    .primary-img { transform: translate(-20px, 10px); max-width: 250px;}
    .bio-avatar-img { width: clamp(96px, 18vw, 145px); }
    .nav-center { display: none; }
    .mobile-menu-btn { display: block; }
    .nav-center.active {
        display: flex; flex-direction: column; position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
        background: rgba(6, 8, 10, 0.98); justify-content: center; z-index: -1; border-bottom: 2px solid var(--tech-cyan);
    }
    .nav-center.active .nav-links { flex-direction: column; align-items: center; font-size: 2rem; margin-bottom: 2rem;}
    .hud-overlay, .hud-crosshair-center, .bg-window { display: none; }
}
@media (max-width: 768px) {
    .section-title { font-size: 2.8rem; }
    .hero-name-title { font-size: 3.5rem; }
    .guyver-core-wrapper { transform: scale(0.8); }
    .primary-img { max-width: 200px; }
    .bio-avatar-img { width: 96px; }
    .bio-avatar-img .bio-tag { display: none; }
    .footer-archive { min-height: 300px; }
    .footer-main-image { width: 82%; }
    .footer-stamp { width: 72px; }
    .footer-stamp-wide { width: 108px; }
    .stamp-bananas { left: 0; top: 2%; }
    .stamp-onycho { right: 0; top: 5%; }
    .stamp-loon { left: 50%; top: 1%; }
    .stamp-yugo1 { left: 2%; bottom: 11%; }
    .stamp-yugo2 { right: 2%; bottom: 3%; }
    .stamp-yugo3 { right: 4%; bottom: 17%; }
}

/* Responsive, touch, and accessibility hardening */
html {
    scroll-padding-top: 82px;
}

body.menu-open {
    overflow: hidden;
}

.skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10000;
    padding: 0.7rem 1rem;
    color: #000;
    background: var(--tech-cyan);
    font-family: var(--font-hud);
    text-decoration: none;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

:where(a, button):focus-visible {
    outline: 3px solid var(--warn-amber);
    outline-offset: 4px;
}

.flag-btn,
.mobile-menu-btn {
    min-width: 44px;
    min-height: 44px;
}

.flag-btn {
    width: 44px;
    height: 44px;
    padding: 9px 6px;
}

.mobile-menu-btn {
    position: relative;
    z-index: 1002;
    align-items: center;
    justify-content: center;
    color: var(--tech-cyan);
    background: rgba(0, 255, 204, 0.06);
    border: 1px solid rgba(0, 255, 204, 0.65);
    box-shadow: 0 0 12px rgba(0, 255, 204, 0.12);
}

.mobile-menu-icon,
.mobile-menu-icon::before,
.mobile-menu-icon::after {
    display: block;
    width: 25px;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-icon {
    position: relative;
}

.mobile-menu-icon::before,
.mobile-menu-icon::after {
    content: '';
    position: absolute;
    left: 0;
}

.mobile-menu-icon::before { top: -8px; }
.mobile-menu-icon::after { top: 8px; }
.mobile-menu-btn[aria-expanded="true"] .mobile-menu-icon { background: transparent; }
.mobile-menu-btn[aria-expanded="true"] .mobile-menu-icon::before { transform: translateY(8px) rotate(45deg); }
.mobile-menu-btn[aria-expanded="true"] .mobile-menu-icon::after { transform: translateY(-8px) rotate(-45deg); }

.hero-name-title,
.section-title,
.project-content h3,
.edu-title,
.pub-title,
.footer-copy {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.edu-grid,
.media-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
}

@media (max-width: 1024px) {
    nav {
        min-height: 70px;
        padding: 0.65rem clamp(1rem, 4vw, 2rem);
    }

    nav .logo {
        font-size: clamp(1.55rem, 5.5vw, 2rem);
    }

    .mobile-menu-btn {
        display: inline-flex;
    }

    .nav-center.active {
        z-index: 1001;
        height: 100dvh;
        padding: 5.5rem 1.25rem 1.5rem;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .nav-center.active .nav-links {
        width: min(100%, 24rem);
        gap: 0.35rem;
        margin-bottom: 1.25rem;
    }

    .nav-center.active .nav-links a {
        display: flex;
        min-height: 44px;
        align-items: center;
        justify-content: center;
        padding: 0.45rem 0.75rem;
        font-size: 1.55rem;
    }

    header {
        min-height: auto;
        padding: 110px 5% 4rem;
    }

    .hero-grid {
        padding-top: 0;
        gap: 2.5rem;
    }

    .hero-content { order: 1; }
    .hero-dual-images {
        order: 2;
        height: 360px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .scanlines { opacity: 0.08; }

    header {
        padding: 96px 1rem 3rem;
    }

    section {
        padding: 4rem 1rem;
    }

    .hero-grid { gap: 2rem; }

    .hero-name-title {
        font-size: clamp(2.85rem, 14vw, 3.75rem);
        line-height: 0.9;
        letter-spacing: 1px;
        -webkit-text-stroke-width: 1px;
    }

    .hero-name-title span {
        font-size: 0.78em;
        line-height: 0.95;
    }

    .hero-quote {
        font-size: 1.15rem;
        margin-bottom: 1.5rem;
    }

    .hero-content p {
        padding: 1rem;
        margin-bottom: 1.5rem;
        font-size: 1rem;
    }

    .hero-btns {
        flex-direction: column;
        gap: 0.85rem;
    }

    .bio-btn {
        width: 100%;
        min-height: 48px;
    }

    .bio-btn .armor-top { transform: translateY(-100%); }
    .bio-btn .armor-bottom { transform: translateY(100%); }
    .bio-btn .flesh { opacity: 0.12; }
    .bio-btn.secondary .flesh { opacity: 0; }

    .hero-dual-images { height: 300px; }
    .primary-img { max-width: 180px; }
    .bio-avatar-img { width: 82px; }

    .section-header { margin-bottom: 2rem; }
    .section-title { font-size: clamp(2.1rem, 11vw, 2.8rem); line-height: 1; }
    .section-subtitle { font-size: 1rem; }

    .edu-grid,
    .gallery-grid,
    .projects-grid,
    .media-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.25rem;
    }

    .edu-card,
    .project-content,
    .pub-card {
        padding: 1.25rem;
    }

    .edu-title,
    .project-content h3 { font-size: 1.75rem; }
    .edu-meta { align-items: flex-start; flex-wrap: wrap; }

    .gallery-caption {
        position: static;
        margin-top: 8px;
        font-size: 1rem;
    }

    .mech-image-container { height: 190px; }
    .project-links a { min-height: 44px; width: 100%; }

    .pub-card:hover { transform: none; }
    .media-info h3 { font-size: 1.5rem; }

    .bio-core-section { padding-inline: 1rem; }
    .guyver-core-wrapper { margin-block: -1rem; }

    footer { padding-inline: 1rem; }
    footer h3 { font-size: clamp(2rem, 10vw, 3rem); }
    .social-links { gap: 0.75rem; }
    .social-links a { width: 48px; height: 48px; }
    .footer-copy { line-height: 1.4; }
}

@media (max-width: 420px) {
    nav .logo i { display: none; }
    .hero-dual-images { height: 270px; }
    .primary-img { max-width: 165px; }
    .bio-avatar-img { width: 74px; }
    .memory-window { width: 100%; }
    .footer-stamp { width: 58px; }
    .footer-stamp-wide { width: 88px; }
}

@media (hover: none) {
    .mech-door-top { transform: translateY(-100%); }
    .mech-door-bottom { transform: translateY(100%); }
    .mech-image-container img { filter: grayscale(25%) contrast(115%); }

    .guyver-core-wrapper .armor-plate.armor-top { top: -80px; }
    .guyver-core-wrapper .armor-plate.armor-bottom { bottom: -80px; }
    .guyver-core-wrapper .core-links { opacity: 1; pointer-events: auto; }
    .guyver-core-wrapper .bio-tentacles { opacity: 0.7; }
}

@media (pointer: coarse) {
    body,
    a,
    button,
    .project-card,
    .pub-card,
    .edu-card,
    .guyver-core-wrapper,
    .gallery-item { cursor: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* --- EASTER EGG: PANIC BUTTON (NO PRESIONAR) --- */
.panic-btn {
    position: static;
    margin: 2.5rem auto 0.5rem;
    z-index: 9990;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid #ff1a1a;
    background: radial-gradient(circle at 35% 28%, #ff5a5a, #b30000 52%, #3d0000 100%);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.55), inset 0 0 24px rgba(0, 0, 0, 0.85);
    color: #fff;
    font-family: var(--font-hud);
    line-height: 1.15;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    animation: panicPulse 2.2s ease-in-out infinite;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.panic-btn:hover { transform: scale(1.08); filter: brightness(1.15); }
.panic-btn:active { transform: scale(0.92); }

@keyframes panicPulse {
    0%, 100% { box-shadow: 0 0 14px rgba(255, 0, 0, 0.45), inset 0 0 24px rgba(0, 0, 0, 0.85); }
    50% { box-shadow: 0 0 34px rgba(255, 0, 0, 0.9), inset 0 0 28px rgba(0, 0, 0, 0.9); }
}

.panic-btn::before {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 26, 26, 0.6);
    animation: panicRotate 8s linear infinite;
    pointer-events: none;
}

@keyframes panicRotate { to { transform: rotate(360deg); } }

.panic-led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffd7d7;
    box-shadow: 0 0 8px #fff, 0 0 14px #ff1a1a;
    animation: blink 1s step-end infinite;
}

.panic-label { font-size: 0.82rem; text-align: center; }

/* --- PANIC OVERLAY: TODO SE PONE ROJO --- */
.panic-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9996;
    background: rgba(140, 0, 0, 0.78);
    backdrop-filter: saturate(0) contrast(1.2);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.panic-overlay.active {
    display: flex;
    animation: panicFlicker 0.14s steps(2) infinite;
}

@keyframes panicFlicker { 50% { background-color: rgba(190, 10, 10, 0.7); } }

.panic-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(rgba(0, 0, 0, 0.35) 0 2px, transparent 2px 4px);
    mix-blend-mode: multiply;
}

.panic-panel {
    position: relative;
    z-index: 1;
    width: min(560px, 94vw);
    background: rgba(10, 0, 0, 0.94);
    border: 3px solid #ff1a1a;
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.6), inset 0 0 30px rgba(255, 0, 0, 0.15);
    font-family: var(--font-hud);
    color: #ff5555;
    text-shadow: 0 0 6px rgba(255, 26, 26, 0.8);
}

.panic-titlebar {
    padding: 0.55rem 1rem;
    border-bottom: 2px solid #ff1a1a;
    background: rgba(255, 26, 26, 0.12);
    font-size: 1.05rem;
    letter-spacing: 1px;
    color: #ff8a8a;
}

.panic-body {
    padding: 1.1rem 1.2rem;
    min-height: 220px;
    font-size: 1.06rem;
    line-height: 1.5;
    text-transform: uppercase;
}

.panic-body div { margin-bottom: 2px; }

body.panic-mode { overflow: hidden; }

@media (max-width: 768px) {
    .panic-btn {
        width: 78px;
        height: 78px;
        margin: 2rem auto 0.25rem;
    }
    .panic-label { font-size: 0.7rem; }
}
