/* Services stage (services-stage.js). Every scene carries its own color along the site's blue to magenta range, ending in
   black. Stacked by default, each demo in its scene. .is-live pins it on larger screens, with one still frame for the demos. */
.sx-scene { --bg: var(--ui); --fg: #000; position: relative; display: grid; gap: clamp(18px, 3vw, 30px); padding: clamp(40px, 7vw, 70px) var(--gutter); background: var(--bg); color: var(--fg); overflow: hidden; }
.sx-system { --bg: #7a6bff; }
.sx-ai { --bg: var(--ai); }
.sx-ship { --bg: #000; --fg: #fff; }
.sx-name { font-size: clamp(16px, 1.5vw, 22px); font-weight: 600; margin-bottom: clamp(8px, 1vw, 14px); }
.sx-title { font-family: 'Monument', var(--body); font-weight: 400; font-size: clamp(28px, 9vw, 56px); line-height: 1.02; text-transform: uppercase; overflow-wrap: anywhere; }
.sx-text { max-width: 40ch; font-size: clamp(18px, 1.5vw, 24px); font-weight: 500; line-height: 1.3; }
.sx-panel { display: grid; gap: 12px; }
.sx-rail { display: none; }

.sx.is-live { height: 360vh; }
.sx.is-live .sx-pin { --bar: 68px; --frame-w: 52%; position: sticky; top: 0; height: 100vh; overflow: hidden; background: #000; }
/* Words on the left, leaving the right side to the frame, which sits above every scene so the color passes behind it. */
.sx.is-live .sx-scene { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 96px calc(var(--frame-w) + var(--gutter) + clamp(20px, 3vw, 50px)) 112px var(--gutter); visibility: hidden; isolation: isolate; }
/* A soft light follows the pointer across the color. */
.sx.is-live .sx-scene::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle 46vw at var(--mx, 70%) var(--my, 40%), rgba(255, 255, 255, 0.26), transparent 70%); }
.sx-ship.sx-scene::after { opacity: 0.45; }
.sx.is-live .sx-head, .sx.is-live .sx-text { position: relative; z-index: 1; }
.sx.is-live .sx-head { will-change: transform; }
.sx.is-live .sx-title { font-size: min(4vw, 8.4vh); }
.sx.is-live .sx-slot { display: none; }

/* The one frame on the right. Same place and size for every service, and each demo fills it the same way: its example
   above, its controls or tip in a bar of the same height below. */
.sx-frame { display: none; }
.sx.is-live .sx-frame { display: block; position: absolute; z-index: 3; right: var(--gutter); top: 88px; bottom: 40px; width: var(--frame-w); height: min(100vh - 128px, 680px); margin-block: auto; border-radius: 18px; background: #000; overflow: hidden; box-shadow: 0 50px 90px -30px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.18); }
.sx.is-live .sx-panel { position: absolute; inset: 0; display: flex; flex-direction: column; background: #000; color: #fff; }
.sx.is-live .demo { flex: 1; min-height: 0; height: auto; border-radius: 0; box-shadow: none; }
.sx.is-live .demo-tip, .sx.is-live .kit-themes, .sx.is-live .chat-actions { flex: none; display: flex; align-items: center; gap: 8px; height: var(--bar); padding: 0 28px; border-top: 1px solid rgba(255, 255, 255, 0.16); background: #000; }
.sx.is-live .kit-themes, .sx.is-live .chat-actions { flex-wrap: nowrap; }
.sx.is-live .kit-themes button, .sx.is-live .chat-actions button { min-height: 40px; padding: 0 clamp(10px, 1.1vw, 16px); border: 2px solid rgba(255, 255, 255, 0.5); border-radius: 999px; background: none; color: #fff; font-size: clamp(13px, 1vw, 15px); white-space: nowrap; }
.sx.is-live .kit-themes button:hover, .sx.is-live .kit-themes button[aria-pressed='true'], .sx.is-live .chat-actions button:hover { background: #fff; color: #000; transform: none; }
.sx.is-live .chat { justify-content: center; padding: 28px 28px calc(var(--bar) + 28px); }
.sx.is-live .chat-suggest { font-size: min(3.4vw, 7vh); }
.sx.is-live .chat-answer { flex: none; }
.sx.is-live .chat-actions { position: absolute; left: 0; right: 0; bottom: 0; }
.sx.is-live .kit { align-content: center; padding: 28px; }

.sx.is-live .sx-rail { position: absolute; z-index: 4; left: var(--gutter); right: calc(var(--frame-w) + var(--gutter) + 20px); bottom: 18px; display: flex; flex-wrap: wrap; gap: 4px clamp(14px, 2vw, 30px); color: #000; transition: color 0.3s; }
.sx-pin[data-current='ship'] .sx-rail { color: #fff; }
.sx-rail button { position: relative; min-height: 36px; font-size: clamp(13px, 1.05vw, 16px); font-weight: 500; color: inherit; opacity: 0.6; transition: opacity 0.2s; }
.sx-rail button:hover, .sx-rail button[aria-current='true'] { opacity: 1; }
.sx-rail button::after { content: ''; position: absolute; left: 0; right: 0; bottom: 3px; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease); }
.sx-rail button[aria-current='true']::after { transform: scaleX(1); }
