
/* Variables globales */

:root {

    --color-fondo-oscuro: #131313;
    --color-fondo-footer: #cbdd62;
    --color-texto-claro: #ffffff;
    --color-texto-oscuro: #000000;
    --color-acento: #cbdd62;
    --color-acento-oscuro: #808854;
    --color-separador: #333333;
    --padding-base: 2rem;
    --padding-lateral: 4rem;
    --font-size-base: 1.6rem;
}

html {
    font-size: 62.5%;
    box-sizing: border-box;

}

*,
*::before,
*::after {
    box-sizing: inherit;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--color-fondo-oscuro);
    color: var(--color-texto-claro);
    font-family: 'Inter', sans-serif;
    font-size: var(--font-size-base);
    margin: 0;
}

/* BLOQUE: HEADER */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--padding-base) var(--padding-lateral);
    border-bottom: 1px solid var(--color-separador);
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--color-fondo-oscuro);

}

/* ELEMENTO: Logotipo */

.header__logo img {
    width: 20rem;
    height: auto;
}

.header__logo {
    position: relative;
    z-index: 20;
}

/*

* BLOQUE: NAV

*/

.nav__list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 3rem;
}

/* ELEMENTO: Enlace */

.nav__link {
    text-decoration: none;
    color: var(--color-texto-claro);
    font-size: 1.6rem;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    padding: 0 0 0.5rem 0;

}

.nav__link:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    inset: auto 0 0 0;
    background-color: var(--color-acento);
    transition: width 0.3s ease;

}

/* Interacción hover y estado activo*/

.nav__link:hover,
.nav__link:active,
.nav__link:focus {
    color: var(--color-acento);
    outline: none;

}

.nav__link:hover:after,
.nav__link:focus:after,
.nav__link--active:after {
    width: 100%;
}

.header__toggle {
    display: none;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    margin: 0 0 0 1rem;
    position: relative;
    z-index: 20;
}

.header__toggle img {
    width: 3rem;
    height: 3rem;
}

/* BLOQUE: RESPONSIVE - Menú móviles */

@media (max-width: 768px) {

    .header {
        /* Ajustamos el padding lateral para que el contenido no toque los bordes */
        padding: var(--padding-base);
    }

    /* 1. HACER EL BOTÓN VISIBLE */
    .header__toggle {
        display: block;
    }

    /* 2. OCULTAR Y PREPARAR EL MENÚ PARA DESLIZAR */
    .nav {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 100vw;
        background-color: var(--color-fondo-oscuro);
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: none;
        z-index: 15;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .nav__list {
        flex-direction: column;
        margin-top: 0;
        padding: var(--padding-base) 0;
        align-items: center;
    }

    .nav__item {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid var(--color-separador);
    }

    .nav__link {
        display: block;
        padding: 1.5rem 0;
        font-size: 2rem;
    }

    /* 3. ESTADO ACTIVO: Clase JavaScript */
    .nav.is-open {
        transform: translateX(0);
        /* Menú visible */
    }
}

/* BLOQUE: IMAGEN "PORTFOLIO" */
.cabecera-container {
    width: 100%;
    padding: 1rem 2rem 0.5rem;
    background-color: var(--color-fondo-oscuro);
    flex-shrink: 0;
    height: auto;
    min-height: 200px; 
    display: flex;
    justify-content: center;
    align-items: center;
}
.cabecera-imagen {
    width: 96%;
    max-width: 1400px;
    height: auto;
    display: block;
    margin: 3rem auto;
}

/* BLOQUE: RESPONSIVE - Imagen "Portfolio" Móviles */

@media (max-width: 768px) {
    .cabecera-container {
        padding: 2rem 1rem;
    }
    
    .cabecera-imagen {
        width: 90%;
        margin: 2rem auto;
    }
}

/* BLOQUE: PRESENTACIÓN */

.texto-mobile {
    display: none; /* Por defecto está oculto */
    text-align: center;
    padding: 3rem var(--padding-base);
    background-color: var(--color-fondo-oscuro);
}

.texto-mobile h1 {
    margin: 2rem 0;
    font-size: 2.8rem;
    color: var(--color-texto-claro);
    font-weight: normal; /* Para mantener la consistencia con el estilo anterior */
}

.texto-mobile p {
    margin: 2rem 0;
    font-size: 1.8rem;
    color: var(--color-acento);
    font-weight: 500;
}

@media (max-width: 768px) {
    .texto-mobile {
        display: block; 
    }
}

/*
* BLOQUE: FOOTER
*/

.footer {
    margin-top: auto;
    background-color: var(--color-fondo-footer);
    padding: var(--padding-base) var(--padding-lateral);
    color: var(--color-texto-oscuro);
}

.footer__content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 120rem;
    margin: 0 auto;
}

