/* =====================================================================
   "Select Software" empty state (homepage #software-capabilities panel).
   The eight software logos orbit a glowing NASR core, linked by flowing gold
   lines. Hover pauses the orbit; clicking a logo opens its capabilities.
   Behaviour: assets/js/software-orbit.js
   ===================================================================== */

#software-capabilities .swx {
    --swx-size: 280px;
    --swx-r: 109px;            /* orbit radius = 39% of the stage (matches the SVG) */
    --swx-gold: #C9A438;
    --swx-gold-hi: #E7CF86;
    --swx-ink: #111A2E;
    --swx-muted: #64748B;
    --swx-spin: 46s;
    gap: 0;
    padding: 0.5rem 0 0.25rem;
}
html.dark-mode #software-capabilities .swx {
    --swx-ink: #F1F5F9;
    --swx-muted: #AAB8CA;
}

#software-capabilities .swx-stage {
    position: relative;
    flex: none;
    width: var(--swx-size);
    height: var(--swx-size);
    margin-bottom: 1.1rem;
}

/* soft gold glow behind everything */
#software-capabilities .swx-halo {
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 164, 56, 0.22), rgba(201, 164, 56, 0.06) 45%, transparent 70%);
    filter: blur(6px);
    animation: swx-breathe 5s ease-in-out infinite;
}
@keyframes swx-breathe { 0%, 100% { opacity: 0.7; transform: scale(0.96); } 50% { opacity: 1; transform: scale(1.04); } }

/* the rotating ring: spokes + logos turn together */
#software-capabilities .swx-ring {
    position: absolute;
    inset: 0;
    animation: swx-spin var(--swx-spin) linear infinite;
}
@keyframes swx-spin { to { transform: rotate(360deg); } }

#software-capabilities .swx-spokes {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}
#software-capabilities .swx-track {
    fill: none;
    stroke: rgba(201, 164, 56, 0.35);
    stroke-width: 0.8;
    stroke-dasharray: 2 4;
}
#software-capabilities .swx-spokes path {
    fill: none;
    stroke: rgba(201, 164, 56, 0.55);
    stroke-width: 0.9;
    stroke-linecap: round;
    stroke-dasharray: 3 5;
    animation: swx-flow 1.6s linear infinite;
}
@keyframes swx-flow { to { stroke-dashoffset: -16; } }

/* each logo sits on the orbit at its angle... */
#software-capabilities .swx-item {
    position: absolute;
    top: 50%;
    left: 50%;
    /* rounded tiles, not circles: the official logos are wide wordmarks */
    width: 72px;
    height: 40px;
    margin: -20px 0 0 -36px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    transform: rotate(var(--a)) translateY(calc(-1 * var(--swx-r))) rotate(calc(-1 * var(--a)));
    z-index: 2;
}
/* ...and turns back against the ring so it always stays upright */
#software-capabilities .swx-in {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    animation: swx-spin var(--swx-spin) linear infinite reverse;
}
#software-capabilities .swx-chip {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: radial-gradient(circle at 35% 28%, #FFFFFF, #F8F4EA 85%);
    border: 1.5px solid rgba(201, 164, 56, 0.55);
    box-shadow: 0 10px 22px -12px rgba(17, 26, 46, 0.55), 0 0 0 4px rgba(201, 164, 56, 0.08);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease, border-color 0.3s ease;
}
#software-capabilities .swx-chip img {
    width: auto;
    height: auto;
    max-width: 58px;
    max-height: 24px;
    object-fit: contain;
}
/* Fathom and KashFlow logos are white wordmarks: give them a navy tile like the core */
#software-capabilities .swx-item[data-sw="Fathom"] .swx-chip,
#software-capabilities .swx-item[data-sw="KashFlow"] .swx-chip {
    background: radial-gradient(circle at 35% 28%, #24365C, #111A2E 75%);
}
/* name label under the logo, shown on hover/focus */
#software-capabilities .swx-name {
    position: absolute;
    left: 50%;
    top: calc(100% + 6px);
    transform: translate(-50%, -4px);
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #111A2E;
    background: linear-gradient(135deg, #E7CF86, #C9A438);
    box-shadow: 0 8px 16px -10px rgba(167, 131, 42, 0.95);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
#software-capabilities .swx-item:hover .swx-chip,
#software-capabilities .swx-item:focus-visible .swx-chip {
    transform: scale(1.16);
    border-color: var(--swx-gold);
    box-shadow: 0 16px 28px -12px rgba(167, 131, 42, 0.8), 0 0 0 6px rgba(201, 164, 56, 0.18), 0 0 24px rgba(201, 164, 56, 0.45);
}
#software-capabilities .swx-item:hover .swx-name,
#software-capabilities .swx-item:focus-visible .swx-name {
    opacity: 1;
    transform: translate(-50%, 2px);
}
#software-capabilities .swx-item:focus-visible { outline: none; }

