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

* {
    margin: 0;
}

:root {
    --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bg: #0b3d91;
    --text: #ffffff;
    --text-muted: #c3d3ef;
    --rule: rgba(255, 255, 255, 0.28);
    --rule-strong: #ffffff;
    --measure: 38rem;
    color-scheme: dark;
}

*:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
}

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

body {
    font-family: var(--font);
    font-size: 1.125rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

.page {
    max-width: calc(var(--measure) + 2 * 1.5rem);
    margin-inline: auto;
    padding-inline: 1.5rem;
    padding-block: 4rem 3rem;
}

@media (min-width: 60rem) {
    .page {
        padding-inline: 5rem;
        padding-block: 6rem 4rem;
        max-width: calc(var(--measure) + 2 * 5rem);
    }
}

/* Masthead */

.masthead {
    padding-bottom: 2.5rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--rule);
}

h1 {
    font-size: clamp(2.5rem, 1.6rem + 3.5vw, 3.75rem);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
}

.lede {
    font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
    line-height: 1.4;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--text-muted);
    text-wrap: balance;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
}

@media (min-width: 40rem) {
    .lede {
        hyphens: manual;
        -webkit-hyphens: manual;
    }
}

/* Body copy */

main p {
    margin-bottom: 1.25em;
    text-wrap: pretty;
    hyphens: auto;
    -webkit-hyphens: auto;
}

@media (min-width: 40rem) {
    main p {
        hyphens: manual;
        -webkit-hyphens: manual;
    }
}

/* Contact */

.contact {
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--rule);
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 1.5rem;
}

/* All the text sits beside the portrait at every width; the portrait and the
   gap shrink on narrow screens so the text column keeps its room. */

.card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: clamp(1rem, 4vw, 1.75rem);
    align-items: start;
}

.portrait {
    grid-column: 1;
    grid-row: 1 / span 4;
    width: clamp(3.5rem, 16vw, 5.5rem);
    aspect-ratio: 1;
    margin-top: 0.25rem; /* optically align with the first line of the name */
    border-radius: 50%;
    object-fit: cover;
}

.card h3,
.card .role,
.credentials,
.tel {
    grid-column: 2;
}

.card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.card p {
    margin-bottom: 0;
}

.role {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.4;
}

.credentials {
    margin-top: 0.4rem;
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.45;
    text-wrap: pretty;
}

.tel {
    margin-top: 0.75rem;
}

.tel a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}


/* Partners */

.partners {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem 4rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--rule);
}

.partner-label {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Logos are supplied as dark-on-white; render them as white on the blue */

.logo-helander {
    width: 13rem;

    border-radius: 4px;
    margin-left: -0.35rem; /* offset whitespace baked into the image */
}

.logo-helsinki {
    width: 7.5rem;
    filter: brightness(0) invert(1);
}

/* Wide screens: partners in a sidebar next to the text */

@media (min-width: 64rem) {
    .page {
        --sidebar: 13rem;
        --gap: 5rem;
        max-width: calc(var(--measure) + var(--gap) + var(--sidebar) + 2 * 5rem);
        display: grid;
        grid-template-columns: minmax(0, var(--measure)) var(--sidebar);
        grid-template-areas:
            "head head"
            "main side";
        column-gap: var(--gap);
    }

    .masthead {
        grid-area: head;
    }

    main {
        grid-area: main;
    }

    .partners {
        grid-area: side;
        align-self: start;
        flex-direction: column;
        gap: 2.5rem;
        margin-top: 0;
        padding-top: 0.35rem; /* line up with the first line of text */
        border-top: 0;
    }
}
