/* Support rules for the Platform and Products pages (everything scoped under .nx). Loaded by both pages. */

/* ---- The space the hero sits in (the live site's hero-space, minus the drifting starfield, which needs a script) ---- */
.nx .hero-space { position: absolute; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; }
.nx .hero-nebula {
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(ellipse 44% 38% at 22% 26%, rgba(88, 58, 190, .34), transparent 68%),
        radial-gradient(ellipse 40% 34% at 78% 62%, rgba(48, 59, 161, .28), transparent 66%),
        radial-gradient(ellipse 30% 26% at 58% 12%, rgba(168, 86, 247, .12), transparent 70%);
    filter: blur(6px);
    animation: nxHeroNebula 34s ease-in-out infinite alternate;
}
@keyframes nxHeroNebula {
    from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
    to { transform: translate3d(1.5%, 1.5%, 0) scale(1.06); }
}

/* The planet sits in the same coordinates the About hero uses */
.nx .hero-space .jupiter-track { position: absolute; inset: 0; }
.nx .hero-space .jupiter-body {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(clamp(520px, 82vw, 1240px) * var(--body-scale, 1));
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
}
.nx .hero-space.is-left .jupiter-body { left: 18%; }
.nx .hero-space.is-right .jupiter-body { left: 82%; }
.nx .hero-space.is-center .jupiter-body { left: 50%; }
.nx .hero-space .body-scale-120 { --body-scale: 1.2; }
.nx .hero-space .body-scale-082 { --body-scale: .82; }

.nx .hero-space .jupiter-halo { width: calc(var(--disc, 42%) * 1.75); }
.nx .hero-space .jupiter-sheen { width: var(--disc, 42%); }
.nx .hero-space .jupiter-plane i { transform: rotate(var(--a)) translateX(calc(var(--disc, 42%) * .88)) rotate(calc(var(--a) * -1)); }
.nx .hero-space .jupiter-plane i:nth-child(1) { --a: 0deg; }
.nx .hero-space .jupiter-plane i:nth-child(2) { --a: 128deg; }
.nx .hero-space .jupiter-plane i:nth-child(3) { --a: 241deg; }

/* Each plate carries a different amount of ink, and its own picture */
.nx .hero-space .jupiter.is-marble { --disc: 22%; }
.nx .hero-space .jupiter.is-streaked { --disc: 84%; }
.nx .hero-space .jupiter.is-marble .jupiter-disc { background-image: url('/img/site/nasa-jupiter-marble.jpg'); opacity: .58; mask-image: radial-gradient(circle at 50% 50%, #000 46%, transparent 66%); }
.nx .hero-space .jupiter.is-streaked .jupiter-disc { background-image: url('/img/about/jupiter.webp'); opacity: .26; mask-image: radial-gradient(circle at 50% 50%, #000 44%, transparent 72%); }
.nx .hero-space .jupiter.is-streaked .jupiter-halo { opacity: .5; }

@media (max-width: 860px) {
    .nx .hero-space .jupiter-body { width: calc(clamp(420px, 132vw, 720px) * var(--body-scale, 1)); }
    .nx .hero-space.is-left .jupiter-body, .nx .hero-space.is-right .jupiter-body { left: 50%; }
    .nx .hero-space .jupiter.is-marble .jupiter-disc { opacity: .34; }
    .nx .hero-space .jupiter.is-streaked .jupiter-disc { opacity: .16; }
    .nx .hero-nebula { filter: blur(10px); }
}

/* Copy stays above the space; the vignette sits between the two */
.nx .page-hero .hero-center { position: relative; z-index: 2; }
.nx .page-hero .hero-vignette { z-index: 1; pointer-events: none; }
/* With space behind it the source plate is a texture, not the picture */
.nx .source-hero .source-hero-art { opacity: .16; }
/* Behind a section rather than a hero: nothing that competes with the copy */
.nx .hero-space.is-section { z-index: 0; }

/* ---- Module suite: with the script one module shows at a time; without it the tab row is hidden and all five are listed ---- */
html:not(.js) .nx .module-tabs { display: none; }
.js .nx .module-panel:not(.is-active) { display: none; }
html:not(.js) .nx .module-panel + .module-panel { margin-top: 16px; }
.nx .module-tabs button { cursor: pointer; }

/* ---- Nova: with the script the three actions switch the answer; without it every answer is listed ---- */
.js .nx .nova-answer:not(.is-active) { display: none; }
html:not(.js) .nx .nova-answer + .nova-answer { margin-top: 8px; }
.nx .nova-actions button { cursor: pointer; }
.nx .nova-answer { margin: 0; }

/* ---- The hive diagram: the rings breathe and the lights each travel their own ring ---- */
.nx .orbit-breathe { animation: nxOrbitBreathe 9s ease-in-out infinite; }
@keyframes nxOrbitBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }
.nx .orbit-arm { transform: rotate(var(--from, 0deg)); animation: nxOrbitArm var(--secs, 34s) linear infinite; }
@keyframes nxOrbitArm { to { transform: rotate(calc(var(--from, 0deg) + 360deg)); } }
.nx .orbit-arm.is-reverse { animation-direction: reverse; }
.nx .orbit-arm.arm-1 { --radius: 36%; --secs: 34s; --from: 18deg; }
.nx .orbit-arm.arm-2 { --radius: 36%; --secs: 34s; --from: 205deg; }
.nx .orbit-arm.arm-3 { --radius: 27%; --secs: 26s; --from: 128deg; }
.nx .orbit-arm.arm-4 { --radius: 27%; --secs: 26s; --from: 310deg; }
.nx .orbit-arm.arm-5 { --radius: 19%; --secs: 44s; --from: 250deg; }
.nx .orbit-arm.arm-6 { --radius: 19%; --secs: 44s; --from: 72deg; }

@media (prefers-reduced-motion: reduce) {
    .nx .hero-nebula, .nx .orbit-breathe, .nx .orbit-arm { animation: none; }
}
.reduced-motion .nx .hero-nebula, .reduced-motion .nx .orbit-breathe, .reduced-motion .nx .orbit-arm { animation: none; }
