/* ========================================
   VARIABLES CSS ( :root )
   ======================================== */
:root {
    /* Layout */
    --max-width: 1064px;
    --padding-top: 6rem;          /* 96px */
    --padding-bottom: 6rem;       /* 96px */
    --padding-side-desktop: 2rem; /* 32px */
    --padding-side-tablet: 1.5rem;/* 24px */
    --padding-side-mobile: 1rem;  /* 16px */

    /* Espaciados (px convertidos a rem, 1rem = 16px) */
    --gap-header-hero: 4.6875rem;           /* 75px */
    --gap-hero-title-desc: 0.5625rem;       /* 9px */
    --gap-desc-btn: 3.125rem;               /* 50px */
    --gap-hero-projects: 7.5rem;            /* 120px */
    --gap-projects-title-cards: 1.875rem;   /* 30px */
    --gap-cards: 2.5rem;                    /* 40px */
    --gap-cards-contact: 5rem;              /* 80px */
    --gap-contact-title-desc: 0.5625rem;    /* 9px */

    /* Colores */
    --bg-color: #FFFFFF;
    --text-primary: #1F3B53;
    --text-header: #000000;
    --link-color: #366EB9;

    /* Tipografía */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html {
    font-size: 16px; /* Base para rem */
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   CONTENEDOR
   ======================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--padding-top) var(--padding-side-desktop) var(--padding-bottom);
}

/* ========================================
   HEADER
   ======================================== */
.site-header .container {
    padding-top: 0;
    padding-bottom: 0;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-top: var(--padding-top);
    padding-bottom: var(--gap-header-hero);
}

