/* IMPORTAR TU FUENTE DE NOTHING */
@font-face {
    font-family: 'Ndot55';
    src: url('assets/fonts/Ndot55-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}
/* JetBrains Mono - Regular */
@font-face {
    font-family: 'JetBrains Mono';
    src: url('assets/fonts/JetBrainsMono-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* JetBrains Mono - Bold */
@font-face {
    font-family: 'JetBrains Mono';
    src: url('assets/fonts/JetBrainsMono-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}

:root {
    --bg-color: #050505;
    --text-main: #f0f0f0;
    --text-muted: #888888;
    --red-accent: #ff2a2a;
    --grid-color: rgba(255, 255, 255, 0.05);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace; /* <-- Aplicamos JetBrains Mono */
    line-height: 1.6;
    overflow-x: hidden;
    background-image: radial-gradient(var(--grid-color) 1px, transparent 1px);
    background-size: 20px 20px;
}

.nothing-font {
    font-family: 'Ndot55', sans-serif;
    letter-spacing: 2px;
}

.text-red { color: var(--red-accent); }
.text-blue { color: #00e5ff; }
.mt-4 { margin-top: 2rem; }

/* Efecto CRT Scanlines */
.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 3px 100%;
    z-index: 100;
    pointer-events: none;
    opacity: 0.6;
}

.terminal-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    border-bottom: 2px solid var(--red-accent);
    padding-bottom: 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.brand {
    font-size: 2.5rem;
    color: var(--text-main);
    text-transform: uppercase;
}

.sys-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

nav {
    display: flex;
    gap: 10px; /* Reducimos un poco el gap para que quepan mejor en móvil */
    margin-bottom: 40px;
    width: 100%; /* Aseguramos que ocupe todo el ancho disponible */
    justify-content: space-between; /* Distribuye el espacio entre los botones */
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    flex: 1; /* <-- NUEVO: Hace que todos los botones intenten ocupar el mismo ancho */
    text-align: center; /* Centramos el texto dentro del botón */
    border-bottom: 2px solid transparent; /* Efecto visual sutil */
    padding-bottom: 5px;
}

.nav-btn:hover, .nav-btn.active {
    color: var(--red-accent);
    text-shadow: 0 0 10px rgba(255, 42, 42, 0.5);
    border-bottom: 2px solid var(--red-accent); /* Ahora el botón activo tiene una línea debajo */
}

.view {
    display: none;
    animation: fadeIn 0.5s ease;
}

.view.active {
    display: block;
}

/* TERMINAL WINDOW (HOME) LINUX STYLE */
.terminal-window {
    border: 1px solid var(--red-accent);
    background: rgba(10, 10, 10, 0.9);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(255, 42, 42, 0.1);
}

.terminal-header {
    background: var(--red-accent);
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-header .title {
    color: #000;
    font-size: 0.9rem;
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
}

.terminal-header .actions {
    color: #000;
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 2px;
}

.terminal-body {
    padding: 25px;
    min-height: 200px;
    border-top: 1px solid rgba(255, 42, 42, 0.5);
    position: relative; /* Necesario para anclar el fondo */
    z-index: 1; /* Mantiene el texto por encima */
}

.terminal-body::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('assets/samurai-cyberpunk.jpg');
    background-size: 25%;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0; /* Oculto por defecto */
    mix-blend-mode: screen;
    z-index: -1;
    pointer-events: none;
}

/* Clase que inyecta el JS para disparar la animación */
.terminal-body.show-bg-glitch::before {
    /* Alargamos un poco la animación a 0.8s para que el efecto de aparición se aprecie mejor */
    animation: bg-glitch-reveal 0.8s linear forwards;
}

/* Animación: Aparición por fragmentos horizontales (clip-path) y parpadeos de opacidad */
@keyframes bg-glitch-reveal {
    0% {
        opacity: 0;
        clip-path: inset(50% 0 50% 0);
    }
    10% {
        opacity: 0.1;
        clip-path: inset(10% 0 80% 0);
        transform: translateX(-2px);
    }
    20% {
        opacity: 0.2;
        clip-path: inset(70% 0 10% 0);
        transform: translateX(2px);
    }
    30% {
        opacity: 0;
        clip-path: inset(50% 0 50% 0);
        transform: translateX(0);
    }
    40% {
        opacity: 0.15;
        clip-path: inset(20% 0 50% 0);
    }
    50% {
        opacity: 0.25;
        clip-path: inset(0% 0 0% 0); /* Muestra la imagen completa un instante */
        transform: translateX(-1px);
    }
    60% {
        opacity: 0.05;
        clip-path: inset(60% 0 20% 0);
    }
    70% {
        opacity: 0.15;
        clip-path: inset(0% 0 0% 0);
        transform: translateX(1px);
    }
    80% {
        opacity: 0.05;
        clip-path: inset(30% 0 40% 0);
    }
    90% {
        opacity: 0.2;
        clip-path: inset(0% 0 0% 0);
    }
    100% {
        opacity: 0.15; /* Se estabiliza en la opacidad final */
        clip-path: inset(0 0 0 0); /* Imagen completamente visible */
        transform: translateX(0);
        filter: none;
    }
}

.cli-prompt {
    margin-top: 20px;
}
.hidden { display: none !important; }
.blink { animation: blinker 1s step-start infinite; }
@keyframes blinker { 50% { opacity: 0; } }

/* ABOUT SECTION */
.about-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
}

.avatar-container {
    position: relative;
    border: 1px solid var(--text-muted);
    padding: 10px;
}

.avatar {
    width: 100%;
    height: auto;
    display: block;
}

.img-overlay {
    position: absolute;
    top: 10px; left: 10px; right: 10px; bottom: 10px;
    background-image: radial-gradient(rgba(0,0,0,0.5) 1px, transparent 1px);
    background-size: 4px 4px;
    pointer-events: none;
}

/* TERMINAL TABLE */
.skills-container {
    margin-top: 2rem;
}

.terminal-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9rem;
    border: 1px solid #333;
}
.terminal-table th, .terminal-table td {
    border-bottom: 1px solid #222;
    padding: 12px;
    text-align: left;
}
.terminal-table th {
    color: var(--red-accent);
    font-family: 'JetBrains Mono', sans-serif;
    letter-spacing: 1px;
    background: rgba(255, 42, 42, 0.05);
    border-bottom: 1px solid var(--red-accent);
    font-size: 1.2rem;
}
.terminal-table tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}
.terminal-table code {
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 8px;
    border-radius: 2px;
    color: #ffbd2e;
    font-size: 0.85rem;
}

/* PROJECT SECTION */
.project-card {
    border: 1px solid #333;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: border-color 0.3s ease;
}
.project-card:hover { border-color: var(--red-accent); }

.icon-svg {
    width: 50px;
    height: 50px;
    filter: invert(1);
}

.status {
    color: var(--red-accent);
    font-size: 0.8rem;
    display: block;
    margin-top: 10px;
}

/* CONTACT SECTION */
.contact-links {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.contact-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.5rem;
    border-left: 3px solid transparent;
    padding-left: 10px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.contact-links a i {
    font-size: 1.2rem;
    width: 30px;
    text-align: center;
}
.contact-links a:hover {
    border-left: 3px solid var(--red-accent);
    color: var(--red-accent);
}

/* ANIMACIONES */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.glitch { position: relative; }
.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-color);
}
.glitch::before {
    left: 2px;
    text-shadow: -1px 0 red;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}
.glitch::after {
    left: -2px;
    text-shadow: -1px 0 blue;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(10px, 9999px, 31px, 0); }
    5% { clip: rect(70px, 9999px, 73px, 0); }
    10% { clip: rect(23px, 9999px, 98px, 0); }
    15% { clip: rect(8px, 9999px, 12px, 0); }
    20% { clip: rect(50px, 9999px, 20px, 0); }
    100% { clip: rect(10px, 9999px, 31px, 0); }
}

@media (max-width: 768px) {
    .about-grid { grid-template-columns: 1fr; }
    header { flex-direction: column; align-items: flex-start; gap: 10px;}
    nav { flex-wrap: wrap; }
}

/* =========================================
 *  CYBERPUNK 2077 MUGSHOT (FICHA POLICIAL)
 *  ========================================= */
/* 1. Añadimos padding al contenedor para que el borde rojo envuelva al header */
.mugshot-container {
    border: 2px solid var(--red-accent);
    background: #0a0a0a;
    position: relative;
    font-family: 'Courier New', Courier, monospace;
    box-shadow: 4px 4px 0px rgba(255, 42, 42, 0.3);
    height: fit-content;
    padding: 5px; /* <-- NUEVO: Margen interior */
}

/* 2. Añadimos un pequeño margen inferior para separarlo de la foto */
.mugshot-header {
    background: #00e5ff;
    color: #050505;
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 0.85rem;
    letter-spacing: 1px;
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
    margin-bottom: 5px; /* <-- NUEVO: Separación con la imagen */
}

/* 3. Forzamos a que la imagen ocupe el mismo ancho que el texto superior */
.pet-container {
    width: 100%; /* <-- NUEVO: Ocupa todo el ancho disponible */
    max-width: 100%;
    margin-top: 25px;
    border: 1px solid var(--red-accent); /* Aseguramos que el borde sea visible */
}

.mugshot-image-wrapper {
    position: relative;
    padding: 10px;
    border-bottom: 2px solid var(--red-accent);
    overflow: hidden;
}

/* Filtro para dar aspecto de cámara de seguridad térmica/sintética */
.cp-filter {
    filter: contrast(130%) saturate(80%) sepia(30%) hue-rotate(320deg) brightness(90%);
}

/* Brackets de apuntado estilo UI Cyberpunk */
.cp-ui-brackets::before, .cp-ui-brackets::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    border: 3px solid #00e5ff;
    z-index: 2;
}
.cp-ui-brackets::before {
    top: 20px; left: 20px;
    border-right: none; border-bottom: none;
}
.cp-ui-brackets::after {
    bottom: 20px; right: 20px;
    border-left: none; border-top: none;
}

/* Línea de escaneo láser */
.scanner-line {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 2px;
    background: rgba(0, 229, 255, 0.5);
    box-shadow: 0 0 10px #00e5ff;
    animation: scan 4s linear infinite;
    z-index: 3;
}

@keyframes scan {
    0% { top: 10%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 90%; opacity: 0; }
}

.mugshot-footer {
    padding: 15px;
    font-size: 0.85rem;
}

.mugshot-footer .stat {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed #333;
    margin-bottom: 8px;
    padding-bottom: 2px;
}

.mugshot-footer .stat span:first-child {
    color: var(--text-muted);
}

.mugshot-footer .stat span:last-child {
    color: #00e5ff; /* Cyan accent */
    font-weight: bold;
}

.mugshot-footer .stat span.text-red {
    color: var(--red-accent);
}

.barcode {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    letter-spacing: -3px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 15px;
    transform: scaleY(1.5);
}
