/* ==========================================================
   Projects page.
   One accent (the site's yellow), square corners, no card boxes,
   whitespace instead of rules. Builds on f1.css tokens and header.
   ========================================================== */

.pj {
    --pj-accent: var(--yellow);
}

/* ---------- page title: the page simply opens on the work ---------- */
.pj-head {
    padding: 150px var(--gutter) 0;
}

.pj-head h1 {
    font: 400 clamp(28px, 4vw, 60px)/1.1 var(--display);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* ---------- fleet: sticky index + feed ---------- */
.pj-fleet {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: clamp(32px, 6vw, 110px);
    padding: clamp(48px, 7vh, 84px) var(--gutter) 40px;
    scroll-margin-top: 70px;
}

.pj-index {
    position: sticky;
    top: 118px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pj-index a {
    position: relative;
    display: block;
    padding: 9px 0 9px 20px;
    color: rgba(242, 242, 242, 0.38);
    transition: color 0.35s ease, padding-left 0.35s cubic-bezier(.2, .8, .2, 1);
}

.pj-index a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 0;
    height: 2px;
    background: var(--pj-accent);
    transform: translateY(-50%);
    transition: width 0.4s cubic-bezier(.2, .8, .2, 1);
}

.pj-index .y {
    display: block;
    margin-bottom: 6px;
    font: 400 9px/1 var(--display);
    letter-spacing: 0.18em;
}

.pj-index .n {
    display: block;
    font: 400 12px/1.2 var(--display);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.pj-index a:hover,
.pj-index a.is-current {
    color: #fff;
}

.pj-index a.is-current {
    padding-left: 30px;
}

.pj-index a.is-current::before {
    width: 16px;
}

.pj-feed {
    display: flex;
    flex-direction: column;
    gap: clamp(110px, 15vh, 190px);
    min-width: 0;
}

/* ---------- plates ---------- */
.pj-plate {
    scroll-margin-top: 96px;
}

.pj-photo {
    position: relative;
    overflow: hidden;
    background: #0b0c0e;
}

.pj-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--pos, 50% 50%);
    transition: transform 1.2s cubic-bezier(.2, .8, .2, 1);
}

.pj-plate:hover .pj-photo img {
    transform: scale(1.025);
}

.pj-plate--wide .pj-photo {
    aspect-ratio: 16 / 9;
}

.pj-body {
    padding-top: 34px;
}

.pj-name {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 20px;
    font: 400 clamp(22px, 2.7vw, 42px)/1.15 var(--display);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.pj-name small {
    font: 400 11px/1 var(--display);
    letter-spacing: 0.18em;
    color: var(--muted);
}

.pj-result {
    margin-top: 16px;
    font: 600 clamp(19px, 1.7vw, 25px)/1.3 var(--ui);
}

.pj-plate--wide .pj-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: clamp(32px, 5vw, 90px);
}

.pj-plate--wide .pj-name,
.pj-plate--wide .pj-result {
    grid-column: 1;
}

.pj-plate--wide .pj-text {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: end;
}

.pj-plate--wide .pj-specs {
    grid-column: 1 / -1;
}

.pj-text {
    max-width: 52ch;
    margin-top: 22px;
    color: rgba(242, 242, 242, 0.82);
    font-size: 19px;
    line-height: 1.65;
    text-wrap: pretty;
}

.pj-specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, max-content));
    gap: 24px clamp(28px, 4vw, 64px);
    margin-top: 34px;
}

.pj-specs dt {
    font: 400 9px/1 var(--display);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.pj-specs dd {
    margin-top: 10px;
    font: 500 18px/1.35 var(--ui);
}

/* tall variant: portrait photo and text side by side */
.pj-plate--tall {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    column-gap: clamp(32px, 5vw, 80px);
    align-items: end;
}

.pj-plate--tall .pj-photo {
    aspect-ratio: 4 / 5;
}

.pj-plate--tall .pj-body {
    padding-top: 0;
}

.pj-plate--tall .pj-strip {
    grid-column: 1 / -1;
}

/* the vehicle itself, small, along the foot of each plate */
.pj-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-top: 46px;
}

