@import url('https://fonts.googleapis.com/css2?family=Chonburi&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Chonburi&family=Oranienbaum&display=swap');

/* Ajuste global para evitar desbordamientos */
body, .main {
    overflow-x: hidden; /* Evita el scroll horizontal en móviles */
    width: 100%;
}

/* Forzamos que las tarjetas sean fluidas y se centren */
.card {
    width: 95% !important; /* Margen pequeño a los lados en móvil */
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Ajuste para pantallas extra pequeñas (menos de 400px) */
@media (max-width: 767px) {
    /* 1. Eliminamos la imagen por completo del flujo */
    .imagenPrincipal {
        display: none !important;
    }

    /* 2. Forzamos a que el contenedor sea de una sola columna */
    .headline {
        display: block !important; /* Cambiamos de grid a block */
        width: 100vw;
    }

    /* 3. Centramos el contenido de datos */
    .datos {
        width: 100% !important;
        padding: 0;
        margin: 0;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .secciones{
        display: flex;
        width: 90%;
    }

    .datos h1{
        font-size: 10vh !important;
    }
    .datos h3{
        font-size: 4.5vh !important;
    }
    #sobreMi h1 {
        font-size: 6vh !important; 
    }
    #educacion h1 {
        font-size: 6vh !important; 
    }
    #contacto h2 {
        font-size: 3.5vh !important; 
    }
}

/* Ajuste de los títulos grandes para móvil */
@media (max-width: 768px) {
    #sobreMi h1, #educacion h1 {
        font-size: 15vw; /* Tamaño dinámico basado en el ancho del celular */
        text-align: center;
        margin-top: 2rem;
    }
    
    .descripcion-personal {
        font-size: 1rem;
        padding: 0 15px;
    }

    .imagenEmpresa {
        max-width: 150px; /* Que el logo no sea gigante en el celular */
    }
}

/* Contenedor de píldoras para que no se corten */
.card-body {
    display: flex;
    flex-direction: column;
}

#pildoras-container {
    display: flex;
    flex-wrap: wrap; /* Permite que salten de línea si no caben */
    gap: 8px; /* Espacio uniforme entre ellas */
    justify-content: flex-start; /* Alineadas a la izquierda */
    margin-top: 10px;
}

@media (min-width: 768px) {
    #pildoras-container {
        justify-content: flex-start; /* Alineadas a la izquierda en PC */
    }
}

/* Solo para celulares (pantallas menores a 768px) */
@media (max-width: 768px) {
    .datos h1 {
        font-size: 8vh; 
    }
}
/* --- RESPONSIVIDAD GENERAL --- */

/* Ajuste para Tablets y Laptops pequeñas */
@media (max-width: 992px) {
    .headline {
        grid-template-columns: 1fr; /* Apila el texto sobre la imagen */
    }

    .imagenPrincipal {
        height: 40vh; /* La imagen no ocupa todo el alto en móvil */
        background-image: 
            linear-gradient(to bottom, rgba(0,0,0,1) 0%, transparent 30%),
            linear-gradient(to top, rgba(0,0,0,1) 0%, transparent 30%), 
            url(../img/FotoUno.png);
    }

    .datos {
        padding: 40px 20px;
    }

    #sobreMi h1, #educacion h1 {
        font-size: 8vh;
        text-align: center;
    }
}

/* Ajuste específico para Celulares */
@media (max-width: 576px) {
    .datos h1 {
        font-size: 12vw; /* Nombre fluido según el ancho del cel */
    }

    .card-body {
        text-align: center; /* Centra el texto en móvil para mejor balance */
    }

    .pildora {
        display: inline-block; /* Evita que se estiren al 100% de la tarjeta */
        width: fit-content;
        font-size: 0.75rem;
        padding: 4px 10px;
        margin: 3px;
    }

    .contact-container {
        flex-direction: column;
        gap: 10px;
    }

    .glow-on-hover, .contact-link {
        width: 100%; /* Botones fáciles de tocar con el pulgar */
        max-width: 280px;
    }

    [popover] {
        width: 90%; /* El popover ocupa casi todo el ancho en móvil */
        min-width: auto;
    }
}

/* Mejora para que las imágenes de empresa no se deformen */
.imagenEmpresa {
    width: 100%;
    aspect-ratio: 1 / 1; /* Mantiene un cuadrado perfecto, o usa 16/9 según prefieras */
    object-fit: contain; /* Asegura que la imagen quepa sin estirarse */
    background-color: transparent; /* Opcional: fondo para que no se vea vacío si la imagen es pequeña */
}

@media (min-width: 768px) {
    .imagenEmpresa {
        max-width: 100%; /* Tamaño completo en PC */
    }
}

/* Asegura que el contenedor no fuerce a las píldoras a estirarse */
#pildoras-container {
    display: flex;
    flex-wrap: wrap;       /* Permite que salten de línea */
    gap: 8px;              /* Espacio uniforme entre ellas */
    justify-content: flex-start; /* Alineadas a la izquierda */
    margin-top: 15px;      /* Separación del texto superior */
}

/* Ajuste individual de la píldora */
.pildora {
    display: inline-block;
    width: fit-content;    /* Solo ocupan el ancho de su texto */
    padding: 5px 15px;
    border: 1px solid #cccccc;
    border-radius: 50px;
    font-size: 0.9rem;
    color: #444;
    background-color: transparent;
    margin: 0;             /* El espacio lo da el 'gap' del contenedor */
    transition: all 0.3s ease;
}

/* Centrado automático en celulares para todas las secciones */
@media (max-width: 768px) {
    #pildoras-container {
        justify-content: center; /* Se centran en móvil como en tu captura de Educación */
    }
}

* {
    margin: 0%;
    padding: 0%;
}

