/* Home: one column with a single left edge. Words stay at reading width; the work gets the full column. */

.home > section {
    padding-block: 64px;
    border-top: 1px solid var(--line);
}

/* The first screen: the intro, then the client logos. On phones it fills the screen height, with the spare
   space shared above the intro, between it and the logos, and below them; the Experience heading shows
   at the bottom. */
.home-first > .intro {
    padding-block: 96px 56px;
}

@media (max-width: 640px) {
    .home-first {
        display: flex;
        flex-direction: column;
        /* screen height, less the header (70px) and the Experience section's top padding and heading (133px) */
        min-height: calc(100vh - 203px);
        min-height: calc(100svh - 203px);
    }

    .home-first > .intro {
        margin-top: auto;
        padding-top: clamp(40px, 11svh, 112px);
    }

    .home-first > .logos {
        margin-block: auto;
    }
}

/* Intro */
.intro {
    display: grid;
    gap: 18px;
}

.intro h1 {
    max-width: 20em;
    font-size: var(--s-5);
    line-height: 1.15;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.intro h1 .em {
    color: var(--accent);
}

.intro .lede {
    max-width: var(--measure);
    color: var(--fg-2);
    font-size: 17px;
}

.intro .lede a {
    color: var(--fg);
}

.intro__cta {
    margin-top: 4px;
}

.intro__cta .btn {
    height: 44px;
    padding: 0 20px;
    font-size: var(--s-2);
}

/* Client logos: one colour, two rows drifting slowly opposite ways across the full width, faded at both
   edges. Hover or focus pauses them; with reduced motion one row sits still and wraps. */
body.home main {
    overflow-x: clip;
}

.home-first > .logos {
    display: grid;
    gap: 28px;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding-block: 0 64px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}

.logos__track {
    display: flex;
    width: max-content;
    animation: logos-drift 70s linear infinite;
}

.logos__track--rev {
    animation-direction: reverse;
    animation-duration: 90s;
}

.logos:hover .logos__track,
.logos:focus-within .logos__track {
    animation-play-state: paused;
}

.logos__set {
    display: flex;
    align-items: center;
    gap: 80px;
    margin: 0;
    padding: 0 40px;
    list-style: none;
}

.logos__item {
    display: grid;
    place-items: center;
    height: 64px;
    color: var(--fg-3);
    transition: color 0.25s;
}

.logos__item:hover,
.logos__item:focus-visible {
    color: var(--fg);
}

.logos__mark {
    display: block;
    width: calc(var(--h) * var(--r));
    height: var(--h);
    background: currentColor;
    -webkit-mask: var(--logo) center / contain no-repeat;
    mask: var(--logo) center / contain no-repeat;
}

@keyframes logos-drift {
    to {
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-first > .logos {
        width: auto;
        margin-left: 0;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .logos__track,
    .logos__set {
        width: auto;
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px 48px;
    }

    .logos__set[aria-hidden],
    .logos__track--rev {
        display: none;
    }
}

@media (max-width: 640px) {
    .home-first > .logos {
        gap: 24px;
    }

    .logos__set {
        gap: 56px;
        padding: 0 28px;
    }

    .logos__item {
        height: 52px;
    }

    .logos__mark {
        width: calc(var(--h) * var(--r) * 0.9);
        height: calc(var(--h) * 0.9);
    }
}

/* Selected work: the heading with a link to every case study */
.sec-head--row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    max-width: none;
}

.see-all {
    font-size: var(--s-2);
    color: var(--fg-2);
    text-decoration-color: transparent;
    white-space: nowrap;
}

.see-all:hover {
    color: var(--fg);
    text-decoration-color: var(--accent);
}

.see-all span {
    display: inline-block;
    transition: transform 0.2s;
}

.see-all:hover span {
    transform: translateX(3px);
}

/* Experience */
.exp {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line);
}

/* The role leads and the years close the row, right-aligned in a column just wide enough for
   "2010 – 2015" */
.exp li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 16px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
}

.exp .y {
    font-size: var(--s-2);
    color: var(--fg-3);
    text-align: right;
}

.exp .d {
    color: var(--fg-2);
}

.exp a {
    text-decoration-color: var(--line);
}

/* Each role leads with its company's mark, in one colour on a small rounded tile like an avatar */
.exp__role {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.exp__logo {
    flex: none;
    position: relative;
    width: 32px;
    height: 32px;
    margin-top: -3px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
}

.exp__logo::before {
    content: "";
    position: absolute;
    inset: 7px;
    background: var(--fg);
    -webkit-mask: var(--logo) center / contain no-repeat;
    mask: var(--logo) center / contain no-repeat;
}

/* A wordmark gets the tile's full width, and a light, open mark a little more room */
.exp__logo--wide::before {
    inset: 7px 4px;
}

.exp__logo--light::before {
    inset: 5px;
}

.outside {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 20px;
}

.outside p {
    max-width: var(--measure);
    color: var(--fg-2);
    text-wrap: pretty;
}

@media (max-width: 640px) {
    .exp li {
        gap: 12px;
    }
}

/* Contact */
.contact-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.email {
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    font-size: var(--s-2);
    user-select: all;
    -webkit-user-select: all;
}
