/* ===========================
   RESETEO BRUTALISTA
   =========================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #050505;
    --surface: #0a0a0a;
    --border-color: #1a1a1a;
    --text-primary: #c0c0c0;
    --text-secondary: #505050;
    --text-muted: #333333;
    --accent: #0d1a0d;
    --accent-glow: #1a2e1a;
    --white: #e0e0e0;
    --pure-white: #ffffff;
    --terminal-green: #0f1f0f;
    --font-mono: 'Share Tech Mono', monospace;
    --font-sans: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg);
}

body {
    max-width: 100vw;
    overflow-x: hidden;
    font-family: var(--font-sans);
    font-style: normal;
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
}

/* ===========================
   SCANLINES OVERLAY
   =========================== */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

/* ===========================
   TIPOGRAFÍA
   =========================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-mono);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    user-select: none;
    -webkit-user-drag: none;
}

/* ===========================
   MENÚ DE NAVEGACIÓN
   =========================== */
#menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(5, 5, 5, 0.92);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

#menu ul {
    list-style-type: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

#menu ul li a {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.15s ease;
    position: relative;
}

#menu ul li a:hover {
    color: var(--white);
}

#menu ul li a.active {
    color: var(--pure-white);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* ===========================
   HOME
   =========================== */
.home {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: var(--bg);
    padding: 0 20px;
    position: relative;
}

.home-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    width: min(450px, 80vw);
    height: auto;
    filter: brightness(1.1) contrast(1.1);
}

/* Glitch Effect (funcional con texto) */
.glitch-wrapper {
    position: relative;
}

.glitch {
    font-family: var(--font-mono);
    font-size: clamp(1.2rem, 4vw, 2rem);
    color: var(--text-primary);
    letter-spacing: 6px;
    position: relative;
    text-transform: uppercase;
    cursor: default;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.6;
}

.glitch::before {
    color: #0a1a0a;
    z-index: -1;
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.glitch::after {
    color: #1a0a0a;
    z-index: -2;
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch-anim-1 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 1px); }
    40% { transform: translate(2px, -1px); }
    60% { transform: translate(-1px, -1px); }
    80% { transform: translate(1px, 1px); }
}

@keyframes glitch-anim-2 {
    0%, 100% { transform: translate(0); }
    25% { transform: translate(2px, -1px); }
    50% { transform: translate(-1px, 1px); }
    75% { transform: translate(-2px, -1px); }
}

.terminal-prompt {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ===========================
   SECCIÓN SOBRE MÍ
   =========================== */
.sobre {
    margin: 0 8%;
    padding: 80px 20px;
}

.section-title {
    font-family: var(--font-mono);
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    color: var(--pure-white);
    margin-bottom: 3rem;
    letter-spacing: 3px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.textoeimagen {
    display: flex;
    align-items: flex-start;
    gap: 3rem;
    flex-wrap: wrap;
}

.portrait-container {
    flex-shrink: 0;
    position: relative;
}

.portrait {
    max-width: 280px;
    width: 100%;
    height: auto;
    filter: grayscale(30%) contrast(1.2) brightness(0.9);
    border: 2px solid var(--border-color);
    transition: border-color 0.3s ease, filter 0.3s ease;
}

.portrait:hover {
    border-color: var(--text-secondary);
    filter: grayscale(0%) contrast(1.1) brightness(1);
}

.texto {
    flex: 1;
    min-width: 260px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
}

.texto p {
    margin-bottom: 1.2rem;
}

.texto p:last-child {
    margin-bottom: 0;
}

.highlight {
    color: var(--white);
    font-weight: 500;
}

/* Redes sociales */
.redes-sociales {
    margin-top: 3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: flex-start;
}

.btn-redes {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    padding: 8px 0;
    border-bottom: 1px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.btn-redes:hover {
    color: var(--pure-white);
    border-bottom-color: var(--text-secondary);
}

/* ===========================
   GALERÍA
   =========================== */
.galeria {
    margin: 0 8%;
    padding: 80px 20px;
}

.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 2rem;
}

.galeria-item img {
    width: 100%;
    height: auto;
    border: 1px solid #1a1a1a;
    filter: brightness(0.85);
    transition: border-color 0.2s ease, filter 0.2s ease, transform 0.15s ease;
    cursor: pointer;
}

.galeria-item img:hover {
    border-color: var(--text-secondary);
    filter: brightness(1.05);
    transform: scale(1.02);
}

/* ===========================
   VISOR DE OBRA (MODAL)
   =========================== */
.obra-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    justify-content: center;
    align-items: center;
}

.obra-viewer.active {
    display: flex;
}

.obra-viewer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.96);
    cursor: pointer;
}