.main{
    height: 100%;
    background-color: black;
}

.headline{
    display: grid;
    grid-template-columns: 3fr 1fr;
}

.datos{
    text-align: center;
    align-content: center;
    color: aliceblue;
}

.datos h1{
    font-size: clamp(2.5rem, 10vw, 8rem);
    font-family: "Chonburi", serif;
    font-weight: 400;
    font-style: normal;
    font-size: 14vh;
}

.datos h3{
    font-family: "Chonburi", serif;
    font-weight: 400;
    font-style: normal;
    font-size: 5vh;
}

.imagenPrincipal{
    background-image: 
        linear-gradient(to right, rgba(0,0,0,1) 0%, transparent 40%),
        linear-gradient(to left, rgba(0,0,0,1) 0%, transparent 40%), 
        url(../img/FotoUno.png);
    
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    height: 100vh;
}

/* Efecto Glow Botones */
.glow-on-hover {
    width: 220px;
    height: 50px;
    border: none;
    outline: none;
    color: #a4a4a4;
    background: #000000;
    cursor: pointer;
    position: relative;
    z-index: 0;
    border-radius: 10px;
}

.glow-on-hover:before {
    content: '';
    background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    position: absolute;
    top: -2px;
    left:-2px;
    background-size: 400%;
    z-index: -1;
    filter: blur(5px);
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    animation: glowing 20s linear infinite;
    opacity: 0;
    transition: opacity .3s ease-in-out;
    border-radius: 10px;
}

.glow-on-hover:active { color: #000; }
.glow-on-hover:active:after { background: transparent; }
.glow-on-hover:hover:before { opacity: 1; }

.glow-on-hover:after {
    z-index: -1;
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: #000000;
    left: 0;
    top: 0;
    border-radius: 10px;
}

@keyframes glowing {
    0% { background-position: 0 0; }
    50% { background-position: 400% 0; }
    100% { background-position: 0 0; }
}

#sobreMi{ margin: 5vh; }

.descripcion-personal {
    color: #bbb;
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 4vh;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    padding: 0 5%; 
    text-wrap: balance; 
}

.card{
    max-width: 100% !important;
    border: none;
}

.imagenEmpresa{
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: 100%;
}

/* Estilo de Píldoras (Versión Limpia) */
.pildora {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 5px;
    text-decoration: none;
    color: #444444; 
    border: 1px solid #cccccc; 
    background-color: transparent;
    transition: all 0.4s ease;
    margin-bottom: 8px;
}

.pildora:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateY(-2px); 
    color: #000000; 
    border-color: #000000;
}

#sobreMi h1, #educacion h1 {
    font-family: "Chonburi", serif;
    font-weight: 400;
    font-style: normal;
    font-size: 10vh;
}

#educacion{ margin: 5vh; }
.universidad{ align-content: center; }
h1{ color: #ffffff; }

/* Footer */
footer {
    background-color: #000;
    color: #fff;
    padding: 60px 20px 20px;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

footer h2 { font-size: 2rem; margin-bottom: 10px; font-weight: 700; }
footer p { color: #bbb; margin-bottom: 30px; }

.contact-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    align-content: center;
}

.contact-link {
    color: #fff;
    background-color: #000;
    text-decoration: none;
    border: 1px solid #333;
    padding: 10px 20px;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.contact-link:hover {
    background-color: #fff;
    color: #000;
}

.secondary-links { margin-bottom: 30px; }
.secondary-links a {
    color: #888;
    text-decoration: none;
    margin: 0 15px;
    font-size: 0.85rem;
    transition: color 0.3s;
}
.secondary-links a:hover { color: #fff; }

.copyright {
    font-size: 0.75rem;
    color: #555;
    border-top: 1px solid #222;
    padding-top: 20px;
}

/* Transiciones de Logos */
.transition {
    width: 100%; 
    height: 100%; 
    transition: transform 0.4s ease-in-out, filter 0.3s, content 0.3s ease;
    object-fit: cover; 
    object-position: center; 
}

.imagenEmpresa:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
    cursor: pointer;
}

.ntt:hover { content: url('../img/ntt2.png'); }
.apinterfaces:hover { content: url("../img/apinterfaces2.jpg"); }
.coppel:hover { content: url('../img/coppel2.jpg'); }

/* Popover Contacto */
#contact-trigger { anchor-name: --contact-anchor; }

[popover] {
  position-anchor: --contact-anchor;
  position-area: top span-all;
  position-try-fallbacks: flip-block;
  margin-bottom: 10px;
  border: 1px solid #000;
  background: #fff;
  padding: 15px;
  text-align: center;
  min-width: 180px;
  border-radius: 5px;
  outline: none;
}

[popover]:popover-open { animation: fade-in 0.3s ease-out; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ws-button {
  display: block;
  background: #000;
  color: #fff;
  text-decoration: none;
  padding: 8px 12px;
  font-size: 0.8rem;
  text-transform: uppercase;
  transition: opacity 0.3s;
  border-radius: 5px;
}

.phone-number {
  font-weight: bold;
  margin-bottom: 10px;
  color: #000;
  font-size: 1.1rem;
}

.ws-button:hover {
  background-color: #25D366;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

/* --- OPTIMIZACIÓN DE QA: PRECARGA DE IMÁGENES --- */
body::after {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    z-index: -1;
    content: 
        url('../img/ntt2.png') 
        url('../img/apinterfaces2.jpg') 
        url('../img/coppel2.jpg');
    display: inline-block;
}

/* --- EFECTO FADE-IN AL SCROLL --- */

/* Estado inicial: oculto y un poco más abajo */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    visibility: hidden;
}

/* Estado cuando la sección entra en el campo de visión */
.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}