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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    padding: 1em;
    line-height: 1.5;
    overflow-x: hidden;
}

body.menu-open {
    overflow: hidden;
}

body::-webkit-scrollbar {
    display: none;
}

/* TIPOGRAFÍA */

h1 {
    font-size: 2.75rem;
    margin-bottom: 0.5em;
    line-height: 1.4;
    color: #fff;
}

.subtitulo {
    margin-top: 4px;
    display: block;
    font-size: 1.1rem;
}

h1 .subtitulo {
    display: block;
    font-size: 1.25rem;
    font-weight: normal;
    color: #ffffff;
    opacity: 0.9;
    margin-top: 0.2em;
}

.parrafo-container {
    margin-bottom: 1.25em;
    font-size: 1.25rem;
    line-height: 1.5;
    color: #e0e0e0;
}

/* NAVEGACIÓN */
nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5em 3em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: Arial, Helvetica, sans-serif;
    position: relative;
}

nav .logo {
    font-weight: bolder;
    font-size: 1.6rem;
    color: #FFF;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    display: flex;
    user-select: none;
}

/* NUEVO ESTILO PARA EL MENÚ HAMBURGUESA */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
    z-index: 1000;
    width: 40px;
    height: 40px;
    touch-action: manipulation;
}

.linea {
    display: block;
    width: 28px;
    height: 3px;
    background-color: #fff;
    transition: transform 0.4s ease, opacity 0.4s ease;
    position: relative;
}

.linea:first-child {
    margin-bottom: 6px;
}

.hamburger.active .linea:first-child {
    transform: translateY(0) rotate(45deg);
}

.hamburger.active .linea:last-child {
    transform: translateY(-9px) rotate(-45deg);
}

/* Desktop */
.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 1rem;
    font-size: 20px;
}

.nav-menu a {
    text-transform: uppercase;
    color: #ffffff;
    padding: 0.3em 0.9em;
    border-radius: 1.25em;
    transition: background-color 0.3s ease, opacity 0.3s ease-in-out;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-menu a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    opacity: 1;
    border-color: #b5b5b573;
}

/* Overlay para fondo oscuro */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* CONTENEDORES GENERALES */
header,
section {
    max-width: 85em;
    margin: 2em auto;
    padding: 2em 3em;
    background-color: #1e1e1e;
    border-radius: 0.75em;
    transition: background-color 0.3s ease;
}

.flex-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 3em;
    margin-top: 3em;
}

