/* ==========================================================================
   Ecosystem page — cinematic staging (part 1 of 2)
   Page-specific Act 01 flywheel and mnemonic. Shared
   cinematic primitives (chapter markers, hero, film strip, ghost buttons)
   live in cinema.css; scenes/log/finale-credits live in ecosystem-scenes.css.
   ========================================================================== */

/* --- Act 01: flywheel ---------------------------------------------------- */

.nm-ecosystem-flywheel {
    background: radial-gradient(80% 72% at 50% 55%, rgba(153, 0, 1, 0.12), transparent 70%);
    margin-inline: auto;
    max-width: min(58rem, 100%);
    overflow: hidden;
    position: relative;
}

.nm-flywheel-diagram {
    padding-top: 1rem;
    position: relative;
}

.nm-flywheel-rail {
    display: none;
}

.nm-flywheel-core {
    align-items: center;
    aspect-ratio: 1;
    background: rgba(8, 9, 13, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0 auto 2rem;
    max-width: 18rem;
    padding: 2rem;
    text-align: center;
    width: min(100%, 18rem);
}

.nm-flywheel-core-rule {
    background: rgba(255, 85, 104, 0.54);
    height: 1px;
    margin-bottom: 1rem;
    width: 66%;
}

.nm-flywheel-core-kicker {
    color: #ff5568;
    font-family: var(--nm-font-mono);
    font-size: clamp(0.68rem, 1.2vw, 0.78rem);
    letter-spacing: 0.16em;
    line-height: 1.4;
    margin: 0;
    text-transform: uppercase;
}

.nm-flywheel-core-title {
    color: #fff;
    font-family: var(--nm-font-display);
    font-size: clamp(1.28rem, 2.3vw, 1.6rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.08;
    margin: 0.75rem 0;
}

.nm-flywheel-core-copy {
    color: #b3b3b3;
    font-family: var(--nm-font-body);
    font-size: clamp(0.8rem, 1.35vw, 0.92rem);
    line-height: 1.4;
    margin: 0;
}

.nm-flywheel-flow {
    display: grid;
    gap: 1.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nm-flywheel-stage {
    background: linear-gradient(145deg, #22080d 0%, #0d0e15 48%, #08090d 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 1.5rem 2.25rem rgba(0, 0, 0, 0.42);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 6.5rem;
    padding: 1rem 1.25rem;
    position: relative;
}

.nm-flywheel-stage:not(:last-child)::after {
    bottom: -1.24rem;
    color: #ff5568;
    content: "↓";
    font-family: var(--nm-font-mono);
    font-size: 0.9rem;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
}

.nm-flywheel-stage--active {
    border-color: rgba(255, 85, 104, 0.46);
    box-shadow:
        0 1.5rem 2.25rem rgba(0, 0, 0, 0.5),
        0 0 2.5rem rgba(153, 0, 1, 0.18);
}

.nm-flywheel-anchor {
    background: #990001;
    border: 1px solid #ff7382;
    box-shadow: 0 0 0.45rem rgba(225, 29, 51, 0.72);
    height: 0.68rem;
    left: 50%;
    position: absolute;
    top: -0.38rem;
    transform: translateX(-50%) rotate(45deg);
    width: 0.68rem;
}

.nm-flywheel-step {
    color: #ff7382;
    font-family: var(--nm-font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.18em;
}

.nm-flywheel-title {
    color: #fff;
    font-family: var(--nm-font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.1;
    margin-top: 0.38rem;
}

.nm-flywheel-copy {
    color: #9698a1;
    font-family: var(--nm-font-body);
    font-size: 0.72rem;
    line-height: 1.35;
    margin-top: 0.3rem;
}

@media (min-width: 900px) {
    .nm-ecosystem-flywheel {
        max-width: min(68.75rem, 100%);
    }

    .nm-flywheel-diagram {
        aspect-ratio: 1100 / 650;
        padding-top: 0;
    }

    .nm-flywheel-rail {
        display: block;
        height: 100%;
        inset: 0;
        position: absolute;
        width: 100%;
    }

    .nm-flywheel-track,
    .nm-flywheel-signal {
        fill: none;
        stroke-linecap: round;
    }

    .nm-flywheel-track {
        stroke: rgba(255, 255, 255, 0.055);
        stroke-width: 38;
    }

    .nm-flywheel-signal {
        filter: drop-shadow(0 0 8px rgba(225, 29, 51, 0.38));
        stroke: #e11d33;
        stroke-width: 2.4;
    }

    .nm-flywheel-core {
        left: 50%;
        margin: 0;
        padding: 2.2%;
        position: absolute;
        top: 59.23%;
        transform: translate(-50%, -50%);
        width: 26.18%;
    }

    .nm-flywheel-core-rule {
        margin-bottom: 7%;
    }

    .nm-flywheel-core-kicker {
        font-size: clamp(0.6rem, 0.82vw, 0.72rem);
    }

    .nm-flywheel-core-title {
        font-size: clamp(1.12rem, 1.75vw, 1.42rem);
        margin: 5% 0;
    }

    .nm-flywheel-core-copy {
        font-size: clamp(0.7rem, 0.9vw, 0.82rem);
    }

    .nm-flywheel-flow {
        display: contents;
    }

    .nm-flywheel-stage {
        height: 14.46%;
        min-height: 0;
        padding: 1.35% 1.8%;
        position: absolute;
        width: 21.82%;
    }

    .nm-flywheel-stage:not(:last-child)::after {
        content: none;
    }

    .nm-flywheel-stage--1 {
        left: 39.09%;
        top: 17.23%;
    }

    .nm-flywheel-stage--2 {
        left: 73.45%;
        top: 35.38%;
    }

    .nm-flywheel-stage--3 {
        left: 63.64%;
        top: 79.54%;
    }

    .nm-flywheel-stage--4 {
        left: 14.55%;
        top: 79.54%;
    }

    .nm-flywheel-stage--5 {
        left: 4.73%;
        top: 35.38%;
    }

    .nm-flywheel-stage--1 .nm-flywheel-anchor {
        bottom: -0.38rem;
        left: 50%;
        top: auto;
    }

    .nm-flywheel-stage--2 .nm-flywheel-anchor {
        left: -0.38rem;
        top: 50%;
        transform: translateY(-50%) rotate(45deg);
    }

    .nm-flywheel-stage--3 .nm-flywheel-anchor,
    .nm-flywheel-stage--4 .nm-flywheel-anchor {
        left: 50%;
        top: -0.38rem;
    }

    .nm-flywheel-stage--5 .nm-flywheel-anchor {
        left: auto;
        right: -0.38rem;
        top: 50%;
        transform: translateY(-50%) rotate(45deg);
    }

    .nm-flywheel-step {
        font-size: clamp(0.48rem, 0.62vw, 0.58rem);
    }

    .nm-flywheel-title {
        font-size: clamp(0.9rem, 1.45vw, 1.18rem);
        margin-top: 2.5%;
    }

    .nm-flywheel-copy {
        font-size: clamp(0.58rem, 0.78vw, 0.72rem);
        margin-top: 1.8%;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .nm-flywheel-signal {
        animation: nm-flywheel-signal-flow 9s linear infinite;
        stroke-dasharray: 8 6;
    }
}

@keyframes nm-flywheel-signal-flow {
    to {
        stroke-dashoffset: -140;
    }
}

.nm-ecosystem-mnemonic {
    color: var(--nm-color-text);
    font-family: var(--nm-font-display);
    font-size: clamp(1rem, 2vw, 1.35rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    margin: 2.5rem auto 0;
    text-align: center;
    text-transform: uppercase;
}

@media (max-width: 767px) {
    .nm-ecosystem-mnemonic {
        line-height: 1.5;
    }
}