.header-name {
    font-size: 1.5rem;   /* 24px */
    font-weight: 500;    /* Medium */
    color: var(--text-header);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.header-subtitle {
    font-size: 1rem;     /* 16px */
    font-weight: 500;    /* Medium */
    color: var(--text-header);
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* ========================================
   HERO
   ======================================== */
.hero .container {
    padding-top: 0;
    padding-bottom: 0;
}

.hero-grid {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 3rem;
}

.hero-text {
    flex: 1 1 55%;
    max-width: 65%;
}

.hero-image {
    flex: 0 0 auto;
    margin-top: 0.25rem;
}

.hero-image img {
    width: 350px;
    height: 440px;
    border-radius: 20px;
    object-fit: cover;    /* Evita deformaciones */
    display: block;
    background-color: #f0f4f9; /* Color de respaldo mientras carga */
}

/* Hero Título */
.hero-title {
    font-size: 3rem;       /* 48px */
    font-weight: 600;      /* SemiBold */
    line-height: 4rem;     /* 64px */
    color: var(--text-primary);
    letter-spacing: -0.03em;
    margin-bottom: var(--gap-hero-title-desc);
}

/* Hero Descripción */
.hero-description {
    font-size: 1.5rem;     /* 24px */
    font-weight: 400;      /* Regular */
    line-height: 2.1875rem;/* 35px */
    color: var(--text-primary);
    max-width: 90%;
    margin-bottom: var(--gap-desc-btn);
}

/* Botón LinkedIn */
.hero-button-wrapper {
    margin-top: 0;
}

.btn-linkedin {
    font-size: 1.5rem;     /* 24px */
    font-weight: 400;
    color: var(--text-primary);
    text-decoration: none;
    display: inline-block;
    transition: text-decoration 0.2s ease;
    line-height: 1.4;
}

.linkedin-highlight {
    color: var(--link-color);
}

.btn-linkedin:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ========================================
   PROYECTOS (CARDS)
   ======================================== */
.projects .container {
    padding-top: var(--gap-hero-projects);
    padding-bottom: 0;
}

.projects-title {
    font-size: 1.5rem;     /* 24px */
    font-weight: 600;      /* SemiBold */
    color: var(--text-primary);
    margin-bottom: var(--gap-projects-title-cards);
    letter-spacing: -0.01em;
}

.cards-grid {
    display: flex;
    flex-direction: column;
    align-items: center;   /* Centrado horizontal exacto */
    gap: var(--gap-cards);
}

/* Contenedor de cada card (es el <a>) */
.card-link {
    display: block;
    width: 850px;          /* Ancho fijo exacto como pide el spec */
    max-width: 100%;       /* Para que no se desborde en pantallas pequeñas */
    text-decoration: none;
    border-radius: 10px;
    overflow: hidden;      /* Para respetar el border-radius en hover */
    transition: transform 250ms ease-out;
    cursor: pointer;
    /* Sin sombra */
    box-shadow: none;
    background: transparent;
}

/* Efecto Hover: scale(1.03) como en glorialo.design */
.card-link:hover {
    transform: scale(1.03);
}

.card-container {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc; /* Fondo de respaldo */
}

.card-container img {
    display: block;
    width: 100%;
    height: auto;          /* Mantiene la proporción 850x340 (aspect ratio 2.5:1) */
    aspect-ratio: 850 / 340;
    object-fit: cover;
    border-radius: 10px;
    background-color: #eef2f6;
}

/* ========================================
   CONTACTO (ACTUALIZADO: CENTRADO)
   ======================================== */
.contact .container {
    padding-top: var(--gap-cards-contact);
    padding-bottom: 0;
}

.contact-title {
    font-size: 1.5rem;     /* 24px */
    font-weight: 700;      /* Bold */
    color: var(--text-primary);
    margin-bottom: var(--gap-contact-title-desc);
    letter-spacing: -0.01em;
    text-align: center;    /* <--- CAMBIO: Centrado en todas las pantallas */
}

.contact-description {
    font-size: 1rem;       /* 16px */
    font-weight: 400;      /* Regular */
    color: var(--text-primary);
    line-height: 1.5;
    max-width: 70%;
    margin: 0 auto;        /* <--- CAMBIO: Centrado horizontal y con ancho máximo */
    text-align: center;    /* <--- CAMBIO: Texto centrado */
}

/* ========================================
   FOOTER / ICONOS (ACTUALIZADO: CENTRADO Y PADDING REDUCIDO)
   ======================================== */
.site-footer .container {
    padding-top: 2rem;     /* <--- CAMBIO: Bajó de 5rem a 2rem */
    padding-bottom: var(--padding-bottom);
}

.social-icons {
    display: flex;
    align-items: center;
    justify-content: center; /* <--- CAMBIO: Íconos centrados en desktop */
    gap: 1.5rem;
}

.social-icons a {
    display: inline-block;
    transition: opacity 0.2s ease;
    line-height: 0;
}

.social-icons a:hover {
    opacity: 0.7;
}

.social-icons img {
    width: 40px;
    height: 40px;
    display: block;
    object-fit: contain;
}

/* ========================================
   RESPONSIVE: TABLET
   ======================================== */
@media (max-width: 1024px) {
    .container {
        padding-left: var(--padding-side-tablet);
        padding-right: var(--padding-side-tablet);
    }

    .hero-text {
        max-width: 58%;
    }

    .hero-image img {
        width: 280px;
        height: 352px; /* Mantiene proporción 350/440 */
    }

    .hero-title {
        font-size: 2.6rem;
        line-height: 3.4rem;
    }

    .hero-description {
        font-size: 1.3rem;
        line-height: 1.9rem;
    }

    .btn-linkedin {
        font-size: 1.3rem;
    }

    .card-link {
        width: 100%; /* En tablet ocupa el ancho disponible, pero centrado */
        max-width: 750px;
    }

    .contact-description {
        max-width: 85%;
    }
}

/* ========================================
   RESPONSIVE: MOBILE
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding-left: var(--padding-side-mobile);
        padding-right: var(--padding-side-mobile);
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    /* Header */
    .header-content {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    .header-name {
        font-size: 1.25rem;
    }
    .header-subtitle {
        font-size: 0.875rem;
    }

    /* Hero: la imagen pasa debajo del texto */
    .hero-grid {
        flex-direction: column;
        align-items: center;
        gap: 2.5rem;
    }

    .hero-text {
        max-width: 100%;
        flex: 1 1 auto;
    }

    .hero-image {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .hero-image img {
        width: 100%;
        max-width: 350px;
        height: auto;
        aspect-ratio: 350 / 440;
    }

    .hero-title {
        font-size: 2.2rem;
        line-height: 2.8rem;
        max-width: 100%;
    }

    .hero-description {
        font-size: 1.125rem;
        line-height: 1.6rem;
        max-width: 100%;
    }

    .btn-linkedin {
        font-size: 1.125rem;
    }

    /* Proyectos */
    .projects .container {
        padding-top: 5rem;
    }

    .projects-title {
        font-size: 1.25rem;
        text-align: center;
    }

    .cards-grid {
        gap: 1.75rem;
    }

    .card-link {
        width: 100%;
        max-width: 100%;
    }

    .card-link:hover {
        transform: scale(1.02); /* Ligeramente más sutil en móvil */
    }

    /* Contacto */
    .contact .container {
        padding-top: 4rem;
    }
    .contact-title {
        font-size: 1.25rem;
    }
    .contact-description {
        font-size: 0.9375rem;
        max-width: 100%;
    }

    /* Footer */
    .site-footer .container {
        padding-top: 2rem;     /* Mantenemos 2rem en móvil también */
        padding-bottom: 3rem;
    }
    .social-icons {
        gap: 2rem;            /* El centrado ya se hereda de la versión desktop */
    }
}

/* ========================================
   AJUSTES PARA PANTALLAS MUY PEQUEÑAS
   ======================================== */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
        line-height: 2.4rem;
    }
    .hero-description {
        font-size: 1rem;
        line-height: 1.5rem;
    }
    .btn-linkedin {
        font-size: 1rem;
    }
    .header-name {
        font-size: 1.1rem;
    }
}