/* =========================
   PROJECT PAGE
========================= */

.project-page {
    background-color: var(--color-background);
    color: var(--color-text);
}


/* =========================
   NAV OVERRIDE
========================= */

/*
 * Na Home a Nav começa invisível
 * porque hero-intro.js controla
 * o reveal.
 *
 * Nas project pages ela deve
 * aparecer imediatamente.
 */

.project-page .nav {
    opacity: 1;
    visibility: visible;
}


/* =========================
   PROJECT HERO
========================= */

.project-hero {
    position: relative;

    width: 100%;
    height: 100svh;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}


/* =========================
   CURSOR PROJECT PREVIEW
========================= */

.project-hero__cursor-preview {
    position: absolute;

    top: 0;
    left: 0;

    width: clamp(
        180px,
        16vw,
        240px
    );

    aspect-ratio: 16 / 10;

    z-index: 5;

    pointer-events: none;

    opacity: 0;

    transform:
        translate3d(0, 0, 0)
        scale(0.96);

    will-change:
        transform,
        opacity;

    overflow: hidden;
}


/*
 * A case study whose preview images are 16:9 and run
 * to their edges (project-hero--landscape) shows them
 * whole: the 16:10 frame would trim 5% off each side.
 */

.project-hero--landscape .project-hero__cursor-preview {
    aspect-ratio: 16 / 9;
}


.project-hero__cursor-image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    user-select: none;
    -webkit-user-drag: none;
}


.project-hero__inner {
    width: 100%;
    height: 100%;

    display: grid;

    grid-template-rows:
        80px
        1fr
        auto
        48px;
}


/* =========================
   PROJECT NAME
========================= */

.project-hero__name {
    grid-row: 2;

    align-self: center;

    margin: 0;
    padding-inline: 48px;

    font-family: var(--font-display);

    font-size: min(
        var(--font-display-desktop),
        10.94svh
    );

    font-weight: var(--weight-bold);

    line-height: 0.85;
    letter-spacing: 0;

    color: var(--color-text);
}


/*
 * Each line of the project name sits in its own
 * mask for the entrance reveal (project-hero-title.js),
 * exactly as the Works title. A line keeps the
 * title's line-height, so the name is laid out
 * exactly as plain lines, and a line that wraps on
 * a narrow screen wraps inside its mask. Descenders
 * (the "p" of "App") hang below their line, so
 * every line reaches 0.25em lower and its mask gives
 * that space back: the clip holds the whole glyph
 * and the next line keeps its place.
 */

.project-hero__name-mask {
    display: block;

    margin-bottom: -0.25em;

    overflow: hidden;
}


.project-hero__name-line {
    display: block;

    padding-bottom: 0.25em;
}


/*
 * Until the reveal script takes over, the
 * lines wait below their masks. The class is
 * set before the first paint (in each project
 * page's head) and only while JavaScript runs.
 */

@media (prefers-reduced-motion: no-preference) {

    .project-title-pending .project-hero__name-line {
        transform: translateY(115%);
    }

}


/* =========================
   PROJECT MARQUEE
========================= */

.project-hero__marquee {
    grid-row: 3;

    width: 100%;

    overflow: hidden;
}


.project-hero__marquee-track {
    width: max-content;

    display: flex;
    align-items: center;

    animation:
        project-hero-marquee
        30s
        linear
        infinite;

    /*
     * Every duration in this file is written for a
     * reference loop (1280px at 16px). Each case
     * study lists its own disciplines, so its
     * marquee sets --marquee-length to its loop
     * divided by that reference, and every page
     * keeps the same speed.
     */

    animation-duration: calc(30s * var(--marquee-length, 1));
}


.project-hero__marquee-group {
    display: flex;
    align-items: center;

    gap: 40px;

    padding-right: 40px;

    flex-shrink: 0;
}


