html {
    scroll-behavior: smooth;
}

/* --- Reset y Variables Globales --- */
:root {
    --primary-color: #333;
    --secondary-color: #777;
    --background-color: #ffffff;
    --light-gray-color: #f4f4f4;
    --border-color: #ddd;
    --accent-color: #007bff;
}

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

body {
    font-family: 'Lato', sans-serif;
    color: var(--primary-color);
    background-color: var(--background-color);
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    font-weight: 700;
}

h2.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

section {
    padding: 60px 0;
    border-bottom: 1px solid var(--border-color);
}

img {
    max-width: 100%;
    height: auto;
}

a {
    text-decoration: none;
    color: var(--accent-color);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.3s, color 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #555;
}


/* --- Header --- */
.main-header {
    background: var(--background-color);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.main-nav a {
    color: var(--secondary-color);
    font-weight: 400;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: var(--primary-color);
}

/* --- Hero Section --- */

.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-bottom: 80px;

    /* --- FONDO SIMPLE Y DIRECTO --- */
    /* 1. Un color de fondo muy sutil (pero visible) */
    background-color: var(--light-gray-color);
    
    /* 2. La imagen encima, con la ruta más probable */
    background-image: url('/assets/herobg.svg');
    background-size: cover;
    background-position: center center;
}

/* --- logo animado --- */
#mi-logo-contenedor {
    /* * ¡AQUÍ DEFINES EL TAMAÑO!
     * Cambia estos valores de width (ancho) y height (alto) como necesites.
     */
    width: 100%;
    height: 100%;
}

/*
 * Esta regla es CLAVE: hace que el SVG dentro del contenedor
 * ocupe el 100% del espacio disponible (los 300x300px que definimos arriba).
 * De esta forma, el logo siempre se ajustará al tamaño de su contenedor.
*/
#mi-logo-contenedor svg {
    width: 100%;
    height: 100%;
	display: block; /* Asegura que se comporte como un bloque para ocupar el 100% */
}
:root {
    /* ¡OPCIÓN DE VELOCIDAD! Cambia este valor para ajustar la velocidad. */
    --draw-duration: 2.5s;
}

@keyframes draw-line {
    to {
        stroke-dashoffset: 0;
    }
}

/* 1. Marco exterior */
#frame-outer {
    stroke-dasharray: 2416; 
    stroke-dashoffset: 2416;
    animation: draw-line var(--draw-duration) ease-out forwards;
}

/* 2. Marco interior */
#frame-inner {
    stroke-dasharray: 2416;
    stroke-dashoffset: 2416;
    animation: draw-line var(--draw-duration) ease-out forwards;
    animation-delay: 0.5s;
}

/* 3. Letra J */
#letter-j {
    stroke-dasharray: 595;
    stroke-dashoffset: 595;
    animation: draw-line var(--draw-duration) ease-in-out forwards;
    animation-delay: 1s;
}

/* --- ESTILOS PARA LA IMAGEN DE PERFIL EN EL HERO --- */
.hero-profile-image {
    /* 1. TAMAÑO Y CENTRADO DEL CÍRCULO */
    width: 230px;
    height: 230px;
    margin: 0 auto 25px auto; /* Centra el círculo horizontalmente */

    /* 2. ESTILOS DEL CÍRCULO */
    border-radius: 50%;
    overflow: hidden; /* Muy importante para recortar la imagen */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.50); /* Sombra mejorada */
}

.hero-profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Mantiene la imagen cubriendo el espacio */

    /* 1. ESTE ES EL ZOOM: 
       Prueba valores como 1.1 (10% más grande), 1.2 (20%), 1.3 (30%)... */
    /*transform: scale(1.2);
	transform-origin: center bottom;  */ /* FIJAR CENTRO INFERIOR, ALINEACIñÓN INTERNA */

    /* 2. ESTE ES EL ENCUADRE (AJUSTE FINO): 
       Una vez que tengas el zoom que te gusta, ajusta este % para centrar la silueta. */
    object-position: center 30%;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.hero-text {
    flex: 2;
    text-align: left;
}

.hero-text h1 {
    font-size: 2.7rem;
    margin-bottom: 20px;
	text-decoration: underline;
}
.hero-text p {
    color: var(--secondary-color);
    margin-bottom: 15px;
}
.hero-text .small-text {
    font-size: 0.8rem;
    color: #999;
}

