.home {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 34px 0 60px;
    font-family:
        'Cloud Fonts', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial,
        sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
    color: #f0f6fc;
}

/* portrait: avatar + name on the left, contacts on the right, wraps on very narrow screens */
.home-profile {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    /* column gap grows with the screen, 14px is the most a phone has room for */
    gap: 16px clamp(14px, calc(20vw - 70px), 80px);
    padding: 0 35px 15px;
    /* portrait: sits on the page background, landscape makes it a card */
    background-color: transparent;
    text-align: center;
}

.home-id {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.home-avatar {
    display: block;
    width: 72px;
    height: 72px;
    margin: 0 0 10px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 3px #262626;
}

.home-name {
    margin: 0;
    font-size: 18px;
}

.home-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.home-contact a,
.home-contact li > div {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    color: #f0f6fc;
    text-decoration: none;
}

.home-contact a:hover {
    opacity: 0.7;
}

.home-icon {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #f0f6fc;
}

.home-icon svg {
    width: 22px;
    height: 22px;
}

.home-contact-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.home-contact-text small {
    color: #9198a1;
    font-size: 12px;
}

.home-articles a {
    color: #f0f6fc;
    text-decoration: underline;
    text-decoration-color: #595959;
    text-underline-offset: 3px;
}

.home-articles a:hover {
    text-decoration-color: #f0f6fc;
}

.home-articles {
    /* markdown-body adds side margins, the layout gap is enough */
    margin: 0;
    padding: 30px 35px;
    background-color: #1a1a1a;
}

.home-articles h2:first-child {
    margin-top: 0;
}

/* landscape: profile on the left, articles on the right */
@media (orientation: landscape) and (min-width: 700px) {
    .home {
        padding: 50px 35px 100px;
        flex-direction: row;
        align-items: flex-start;
        gap: 20px;
    }

    .home-profile {
        position: sticky;
        top: calc(var(--topbar-height) + 50px);
        /* width comes from the contacts block */
        flex: none;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0;
        padding: 30px 24px 18px;
        background-color: #1a1a1a;
    }

    .home-avatar {
        width: 96px;
        height: 96px;
        margin-bottom: 16px;
    }

    .home-name {
        margin-bottom: 24px;
        font-size: 24px;
    }

    .home-contact {
        margin: 0 auto;
    }

    .home-contact a,
    .home-contact li > div {
        gap: 12px;
    }

    .home-contact-text {
        font-size: 15px;
    }

    .home-articles {
        flex: 1;
        min-width: 0;
        padding: 30px 35px;
    }
}

.home-articles code {
    border-radius: 0;
}

/* no bullets, items are told apart by spacing */
.home-articles ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-articles li + li {
    margin-top: 18px;
}

/* very narrow phones: keep the profile left-right instead of wrapping */
@media (max-width: 400px) {
    .home-profile {
        padding-right: 24px;
        padding-left: 24px;
    }
}