/* ELEMENTO: Logo e Información */

.footer__brand-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.footer__logo-img {
    width: 16rem;
    height: auto;
}

.footer__copyright {
    font-size: 1.4rem;
    margin: 0;
}

/* ELEMENTO: Redes Sociales */

.footer__social {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer__social-heading {
    font-weight: 500;
    font-size: var(--font-size-base);
    margin: 0 0 1.5rem 0;
}

.footer__social-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1rem;
}

.footer__link {
    text-decoration: none;
    color: var(--color-texto-oscuro);
    font-size: 1.4rem;
    transition: color 0.3s ease;
    position: relative;
    padding: 0 0 0.2rem 0;
}

.footer__link:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    inset: auto 0 0 0;
    background-color: var(--color-fondo-oscuro);
    transition: width 0.3s ease;
}

/* Interacción hover y estado activo */

.footer__link:hover,
.footer__link:active,
.footer__link:focus {
    color: var(--color-texto-oscuro);
    outline: none;
}

.footer__link:hover:after,
.footer__link:focus:after,
.footer__link:active:after {
    width: 100%;
}

/* BLOQUE: RESPONSIVE - Footer Móviles */

@media (max-width: 768px) {
    .footer__content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 3rem;
    }

    .footer__social-list {
        justify-content: center;
    }
}


/* BLOQUE: CONTACTO*/

.contact-section {
    margin: 0 auto;
    padding: 0 var(--padding-lateral) 6rem var(--padding-lateral);
    text-align: left;
}

/* <h1> grande */
.contact-info__heading-large {
    /* tamaño específico para "hola!" */
   font-size: 10rem;
    margin: 0 0 2rem 0;
    color: var(--color-acento);
}

/* Base del Grid para el Formulario y la Información */
.contact-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9rem;
    align-items: start;
    margin: 7rem 0 0 0;
    text-align: left;
}

/* Columna (Información/Texto) */
.contact-info {
    padding-top: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.contact-info p {
    font-size: 1.8rem;
    margin: 0 0 10rem 0;
}


/*
* BLOQUE: FORMULARIO
*/

.formulario {
    padding: 3rem 4rem;
    border-radius: 1.6rem;
    background-color: var(--color-texto-claro);
    box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.2);
    max-width: 50rem;
    width: 100%;
    margin: 0 auto 0 auto;
}

.formulario__titulo {
    text-align: center;
    color: var(--color-fondo-oscuro);
    margin: 0 0 2.4rem 0;
    font-size: 2.8rem;
}

.formulario__grupo {
    margin: 0 0 1.6rem 0;
}

.formulario__etiqueta {
    display: block;
    margin: 0 0 0.6rem 0;
    font-weight: 500;
    color: var(--color-fondo-oscuro);
}

.formulario__input,
.formulario__textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 1px solid var(--color-separador);
    border-radius: 0.8rem;
    font-size: var(--font-size-base);
    color: var(--color-fondo-oscuro);
    transition: border-color 0.3s ease;
}

.formulario__input:focus,
.formulario__textarea:focus {
    border-color: var(--color-acento);
    outline: none;
}

.formulario__textarea {
    resize: none;
    height: 12rem;
}

.formulario__boton {
    width: 100%;
    padding: 1.2rem;
    background-color: var(--color-acento);
    color: var(--color-fondo-oscuro);
    font-size: var(--font-size-base);
    border: none;
    border-radius: 0.8rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: 700;
}

.formulario__boton:hover,
.formulario__boton:focus {
    background-color: var(--color-acento);
    filter: brightness(0.9);
    outline: none;
}