.project-hero__marquee span {
    font-family: var(--font-mono);

    font-size: var(--font-label-desktop);
    font-weight: var(--weight-regular);

    line-height: 1.2;

    white-space: nowrap;

    color: var(--color-text);
}


/* =========================
   MARQUEE MOVEMENT
========================= */

/*
 * Each case study repeats its three disciplines
 * in eight copies and the track moves by exactly
 * one per loop. Even the shortest list stays
 * covered on screens over 3000px wide.
 */

@keyframes project-hero-marquee {

    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(calc(-100% / 8));
    }

}


/* =========================
   PROJECT INTRO
========================= */

.project-intro {
    width: 100%;

    padding-top: 120px;
}


.project-intro__inner {
    width: 100%;
}


/* =========================
   PROJECT IDENTITY
========================= */

.project-intro__identity {
    padding-inline: 48px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    gap: 36px;
}


/* =========================
   PROJECT LOGO
========================= */

.project-intro__logo {
    display: block;

    width: 120px;
    height: 120px;

    object-fit: contain;
}

/* =========================
   PROJECT INTRO TITLE
========================= */

/*
 * The secondary display step, one below the
 * project name: the same size as the Identity /
 * System / Application labels on every screen
 * (72px here, 64px Tablet, 48px Mobile).
 */

.project-intro__title {
    margin: 0;

    max-width: 920px;

    font-family: var(--font-display);

    font-size: min(
        72px,
        8.4svh
    );

    font-weight: var(--weight-bold);

    line-height: 1.04;
    letter-spacing: -0.02em;

    color: var(--color-text);
}


/* =========================
   PROJECT INTRO VISUAL
========================= */

.project-intro__visual {
    width: 100%;

    margin:
        72px
        0
        0;

    overflow: hidden;

    border-radius:
        16px
        16px
        0
        0;
}


.project-intro__visual img {
    display: block;

    width: 100%;
    height: auto;

    object-fit: cover;
}


/* =========================
   PROJECT OVERVIEW
========================= */

.project-overview {
    width: 100%;

    padding:
        140px
        48px
        0;
}


.project-overview__inner {
    width: 100%;
    max-width: 820px;

    margin-inline: auto;
}


/* =========================
   OVERVIEW TEXT
========================= */

.project-overview__text {
    width: 100%;

    margin: 0;

    font-family: var(--font-mono);

    font-size: min(
        var(--font-body-desktop),
        1.95svh
    );

    font-weight: var(--weight-regular);

    line-height: 1.4;

    color: var(--color-text);
}


/* =========================
   OVERVIEW SERVICES
========================= */

.project-overview__services {
    margin:
        96px
        0
        0;

    text-align: center;

    font-family: var(--font-mono);

    font-size: min(
        var(--font-body-desktop),
        1.95svh
    );

    font-weight: var(--weight-regular);

    line-height: 1.2;

    color: var(--color-text);
}

/*
 * Each discipline is one unbreakable unit, so a
 * line only breaks between two of them, and the
 * "·" belongs to the discipline after it. Screen
 * readers hear a comma instead of the "·".
 */

.project-overview__services span {
    white-space: nowrap;
}

.project-overview__services span + span::before {
    content: "· ";
    content: "· " / ", ";
}


/* =========================
   PROJECT PROCESS
========================= */

.project-process {
    width: 100%;

    padding:
        160px
        48px
        0;
}


.project-process__inner {
    width: 100%;
    max-width: 1160px;

    margin-inline: auto;

    display: grid;

    grid-template-columns:
        minmax(280px, 360px)
        minmax(420px, 520px);

    justify-content: space-between;
    align-items: center;

    gap: 120px;
}


/* =========================
   PROCESS CONTENT
========================= */

.project-process__content {
    display: flex;
    flex-direction: column;

    gap: 20px;
}


.project-process__title {
    margin: 0;

    font-family: var(--font-display);

    font-size: min(
        var(--font-subtitle-desktop),
        2.34svh
    );

    font-weight: var(--weight-bold);

    line-height: 1.1;

    color: var(--color-text);
}


