/* Homepage Front Office: the channels film (ch-stage.js).
 *
 * The stage sits straight on the section (#E8F6F5 and its glow): the scene paints no background. Until the scene is
 * built the page shows the original static diagram; then the stage, resting on "ready" (the same diagram, drawn by the
 * scene), takes its place. At rest the seven spokes and the hub are buttons over the drawn tiles, opening the same
 * channel windows. A Pause / Play / Replay pill sits in the top-right corner. */

.ch-stage {
    display: none;
    position: relative;
    max-width: 1140px;
    margin: 8px auto 0;
    container-type: inline-size;
}

.ch-stage:focus {
    outline: none;
}

.ch-stage.is-armed.is-built {
    display: block;
}

/* The stage replaces the static diagram once it can draw it. */
.ch-stage.is-armed.is-built ~ .fo-diagram-wrapper {
    display: none;
}

.ch-stage.ch-unavailable {
    display: none;
}

.ch-stage .ha.ha-ch {
    width: 100%;
    max-width: none;
    aspect-ratio: 16 / 9;
}

/* The scene's narrow camera runs on stages under 640 px, in a 4:5 frame. */
@container (max-width: 639px) {
    .ch-stage .ha.ha-ch {
        aspect-ratio: 4 / 5;
    }
}

/* ------------------------------------------------------------------ resting spokes */
.ch-spots {
    position: absolute;
    inset: 0;
    z-index: 3;
    visibility: hidden;
    pointer-events: none;
}

.ch-stage.is-resting .ch-spots {
    visibility: visible;
}

.ch-spot {
    appearance: none;
    position: absolute;
    width: 8.245%;
    height: 14.657%;
    padding: 0;
    border: 0;
    border-radius: 20.8% / 20.8%;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ch-spot:hover {
    background: rgba(76, 181, 174, 0.08);
    box-shadow: inset 0 0 0 2px #4CB5AE, 0 8px 32px rgba(76, 181, 174, 0.15);
}

.ch-spot:focus-visible {
    outline: 3px solid #1A2B3C;
    outline-offset: 3px;
}

.ch-spot-hub {
    left: 44.299%;
    top: 39.865%;
    width: 11.402%;
    height: 20.27%;
    border-radius: 50%;
}

.ch-spot-email { left: 45.88%; top: 13.046%; }
.ch-spot-fax { left: 59.255%; top: 23.574%; }
.ch-spot-text { left: 62.151%; top: 48.759%; }
.ch-spot-voice { left: 53.422%; top: 68.796%; }
.ch-spot-mobile { left: 38.339%; top: 68.796%; }
.ch-spot-webapp { left: 29.609%; top: 48.759%; }
.ch-spot-landingpage { left: 32.505%; top: 23.574%; }

@container (max-width: 639px) {
    .ch-spot {
        width: 18.855%;
        height: 15.084%;
    }

    .ch-spot-hub {
        left: 37.144%;
        top: 39.715%;
        width: 25.712%;
        height: 20.57%;
    }

    .ch-spot-email { left: 40.572%; top: 12.924%; }
    .ch-spot-fax { left: 70.198%; top: 23.418%; }
    .ch-spot-text { left: 76.612%; top: 48.521%; }
    .ch-spot-voice { left: 57.277%; top: 68.493%; }
    .ch-spot-mobile { left: 23.868%; top: 68.493%; }
    .ch-spot-webapp { left: 4.533%; top: 48.521%; }
    .ch-spot-landingpage { left: 10.947%; top: 23.418%; }
}

/* ------------------------------------------------------------------ pause / play / replay */
.ch-ctl {
    appearance: none;
    position: absolute;
    top: 2.4%;
    right: 1.6%;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px 9px 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: inset 0 0 0 1px var(--border, #E8ECF1), 0 4px 14px rgba(18, 60, 58, 0.06);
    color: var(--text-gray, #5A6B7D);
    font: 600 0.84rem/1 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease, box-shadow 0.2s ease;
}

.ch-ctl svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ch-stage.is-paused .ch-ctl svg path,
.ch-stage.is-resting:not(.is-done) .ch-ctl svg path {
    fill: currentColor;
}

.ch-stage:hover .ch-ctl,
.ch-stage.is-paused .ch-ctl,
.ch-stage.is-done .ch-ctl,
.ch-ctl:focus-visible {
    opacity: 1;
}

.ch-ctl:hover {
    color: #127C74;
    box-shadow: inset 0 0 0 1px rgba(76, 181, 174, 0.55), 0 4px 14px rgba(18, 60, 58, 0.08);
}

.ch-ctl:focus-visible {
    outline: 3px solid #1A2B3C;
    outline-offset: 3px;
}

@container (max-width: 639px) {
    .ch-ctl {
        top: 8px;
        right: 8px;
        padding: 8px 12px 8px 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ch-spot,
    .ch-ctl {
        transition: none;
    }
}