header img {
    max-width: 100%;
    width: 220px;
    height: 220px;
    border-radius: 0.75em;
    object-fit: cover;
    object-position: bottom;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.text-container {
    flex: 1;
    color: #e0e0e0;
}

/* BOTONES */
/* Botón CV */
.btn-cv {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: #FFF;
    color: #121212;
    padding: 0.6em 4.2em;
    border-radius: 1.25em;
    font-weight: bold;
    min-width: 6rem;
    height: 2.2rem;
    overflow: hidden;
    font-size: 1.2rem;
    border: 1px solid rgba(128, 128, 128, 0.1);
    transition: background 0.3s ease, transform 0.2s ease;
    cursor: pointer;
}

/* Hover */
.btn-cv:hover {
    background: #FFF;
}

/* Animación texto e icono */
.btn-cv .btn-text,
.btn-cv .btn-icon {
    position: absolute;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.btn-icon img {
    width: 1.2em;
    height: 1.2em;
    display: inline-block;
    vertical-align: middle;
}

.btn-cv .btn-text {
    transform: translateY(0);
}

.btn-cv .btn-icon {
    transform: translateY(100%);
    opacity: 0;
}

.btn-cv:hover .btn-text {
    transform: translateY(-100%);
    opacity: 0;
}

.btn-cv:hover .btn-icon {
    transform: translateY(0);
    opacity: 1;
}

/* Botón GitHub */
.btn-github {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.6em 1.2em;
    min-width: 5rem;
    border-radius: 1.25em;
    font-weight: bold;
    overflow: hidden;
    min-width: 6rem;
    height: 2.2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-github .btn-text,
.btn-github .btn-icon {
    position: absolute;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-github .btn-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-github .btn-icon img {
    filter: brightness(0) invert(1);
}

.btn-github .btn-text {
    transform: translateY(0);
}

.btn-github .btn-icon {
    transform: translateY(100%);
    opacity: 0;
}

.btn-github:hover .btn-text {
    transform: translateY(-100%);
    opacity: 0;
}

.btn-github:hover {
    background: rgba(0, 0, 0, 0.75);
    /* más contraste */
}

.btn-github:hover .btn-icon {
    transform: translateY(0);
    opacity: 1;
}

.btn-github .btn-icon svg {
    width: 22px;
    height: 22px;
    display: block;
    margin: 0 auto;
}


/* SECCIÓN PROYECTOS */
#proyectos {
    padding: 4em 2em;
    background-color: #1e1e1e;
}

#proyectos .skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1em;
    max-width: 1250px;
    margin: 0 auto;
}

#proyectos .skill-card {
    background-color: #252525;
    border-radius: 1.25em;
    padding: 2em;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(128, 128, 128, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

#proyectos .skill-card:hover {
    border-color: #b5b5b580;
    background: #b5b5b510;
}

#proyectos .card-content h3 {
    font-size: 1.4em;
    text-transform: capitalize;
    margin-bottom: 0.8em;
    color: #ffffff;
}

h1,
.parrafo-container {
    text-wrap: balance;
    word-break: break-word;
}

#proyectos .card-content p {
    font-size: 1.2em;
    color: #cecece;
    line-height: 1.4;
    margin: 0;
}

#proyectos .card-links {
    margin-top: auto;
    display: flex;
    gap: 0.9em;
}

#proyectos .card-links a:first-child {
    margin-top: auto;
    display: flex;
    gap: 0.8em;
    color: #121212;
    background-color: #e0e0e0;
}

#proyectos .card-links a:last-child {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#proyectos .card-links a:last-child:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: #b5b5b580;
}

/* Estilos para la sección de tecnologías dentro de cada tarjeta de proyecto */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    margin-bottom: 20px;
}

.tech-stack span {
    /* Nuevo estilo para que las tecnologías resalten */
    background-color: #444444;
    color: #e0e0e0;
    padding: 3px 7px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Efecto hover opcional para una mejor interacción */
.tech-stack span:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

/* HTML */
.tech-stack .html {
    background-color: #e44d26;
    color: #ffffff;
}

/* CSS */
.tech-stack .css {
    background-color: #1572b6;
    color: #ffffff;
}

/* JavaScript */
.tech-stack .javascript {
    background-color: #f0db4f;
    color: #1a1a1a;
}

/* API Wikipedia */
.tech-stack .api-wikipedia {
    background-color: #5a5a5a;
    color: #e0e0e0;
}

/* Tarjeta "Próximamente" */
.coming-soon-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.coming-soon-card .coming-soon-icon {
    font-size: 2.5rem;
    margin-bottom: 1em;
    color: #e0e0e0;
}

/* HABILIDADES */
.habilidades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1.1em;
    justify-items: center;
    user-select: none;
}

.habilidad-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.2em 0.8em;
    border-radius: 1.25em;
    width: 100%;
    max-width: 150px;
    transition: transform 0.2s ease, background-color 0.3s ease, border-color 0.3s ease;
    border: 1px solid rgba(128, 128, 128, 0.1);
    background-color: #252525;
}

.habilidad-card:hover {
    background-color: rgba(255, 255, 255, 0.10);
    border-color: #b5b5b573;
}

.habilidad-card svg {
    width: 3em;
    height: 3em;
    object-fit: contain;
    margin-bottom: 0.7em;
}

.habilidad-card img {
    width: 1.8em;
    height: 1.8em;

    margin-bottom: 0.7em;
}

.habilidad-card p {
    font-size: 1.3em;
    color: #ffffff;
    margin: 0;
}