/* pointing anywhere at the constellation pauses it so a logo is easy to click */
#software-capabilities .swx-stage:hover .swx-ring,
#software-capabilities .swx-stage:hover .swx-in,
#software-capabilities .swx-stage:focus-within .swx-ring,
#software-capabilities .swx-stage:focus-within .swx-in {
    animation-play-state: paused;
}

/* the glowing NASR core */
#software-capabilities .swx-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 78px;
    height: 78px;
    margin: -39px 0 0 -39px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, #24365C, #111A2E 70%, #0A1222);
    border: 2px solid rgba(231, 207, 134, 0.85);
    box-shadow: 0 0 0 6px rgba(201, 164, 56, 0.12), 0 18px 34px -14px rgba(17, 26, 46, 0.8), 0 0 36px rgba(201, 164, 56, 0.35);
    z-index: 3;
}
#software-capabilities .swx-core img {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(231, 207, 134, 0.55));
}
#software-capabilities .swx-pulse {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 1.5px solid rgba(231, 207, 134, 0.7);
    animation: swx-pulse 2.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
#software-capabilities .swx-pulse--2 { animation-delay: 1.4s; }
@keyframes swx-pulse { 0% { transform: scale(1); opacity: 0.85; } 100% { transform: scale(1.9); opacity: 0; } }

/* message under the constellation */
#software-capabilities .swx .swx-title:not(#swx-x) {
    margin: 0 !important;
    max-width: none;
    font-family: var(--font-heading, inherit);
    font-size: 1.18rem !important;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--swx-ink) !important;
}
#software-capabilities .swx .swx-title b {
    background: linear-gradient(135deg, #E7CF86, #C9A438 55%, #A7832A);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
#software-capabilities .swx .swx-sub:not(#swx-x) {
    margin: 0.4rem auto 0 !important;
    max-width: 290px;
    font-size: 0.9rem !important;
    line-height: 1.5;
    color: var(--swx-muted) !important;
}

/* smaller laptops: the panel is a little shorter */
@media (max-width: 1100px) {
    #software-capabilities .swx { --swx-size: 250px; --swx-r: 97px; }
    #software-capabilities .swx-item { width: 64px; height: 36px; margin: -18px 0 0 -32px; }
    #software-capabilities .swx-chip img { max-width: 52px; max-height: 22px; }
}
@media (max-width: 420px) {
    #software-capabilities .swx { --swx-size: 230px; --swx-r: 90px; }
    #software-capabilities .swx-item { width: 60px; height: 34px; margin: -17px 0 0 -30px; }
    #software-capabilities .swx-chip img { max-width: 48px; max-height: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    #software-capabilities .swx-halo,
    #software-capabilities .swx-ring,
    #software-capabilities .swx-in,
    #software-capabilities .swx-spokes path,
    #software-capabilities .swx-pulse { animation: none !important; }
}