.project-process__text {
    margin: 0;

    max-width: 360px;

    font-family: var(--font-mono);

    font-size: min(
        var(--font-body-desktop),
        1.95svh
    );

    font-weight: var(--weight-regular);

    line-height: 1.35;

    color: var(--color-text);
}


/* =========================
   PROCESS VISUAL
========================= */

.project-process__visual {
    width: 100%;

    margin: 0;

    justify-self: end;

    overflow: hidden;
}


.project-process__visual img {
    display: block;

    width: 100%;
    height: auto;

    object-fit: cover;
}


/* =========================
   PROJECT SYSTEM
========================= */

.project-system {
    width: 100%;

    display: flex;
    align-items: center;

    padding: 160px 0;
}


.project-system__inner {
    width: 100%;
    max-width: 1280px;

    margin-inline: auto;
    padding-inline: 48px;

    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;

    gap: 120px;

    align-items: center;
}


/* =========================
   ITEMS / ACCORDION
========================= */

.project-system__content {
    display: flex;
    flex-direction: column;

    gap: 42px;
}


.project-system__item {
    display: flex;
    flex-direction: column;

    align-items: flex-start;
}


/* =========================
   TRIGGER
========================= */

.project-system__trigger {
    margin: 0;
    padding: 0;

    appearance: none;
    border: 0;
    background: transparent;

    color: var(--color-text);

    text-align: left;

    cursor: pointer;
}


.project-system__label {
    margin: 0;

    font-family: var(--font-display);

    font-size: min(
        72px,
        8.4svh
    );

    font-weight: var(--weight-bold);

    line-height: 0.95;
    letter-spacing: 0;
}


/* =========================
   TEXT PANEL
========================= */

.project-system__panel {
    overflow: hidden;
}


.project-system__text {
    width: 100%;
    max-width: 390px;

    margin: 22px 0 0;

    font-family: var(--font-mono);

    font-size: min(
        var(--font-body-desktop),
        1.95svh
    );

    font-weight: var(--weight-regular);

    line-height: 1.35;

    color: var(--color-text);
}


/* =========================
   VISUAL
========================= */

.project-system__visual {
    position: relative;

    width: 100%;
    height: 420px;

    margin: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
}


/*
 * Todas as imagens ocupam exatamente
 * o mesmo espaço.
 *
 * Isso impede o visual de "pular"
 * quando mudamos de aba.
 */

.project-system__image {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: contain;

    opacity: 0;
    visibility: hidden;

    pointer-events: none;
}


.project-system__image.is-active {
    opacity: 1;
    visibility: visible;
}


/* =========================
   HOVER
========================= */

.project-system__trigger:hover
.project-system__label {
    opacity: 0.6;
}


/* =========================
   REDUCED MOTION
========================= */

@media (prefers-reduced-motion: reduce) {

    .project-system__trigger,
    .project-system__image,
    .project-system__panel {
        transition: none;
    }

}


/* =========================
   PROJECT OUTCOME
========================= */

.project-outcome {
    width: 100%;

    padding:
        160px
        48px
        0;
}


.project-outcome__inner {
    width: 100%;
    max-width: 1160px;

    margin-inline: auto;
}


/* =========================
   OUTCOME CONTENT
========================= */

.project-outcome__content {
    max-width: 760px;
}


.project-outcome__title {
    margin: 0;

    font-family: var(--font-display);

    font-size: min(
        var(--font-subtitle-desktop),
        2.34svh
    );

    font-weight: var(--weight-bold);

    line-height: 1.1;

    color: var(--color-text);
}


.project-outcome__text {
    margin: 20px 0 0;

    font-family: var(--font-mono);

    font-size: min(
        var(--font-body-desktop),
        1.95svh
    );

    font-weight: var(--weight-regular);

    line-height: 1.35;

    color: var(--color-text);
}


