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

/* VARIABLES */
:root {
    --color-secundario: #1e293b;
    --color-principal: #2563eb;
    --color-fondo: #dee8f3;
    --color-blanco: #ffffff;
    --color-gris: #9cafc9;
}

html {
    scroll-behavior: smooth;
}

/* BODY */
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--color-blanco);
    color: var(--color-secundario);
    line-height: 1.6;
}

/* HEADER */
header {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--color-secundario);
    color: var(--color-blanco);
}

header h1 {
    font-weight: 700;
    letter-spacing: 1px;
}

/* NAV */
nav {
    border-bottom: 1px solid #e2e8f0;
    background: var(--color-gris);
}

nav ul {
    display: flex;
    justify-content: center;
    gap: 2rem;
    list-style: none;
    padding: 1rem;
}

nav a {
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s;
    color: var(--color-secundario);
}

/* ANIMACIÓN SUBRAYADO */
nav a::after {
    content: "";
    position: absolute;
    width: 0%;
    height: 2px;
    background: var(--color-blanco);
    left: 0;
    bottom: -5px;
    transition: width 0.3s;
}

nav a:hover {
    color: var(--color-blanco);
}

nav a:hover::after {
    width: 100%;
}

/* SECCIONES */
section {
    max-width: 1000px;
    margin: auto;
    padding: 4rem 1.5rem;
}

section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    text-align: center;
}

/* SOBRE MI */
#sobre-mi {
    text-align: center;
}

#sobre-mi img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin: 1rem 0;
    object-fit: cover;
    border: 3px solid var(--color-principal);
}

/* TARJETAS */
.contenedor-tarjetas {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.tarjeta {
    background: var(--color-blanco);
    width: 280px;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.tarjeta img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.tarjeta h3 {
    margin: 1rem;
}

.tarjeta p {
    margin: 0 1rem 1.5rem;
    color: var(--color-gris);
}

/* HOVER*/
.tarjeta:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* HABILIDADES */
#habilidades ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#habilidades li {
    background: var(--color-blanco);
    padding: 1rem;
    border-radius: 0.7rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
}

/* FORMULARIO */
#contacto p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    text-align: center;
}

form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    align-items: center;
}

form input {
    width: 100%;
    max-width: 400px;
    padding: 0.8rem;
    border-radius: 0.5rem;
    border: 1px solid #cbd5f5;
    outline: none;
    transition: border 0.3s, box-shadow 0.3s;
}

/* FOCUS*/
form input:focus {
    border: 1px solid var(--color-principal);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* BOTÓN */
form button {
    width: 100%;
    max-width: 400px;
    padding: 0.9rem;
    border: none;
    border-radius: 0.5rem;
    background: var(--color-principal);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

/* HOVER BOTÓN */
form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

/* PELÍCULAS */
.contenedor-peliculas {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center; 
}

.pelicula {
    background: var(--color-blanco);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    max-width: 300px;
    margin: auto; 
    width: 280px; 
}

.pelicula img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    object-position: center top;
}

.pelicula img {
    width: 100%;
    aspect-ratio: 2 / 3; /* 👈 formato póster */
    object-fit: cover;
    border-radius: 0.5rem 0.5rem 0 0;
}

.pelicula h3 {
    margin: 1rem;
}

.pelicula p {
    margin: 0 1rem 1.5rem;
    color: var(--color-gris);
}

/* HOVER */
.pelicula img {
    transition: transform 0.4s ease;
}

.pelicula:hover img {
    transform: scale(1.05);
}

/* FOOTER */
footer {
    text-align: center;
    padding: 2rem;
    background: var(--color-secundario);
    color: var(--color-blanco);
    margin-top: 2rem;
}

/* CONTENEDOR REDES */
.redes {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

/* ICONOS */
.redes a {
    color: white;
    font-size: 1.5rem;
    transition: transform 0.3s, color 0.3s;
}

/* HOVER ICONOS */
.redes a:hover {
    color: var(--color-principal);
    transform: translateY(-5px) scale(1.1);
}

/* RESPONSIVE */
@media (max-width: 768px) {

    nav ul {
        flex-direction: column;
        gap: 1rem;
    }

    section {
        padding: 2.5rem 1rem;
    }

    .tarjeta {
        width: 90%;
    }

    .pelicula {
        width: 90%;
    }
}

