/*
 * Home page.
 * Must work on old browsers (iOS 12 / Safari 12): no flex `gap`, clamp(),
 * aspect-ratio, :is()/:where(), `inset`.
 *
 * Layouts:
 *   >= 600px  illustration scales with the screen (max 1000px), navigation laid over it
 *   <  600px  illustration on top, navigation as stacked buttons below it
 */

html {
    -webkit-text-size-adjust: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: Verdana, Geneva, sans-serif;
    background: #409633;
}

/*
 * The window is filled by continuing the illustration's edges, like in v2:
 * 1px strips taken from its left, right and top edges are repeated outwards.
 * The illustration itself sits at the bottom, right above the footer.
 */
.home-main {
    display: flex;
    flex: 1 0 auto;
}

.home-main::before,
.home-main::after {
    content: "";
    flex: 1 1 0;
}

.home-main::before {
    background: #fff url("../img/home/edge-day.jpg") left bottom repeat-x;
}

.home-main::after {
    background: #154660 url("../img/home/edge-night.jpg") right bottom repeat-x;
}

.home-hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex: 0 1 1000px;
    min-width: 0;
    background: #39b6e4 url("../img/home/edge-top.jpg") center top repeat-y;
    background-size: 100% 1px;
}

.home-hero__picture {
    position: relative;
}

.home-hero__image {
    display: block;
    width: 100%;
    height: auto;
}

/* Navigation over the illustration */
.home-nav__group {
    position: absolute;
    top: 36.6%;
    width: 22%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-nav__group--day {
    left: 7%;
}

.home-nav__group--night {
    right: 7%;
}

.home-nav__item {
    margin: 0 0 1.2vw;
}

.home-nav__link {
    display: flex;
    align-items: center;
    font-family: Palatino, "Palatino Linotype", Garamond, Times, serif;
    font-size: 15.6px;
    font-weight: bold;
    text-decoration: none;
}

.home-nav__group--night .home-nav__link {
    flex-direction: row-reverse;
    text-align: right;
}

.home-nav__icon {
    display: block;
    flex-shrink: 0;
    width: 70px;
    height: 70px;
}

.home-nav__label {
    margin: 0 6px;
    padding: 3px 6px;
    border-radius: 6px;
}

.home-nav__group--day .home-nav__link {
    color: #0040a0;
}

.home-nav__group--day .home-nav__link:hover,
.home-nav__group--day .home-nav__link:focus {
    color: #00b040;
}

.home-nav__group--night .home-nav__link {
    color: #ff0;
}

.home-nav__group--night .home-nav__link:hover,
.home-nav__group--night .home-nav__link:focus {
    color: #80ff00;
}

/* Footer */
.home-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    color: #fff;
    text-align: center;
}

.home-footer__title {
    margin: 0 22px;
    font-family: Palatino, "Palatino Linotype", Garamond, Times, serif;
    font-size: 16px;
    font-weight: bold;
    color: #fff0a0;
}

.home-footer__title--latin {
    color: #a0e0ff;
}

.home-footer__info {
    max-width: 520px;
    margin: 0;
    font-size: 11px;
    line-height: 1.5;
}

.home-footer__info a {
    color: #ffffc0;
    text-decoration: none;
}

.home-footer__info a:hover,
.home-footer__info a:focus {
    color: #ffff80;
    text-decoration: underline;
}

/* Tablet: smaller icons, readable labels over the picture */
@media (max-width: 999px) {
    .home-nav__link {
        font-size: 15px;
    }

    .home-nav__icon {
        width: 48px;
        height: 48px;
    }

    .home-nav__group--day .home-nav__label {
        background: rgba(255, 255, 255, 0.7);
    }

    .home-nav__group--night .home-nav__label {
        background: rgba(20, 70, 97, 0.7);
    }
}

/* Mobile: navigation below the illustration, stacked buttons */
@media (max-width: 599px) {
    .home-main {
        display: block;
        background: #144661;
    }

    .home-main::before,
    .home-main::after {
        display: none;
    }

    .home-hero {
        display: block;
        background: none;
    }

    .home-nav {
        padding: 12px 4vw 4px;
    }

    .home-nav__group {
        position: static;
        width: auto;
    }

    .home-nav__item {
        margin: 0 0 8px;
    }

    .home-nav__group--night .home-nav__link {
        flex-direction: row;
        text-align: left;
    }

    .home-nav__link,
    .home-nav__group--day .home-nav__link,
    .home-nav__group--night .home-nav__link {
        padding: 6px 10px;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
        font-size: 18px;
    }

    .home-nav__icon {
        width: 40px;
        height: 40px;
    }

    .home-nav__group--day .home-nav__label,
    .home-nav__group--night .home-nav__label {
        background: none;
        margin: 0 0 0 10px;
        padding: 0;
    }

    .home-footer {
        display: block;
        padding: 20px 16px;
    }

    .home-footer__title {
        margin: 0;
    }

    .home-footer__info {
        margin: 14px auto;
    }
}