/* =========================
   OUTCOME VISUAL
========================= */

.project-outcome__visual {
    width: 72%;
    max-width: 820px;

    margin:
        72px
        auto
        0;
}


.project-outcome__visual img {
    display: block;

    width: 100%;
    height: auto;

    object-fit: cover;
}


/* =========================
   OUTCOME VIDEO
========================= */

/*
 * js/project-outcome-video.js. The video keeps its
 * own 2:1 frame at every width, never cropped or
 * stretched. Until the poster arrives the frame
 * shows the poster's tone. The button in its corner
 * is the same circle as the nav's motion toggle,
 * with a light ring so it reads on dark frames too.
 */

.project-outcome__player {
    position: relative;
}

.project-outcome__video {
    display: block;

    width: 100%;
    height: auto;

    aspect-ratio: 2 / 1;
    object-fit: contain;

    background-color: #e4e1d9;
}

/* Without JavaScript: the poster, in the same frame */

.project-outcome__player .project-outcome__fallback {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;
}

.project-outcome__toggle {
    position: absolute;
    right: var(--space-16);
    bottom: var(--space-16);

    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background-color: var(--color-text);
    color: var(--color-background);

    box-shadow: 0 0 0 1px rgba(253, 253, 243, 0.5);

    cursor: pointer;
}

.project-outcome__toggle[hidden] {
    display: none;
}

/* The hit area grows to 44px */

.project-outcome__toggle::before {
    content: "";

    position: absolute;
    inset: -6px;
}

.project-outcome__icon {
    width: 12px;
    height: 12px;

    display: block;
}

.project-outcome__icon--play,
.project-outcome__toggle.is-paused .project-outcome__icon--pause {
    display: none;
}

.project-outcome__toggle.is-paused .project-outcome__icon--play {
    display: block;
}

@media (forced-colors: active) {
    .project-outcome__toggle {
        border: 1px solid ButtonText;
    }
}


/* =========================
   REDUCED MOTION
========================= */

/*
 * Reduced motion starts the loop paused; the
 * motion toggle (js/motion-toggle.js) pauses
 * or plays it for everyone.
 */

@media (prefers-reduced-motion: reduce) {
    .project-hero__marquee-track {
        animation-play-state: paused;
    }
}

[data-motion="paused"] .project-hero__marquee-track {
    animation-play-state: paused;
}

[data-motion="playing"] .project-hero__marquee-track {
    animation-play-state: running;
}

/* ========================================
   PROJECT SECTION RHYTHM
======================================== */

.project-process,
.project-system,
.project-outcome {
    padding-top: 0;
    padding-bottom: 0;
}

.project-process,
.project-system,
.project-outcome {
    margin-top: 180px;
}

/* =========================
   PROJECT PAGE — DESKTOP
========================= */

/*
 * The disciplines marquee follows the Home and Works
 * Hero marquees: 16px on shorter screens, growing
 * with the screen height to 18px at 1023px tall. Its
 * row keeps the height of the 16px line it was laid
 * out with (16px × 1.2), so the Hero stays where it
 * is. The line keeps that line's leading (16px × 0.2)
 * and grows upward from the row's bottom edge, so the
 * text stays on the same baseline.
 */

@media (min-width: 1025px) {

    .project-hero__marquee-track {
        height: calc(var(--font-label-desktop) * 1.2);

        align-items: flex-end;
    }

    .project-hero__marquee span {
        font-size: clamp(
            var(--font-label-desktop),
            1.76svh,
            var(--font-marquee-desktop)
        );
        line-height: calc(1em + var(--font-label-desktop) * 0.2);
    }
}

/*
 * A larger size makes a longer loop (the reference
 * loop is 1280px at 16px, 1400px at 18px), so the
 * loop runs longer to keep the 16px speed of about
 * 42.7px/s: 30s scaled by the loop length, then by
 * the page's --marquee-length. Between 910px and
 * 1022px tall the size grows with the screen
 * height, so the duration steps up through that
 * range in four bands, each within about 1% of the
 * exact speed.
 */

