/* hv-ecology.css — "the ecology comes alive": a living two-axis specialist
   chart layered into #ecology-studio (dark ink ground, #specialists).
   All classes are hv3-*; state + motion are driven by js/hv-ecology.js,
   which subscribes to home-page.js via the figure's data-ecology attribute.
   No selector here touches the figure's buttons, readout, or a11y nodes. */

.home-ecology-visual.hv3-live {
    min-height: 27rem;
    background: #1d1b17;
}

/* the old static axes / 3x3 cells / core stay in the markup as a no-JS
   fallback; once the scene mounts they are hidden, not removed */
.home-ecology-visual.hv3-live > :not(.hv3-stage) {
    display: none;
}

.hv3-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hv3-svg {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

/* ---- in-scene type (SVG) — floor is 13px, cell labels 14px ---- */

.hv3-axis-title {
    fill: #bcb5a9;
    font-family: var(--home-mono, "Geist Mono", "Courier New", monospace);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .09em;
}

.hv3-cell-label {
    fill: rgba(255, 250, 241, .96);
    font-family: var(--home-sans, "Geist", Arial, sans-serif);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .015em;
    paint-order: stroke;
    stroke: rgba(23, 22, 19, .8);
    stroke-width: 3px;
    stroke-linejoin: round;
}

.hv3-nucleus-label {
    fill: #f09a78;
    font-family: var(--home-mono, "Geist Mono", "Courier New", monospace);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    paint-order: stroke;
    stroke: rgba(23, 22, 19, .8);
    stroke-width: 3px;
    stroke-linejoin: round;
}

/* ---- legend chip (mono, 13px) ---- */

.hv3-legend {
    position: absolute;
    top: .85rem;
    right: .9rem;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: .5rem;
    max-width: calc(100% - 4.25rem);
    padding: .42rem .7rem;
    border: 1px solid rgba(185, 178, 165, .28);
    background: rgba(20, 19, 16, .84);
    color: #e9e4d8;
    font-family: var(--home-mono, "Geist Mono", "Courier New", monospace);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: .02em;
}

.hv3-legend-dot {
    flex: none;
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: #f09a78;
    box-shadow: 0 0 .55rem rgba(240, 154, 120, .5);
    transition: background .3s ease, box-shadow .3s ease;
}

.hv3-legend-txt {
    min-width: 0;
}

.hv3-legend.hv3-legend-swap .hv3-legend-txt {
    animation: hv3-legend-in .45s var(--home-ease, ease) both;
}

@keyframes hv3-legend-in {
    from { opacity: 0; transform: translateY(.3rem); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    .home-ecology-visual.hv3-live {
        min-height: 23rem;
    }

    .hv3-legend {
        top: .6rem;
        right: .6rem;
        max-width: calc(100% - 2.5rem);
    }
}

/* forced colors: hand the figure back to its original static markup,
   which home-v2.css already styles for this mode */
@media (forced-colors: active) {
    .hv3-stage {
        display: none;
    }

    .home-ecology-visual.hv3-live > :not(.hv3-stage) {
        display: revert;
    }
}
