/* ===========================================================================
   SIS Assistant — voice + navigation layer (js/sis-voice-nav.js).
   Only adds to the assistant panel's voice screen; the panel itself is styled
   by sis-engagement.css. State lives in #sisAssistant[data-sis-voice]:
   idle · listening · thinking · speaking.
   =========================================================================== */

/* the orb is the push-to-talk button */
.sis-as__ring[data-sis-voice-mic] { cursor: pointer; outline: none; transition: transform .25s ease; }
.sis-as__ring[data-sis-voice-mic]:hover { transform: scale(1.03); }
.sis-as__ring[data-sis-voice-mic]:focus-visible { box-shadow: 0 0 0 3px rgba(255, 255, 255, .85), 0 0 0 7px rgba(233, 59, 110, .6); }
.sis-as--no-voice .sis-as__ring[data-sis-voice-mic] { cursor: default; transform: none; }

/* listening: the halo speeds up and a ring pulses out from the orb */
.sis-as[data-sis-voice="listening"] .sis-as__ring-halo { animation-duration: 1.1s; }
.sis-as[data-sis-voice="listening"] .sis-as__ring::after {
    content: ""; position: absolute; inset: -6px; border-radius: 50%; z-index: 1;
    border: 2px solid rgba(255, 110, 150, .85);
    animation: sis-voice-pulse 1.3s ease-out infinite;
}
@keyframes sis-voice-pulse {
    from { transform: scale(1);    opacity: .9; }
    to   { transform: scale(1.28); opacity: 0; }
}
/* thinking: the orb dims slightly while the answer is fetched */
.sis-as[data-sis-voice="thinking"] .sis-as__ring img { filter: saturate(.7) brightness(.85); transition: filter .3s ease; }
/* speaking: a slow glow */
.sis-as[data-sis-voice="speaking"] .sis-as__ring-halo { animation-duration: 1.8s; }

.sis-as__hint {
    margin: 18px 0 0;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .3px;
    color: rgba(255, 255, 255, .55);
}
.sis-as[data-sis-voice="listening"] .sis-as__hint { color: #ff8fb4; }

/* what was heard, and the reply */
.sis-as__vo { width: 100%; max-width: 320px; }
.sis-as__heard {
    margin: 14px 0 0;
    font-size: 13.5px;
    font-style: italic;
    line-height: 1.45;
    color: rgba(255, 255, 255, .62);
}
.sis-as__said {
    margin: 10px 0 0;
    max-height: 132px;
    overflow-y: auto;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    font-size: 14px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .9);
    text-align: left;
    white-space: pre-wrap;
    overscroll-behavior: contain;
}
/* with a conversation on screen the keyboard button sits closer */
.sis-as__vo:not(:empty) ~ .sis-as__keyboard { margin-top: 18px; }

/* mute — top-left, mirroring the close button top-right */
.sis-as__mute {
    position: absolute;
    top: 26px;
    left: 22px;
    z-index: 3;
    width: 34px;
    height: 34px;
    border: 0;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .09);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, transform .2s ease;
}
.sis-as__mute[hidden] { display: none; }
.sis-as__mute:hover { background: rgba(255, 255, 255, .18); transform: scale(1.06); }
.sis-as__mute:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.sis-as__mute .sis-as__mute-off,
.sis-as__mute[aria-pressed="true"] .sis-as__mute-on { display: none; }
.sis-as__mute[aria-pressed="true"] .sis-as__mute-off { display: block; }

/* Hands-free "Hey SIS" switch — under the hint, desktop only */
.sis-as__wake {
    margin-top: 10px;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, .6);
    font-family: 'Outfit', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease;
}
.sis-as__wake[hidden] { display: none; }
.sis-as__wake[aria-pressed="true"] { color: #8ff0c4; border-color: rgba(32, 201, 151, .45); }
.sis-as__wake:hover { color: #fff; }
.sis-as__wake:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* While it is listening for "Hey SIS" in the background, the voice launcher
   carries a soft green ring — the visitor can always see the mic is on. */
.sis-launch--wake .sis-launch__btn--voice { animation: sis-wake-ring 2.4s ease-in-out infinite; }
@keyframes sis-wake-ring {
    0%, 100% { box-shadow: 0 8px 26px rgba(233, 59, 110, .38), 0 0 0 2px rgba(32, 201, 151, .55); }
    50%      { box-shadow: 0 8px 26px rgba(233, 59, 110, .38), 0 0 0 6px rgba(32, 201, 151, .18); }
}

/* Greeting bubble on arrival — sits just above the launchers */
.sis-greet {
    position: fixed;
    right: 24px;
    bottom: 170px;
    z-index: 10045;
    display: flex;
    align-items: flex-start;
    max-width: 290px;
    border-radius: 18px 18px 6px 18px;
    background: #fff;
    box-shadow: 0 18px 44px -12px rgba(11, 13, 24, .38), 0 0 0 1px rgba(233, 59, 110, .14);
    opacity: 0;
    transform: translateY(12px) scale(.96);
    transform-origin: bottom right;
    transition: opacity .35s ease, transform .45s cubic-bezier(.16, 1, .3, 1);
}
.sis-greet.is-in { opacity: 1; transform: none; }
.sis-greet__body {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px 8px 14px 16px;
    border: 0;
    background: transparent;
    text-align: left;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: #3b3f4c;
    cursor: pointer;
}
.sis-greet__body b { color: #111; font-weight: 700; }
.sis-greet__wave { font-size: 20px; line-height: 1; animation: sis-wave 1.6s ease-in-out 2; transform-origin: 70% 70%; }
@keyframes sis-wave { 0%, 60%, 100% { transform: rotate(0); } 15%, 45% { transform: rotate(16deg); } 30% { transform: rotate(-10deg); } }
.sis-greet__x {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    margin: 8px 8px 0 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .05);
    color: #666;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}
.sis-greet__x:hover { background: rgba(0, 0, 0, .1); color: #111; }
.sis-greet button:focus-visible { outline: 2px solid #e93b6e; outline-offset: 2px; }
@media (max-width: 767px) {
    .sis-greet { right: 14px; bottom: 142px; max-width: calc(100vw - 28px); }
}

/* short phones: tighten the voice screen so the reply still fits */
@media (max-height: 740px) {
    .sis-as__ask { margin-bottom: 22px; }
    .sis-as__ring { width: min(170px, 44vw); }
    .sis-as__said { max-height: 96px; }
}

@media (prefers-reduced-motion: reduce) {
    .sis-as[data-sis-voice="listening"] .sis-as__ring::after { animation: none; opacity: .8; }
    .sis-launch--wake .sis-launch__btn--voice { animation: none; box-shadow: 0 8px 26px rgba(233, 59, 110, .38), 0 0 0 3px rgba(32, 201, 151, .6); }
}