@media (min-width: 1025px) and (min-height: 910px) {
    .project-hero__marquee-track { animation-duration: calc(30.369s * var(--marquee-length, 1)); }
}

@media (min-width: 1025px) and (min-height: 939px) {
    .project-hero__marquee-track { animation-duration: calc(31.074s * var(--marquee-length, 1)); }
}

@media (min-width: 1025px) and (min-height: 967px) {
    .project-hero__marquee-track { animation-duration: calc(31.767s * var(--marquee-length, 1)); }
}

@media (min-width: 1025px) and (min-height: 995px) {
    .project-hero__marquee-track { animation-duration: calc(32.46s * var(--marquee-length, 1)); }
}

@media (min-width: 1025px) and (min-height: 1023px) {
    .project-hero__marquee-track { animation-duration: calc(32.813s * var(--marquee-length, 1)); }
}

/* =========================
   PROJECT PAGE — TABLET
========================= */

/*
 * Shared by every project page. Layout and spacing
 * follow the Figma Tablet frame; type sizes reuse
 * the approved Home and Works Tablet system:
 *
 *   Hero      same as the Works Tablet hero: 72px /
 *             40px grid rows, 80px display title,
 *             16px marquee with 32px gaps.
 *
 *   Intro     logo, 64px headline (the secondary
 *             display step, as the System labels)
 *             and full-bleed media, with the Figma
 *             spacing.
 *
 *   Process   text left and visual right while both
 *             Desktop minimum widths fit; below that
 *             the visual drops under the text.
 *
 *   System    one column: heading, description,
 *             half-width visual, remaining headings.
 *
 *   Outcome   text and media span the content width.
 *
 *   Body copy is 18px everywhere, section titles
 *   22px, and no type size depends on the screen
 *   height. Contact is shared through contact.css.
 */

