/*
 * Bootstrap Package wraps every colPos-0 element in a `.section` div with
 * `overflow: hidden` (components/_section.scss). Any ancestor with a
 * non-visible overflow breaks `position: sticky` on a descendant, so this
 * has to be reset specifically where it would wrap this block.
 */
.section:has(> .mission-control) {
    overflow: visible;
}

.mission-control {
    position: relative;
    background: var(--pm-color-ink);
    color: var(--pm-color-paper);
}

.mission-sticky {
    position: relative;
    isolation: isolate;
    padding-block: clamp(56px, 8vw, 96px);
}

.mission-bg,
.mission-bg span {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.mission-bg {
    z-index: -1;
    background:
        linear-gradient(120deg, rgba(10, 12, 15, 0.82), rgba(17, 24, 32, 0.68)),
        url("mission-bg-2560w.jpg") center / cover;
}

/*
 * Content Blocks publishes this ContentElement's whole `assets/` folder as
 * one unit, so the relative url() above and below keep resolving to their
 * sibling file after publishing - same pattern as main.css's wallpaper var.
 */
@supports (background-image: image-set(url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBTAA7") type("image/gif") 1x)) {
    .mission-bg {
        background:
            linear-gradient(120deg, rgba(10, 12, 15, 0.82), rgba(17, 24, 32, 0.68)),
            image-set(
                url("mission-bg-1280w.webp") type("image/webp") 1x,
                url("mission-bg-2560w.webp") type("image/webp") 2x
            ) center / cover;
    }
}

.mission-grid {
    opacity: 0.34;
    background:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(circle at 58% 46%, #000 0, transparent 68%);
}

.mission-glow {
    border-radius: 50%;
    filter: blur(48px);
    opacity: 0.62;
}

.mission-glow-orange {
    width: 36vw;
    height: 36vw;
    left: 48%;
    top: 26%;
    background: rgba(245, 158, 1, 0.2);
}

.mission-glow-cyan {
    width: 24vw;
    height: 24vw;
    right: 6%;
    bottom: 8%;
    background: rgba(114, 216, 255, 0.12);
}

.mission-layout {
    position: relative;
    z-index: 1;
    width: min(100% - 40px, var(--pm-container-wide));
    margin-inline: auto;
    padding-inline: clamp(22px, 4.4vw, 64px);
    display: grid;
    grid-template-columns: minmax(320px, 640px) minmax(320px, 640px);
    gap: clamp(24px, 3vw, 48px);
    align-items: center;
}

.mission-copy {
    position: relative;
    z-index: 2;
    max-width: 670px;
}

.mission-copy .kicker {
    margin: 0 0 14px;
    color: var(--pm-color-orange);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.mission-copy h1 {
    margin: 0 0 20px;
    color: var(--pm-color-paper);
    font-size: clamp(40px, 4.6vw, 72px);
    line-height: 1.02;
    font-weight: 900;
    text-shadow: 0 4px 32px rgba(0, 0, 0, 0.48);
}

.mission-copy h1 span {
    display: block;
}

.mission-copy h1 .headline-outline {
    color: transparent;
    -webkit-text-stroke: 1.4px rgba(255, 253, 248, 0.58);
    text-shadow: none;
}

.mission-copy .lead {
    margin: 0;
    color: rgba(255, 253, 248, 0.88);
    font-size: 18px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.44);
}

.mission-actions {
    margin-top: 28px;
}

.mission-visual {
    position: relative;
    z-index: 1;
    min-height: min(70svh, 640px);
    width: 100%;
    max-width: 100%;
}

.mission-visual::before,
.mission-visual::after {
    content: "";
    position: absolute;
    inset: 9%;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.mission-visual::after {
    inset: 20%;
    border-color: rgba(245, 158, 1, 0.18);
}

.mission-orbit {
    position: absolute;
    left: 50%;
    top: 50%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.orbit-web {
    width: 76%;
    height: 42%;
    border-color: rgba(245, 158, 1, 0.46);
    box-shadow: 0 0 42px rgba(245, 158, 1, 0.08);
}

.orbit-ai {
    width: 62%;
    height: 78%;
    border-color: rgba(114, 216, 255, 0.32);
    box-shadow: 0 0 42px rgba(114, 216, 255, 0.08);
}

.mission-core {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 4;
    width: 180px;
    height: 180px;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    padding: 20px;
    border-radius: 50%;
    border: 1px solid rgba(245, 158, 1, 0.55);
    background:
        radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.22), transparent 19%),
        rgba(17, 24, 32, 0.88);
    box-shadow: 0 0 0 10px rgba(245, 158, 1, 0.04), 0 0 60px rgba(245, 158, 1, 0.28);
}

.mission-core strong {
    display: block;
    color: var(--pm-color-paper);
    font-size: 44px;
    line-height: 1;
    text-align: center;
    text-shadow: 0 0 24px rgba(245, 158, 1, 0.56);
}

.mission-core span {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 900;
    color: var(--pm-color-orange);
    text-align: center;
}

.mission-node,
.mission-satellite,
.mission-console {
    position: absolute;
    z-index: 5;
    border-radius: var(--pm-radius);
    border: 1px solid var(--pm-color-line-dark);
    background: rgba(10, 12, 15, 0.68);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.mission-node {
    width: 130px;
    min-height: 92px;
    display: grid;
    place-items: center;
    text-align: center;
    font-weight: 900;
}

/*
 * left/top are the box's centre, not its corner - mission-control.js
 * continuously drifts these two around the core (idle orbit, independent
 * of scroll), and centring via transform lets JS just write plain
 * percentages without touching the transform property that .is-active
 * below also needs for its scale pulse. These values are the no-JS /
 * reduced-motion resting position (roughly where the old corner-anchored
 * 4%/22% and 4%/20% boxes used to sit).
 */
.node-web,
.node-ai {
    transform: translate(-50%, -50%);
}

.node-web {
    left: 15%;
    top: 30%;
    color: var(--pm-color-orange);
    border-color: rgba(245, 158, 1, 0.45);
}

.node-ai {
    left: 85%;
    top: 72%;
    color: var(--pm-color-cyan);
    border-color: rgba(114, 216, 255, 0.4);
}

.mission-node.is-active {
    transform: translate(-50%, -50%) scale(1.08);
}

.mission-node.node-web.is-active {
    border-color: rgba(245, 158, 1, 0.9);
    box-shadow: 0 0 32px rgba(245, 158, 1, 0.4);
}

.mission-node.node-ai.is-active {
    border-color: rgba(114, 216, 255, 0.85);
    box-shadow: 0 0 32px rgba(114, 216, 255, 0.35);
}

.mission-satellite {
    max-width: 160px;
    padding: 10px 12px;
    color: rgba(255, 253, 248, 0.78);
    font-size: 12px;
    font-weight: 800;
}

.sat-one {
    left: 10%;
    bottom: 12%;
}

.sat-two {
    right: 8%;
    top: 10%;
}

.sat-three {
    left: 34%;
    top: 2%;
}

.sat-four {
    right: 26%;
    bottom: 4%;
}

.mission-flow {
    position: absolute;
    z-index: 3;
    height: 2px;
    transform-origin: left center;
    opacity: 0.74;
}

.flow-web {
    left: 18%;
    top: 38%;
    width: 26%;
    transform: rotate(9deg);
    background: linear-gradient(90deg, transparent, var(--pm-color-orange));
}

.flow-ai {
    left: 50%;
    top: 54%;
    width: 27%;
    transform: rotate(30deg);
    background: linear-gradient(90deg, var(--pm-color-cyan), transparent);
}

.mission-console {
    left: 4%;
    right: 4%;
    bottom: 1%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
}

.mission-console span {
    color: rgba(255, 253, 248, 0.62);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.mission-console strong {
    color: var(--pm-color-paper);
    text-align: right;
}

.mission-progress {
    position: relative;
    z-index: 1;
    width: min(100% - 40px, var(--pm-container-wide));
    margin: 18px auto 0;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.mission-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--pm-color-orange), var(--pm-color-cyan));
}

/* Steps: readable, visible cards by default - this is the permanent
   no-JS/reduced-motion baseline, not just a loading state. */
.mission-steps {
    position: relative;
    z-index: 1;
    width: min(100% - 40px, var(--pm-container-wide));
    margin: clamp(32px, 5vw, 56px) auto 0;
    padding-inline: clamp(22px, 4.4vw, 64px);
    display: grid;
    gap: 16px;
}

.mission-step {
    padding: 22px 24px;
    border-radius: var(--pm-radius);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 12, 15, 0.72);
    color: rgba(255, 253, 248, 0.74);
}

.mission-step.is-active {
    border-color: rgba(245, 158, 1, 0.5);
}

.mission-step-index {
    display: block;
    color: var(--pm-color-orange);
    font-weight: 900;
}

.mission-step h2 {
    margin: 6px 0 10px;
    color: var(--pm-color-paper);
    font-size: 22px;
}

.mission-step p {
    margin: 0;
    color: rgba(255, 253, 248, 0.82);
}

.mission-step-console {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--pm-color-line-dark);
}

.mission-step-console span {
    color: rgba(255, 253, 248, 0.6);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.mission-step-console strong {
    color: var(--pm-color-paper);
    text-align: right;
}

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

    /*
     * Mobile drops the free-floating collage (orbits/nodes/satellites all
     * absolutely positioned over one another) for a calm, static circle up
     * top plus a plain stacked list underneath - nothing here needs to move,
     * mission-control.js already skips all scroll/GSAP wiring below 900px.
     */
    .mission-visual {
        min-height: auto;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mission-orbit-stage {
        position: relative;
        height: 260px;
        margin-bottom: 6px;
    }

    .mission-node,
    .mission-satellite,
    .mission-console {
        position: static;
        width: 100%;
        max-width: none;
    }

    .mission-node {
        min-height: auto;
        padding: 14px;
    }

    /*
     * .node-web/.node-ai centre themselves on their (JS-animated) left/top
     * point via translate(-50%,-50%) on desktop; static-flow mobile boxes
     * must not carry that same shift, or they'd sit offset from their
     * actual position in the stack.
     */
    .node-web,
    .node-ai {
        transform: none;
    }

    .mission-flow,
    .mission-progress {
        display: none;
    }

    /*
     * These two decorative boundary rings are sized as a % of
     * .mission-visual itself; now that the box's height comes from the
     * whole stacked list (not just the circle), they'd stretch into giant
     * ovals across the list instead of framing the orbit stage.
     */
    .mission-visual::before,
    .mission-visual::after {
        display: none;
    }
}

/*
 * Progressive enhancement: mission-control.js only adds this class once
 * GSAP/ScrollTrigger loaded successfully, the visitor has not requested
 * reduced motion, and the viewport is wide enough (>900px - mobile always
 * keeps the plain readable step list above, no sticky/pin behaviour).
 */
.mission-control.is-enhanced {
    min-height: 500vh;
}

.mission-control.is-enhanced .mission-sticky {
    position: sticky;
    top: 70px;
    min-height: calc(100svh - 70px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.mission-control.is-enhanced .mission-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    margin: 0;
}

.mission-control.is-enhanced .mission-steps {
    margin: -100svh auto 0;
    padding-top: 100svh;
    pointer-events: none;
}

.mission-control.is-enhanced .mission-step {
    min-height: 82vh;
    width: min(390px, 100%);
    margin-left: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-color: transparent;
    background: transparent;
    color: transparent;
    opacity: 0;
}