/* Estilos para las tarjetas bloqueadas */
.habilidad-card.locked {
    filter: blur(1px);
    cursor: not-allowed;
    position: relative;
    overflow: hidden;
}

/* Capa de superposición para el efecto borroso */
.locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    z-index: 10;
    border-radius: 1.25em;
    padding: 0.5em;
}

/* Estilo del ícono de candado en la esquina */
.locked-icon-corner {
    width: 1.2em;
    height: 1.2em;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

/* FOOTER */
footer {
    background-color: #1e1e1e;
    text-align: center;
    color: #dcdcdc;
    border-radius: 1.25em;
    max-width: 85em;
    margin: 2em auto;
    padding: 2em 3em;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.social-links {
    margin-top: 0.5em;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.35em;
}

.social-links a {
    font-size: 1.1em;
    font-weight: 500;
    padding: 0.4em 0.8em;
    border-radius: 1.25em;
    text-decoration: none;
    transition: background-color 0.25s ease, transform 0.3s ease;
    color: #ffffff;
    border: 1px solid rgba(128, 128, 128, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5em;
}

/* Estilos de hover para todos los enlaces sociales */
.social-links a:hover {
    background-color: rgba(255, 255, 255, 0.10);
    border-color: #b5b5b573;
}

.btn-icon-footer {
    width: 25px;
    height: 25px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* MEDIA QUERIES */

/* Tablet y móviles en landscape: hasta 1024px */
@media screen and (max-width: 1024px) {
    body::-webkit-scrollbar {
        display: none;
    }

    nav {
        padding: 1.5em 2em;
    }

    header,
    section {
        padding: 2em 2em;
    }

    .flex-container {
        gap: 2em;
    }

    .text-container {
        min-width: 100%;
    }

    header img {
        width: 200px;
        height: 200px;
        margin: auto;
    }

    h1 {
        font-size: 2.5rem;
    }

    .parrafo-container {
        font-size: 1.1rem;
        text-wrap: balance;
    }

    .hamburger {
        display: flex;
        z-index: 1000;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: #252525;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 2em;
        z-index: 999;
        transition: right 0.5s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        display: flex;
    }

    .nav-menu.active {
        right: 0;
        background-color: #252525;
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
        margin-bottom: 1.5em;
    }

    .nav-menu a {
        display: block;
        padding: 0.8em;
        font-size: 1.2rem;
        width: 100%;
    }
}

/* Móviles grandes: 481px a 767px */
@media screen and (max-width: 767px) {
    body {
        padding: 0.5em;
    }

    nav {
        padding: 1em;
    }

    header,
    section {
        padding: 1.5em 1em;
        margin: 1em auto;
        border-radius: 1.25em;
    }

    .flex-container {
        flex-direction: column;
        text-align: left;
        margin-top: 1.5em;
        gap: 1.5em;
    }

    h1 {
        font-size: 2.2rem;
    }

    h1 .subtitulo {
        font-size: 1.1rem;
    }

    .parrafo-container {
        text-wrap: balance;
    }

    #proyectos .skills-grid {
        grid-template-columns: 1fr;
    }

    .habilidades-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8em;
    }

    .habilidad-card {
        padding: 1em 0.5em;
        max-width: none;
    }

    .habilidad-card img {
        width: 40px;
        height: 40px;
    }

    .habilidad-card p {
        font-size: 1rem;
    }

    footer {
        padding: 1.5em 1em;
        margin-top: 2em;
    }

    .social-links {
        flex-direction: row;
    }

    .social-links a {
        display: inline-flex;
        padding: 0.4em 0.8em;
    }
}

/* Móviles pequeños: 320px a 480px */
@media screen and (max-width: 480px) {
    nav .logo {
        font-size: 1.3em;
    }

    h1 {
        font-size: 2rem;
    }

    .btn-cv,
    .btn-github {
        justify-content: center;
    }

    #proyectos .card-links {
        flex-direction: column;
    }

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

    .habilidad-card img {
        width: 35px;
        height: 35px;
    }

    .nav-menu {
        width: 85%;
    }
}