@media (min-width: 768px) and (max-width: 1024.98px) {

    /* =========================
       HERO
    ========================= */

    .project-hero__inner {
        grid-template-rows:
            72px
            1fr
            auto
            40px;
    }

    .project-hero__name {
        font-size: var(--font-display-tablet);
        line-height: 0.85;
    }

    /*
     * The marquee row keeps the height of the 12px
     * line the Tablet Hero was laid out with (12px ×
     * 1.2), and the 16px line grows upward from its
     * bottom edge on the same baseline, as on the
     * Home and Works Heroes. Its tallest letters reach
     * just past that row, so the strip only clips
     * sideways; a clipping box loses the zero minimum
     * width of a scroll container, so it is set back
     * here.
     *
     * The 16px reference loop is longer (1216px
     * instead of 976px), so it runs longer too (30s ×
     * 1216 / 976, then × --marquee-length) and keeps
     * the same speed of about 32.5px/s.
     */

    .project-hero__marquee {
        min-width: 0;

        overflow-x: clip;
        overflow-y: visible;
    }

    .project-hero__marquee-track {
        height: calc(12px * 1.2);

        align-items: flex-end;

        animation-duration: calc(37.377s * var(--marquee-length, 1));
    }

    .project-hero__marquee-group {
        gap: 32px;
        padding-right: 32px;
    }

    .project-hero__marquee span {
        font-size: var(--font-marquee-tablet);
        line-height: calc(1em + 12px * 0.2);
    }


    /* =========================
       INTRO
    ========================= */

    .project-intro {
        padding-top: 160px;
    }

    .project-intro__identity {
        gap: 72px;
    }

    .project-intro__logo {
        width: 192px;
        height: 192px;
    }

    .project-intro__title {
        font-size: 64px;
    }

    .project-intro__visual {
        margin-top: 88px;
    }


    /* =========================
       OVERVIEW
    ========================= */

    .project-overview {
        padding-top: 76px;
    }

    .project-overview__text {
        font-size: 18px;
    }

    .project-overview__services {
        margin-top: 72px;

        font-size: 18px;
    }


    /* =========================
       SECTION RHYTHM
    ========================= */

    .project-process,
    .project-system,
    .project-outcome {
        margin-top: 210px;
    }

    /*
     * Contact starts on the same rhythm: 210px minus
     * its own 72px top padding. Contact itself is
     * untouched.
     */

    main > .contact {
        margin-top: 138px;
    }


    /* =========================
       PROCESS
    ========================= */

    /*
     * Text and visual sit side by side only while
     * the Desktop minimums fit (360px text, 420px
     * visual, 48px gap). Otherwise the visual wraps
     * under the text and centers, as in the Figma.
     */

    .project-process__inner {
        display: flex;
        flex-wrap: wrap;
        align-items: center;

        gap: 56px 48px;
    }

    .project-process__content {
        flex: 1 1 360px;

        min-width: 0;
        max-width: 520px;
    }

    .project-process__visual {
        flex: 1 1 420px;

        min-width: 0;
        max-width: 600px;

        margin-inline: auto;
    }

    .project-process__title {
        font-size: var(--font-subtitle-tablet);
    }

    .project-process__text {
        max-width: none;

        font-size: 18px;
    }


    /* =========================
       IDENTITY / SYSTEM / APPLICATION
    ========================= */

    /*
     * One column. The items and the visual become
     * siblings, and the visual sits right after the
     * active item (heading + open description), with
     * the remaining headings below it. project-system.js
     * moves .is-active on click, so the visual follows
     * the open item with no extra script.
     */

    .project-system__inner {
        display: flex;
        flex-direction: column;
        align-items: flex-start;

        gap: 42px;
    }

    .project-system__content {
        display: contents;
    }

    .project-system__item.is-active ~ .project-system__item {
        order: 2;
    }

    .project-system__visual {
        order: 1;

        width: calc(50% - 24px);
        height: auto;
        aspect-ratio: 1 / 1;

        margin: 14px 0;

        overflow: visible;
    }

    .project-system__image {
        object-position: left top;
    }

    /*
     * The visual area stays the approved Identity
     * square. System and Application are landscape,
     * so they render 4/3 as wide as that square, at
     * their own aspect ratio and on the text's left
     * edge. A 16:9 image then covers about the same
     * area as the square and still fits inside its
     * height, so the spacing is unchanged.
     * (max-width lifts the reset's img cap of 100%.)
     *
     * A case study whose Identity image is landscape
     * too (project-system--landscape) gives it the same
     * size, so all three tabs match.
     */

    .project-system__image[data-system-image="system"],
    .project-system__image[data-system-image="application"],
    .project-system--landscape .project-system__image[data-system-image="identity"] {
        right: auto;
        bottom: auto;

        width: calc(100% * 4 / 3);
        max-width: none;
        height: auto;
    }

    /*
     * During a switch, project-system.js keeps both the
     * old and the new image marked .is-active until the
     * old one has faded out. The visual has already
     * moved under the new item by then, so it stays
     * hidden for that moment and fades back in once
     * the switch is done. A filter is used because GSAP
     * owns the visual's inline opacity (scroll reveal).
     */

    .project-system__visual {
        transition: filter 300ms ease;
    }

    .project-system__visual:has(
        .project-system__image.is-active ~ .project-system__image.is-active
    ) {
        filter: opacity(0);

        transition: none;
    }

    .project-system__label {
        font-size: 64px;
    }

    .project-system__text {
        max-width: 520px;

        margin-top: 38px;

        font-size: 18px;
    }


    /* =========================
       OUTCOME
    ========================= */

    .project-outcome__title {
        font-size: var(--font-subtitle-tablet);
    }

    .project-outcome__text {
        font-size: 18px;
    }

    .project-outcome__visual {
        width: 100%;

        margin-top: 80px;
    }

    /*
     * Whatever media the Outcome figure holds (an
     * image today, a video of the finished website
     * later) fills the figure's width at its own
     * aspect ratio.
     */

    .project-outcome__visual > * {
        display: block;

        width: 100%;
        height: auto;
    }
}