@media (max-width: 768px) {

    /* BLOQUE: CONTACTO MÓVIL */
    
    .contact-section {
        padding: 0 var(--padding-base) 4rem var(--padding-base);
    }
    
    /* <h1> grande */
    .contact-info__heading-large {
       font-size: 6rem;
       margin: 2rem 0 1rem 0; 
       text-align: center; 
    }

    /* Base del Grid para el Formulario y la Información */
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 3rem; 
        margin: 4rem 0 0 0; 
        text-align: left;
    }

    /* Columna Izquierda (Información/Texto) */
    .contact-info {
        padding-top: 0;
        text-align: center;
    }

    .contact-info p {
        margin: 0 auto 3rem auto; 
        max-width: 90%; 
    }

    .formulario {
        max-width: 100%;
        margin: 0; 
        padding: 2.5rem; 
    }
}

/*
* BLOQUE: ABOUT.HTML (SOBRE MÍ)
*/

/* 1. LAYOUT PRINCIPAL:  */
.about-main {
    display: flex;
    flex-grow: 1;
}

/* 2. CONTENEDOR DEL GRID: Maquetación a dos columnas */
.about-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
}

/* Columna de Contenido (Texto) */
.about-content {
    padding: 6rem var(--padding-lateral) 6rem var(--padding-lateral);
    order: 1;
}

.about__heading {
    font-size: 14rem;
    margin: 0 0 2rem 0;
    color: var(--color-acento);
}

.about__lead {
    font-size: 2.2rem;
    font-weight: 500;
    margin: 0 0 3rem 0;
}

/* 3. COLUMNA DE LA FOTO (DERECHA) */
.about-photo-container {
    grid-column: 2 / 4;
    width: 100%;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    order: 2;
}

.about-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.about__cta-button {
    padding: 1rem 2rem;
    display: inline-block;
    margin: 3rem 0 3rem 0;
    background-color: var(--color-acento);
    color: var(--color-fondo-oscuro);
    font-size: var(--font-size-base);
    text-decoration: none;
    border: none;
    border-radius: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    white-space: nowrap;
    max-width: fit-content;
}

.about__cta-button:hover,
.about__cta-button:focus {
    background-color: var(--color-acento);
    filter: brightness(0.9);
    outline: none;
    transform: translateY(-2px);
}

/* BLOQUE: RESPONSIVE - About.html */
@media (max-width: 768px) {
    .about-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-content {
        padding: 4rem var(--padding-base);
        order: 1;
        max-width: none;
    }

    .about__heading,
    .about__lead,
    .about__text-block h2,
    .about__text-block p {
        text-align: left;
    }

    .about-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .about__cta-button {
        align-self: center;
        width: auto;
        min-width: 200px;
        padding: 1.2rem 2.4rem;
        margin: 2rem auto;
        text-align: center;
    }
  
    .about-photo-container {
        grid-column: auto;
        order: 2;
        margin: 0;
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

/* BLOQUE: SLIDER */

.infinite-slider {
    width: 100%;
    background-color: var(--color-fondo-oscuro);
    overflow: hidden;
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-top: auto;
}

.slider__viewport {
    width: 100%;
    flex-grow: 1;
    margin: 0;
    overflow: hidden;
    position: relative;
    padding: 2rem 0;
    height: 45vh;
}

.slider__track {
    display: flex;
    width: fit-content; 
    height: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
    animation: slide 40s linear infinite;
}

.slider__item {
    width: 400px; 
    height: 100%;
    flex-shrink: 0;
}

.slider__image {
    width: 85%;
    height: 85%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Pausar en hover */
.slider__viewport:hover .slider__track {
    animation-play-state: paused;
}

@keyframes slide {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-400px * 9));
    }
}

/* RESPONSIVE SLIDER */
@media (max-width: 768px) {
    .slider__viewport {
        height: 30vh; 
    }
    
    .slider__item {
        width: 300px;
    }

    .slider__image {
        width: 90%;
        height: 90%;
    }
    
    @keyframes slide {
        100% {
            transform: translateX(calc(-300px * 9));
        }
    }
}

/* BLOQUE: PROYECTOS */

.proyectos-main {
    padding: 6rem var(--padding-lateral);
    max-width: 160rem;
    margin: 0 auto;
}

.proyecto {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6rem;
    margin-bottom: 12rem;
    align-items: center;
}

/* Alternancia de orden para efecto ajedrez */
.proyecto:nth-child(odd) {
    grid-template-areas: "imagen contenido";
}

.proyecto:nth-child(even) {
    grid-template-areas: "contenido imagen";
}

.proyecto__contenido {
    grid-area: contenido;
}