.pj-rocket {
    flex: 1;
    min-width: 0;
    max-width: 640px;
    height: 54px;
    object-fit: contain;
    object-position: left center;
    transition: transform 0.6s cubic-bezier(.2, .8, .2, 1);
}

.pj-plate:hover .pj-rocket {
    transform: translateX(8px);
}

.pj-insig {
    flex: none;
    height: 54px;
    width: auto;
}

/* ---------- what is next ---------- */
.pj-next {
    padding: clamp(100px, 16vh, 200px) var(--gutter) clamp(80px, 12vh, 150px);
}

.pj-next-title {
    max-width: 18ch;
    margin-bottom: 56px;
    font: 400 clamp(22px, 2.8vw, 42px)/1.3 var(--display);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.pj-next-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 10px;
}

.pj-panel {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: clamp(380px, 52vh, 560px);
    overflow: hidden;
    padding: clamp(26px, 3vw, 44px);
    background: #0b0c0e;
}

.pj-panel--b {
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 0.9px, transparent 1.3px);
    background-size: 3px 3px;
}

.pj-panel-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 46% 100%;
    filter: brightness(0.7);
    transition: filter 0.8s ease, transform 1.4s cubic-bezier(.2, .8, .2, 1);
}

.pj-panel--a:hover .pj-panel-bg {
    filter: brightness(0.85);
    transform: scale(1.04);
}

.pj-panel--a::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(5, 5, 6, 0.85), rgba(5, 5, 6, 0.1) 70%);
}

.pj-panel-body {
    position: relative;
    z-index: 1;
    max-width: 44ch;
}

.pj-big {
    display: block;
    margin-bottom: 22px;
    font: 400 clamp(40px, 6vw, 92px)/1 var(--display);
    letter-spacing: 0.02em;
    color: var(--pj-accent);
}

.pj-panel--b .pj-big {
    font-size: clamp(30px, 4.2vw, 62px);
}

.pj-panel h3 {
    font: 400 clamp(14px, 1.3vw, 19px)/1.4 var(--display);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pj-panel p {
    margin-top: 16px;
    color: rgba(242, 242, 242, 0.8);
    font-size: 18px;
    line-height: 1.6;
}

.pj-also {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px clamp(32px, 6vw, 110px);
    margin-top: clamp(70px, 10vh, 120px);
}

.pj-also b {
    display: block;
    margin-bottom: 14px;
    font: 400 13px/1.3 var(--display);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pj-also span {
    display: block;
    max-width: 42ch;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
}

/* ---------- scroll-driven photo settle (where supported) ---------- */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .pj-photo img {
            animation: pj-settle linear both;
            animation-timeline: view();
            animation-range: entry 0% cover 55%;
        }

        @keyframes pj-settle {
            from {
                transform: scale(1.16);
            }

            to {
                transform: scale(1);
            }
        }
    }
}

