body {
    display: grid;
    grid-template-rows: auto 1fr auto;
}

main {
    min-width: 0;
}

.hero {
    padding-block: 1.35rem 0.9rem;
    background: var(--color-white);
}

.hero__inner {
    display: grid;
    justify-items: center;
    gap: 1rem;
}

.hero__intro {
    width: min(100%, 31rem);
    font-size: 0.9rem;
    line-height: 1.15;
    text-align: center;
}

.hero__figure {
    display: flex;
    width: min(78vw, 25rem);
    justify-content: center;
}

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

.about {
    padding-block: 0.9rem 1.1rem;
    background: var(--color-white);
    scroll-margin-top: 1rem;
}

.about__inner {
    display: flex;
    justify-content: center;
}

.about__text {
    width: min(100%, 35rem);
    font-size: 0.78rem;
    line-height: 1.18;
    text-align: center;
}

.site-footer {
    color: var(--color-yellow);
    background: var(--color-black);
}

.site-footer__inner {
    padding-block: 0.42rem 0.3rem;
}

.site-footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(2.8rem, 0.55fr) minmax(2.8rem, 0.65fr);
    gap: 0.5rem;
    align-items: start;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--color-white);
}

.site-footer__grid section,
.site-footer__grid address,
.site-footer__grid p,
.site-footer__grid a {
    min-width: 0;
    font-size: 0.42rem;
    line-height: 1.15;
}

.site-footer__title {
    margin-bottom: 0.08rem;
    font-size: 0.45rem;
    font-weight: 700;
}

.site-footer__contact,
.site-footer__email {
    justify-self: center;
}

.site-footer a:hover {
    text-decoration: underline;
}

.site-footer__copyright {
    padding-top: 0.22rem;
    font-size: 0.42rem;
    text-align: center;
}

@media (min-width: 36rem) {
    .hero {
        padding-block: 1.5rem 1rem;
    }

    .hero__inner {
        gap: 1.1rem;
    }

    .hero__intro {
        width: min(100%, 34rem);
        font-size: 0.92rem;
    }

    .hero__figure {
        width: min(66vw, 27rem);
    }

    .about {
        padding-block: 0.95rem 1.15rem;
    }

    .about__text {
        width: min(100%, 38rem);
        font-size: 0.82rem;
    }
}

@media (min-width: 48rem) {
    /* En pantallas amplias centramos verticalmente el bloque principal dentro
       del espacio disponible entre el header y el footer. Así el contenido
       no queda pegado visualmente a la parte superior. */
    main {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .hero {
        padding-block: 1.55rem 0.85rem;
    }

    .hero__inner {
        gap: 1.15rem;
    }

    .hero__intro {
        font-size: 0.95rem;
    }

    .hero__figure {
        width: min(40vw, 28rem);
    }

    .about {
        padding-block: 0.75rem 1rem;
    }

    .about__text {
        width: min(100%, 40rem);
        font-size: 0.84rem;
    }

    .site-footer__grid section,
    .site-footer__grid address,
    .site-footer__grid p,
    .site-footer__grid a,
    .site-footer__copyright {
        font-size: 0.5rem;
    }

    .site-footer__title {
        font-size: 0.54rem;
    }
}

/* Laptops y escritorios de poca altura: reducimos la imagen y los espacios
   para que la landing completa no se sienta sobredimensionada. */
@media (min-width: 64rem) and (max-height: 50rem) {
    .hero {
        padding-block: 1rem 0.6rem;
    }

    .hero__inner {
        gap: 0.8rem;
    }

    .hero__figure {
        width: min(31vw, 24rem);
    }

    .about {
        padding-block: 0.55rem 0.7rem;
    }

    .about__text {
        font-size: 0.78rem;
        line-height: 1.15;
    }

    .site-footer__inner {
        padding-block: 0.3rem 0.22rem;
    }
}

/* Pantallas móviles con poca altura: mantenemos la imagen compacta. */
@media (max-width: 35.99rem) and (max-height: 46rem) {
    .hero {
        padding-block: 1rem 0.65rem;
    }

    .hero__inner {
        gap: 0.8rem;
    }

    .hero__figure {
        width: min(72vw, 21rem);
    }

    .about {
        padding-block: 0.7rem 0.85rem;
    }

    .about__text {
        font-size: 0.74rem;
    }
}

/* Móviles pequeños: damos prioridad a la legibilidad del footer sin alterar
   el layout de tablet/escritorio. La información institucional ocupa todo el
   ancho y contacto/email comparten una segunda fila. */
@media (max-width: 23.4375rem) {
    .site-footer__inner {
        padding-block: 0.45rem 0.3rem;
    }

    .site-footer__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem 0.75rem;
    }

    .site-footer__institution {
        grid-column: 1 / -1;
    }

    .site-footer__contact,
    .site-footer__email {
        justify-self: start;
    }

    .site-footer__email {
        justify-self: end;
        text-align: right;
    }

    .site-footer__grid section,
    .site-footer__grid address,
    .site-footer__grid p,
    .site-footer__grid a,
    .site-footer__copyright {
        font-size: 0.5rem;
        line-height: 1.2;
    }

    .site-footer__title {
        font-size: 0.54rem;
    }
}