.proyecto__imagen-link {
    grid-area: imagen;
    display: block;
    transition: transform 0.3s ease;
}

.proyecto__titulo {
    font-size: 4.8rem;
    color: var(--color-acento);
    margin: 0 0 2rem 0;
}

.proyecto__descripcion {
    font-size: 1.8rem;
    line-height: 1.6;
    margin: 0;
    color: var(--color-texto-claro);
}

.proyecto__imagen-link:hover {
    transform: scale(1.02);
}

.proyecto__imagen {
    width: 100%;
    height: auto;
    border-radius: 1.6rem;
    display: block;
    object-fit: cover;
    aspect-ratio: 16/9;
}


/* RESPONSIVE PROYECTOS */

@media (max-width: 768px) {
    .proyectos-main {
        padding: 4rem var(--padding-base);
    }

    .proyecto {
        grid-template-columns: 1fr;
        gap: 3rem;
        margin-bottom: 6rem;
    }

    .proyecto:nth-child(odd),
    .proyecto:nth-child(even) {
        grid-template-areas:
            "imagen"
            "contenido";
    }

    .proyecto__contenido {
        text-align: center;
    }

    .proyecto__titulo {
        font-size: 3.6rem;
    }

    .proyecto__imagen {
        max-height: 50vh;
    }
}


/* BLOQUE: DETALLES DE PROYECTO */
.project-detail {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 1200px;
    gap: 4rem;
    padding: 4rem var(--padding-lateral);
    margin: 0 auto;
}

.project-detail__info {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: 800px;
    margin: 0 auto;
}

.project-detail__title {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--color-texto-claro);
}

.project-detail__metadata {
    display: flex;
    gap: 3rem;
    margin-bottom: 2rem;
}

.project-detail__data {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.project-detail__label {
    font-size: 1.4rem;
    text-transform: uppercase;
    color: var(--color-acento);
    margin-bottom: 0.2rem;
}

.project-detail__value {
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--color-texto-claro);
    line-height: 1.2;
}

.project-detail__description {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.project-detail__text {
    font-size: 1.8rem;
    line-height: 1.6;
    color: var(--color-texto-claro);
    margin: 0;
}

/* BLOQUE: CARRUSEL DE LOS PROYECTOS*/
.carousel {
    position: relative;
    width: 100%;
    background-color: var(--color-fondo-oscuro);
}

.carousel__container {
    width: 100%;
    height: 600px;
    position: relative;
}

.carousel__track {
    height: 100%;
    width: 100%;
    position: relative;
}

.carousel__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
}

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

.carousel__slide picture,
.carousel__slide video {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.carousel__image-small {
    width: auto;
    height: auto;
    max-width: 50%;
    max-height: 80%;
}

.carousel__button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
}

.carousel__button:hover {
    background-color: var(--color-acento);
    transform: translateY(-50%) scale(1.1);
}

.carousel__button:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel__button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.carousel__button--prev {
    left: 1rem;
}

.carousel__button--next {
    right: 1rem;
}

.carousel__button img {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* RESPONSIVE: Detalles de Proyecto */
@media (max-width: 768px) {
    .project-detail {
        padding: 2rem var(--padding-base);
        gap: 2rem;
    }

    .project-detail__info {
        padding: 0;
        gap: 2rem;
    }

    .project-detail__title {
        font-size: 2.8rem;
        margin-bottom: 1rem;
        text-align: left;
    }

    .project-detail__metadata {
        flex-direction: column;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .project-detail__text {
        font-size: 1.6rem;
        line-height: 1.5;
        text-align: left;
    }

    .project-detail__description {
        gap: 2rem;
    }

    /* Ajustes del carrusel en móvil */
    .carousel {
        margin: 0 calc(-1 * var(--padding-base));
        width: calc(100% + (var(--padding-base) * 2));
    }

    .carousel__container {
        height: 400px;
    }

    .carousel__slide {
        padding: 1.5rem;
    }

    .carousel__button {
        width: 40px;
        height: 40px;
        background-color: rgba(255, 255, 255, 0.9);
        z-index: 20;
    }

    .carousel__button img {
        width: 18px;
        height: 18px;
    }

    .carousel__button--prev {
        left: 1rem;
    }

    .carousel__button--next {
        right: 1rem;
    }

    .carousel__image-small {
        max-width: 70%;
        max-height: 70%;
    }   
}