/* ---------- small screens ---------- */
@media (max-width: 960px) {
    .pj-head {
        padding-top: 118px;
    }

    .pj-fleet {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .pj-index {
        position: sticky;
        top: 76px;
        z-index: 5;
        flex-direction: row;
        gap: 22px;
        margin-inline: calc(var(--gutter) * -1);
        padding: 12px var(--gutter);
        overflow-x: auto;
        background: rgba(5, 5, 6, 0.82);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        scrollbar-width: none;
    }

    .pj-index::-webkit-scrollbar {
        display: none;
    }

    .pj-index a,
    .pj-index a.is-current {
        flex: none;
        padding: 6px 0;
    }

    .pj-index a::before {
        display: none;
    }

    .pj-index a.is-current .n {
        border-bottom: 2px solid var(--pj-accent);
        padding-bottom: 6px;
    }

    .pj-plate--wide .pj-body,
    .pj-plate--tall {
        display: block;
    }

    .pj-plate--tall .pj-body {
        padding-top: 34px;
    }

    .pj-plate--wide .pj-text {
        margin-top: 22px;
    }

    .pj-next-grid,
    .pj-also {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .pj-strip {
        margin-top: 34px;
    }

    .pj-rocket {
        height: 40px;
    }

    .pj-insig {
        height: 40px;
    }
}


/* ---------- under each project: rank, highlights, mission data ---------- */
.pj-more {
    display: grid;
    grid-template-columns: minmax(140px, 3fr) minmax(0, 5fr) minmax(0, 5fr);
    gap: clamp(24px, 3.4vw, 60px);
    margin-top: 48px;
    padding-top: 34px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.pj-plate--tall .pj-more {
    grid-column: 1 / -1;
}

.pj-rank b {
    display: block;
    font: 400 clamp(44px, 6vw, 92px)/1 var(--display);
    letter-spacing: 0.01em;
    color: var(--pj-accent);
}

.pj-rank i {
    display: block;
    margin-top: 14px;
    font: 400 12px/1 var(--display);
    font-style: normal;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.pj-rank span {
    display: block;
    margin-top: 12px;
    max-width: 22ch;
    color: var(--muted);
    font: 500 15px/1.45 var(--ui);
}

.pj-more h3 {
    margin-bottom: 18px;
    font: 400 9px/1 var(--display);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.pj-notes ol {
    list-style: none;
    counter-reset: n;
}

.pj-notes li {
    counter-increment: n;
    position: relative;
    padding: 14px 0 14px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(242, 242, 242, 0.82);
    font-size: 17px;
    line-height: 1.55;
}

.pj-notes li:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pj-notes li::before {
    content: "0" counter(n);
    position: absolute;
    left: 0;
    top: 19px;
    font: 400 9px/1 var(--display);
    letter-spacing: 0.1em;
    color: var(--muted);
}

.pj-data dl div {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    gap: 16px;
    padding: 13px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pj-data dl div:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pj-data dt {
    font: 400 9px/1.6 var(--display);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.pj-data dd {
    font: 500 17px/1.4 var(--ui);
}

@media (max-width: 960px) {
    .pj-more {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

.pj-rank b {
    white-space: nowrap;
}

.pj-rank--txt b {
    font-size: clamp(34px, 4.4vw, 66px);
}


/* sticky index: larger names, one line of description under each */
.pj-index {
    gap: 4px;
}

.pj-index a {
    padding: 11px 0 11px 20px;
}

.pj-index .y {
    font-size: 10.5px;
    margin-bottom: 7px;
}

.pj-index .n {
    font-size: 15px;
    line-height: 1.25;
}

.pj-index .d {
    display: block;
    max-width: 24ch;
    margin-top: 7px;
    color: var(--muted);
    font: 500 14px/1.35 var(--ui);
    letter-spacing: 0;
    text-transform: none;
    transition: color 0.35s ease;
}

.pj-index a:hover .d,
.pj-index a.is-current .d {
    color: rgba(242, 242, 242, 0.8);
}

@media (max-width: 960px) {
    .pj-index .d {
        display: none;
    }

    .pj-index .n {
        font-size: 13px;
    }
}

.pj-fleet {
    grid-template-columns: 250px minmax(0, 1fr);
}

.pj-index {
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    scrollbar-width: none;
}

.pj-index::-webkit-scrollbar {
    display: none;
}

@media (max-width: 960px) {
    .pj-fleet {
        grid-template-columns: 1fr;
    }

    .pj-index {
        max-height: none;
        overflow-y: visible;
    }
}


/* the line under the heading reads on from it, left to right */
.pj-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    align-items: last baseline;
    gap: 10px clamp(24px, 3vw, 48px);
}

.pj-lede {
    max-width: 50ch;
    color: var(--muted);
    font: 500 clamp(16px, 1.35vw, 20px)/1.5 var(--ui);
    text-wrap: pretty;
}

.pj-index .d {
    display: none;
}

@media (max-width: 960px) {
    .pj-lede {
        flex-basis: 100%;
    }
}


/* ---------- engines ---------- */
.pj-eng {
    padding: clamp(80px, 12vh, 150px) var(--gutter) 0;
}

.pe-hero {
    position: relative;
    aspect-ratio: 21 / 8;
    min-height: 220px;
    overflow: hidden;
    background: #000;
}

.pe-hero video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 32%;
}

.pe-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(5, 5, 6, 0.85), rgba(5, 5, 6, 0) 45%);
}

.pe-hero figcaption {
    position: absolute;
    z-index: 1;
    left: clamp(18px, 2.4vw, 32px);
    bottom: clamp(16px, 2vw, 28px);
    font: 400 9px/1 var(--display);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted);
}

.pe-hero figcaption b {
    display: block;
    margin-bottom: 10px;
    color: #fff;
    font: 400 clamp(15px, 2vw, 26px)/1 var(--display);
    letter-spacing: 0.02em;
}

.pe-list {
    margin-top: clamp(48px, 7vw, 90px);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.pe-row {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(28px, 5vw, 88px);
    align-items: center;
    padding: clamp(36px, 5vw, 64px) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pe-fig {
    position: relative;
    padding: 40px 18px 18px;
    background-color: #08090b;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 0.9px, transparent 1.3px);
    background-size: 14px 14px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.pe-cap {
    position: absolute;
    left: 18px;
    top: 16px;
    font: 400 9px/1 var(--display);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.pe-fig svg {
    display: block;
    width: 100%;
    height: auto;
    fill: none;
    stroke: #fff;
    stroke-width: 1.25;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pe-fig .m { stroke-opacity: 0.55; }
.pe-fig .f { stroke-opacity: 0.22; }
.pe-fig .dot { fill: #fff; stroke: none; }

.pe-name {
    font: 400 clamp(26px, 3.6vw, 54px)/1.05 var(--display);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.pe-text {
    max-width: 46ch;
    margin-top: 20px;
    color: rgba(242, 242, 242, 0.8);
    font-size: 18px;
    line-height: 1.6;
}

.pe-data {
    margin-top: 28px;
}

.pe-data div {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pe-data div:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pe-data dt {
    font: 400 9px/1.6 var(--display);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.pe-data dd {
    font: 500 17px/1.4 var(--ui);
}

@media (max-width: 860px) {
    .pe-row {
        grid-template-columns: 1fr;
        gap: 26px;
    }
}


/* ---------- engines page ---------- */
.pj-photo video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 32%;
}

.pe-soon {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background-color: #08090b;
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 0.9px, transparent 1.3px);
    background-size: 14px 14px;
    text-align: center;
}

.pe-soon b {
    font: 400 clamp(26px, 4.6vw, 64px)/1 var(--display);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.8);
}

.pe-soon span {
    font: 400 10px/1 var(--display);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.pj-plate--wide .pj-more {
    grid-column: 1 / -1;
}

/* text-style ranks such as "2.2 kN" need a little more room */
.pj-more {
    grid-template-columns: minmax(190px, 3.6fr) minmax(0, 5fr) minmax(0, 5fr);
}

.pj-rank--txt b {
    font-size: clamp(28px, 3.4vw, 50px);
}

@media (max-width: 960px) {
    .pj-more {
        grid-template-columns: 1fr;
    }
}


/* ---------- software page ---------- */
.sw-main {
    aspect-ratio: var(--r, 16 / 10);
}

.sw-main img {
    object-fit: cover;
}

.sw-plate .pj-more {
    grid-column: 1 / -1;
}

.sw-shots {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(16px, 2vw, 32px);
    margin-top: clamp(40px, 5vw, 64px);
}

.sw-shots figure {
    margin: 0;
}

.sw-shots img {
    display: block;
    width: 100%;
    aspect-ratio: var(--r, 16 / 10);
    object-fit: cover;
    background: #08090b;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.sw-shots figcaption {
    margin-top: 14px;
    color: var(--muted);
    font: 400 9px/1.5 var(--display);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

@media (max-width: 700px) {
    .sw-shots {
        grid-template-columns: 1fr;
    }
}
