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

html {
    scroll-behavior: smooth;
}

body {
    width: 100%;
    background-color: #000000;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    color: #ffffff;
}

/* MENÚ SUPERIOR EN PÍLDORA Y TOOLTIP */
.menu-wrapper-fijo {
    position: fixed;
    top: 30px;
    left: 8%;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-pildora-container {
    position: relative;
    background-color: #000000;
    padding: 14px 16px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle {
    width: 28px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.barrita {
    width: 100%;
    height: 2.5px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle.activo .barrita:nth-child(1) {
    transform: translateY(7.75px) rotate(45deg);
}

.menu-toggle.activo .barrita:nth-child(2) {
    opacity: 0;
}

.menu-toggle.activo .barrita:nth-child(3) {
    transform: translateY(-7.75px) rotate(-45deg);
}

.tooltip-menu {
    background: rgba(255, 255, 255, 0.95);
    color: #000000;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    white-space: nowrap;
    animation: desvanecimientoBucle 25s infinite ease-in-out;
    transition: opacity 0.3s ease;
}

.menu-wrapper-fijo:has(.menu-toggle.activo) .tooltip-menu {
    animation: none;
    opacity: 0;
    pointer-events: none;
}

.tooltip-contenido {
    display: flex;
    align-items: center;
    gap: 6px;
    animation: reboteHorizontal 1.2s infinite ease-in-out;
}

.tooltip-menu .flechita {
    font-size: 0.7rem;
    color: #000000;
}

.menu-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    background: #000000;
    padding: 20px 24px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    min-width: 180px;
}

.menu-dropdown.activo {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.menu-navegacion {
    list-style: none;
    text-align: left;
}

.menu-navegacion li {
    margin: 12px 0;
}

.menu-navegacion a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.85;
    transition: opacity 0.2s ease, color 0.2s ease;
    display: block;
}

.menu-navegacion a:hover {
    opacity: 1;
    color: #0071e3;
}

/* ANIMACIÓN ENFOQUE EN SCROLL */
.efecto-enfoque-scroll {
    filter: blur(12px);
    opacity: 0;
    transform: translateY(20px);
    transition: filter 1.2s cubic-bezier(0.25, 1, 0.5, 1), 
                opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1), 
                transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.efecto-enfoque-scroll.enfocado {
    filter: blur(0px);
    opacity: 1;
    transform: translateY(0);
}

/* CABECERA Y SECCIÓN PROYECTOS */
.seccion-cabecera-proyectos {
    width: 100%;
    padding: 140px 8% 40px 8%;
    background-color: #000000;
}

.contenedor-texto {
    max-width: 66vw;
    width: 100%;
}

.titulo-cabecera {
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: -1px;
    color: #0071e3;
    margin-bottom: 20px;
}

.intro-proyectos {
    font-size: 1.2rem;
    font-weight: 300;
    line-height: 1.8;
    color: #d1d1d6;
    text-align: justify;
}

.seccion-lista-proyectos {
    width: 100%;
    padding: 20px 8% 100px 8%;
    background-color: #000000;
}

.contenedor-proyectos {
    max-width: 66vw;
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.tarjeta-proyecto {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 40px;
    align-items: center;
}

/* VISOR CÁMARA E INTERACCIÓN DE AUTOFOCUS */
.visual-proyecto-link {
    text-decoration: none;
    display: block;
}

.visor-camara {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: #050505;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.esquina-visor {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    z-index: 10;
    pointer-events: none;
    transition: border-color 0.3s ease;
}

.esquina-visor.top-left     { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.esquina-visor.top-right    { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.esquina-visor.bottom-left  { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.esquina-visor.bottom-right { bottom: 12px; right: 12px; border-left: none; border-top: none; }

.punto-enfoque-central {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 3px;
    z-index: 10;
    pointer-events: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.exif-tag {
    position: absolute;
    bottom: 12px;
    right: 16px;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    z-index: 10;
    pointer-events: none;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.imagen-autofocus {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(10px) brightness(0.7);
    transform: scale(1.05);
    transition: filter 0.4s ease, transform 0.4s ease;
}

.visual-proyecto-link:hover .imagen-autofocus {
    animation: busquedaAutofoco 1.1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.visual-proyecto-link:hover .visor-camara {
    border-color: rgba(0, 113, 227, 0.6);
    box-shadow: 0 0 20px rgba(0, 113, 227, 0.15);
}

.visual-proyecto-link:hover .punto-enfoque-central {
    border-color: #0071e3;
    background-color: rgba(0, 113, 227, 0.2);
}

.visual-proyecto-link:hover .esquina-visor {
    border-color: rgba(0, 113, 227, 0.8);
}

.visual-proyecto-link:hover .exif-tag {
    color: #0071e3;
}

@keyframes busquedaAutofoco {
    0% {
        filter: blur(10px) brightness(0.7);
        transform: scale(1.05);
    }
    30% {
        filter: blur(2px) brightness(0.95);
        transform: scale(1.01);
    }
    55% {
        filter: blur(8px) brightness(0.8);
        transform: scale(1.03);
    }
    75% {
        filter: blur(1px) brightness(0.98);
        transform: scale(1.005);
    }
    100% {
        filter: blur(0px) brightness(1);
        transform: scale(1);
    }
}

/* INFO DERECHA */
.info-proyecto {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.categoria-proyecto {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #a1a1a6;
    margin-bottom: 10px;
}

.info-proyecto h2 {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.titulo-proyecto-link {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tarjeta-proyecto:hover .titulo-proyecto-link {
    color: #0071e3;
}

.info-proyecto p {
    font-size: 1.05rem;
    font-weight: 300;
    line-height: 1.7;
    color: #d1d1d6;
    text-align: justify;
}

/* ANIMACIONES KEYFRAMES TOOLTIP */
/* CICLO DE 25s: 5s VISIBLE / 20s ESCONDIDO */
@keyframes desvanecimientoBucle {
    0% {
        opacity: 0;
        transform: scale(0.8) translateX(15px);
    }
    4% {
        opacity: 1;
        transform: scale(1) translateX(0); /* Entra y se hace visible a los 1s */
    }
    20% {
        opacity: 1;
        transform: scale(1) translateX(0); /* Permanece visible hasta los 5s */
    }
    24% {
        opacity: 0;
        transform: scale(0.8) translateX(15px); /* Se esconde completamente a los 6s */
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateX(15px); /* Se mantiene oculto durante los 19s restantes (20s en total) */
    }
}

@keyframes reboteHorizontal {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-6px); }
}

/* RESPONSIVE MÓVIL */
@media (max-width: 768px) {
    .contenedor-texto,
    .contenedor-proyectos {
        max-width: 100%;
    }
    .tarjeta-proyecto {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}