.obra-viewer-content {
    position: relative;
    width: 90vw;
    max-width: 1100px;
    max-height: 90vh;
    background-color: var(--surface);
    border: 1px solid var(--border-color);
    z-index: 2;
    overflow-y: auto;
    padding: 30px;
}

.obra-viewer-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.obra-imagen-container {
    flex: 1 1 60%;
    min-width: 0;
}

.obra-imagen-container img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    border: 1px solid #1f1f1f;
}

.obra-info {
    flex: 1 1 40%;
    min-width: 220px;
    color: var(--text-secondary);
    font-family: var(--font-sans);
}

.obra-titulo {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    color: var(--pure-white);
    letter-spacing: 2px;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.obra-meta {
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    display: flex;
    gap: 2rem;
}

.meta-label {
    color: var(--text-muted);
    margin-right: 4px;
}

.obra-descripcion {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #888;
}

/* Botón cerrar del viewer */
.obra-viewer-content .close-btn {
    position: absolute;
    top: 12px;
    right: 18px;
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 3;
}

.obra-viewer-content .close-btn:hover {
    color: var(--pure-white);
}

/* ===========================
   VISOR FULLSCREEN
   =========================== */
#fullScreenContainer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.94);
    justify-content: center;
    align-items: center;
    z-index: 10000;
    cursor: pointer;
}

#fullScreenImage {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border: 2px solid #1f1f1f;
    user-select: none;
    -webkit-user-select: none;
}

.close-btn {
    position: absolute;
    top: 25px;
    right: 35px;
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    letter-spacing: 2px;
    transition: color 0.15s ease;
}

.close-btn:hover {
    color: var(--pure-white);
}

/* ===========================
   FOOTER
   =========================== */
footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 20px;
    margin: 0 8%;
}

.footer-block {
    border-left: 2px solid var(--border-color);
    padding-left: 20px;
}

.footertext {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-style: italic;
}

.footer-author {
    margin-top: 8px;
    font-style: normal;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* ===========================
   MEDIA QUERIES
   =========================== */
@media (max-width: 1100px) {
    .sobre,
    .galeria,
    footer {
        margin: 0 5%;
    }
}

@media (max-width: 768px) {
    .textoeimagen {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
    
    .portrait {
        max-width: 70%;
    }
    
    .portrait-container {
        display: flex;
        justify-content: center;
    }

    .section-title {
        text-align: center;
    }

    .redes-sociales {
        justify-content: center;
    }

    #menu ul {
        gap: 1rem;
    }
    
    #menu ul li a {
        font-size: 0.85rem;
    }

    .logo {
        width: min(300px, 70vw);
    }

    /* Ajustes visor obra */
    .obra-viewer-layout {
        flex-direction: column;
        gap: 20px;
    }

    .obra-imagen-container img {
        max-height: 50vh;
    }

    .obra-viewer-content {
        width: 95vw;
        padding: 20px;
    }

    .galeria-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    #menu ul li a {
        font-size: 0.75rem;
        letter-spacing: 0.5px;
    }

    .logo {
        width: 220px;
    }

    .glitch {
        letter-spacing: 3px;
    }

    .portrait {
        max-width: 90%;
    }

    .galeria-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1920px) {
    .logo {
        width: 600px;
    }

    .texto {
        font-size: 1.15rem;
    }

    .btn-redes {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2.2rem;
    }
}
