/* Reinicio global para empezar el proyecto y box-sizing*/
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #f8f2ed;
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    padding: 0;
    color: #111;
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: "Domine", "Noto Serif", Times, serif;
    font-weight: 500;
}

section {
    padding: 4rem 1.5rem;
}

.section-divider {
    border: none;
    height: 1px;
    background-color: #ccc;
    margin: 0.5rem 0 2rem;
}

/* HEADER */

header {
    background-color: #f8f2ed;
    box-shadow: 0 2px 8px #0000000d;
    position: sticky;
    top: 0;
    z-index: 1000;
}


.container {
    max-width: 900px;
    margin: 0 auto;
}

.nav {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}

.nav-links {
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    position: relative;
    color: #000;
    text-decoration: none;
    font-weight: 600;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    background-color: #000;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease-in-out;
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

/* SECCION ABOUT */

.about {
    display: flex;
    flex-direction: column;
}

.about h1 {
    font-size: 3rem;
    margin-top: 0;
    margin-bottom: 0.2rem;
}
/* poner el subtitle más cerca del titulo */
.subtitle {
    font-size: 1.4em;
    color: #fc3b00;
    margin-top: 0;
    position: relative;
    width: fit-content;
    padding-top: 0.6rem;
}

.subtitle::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #000000;
}



.about-intro {
    margin-top: 2.2rem;    
    border-left: 4px solid #4b4b4b;
    padding-left: 1rem;
}

.about-description {
    color: #616161;
}



/* SECCION PROYECTOS */


#projects h2 {
    margin-bottom: 2rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.project-card:hover {
    transform: scale(1.05);
}

.project-card h3 {
    margin-bottom: 0.5rem;
}

.project-card p {
    margin-bottom: 0.5rem;
}

.project-card .tech {
    font-size: 0.8rem;
    color: #555;
    background: #f1f1f1;
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    width: fit-content;
}

.project-card a {
    text-decoration: none;
    font-weight: 600;
    color: #0058bd;
    margin-top: 1rem;
}


/* SECCIÓN EXPERIENCIA */


#experience h2 {
    margin-bottom: 2rem;
}

.job {
    margin-bottom: 2.5rem;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.3rem;
}

.job h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.date {
    font-size: 0.85rem;
    color: #999;
    white-space: nowrap;
    margin-left: 1rem;
}

.company {
    color: #666;
    margin-bottom: 0.5rem;
    margin-top: 0.2rem;
    font-size: 0.95rem;
}

.job-description {
    color: #555;
    line-height: 1.6;
    margin: 0.5rem 0 0 0;
    font-size: 0.95rem;
}


/* SECCIÓN EDUCACIÓN */

#education h2 {
    margin-bottom: 2rem;
}

.education-item {
    margin-bottom: 2rem;
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.3rem;
}

.education-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.education-school {
    color: #666;
    margin: 0.3rem 0 0 0;
    font-size: 0.95rem;
}


/* FOOTER */

footer {
    background-color: #000000;
    color: #ffff;
    padding: 2rem 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    list-style: none;
}

.footer-links a {
    position: relative;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.footer-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0%;
    height: 2px;
    background-color: #fff;
    transition: width 0.5s ease;
}

.footer-links a:hover::after {
    width: 100%;
}

footer hr {
    border: none;
    height: 1px;
    background-color: #444;
    margin: 1.5rem auto;
    width: 80%;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto; /* esto de usar pixeles y el auto no me convence nada, hay que revisarlo*/
}

.social {
    display: flex;
    gap: 1rem;
}

.social a {
    color: #fff;
    text-decoration: none;
}

.social a:hover {
    opacity: 0.7;
}

.social img {
    width: 24px;
    height: auto;
    filter: brightness(0) invert(1);
}


/* RESPONSIVE */

@media (max-width: 768px) {


    /* About */
    .about h1 {
        font-size: 2.2rem;
    }
    .subtitle {
        font-size: 1.2rem;
    }

    /* Projects grid ya se adapta, solo ajustar padding */
    .projects-grid {
        gap: 1rem;
    }

    /* Job & education items */
    .job-header,
    .education-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .date {
        margin-left: 0;
        margin-top: 0.3rem;
    }

    /* Footer */
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    .about h1 {
        font-size: 1.8rem;
    }
    .subtitle {
        font-size: 1rem;
    }
    .project-card {
        padding: 1rem;
    }
    header {
        display: none;
    }
    /* Nav */
    .nav-links {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
}