/* ===== Password gate ===== */
.cs-gate {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

html.cs-locked .cs-gate {
    display: flex;
}

html.cs-locked .home.project {
    display: none;
}

.cs-gate__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 360px;
    padding: 0 32px;
    text-align: center;
}

.cs-gate__form h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
}

.cs-gate__form p {
    margin: 0;
    font-size: 15px;
    color: var(--muted);
}

.cs-gate__input {
    font: inherit;
    font-size: 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: transparent;
    color: var(--ink);
}

.cs-gate__submit {
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 14px;
    border: 1px solid var(--ink);
    border-radius: 4px;
    background: var(--ink);
    color: var(--bg);
    cursor: none;
}

.cs-gate__submit:hover {
    opacity: 0.85;
}

.cs-gate__error {
    display: none;
    margin: 0;
    color: #d3492f;
    font-size: 14px;
}

.project__layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    align-items: stretch;
    padding-left: max(0px, calc((100% - 1440px) / 2));
    padding-right: max(0px, calc((100% - 1440px) / 2));
}

.home__header + .project__layout .project__main > .project__row:first-child,
.home__header + .project__layout > .project__sidebar {
    border-top: none;
}

.project__row {
    width: 100%;
    box-sizing: border-box;
    border-top: 1px solid var(--line);
    padding: 28px 32px;
    position: relative;
}

.project__row::before {
    content: "";
    position: absolute;
    top: -1px;
    right: 100%;
    width: 50vw;
    height: 1px;
    background: var(--line);
    pointer-events: none;
}

.home__header + .project__layout .project__main > .project__row:first-child::before {
    display: none;
}

.project__sidebar {
    border-left: 1px solid var(--line);
    border-top: 1px solid var(--line);
    padding: 28px 32px;
}

.project__sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: sticky;
    top: 112px;
}

.project__meta h3 {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.project__meta p {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
}

.project__title-row h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.project__section {
    display: flex;
    align-items: flex-start;
    gap: 48px;
}

.project__section-text {
    flex: 0 0 335px;
    max-width: 335px;
}

.project__section-text--wide {
    flex: 0 0 auto;
    max-width: 588px;
}

.project__section-text h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
}

.project__section-text p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.project__section-text p + p {
    margin-top: 16px;
}

.project__image {
    flex: 1 1 auto;
    width: 100%;
    max-width: 640px;
    height: auto;
    display: block;
}

.project__image--sm {
    flex: 0 0 auto;
    max-width: 360px;
    margin-left: auto;
}

.project__placeholder {
    background: #d9d9d9;
    flex: 1 1 auto;
    width: 100%;
    max-width: 659px;
    aspect-ratio: 659 / 377;
    align-self: stretch;
}

.project__quote {
    flex: 1 1 auto;
    max-width: 659px;
    margin: 0;
    font-size: 24px;
    font-style: italic;
    line-height: 1.4;
}

.project__subrow {
    display: flex;
    align-items: flex-start;
    gap: 48px;
}

.project__subrow--reverse {
    flex-direction: row-reverse;
}

.project__insight-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
}

.project__insight-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 48px;
}

.project__insight-grid p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.project__subrow + .project__insight-grid {
    margin-top: 40px;
}

.project__insight-grid + .project__placeholder,
.project__insight-grid + .project__image {
    margin-top: 40px;
}

.project__placeholder + .project__placeholder,
.project__image + .project__image,
.project__placeholder + .project__image,
.project__image + .project__placeholder {
    margin-top: 40px;
}

.project__duo {
    display: flex;
    gap: 24px;
    margin-top: 24px;
}

.project__duo .project__image {
    flex: 1 1 0;
    max-width: none;
    width: 100%;
    min-width: 0;
}

.project__duo .project__placeholder {
    flex: 1 1 0;
    max-width: none;
    aspect-ratio: 502 / 288;
}

.project__gallery {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 927px;
    margin: 0 auto;
}

.project__gallery .project__placeholder {
    max-width: none;
    aspect-ratio: 927 / 530;
}

.project__gallery .project__image {
    max-width: none;
    width: 100%;
}

.project__eyebrow {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.project__feature-list {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.project__section-text + .project__feature-list {
    margin-top: 24px;
}

.project__section-text + .project__feature-list--gap-lg {
    margin-top: 64px;
}

.project__subrow + .project__feature-list {
    margin-top: 40px;
}

.project__feature-list + .project__placeholder,
.project__feature-list + .project__image {
    margin-top: 80px;
}

.project__section-text + .project__duo {
    margin-top: 24px;
}

.project__duo + .project__feature-list {
    margin-top: 40px;
}

.project__section-text + .project__contrib-grid {
    margin-top: 24px;
}

.project__stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
    flex: 1 1 auto;
}

.project__stack-media {
    width: 100%;
    max-width: 838px;
    height: auto;
    display: block;
}

.project__section-heading {
    margin: 0 0 24px;
    font-size: 24px;
    font-weight: 400;
}

.project__contrib-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.project__contrib-grid > div {
    padding: 0 28px;
    border-left: 1px solid var(--line);
}

.project__contrib-grid > div:first-child {
    padding-left: 0;
    border-left: none;
}

.project__contrib-grid p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.project__learn-more {
    padding-bottom: 64px;
}

.project__learn-more a {
    display: block;
    color: var(--ink);
    font-size: 16px;
}

.project__learn-more a + a {
    margin-top: 8px;
}

@media (max-width: 900px) {
    .project__layout {
        grid-template-columns: 1fr;
    }

    .project__sidebar {
        border-left: none;
        border-top: 1px solid var(--line);
    }

    .project__section,
    .project__subrow,
    .project__subrow--reverse,
    .project__duo {
        flex-direction: column;
        gap: 24px;
    }

    .project__section-text {
        max-width: none;
    }

    .project__contrib-grid {
        grid-template-columns: 1fr;
        row-gap: 24px;
    }

    .project__contrib-grid > div {
        padding-left: 0;
        border-left: none;
    }

    .project__insight-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}