.hero-image-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-image-placeholder img {
    border-radius: 8px;
    background-color: #E8E8E8;
}
.hero-links {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--secondary-color);
}
.hero-links a {
    margin: 0 10px;
    color: var(--secondary-color);
}

.scroll-down-arrow {
    position: absolute;
    bottom: 30px;
    left: 50%; /* << AÑADIDO: Mueve el inicio al centro */
    font-size: 1.5rem;
    color: var(--primary-color);
    animation: bounce 2s infinite;
    /* La transformación para el centrado ahora se define DENTRO de la animación */
}

@keyframes bounce {
    /* El translateX(-50%) debe estar en todos los pasos para que no salte */
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-15px);
    }
    60% {
        transform: translateX(-50%) translateY(-8px);
    }
}


/* --- Social Icons --- */
.social-icons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 15px;
}
.social-icons a {
    color: var(--secondary-color);
    font-size: 1.2rem;
}
.social-icons a:hover {
    color: var(--primary-color);
}

/* --- Estudios Section --- */
.studies {
    background-color: var(--light-gray-color);
}
.timeline-horizontal {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 20px 0;
}
.timeline-horizontal::before {
    content: '';
    position: absolute;
    top: 26px; /* Adjust to center with the dot */
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--border-color);
}
.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    width: 18%;
}
.timeline-dot {
    width: 12px;
    height: 12px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    margin-bottom: 15px;
    z-index: 1;
}
.timeline-content h3 {
    font-size: 1rem;
}
.timeline-content p {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

/* --- Experiencia Section --- */
.experience-content {
    display: flex;
    gap: 50px;
}
.skills-column {
    flex: 1;
}
.skills-image {
    margin-top: 20px;
}
.skills-image img {
    border-radius: 8px;
}
.timeline-vertical {
    flex: 2;
    position: relative;
    padding-left: 30px;
}
.timeline-vertical::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 4px;
    width: 2px;
    height: calc(100% - 20px);
    background-color: var(--border-color);
}
.timeline-item-vertical {
    position: relative;
    margin-bottom: 30px;
}
.timeline-item-vertical::before {
    content: '';
    position: absolute;
    top: 8px;
    left: -33px; /* Adjust to center with the line */
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    z-index: 1;
}
.timeline-content-vertical h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}
.timeline-content-vertical .date {
    color: var(--secondary-color);
    font-weight: 400;
    margin-left: 10px;
}
.timeline-content-vertical p {
    color: #666;
}

/* --- Proyectos Section --- */
.projects {
    background-color: var(--light-gray-color);
}
.project-carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}
.project-item {
    text-align: center;
}
.project-item.main {
    flex-grow: 1;
    max-width: 50%;
}
.project-item.main h3 {
    margin-top: 15px;
    font-size: 1.5rem;
}
.project-item.main p {
    color: var(--secondary-color);
    margin: 10px 0;
}
.project-item.side {
    opacity: 0.6;
    transform: scale(0.85);
}
.project-item.side p {
    font-size: 0.9rem;
    margin-top: 5px;
}
.project-item img {
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.arrow {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--secondary-color);
    cursor: pointer;
}
.tags .tag {
    display: inline-block;
    background-color: var(--border-color);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    margin: 5px;
}

/* --- Contacto Section --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    background-color: var(--light-gray-color);
    padding: 40px;
    border-radius: 8px;
}
.contact-info h3, .contact-form-wrapper h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}
.contact-info p {
    margin: 10px 0;
}
.contact-info .social-icons {
    justify-content: flex-start;
}
.map-link {
    display: inline-block;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}
.contact-images {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

.contact-form .form-group {
    margin-bottom: 15px;
}
.contact-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}
.form-group-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    margin-bottom: 20px;
}

/* --- Footer --- */
.main-footer {
    background-color: var(--primary-color);
    color: white;
    padding: 30px 0;
}
.main-footer .container {
    display: flex;
    justify-content: space-around;
    align-items: center;
}
.footer-item {
    text-align: center;
}
.footer-contact p {
    margin-bottom: 10px;
}
.footer-contact .social-icons a {
    color: white;
}
.footer-contact .social-icons a:hover {
    color: #ccc;
}