/* =========================
   PROJECT PAGE — MOBILE
========================= */

/*
 * Shared by every project page. Layout and spacing
 * follow the Figma Mobile frame; type sizes reuse
 * the approved Home and Works Mobile system:
 *
 *   Hero      same as the Works Mobile hero: 48px /
 *             32px grid rows, 60px display title,
 *             14px marquee with 24px gaps.
 *
 *   Intro     logo, 48px headline (the secondary
 *             display step, as the System labels)
 *             and full-bleed media.
 *
 *   Sections  one column inside the 20px page
 *             margins. Body copy is 16px, section
 *             titles 20px, labels 48px, and no type
 *             size depends on the screen height.
 *
 *   System    the open item's image sits under its
 *             description at its own aspect ratio.
 *
 *   Outcome   text, then full-bleed media.
 *
 *   Contact   shared through contact.css.
 */

@media (max-width: 767.98px) {

    /* =========================
       HERO
    ========================= */

    .project-hero__inner {
        grid-template-rows:
            48px
            1fr
            auto
            32px;
    }

    .project-hero__name {
        padding-inline: 20px;

        font-size: var(--font-display-mobile);
        line-height: 0.86;
    }

    /*
     * Same as Tablet with the 11px line the Mobile
     * Hero was laid out with: the 14px line grows
     * upward from the bottom of that row on the same
     * baseline. The 14px reference loop (1032px
     * instead of 852px) runs 30s × 1032 / 852, then
     * × --marquee-length, and keeps the same speed
     * of about 28.4px/s.
     */

    .project-hero__marquee {
        min-width: 0;

        overflow-x: clip;
        overflow-y: visible;
    }

    .project-hero__marquee-track {
        height: calc(11px * 1.2);

        align-items: flex-end;

        animation-duration: calc(36.338s * var(--marquee-length, 1));
    }

    .project-hero__marquee-group {
        gap: 24px;
        padding-right: 24px;
    }

    .project-hero__marquee span {
        font-size: var(--font-marquee-mobile);
        line-height: calc(1em + 11px * 0.2);
    }


    /* =========================
       INTRO
    ========================= */

    .project-intro {
        padding-top: 220px;
    }

    .project-intro__identity {
        padding-inline: 20px;

        gap: 72px;
    }

    .project-intro__logo {
        width: 192px;
        height: 192px;
    }

    .project-intro__title {
        font-size: 48px;
    }

    .project-intro__visual {
        margin-top: 52px;
    }


    /* =========================
       OVERVIEW
    ========================= */

    .project-overview {
        padding: 76px 20px 0;
    }

    .project-overview__text {
        font-size: 16px;
    }

    .project-overview__services {
        margin-top: 54px;

        text-align: left;

        font-size: 16px;
    }

    /*
     * Left-aligned, the label can wrap. Every
     * discipline then carries the "·" in front of
     * it, and the label starts one separator (2ch)
     * further left with that strip clipped. The "·"
     * in front of a line's first discipline is never
     * seen, so no line starts or ends with one, and
     * the visible text keeps the same left edge.
     */

    .project-overview__services {
        margin-left: -2ch;

        clip-path: inset(-0.5em -0.5em -0.5em 2ch);
    }

    .project-overview__services span:first-child::before {
        content: "· ";
        content: "· " / "";
    }


    /* =========================
       SECTION RHYTHM
    ========================= */

    /*
     * About 160px of air before each main section.
     * Outcome's 123px adds to the accordion's own
     * 40px end space (see .project-system below).
     */

    .project-process,
    .project-system {
        margin-top: 156px;
    }

    .project-outcome {
        margin-top: 123px;
    }

    /*
     * The last section to "Let's talk." follows the
     * Figma: 88px before Contact plus Contact's own
     * 72px top padding. Contact itself is untouched.
     */

    main > .contact {
        margin-top: 88px;
    }


    /* =========================
       PROCESS
    ========================= */

    /*
     * One column: title, text, then the visual at
     * the content width and its own aspect ratio.
     * The visual slides in from the right when it is
     * revealed, so the section clips horizontally to
     * keep the page one screen wide (clip does not
     * create a scroll container).
     */

    .project-process {
        padding-inline: 20px;

        overflow-x: clip;
    }

    .project-process__inner {
        grid-template-columns: minmax(0, 1fr);

        gap: 24px;
    }

    .project-process__title {
        font-size: var(--font-subtitle-mobile);
    }

    .project-process__text {
        max-width: none;

        font-size: 16px;
    }


    /* =========================
       IDENTITY / SYSTEM / APPLICATION
    ========================= */

    /*
     * Same one-column mechanics as Tablet: the items
     * and the visual become siblings, and the visual
     * sits right after the open item. project-system.js
     * moves .is-active on click; nothing else changes.
     */

    .project-system__inner {
        padding-inline: 20px;

        display: flex;
        flex-direction: column;
        align-items: flex-start;

        gap: 36px;
    }

    .project-system__content {
        display: contents;
    }

    .project-system__item.is-active ~ .project-system__item {
        order: 2;
    }

    /*
     * 40px more after the open image: before the next
     * heading, or, when the last item is open, at the
     * end of the section (the Figma gap before
     * Outcome).
     */

    .project-system__item.is-active + .project-system__item {
        margin-top: 40px;
    }

    .project-system {
        padding-bottom: 40px;
    }

    /*
     * The visual takes the height of the open item's
     * image, so every image keeps its own aspect ratio
     * and the gap to the next heading stays the same.
     * Images fit the content width, and square ones
     * stop at the approved 296px height.
     */

    .project-system__visual {
        order: 1;

        display: block;

        width: 100%;
        height: auto;

        margin: 0;
    }

    .project-system__image {
        inset: 0 auto auto 0;

        width: auto;
        height: auto;
        max-height: 296px;
    }

    .project-system__inner:has([data-system-item="identity"].is-active) [data-system-image="identity"],
    .project-system__inner:has([data-system-item="system"].is-active) [data-system-image="system"],
    .project-system__inner:has([data-system-item="application"].is-active) [data-system-image="application"] {
        position: relative;
    }

    /* Browsers without :has() size the visual by the active image. */

    @supports not selector(:has(a)) {

        .project-system__image.is-active {
            position: relative;
        }
    }

    /*
     * Same switch guard as Tablet: the visual stays
     * hidden while the old and the new image are both
     * active, then fades in under the open item.
     */

    .project-system__visual {
        transition: filter 300ms ease;
    }

    .project-system__visual:has(
        .project-system__image.is-active ~ .project-system__image.is-active
    ) {
        filter: opacity(0);

        transition: none;
    }

    .project-system__label {
        font-size: 48px;
    }

    .project-system__text {
        max-width: none;

        margin-top: 32px;

        font-size: 16px;
    }


    /* =========================
       OUTCOME
    ========================= */

    /*
     * The text keeps the page margins and the media
     * runs edge to edge, as in the Figma.
     */

    .project-outcome {
        padding-inline: 0;
    }

    .project-outcome__content {
        padding-inline: 20px;
    }

    .project-outcome__title {
        font-size: var(--font-subtitle-mobile);
    }

    .project-outcome__text {
        font-size: 16px;
    }

    .project-outcome__visual {
        width: 100%;
        max-width: none;

        margin-top: 56px;
    }

    /*
     * Whatever media the Outcome figure holds (an
     * image today, a video of the finished website
     * later) fills the figure's width at its own
     * aspect ratio.
     */

    .project-outcome__visual > * {
        display: block;

        width: 100%;
        height: auto;
    }
}
