/* Alt & Shift on the site — the Key Dash characters: live three.js stages + rig-rendered sprites (see stars.js). */
body { overflow-x: clip; }   /* the floor and the stars reach the viewport's edges; nothing may widen the page */

/* a sprite puppet: a fixed box (height × --ar), the state image sits on its bottom edge */
.ks { --ks-h: 200px; position: relative; display: inline-block; height: var(--ks-h); width: calc(var(--ks-h) * var(--ar, 1)); vertical-align: bottom; margin: 0;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  transform: rotate(var(--lean, 0deg)); transform-origin: 50% 100%; transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.ks-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; cursor: pointer; -webkit-user-drag: none;
  animation: ks-breathe 4.2s ease-in-out infinite; transform-origin: 50% 100%; }
.ks-shift .ks-img { animation-delay: -1.9s; animation-duration: 4.7s; }
.ks-caps .ks-img { animation: ks-fume 1.1s ease-in-out infinite; }
@keyframes ks-breathe { 0%, 100% { transform: none; } 50% { transform: translateY(-1%) scale(1.004, 1.012); } }
@keyframes ks-fume { 0%, 100% { transform: none; } 50% { transform: translateY(-3%) rotate(-1.2deg); } }
.ks-tap .ks-img { animation: ks-hop .5s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes ks-hop { 0% { transform: none; } 35% { transform: translateY(-9%) scale(1.03, .97); } 65% { transform: translateY(0) scale(.98, 1.03); } 100% { transform: none; } }

/* speech bubble — above the head, pointing down */
.ks-bubble { position: absolute; bottom: calc(100% + 6px); inset-inline-start: 50%; transform: translateX(-50%) translateY(6px) scale(.96);
  width: max-content; max-width: min(250px, 72vw); background: var(--surface, #fff); color: var(--ink, #12141a);
  border: 1px solid var(--line, #e7e9f0); border-radius: 14px; padding: 9px 13px; font: 600 15px/1.45 var(--font-body, "Assistant", system-ui, sans-serif);
  text-align: center; box-shadow: 0 18px 40px -18px rgba(20, 30, 80, .45); opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .22s cubic-bezier(.2, .8, .2, 1); z-index: 3; }
[dir=rtl] .ks-bubble { transform: translateX(50%) translateY(6px) scale(.96); }
.ks-bubble.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
[dir=rtl] .ks-bubble.show { transform: translateX(50%); }
.ks-bubble::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -7px; border: 7px solid transparent; border-top-color: var(--surface, #fff); border-bottom: 0; }
.ks-bubble.b-start { inset-inline-start: 0; transform: translateY(6px) scale(.96); } .ks-bubble.b-start.show { transform: none; }
.ks-bubble.b-start::after { left: 20%; }
.ks-bubble.b-end { inset-inline-start: auto; inset-inline-end: 0; transform: translateY(6px) scale(.96); } .ks-bubble.b-end.show { transform: none; }
.ks-bubble.b-end::after { left: 80%; }
/* over a live stage the bubble is placed in canvas pixels (left/bottom set by stars.js), centred on the head */
.ks-bubble.live, [dir=rtl] .ks-bubble.live { inset-inline: auto; transform: translateX(-50%) translateY(6px) scale(.96); }
.ks-bubble.live.show, [dir=rtl] .ks-bubble.live.show { transform: translateX(-50%); }
.ks-mute { display: inline-block; margin-inline-start: 8px; font-size: 12.5px; font-weight: 600; color: var(--brand, #1c54de); cursor: pointer; white-space: nowrap; }
.ks-mute:hover { text-decoration: underline; }
html.ks-still .ks-img, html.ks-still .ks { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { .ks-img, .ks { animation: none !important; transition: none !important; } }

/* a live stage inside a host: the canvas fills it; the sprite stand-ins sit on its bottom edge until it's up */
.ks-live { position: absolute; inset: 0; }
.ks-live canvas { display: block; width: 100%; height: 100%; }
.ks-live-fallback { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; gap: 6%; pointer-events: none; }
.ks-live-fallback .ks { pointer-events: auto; }
.is-live .ks-live-fallback .ks { position: absolute; inset: 0; width: auto; height: auto; transform: none !important; pointer-events: none; }
.is-live .ks-live-fallback .ks-img { display: none; }
.no-live .ks-live { display: none; }

/* ── hero: a keyboard floor along the bottom edge, the duo at the viewport's sides ── */
header.hero.has-stars { overflow: visible; }
header.hero > .ks-hero { position: static; height: 0; pointer-events: none; }   /* the spots position against the hero itself */
.ks-spot { position: absolute; top: var(--top, 0); height: 210px; width: 200px; pointer-events: auto; }
.ks-spot .ks-live-fallback .ks { --ks-h: 180px; }
.ks-spot-alt { inset-inline-start: max(8px, calc(50% - 600px)); }
.ks-spot-shift { inset-inline-end: max(8px, calc(50% - 600px)); }
.ks-spot .ks-bubble { max-width: 240px; }
@media (max-width: 1259px) {
  .ks-spot { height: 170px; width: 160px; } .ks-spot .ks-live-fallback .ks { --ks-h: 150px; }
  .ks-spot-alt { inset-inline-start: max(4px, calc(50% - 540px)); }
  .ks-spot-shift { inset-inline-end: max(4px, calc(50% - 540px)); }
}
/* narrow: a row at the top of the hero, the app icon between them (sprites; stars.js moves the icon in) */
@media (max-width: 1099px) {
  header.hero > .ks-hero { position: static; height: auto; display: flex; justify-content: center; align-items: center; gap: 14px; margin: 0 auto 26px; }
  .ks-spot { position: static; height: auto; width: auto; }
  .ks-spot .ks { --ks-h: 104px; }
  .ks-hero .mark { margin: 0 6px !important; }
  .ks-spot .ks-bubble { max-width: min(220px, 60vw); }
}
@media (max-width: 560px) { .ks-spot .ks { --ks-h: 92px; } }

/* ── cameos: a star peeks from behind a card as it scrolls into view ── */
.ks-cwrap { position: relative; display: flex; flex-direction: column; }
.ks-cwrap > :not(.ks-cameo) { position: relative; z-index: 1; flex: 1; }
.ks-cameo { position: absolute; z-index: 0; bottom: calc(100% - var(--sink, 56px)); pointer-events: none;
  transform: translateY(72%); opacity: 0; transition: transform .8s cubic-bezier(.2, .8, .2, 1), opacity .3s ease; }
.ks-cameo.end { inset-inline-end: var(--x, 26px); }
.ks-cameo.start { inset-inline-start: var(--x, 26px); }
.ks-cameo.mid { inset-inline-start: 50%; transform: translateX(-50%) translateY(72%); }
[dir=rtl] .ks-cameo.mid { transform: translateX(50%) translateY(72%); }
.ks-cwrap.in > .ks-cameo { transform: none; opacity: 1; }
.ks-cwrap.in > .ks-cameo.mid { transform: translateX(-50%); } [dir=rtl] .ks-cwrap.in > .ks-cameo.mid { transform: translateX(50%); }
.ks-cameo .ks { --ks-h: var(--h, 150px); pointer-events: auto; }
.ks-cameo.has-live, .ks-cameo:has(.ks-live) { width: calc(var(--h, 150px) * 1.15); height: calc(var(--h, 150px) * 1.08); }
.ks-cameo .ks-live-fallback .ks { --ks-h: var(--h, 150px); }
@media (max-width: 760px) {
  /* narrow screens: cards stack, so the star gets its own room above its card (in flow) instead of lying over the
     previous card's text; only its feet tuck behind the card */
  .ks-cwrap:not(.ks-errwrap) > .ks-cameo { position: relative; bottom: auto; inset-inline: auto; margin-bottom: -22px; line-height: 0; transform: translateY(40%); }
  .ks-cwrap:not(.ks-errwrap) > .ks-cameo.end { align-self: flex-end; margin-inline-end: 18px; }
  .ks-cwrap:not(.ks-errwrap) > .ks-cameo.start { align-self: flex-start; margin-inline-start: 18px; }
  .ks-cwrap:not(.ks-errwrap) > .ks-cameo.mid { align-self: center; }
  .ks-cwrap.in:not(.ks-errwrap) > .ks-cameo { transform: none; }
  .ks-cameo .ks { --ks-h: calc(var(--h, 150px) * .64); }
}

/* ── footer: the couch interview set, the duo on the sofa (live) ── */
.ks-set { position: relative; max-width: 1020px; margin: 72px auto 0; padding: 0 24px; }
.ks-couch { position: relative; aspect-ratio: 1600 / 848; border-radius: 22px; overflow: hidden; background: #6b4d3f url(/stars/couch.webp) center / cover no-repeat;
  box-shadow: 0 30px 70px -30px rgba(20, 30, 80, .5), inset 0 0 0 1px rgba(255, 255, 255, .12); }
.ks-couch .ks-live-fallback { align-items: center; padding-top: 2%; }
.ks-couch .ks-live-fallback .ks { --ks-h: 26%; height: 26%; }
.ks-couch .ks-bubble { max-width: min(230px, 40vw); }
.ks-set-t { position: absolute; inset: auto 24px 0; padding: 60px 26px 20px; border-radius: 0 0 22px 22px; background: linear-gradient(transparent, rgba(30, 18, 12, .78)); color: #fff;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; pointer-events: none; }
.ks-set-t nav, .ks-set-t a { pointer-events: auto; }
.ks-set-t b { display: block; font-family: var(--font-display, inherit); font-size: 22px; margin-bottom: 3px; }
.ks-set-t span { font-size: 15.5px; opacity: .85; }
.ks-set-t nav { display: flex; gap: 8px; flex-wrap: wrap; }
.ks-set-t nav a { color: #fff; font-weight: 600; font-size: 15px; padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); backdrop-filter: blur(6px); }
.ks-set-t nav a:hover { background: rgba(255, 255, 255, .28); color: #fff; }
footer.has-stars { margin-top: 36px !important; }
/* narrow: sprites sit on the sofa; the caption moves below the picture */
.ks-couch-row { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; gap: 3%; padding-bottom: 22%; }   /* % of the WIDTH: feet land on the seat */
.ks-couch-row .ks { --ks-h: 21vw; height: 21vw; }   /* a % height would resolve against the padded box */
@media (max-width: 760px) {
  .ks-set { margin-top: 48px; padding: 0 14px; }
  .ks-couch { border-radius: 16px; }
  .ks-set-t { position: static; padding: 14px 4px 0; border-radius: 0; background: none; color: var(--ink, #12141a); }
  .ks-set-t b { font-size: 18px; } .ks-set-t span { font-size: 14px; color: var(--muted, #69707f); opacity: 1; }
  .ks-set-t nav a { font-size: 13.5px; padding: 6px 11px; color: var(--brand, #1c54de); background: var(--tint, #eef3ff); border-color: var(--brand-soft, #dbe4ff); backdrop-filter: none; }
  .ks-couch .ks-bubble { font-size: 13px; max-width: 50vw; }
}

/* ── modal peek: a star hangs over a popup's corner ── */
.ks-modal { position: absolute; top: -200px; left: 0; z-index: 1; pointer-events: none; animation: ks-rise .3s .25s both cubic-bezier(.2, .8, .2, 1); }
.ks-modal .ks { --ks-h: 118px; pointer-events: auto; }
.ks-modal .ks-bubble { max-width: 200px; }
@media (max-width: 560px), (max-height: 640px) { .ks-modal { display: none; } }

/* ── 404: the duo peeks over the card (live), Caps Lock slinks up behind the other corner ── */
main.err .ks-errwrap { width: 100%; max-width: 460px; margin: 180px auto 0 !important; }
main.err .ks-errwrap > .card { margin: 0; }
.ks-errstage { width: 480px; height: 230px; --sink: 70px; }
.ks-errstage.is-live { width: 520px; height: 250px; }
.ks-errstage .ks-live-fallback .ks { --ks-h: 180px; }
.ks-errstage .ks-couch-row { position: static; padding: 0; }
.ks-errstage .ks-couch-row .ks { --ks-h: 150px; height: 150px; }
@media (max-width: 560px) { .ks-errstage { width: 300px; height: 150px; } .ks-errstage .ks-couch-row .ks { --ks-h: 110px; height: 110px; } main.err .ks-errwrap { margin-top: 110px !important; } }

/* ── cookie note: a small card with Alt, bottom start corner ── */
.ks-cookie { position: fixed; z-index: 45; inset-inline-start: 18px; bottom: 18px; width: min(380px, calc(100vw - 36px));
  background: var(--surface, #fff); border: 1px solid var(--line, #e7e9f0); border-radius: 18px; padding: 14px 16px 14px;
  box-shadow: 0 30px 70px -24px rgba(20, 30, 80, .4); display: flex; gap: 14px; align-items: flex-end;
  transform: translateY(16px); opacity: 0; pointer-events: none; transition: opacity .3s ease, transform .3s ease; }
.ks-cookie.show { opacity: 1; transform: none; pointer-events: auto; }
.ks-cookie .ks { --ks-h: 84px; flex: none; margin-bottom: -2px; }
.ks-cookie p { margin: 0 0 8px; font-size: 15px; line-height: 1.45; color: var(--ink-2, #3b4251); }
.ks-cookie p a { font-weight: 600; }
.ks-cookie .ks-cb { display: flex; gap: 8px; }
.ks-cookie button { font: 600 14.5px var(--font-body, inherit); border-radius: 10px; padding: 7px 14px; cursor: pointer; border: 1px solid var(--line, #e7e9f0); background: var(--surface, #fff); color: var(--ink, #12141a); }
.ks-cookie button.pri { background: var(--brand, #1c54de); color: #fff; border-color: transparent; }
.ks-cookie button.pri:hover { background: var(--brand-hover, #1743b4); }
.stickybar.show ~ .ks-cookie { bottom: 84px; }
@media (max-width: 560px) { .ks-cookie { inset-inline-start: 12px; bottom: 12px; width: calc(100vw - 24px); } .stickybar.show ~ .ks-cookie { bottom: 92px; } }

/* ── accessibility widget: round button, bottom start corner; panel above it ── */
.ks-music-btn { inset-inline-start: 74px !important; background: var(--surface, #fff) !important; color: var(--brand, #1c54de) !important; border: 1px solid var(--line, #e7e9f0) !important; box-shadow: 0 12px 28px -12px rgba(20, 30, 80, .5) !important; }
.ks-music-btn[aria-pressed=true] { background: var(--tint, #eef3ff) !important; }
.ks-music-btn svg { width: 24px !important; height: 24px !important; }
.ks-a11y-btn, .ks-music-btn { position: fixed; z-index: 46; inset-inline-start: 18px; bottom: 18px; width: 48px; height: 48px; border-radius: 50%;
  border: none; background: var(--brand, #1c54de); color: #fff; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 12px 28px -10px rgba(28, 84, 222, .8); transition: transform .15s ease, bottom .3s ease; }
.ks-a11y-btn:hover { transform: scale(1.06); }
.ks-a11y-btn svg { width: 28px; height: 28px; }
.ks-cookie.show ~ .ks-a11y-btn, .ks-cookie.show ~ .ks-music-btn { bottom: 130px; }
.stickybar.show ~ .ks-a11y-btn, .stickybar.show ~ .ks-music-btn { bottom: 84px; }
.stickybar.show ~ .ks-cookie.show ~ .ks-a11y-btn, .stickybar.show ~ .ks-cookie.show ~ .ks-music-btn { bottom: 196px; }
@media (max-width: 560px) { .ks-a11y-btn, .ks-music-btn { width: 42px; height: 42px; inset-inline-start: 12px; bottom: 12px; } .ks-music-btn { inset-inline-start: 62px !important; } .ks-a11y-btn svg { width: 24px; height: 24px; } .ks-cookie.show ~ .ks-a11y-btn, .ks-cookie.show ~ .ks-music-btn { bottom: 150px; } .stickybar.show ~ .ks-a11y-btn, .stickybar.show ~ .ks-music-btn { bottom: 88px; } }
.ks-a11y { position: fixed; z-index: 47; inset-inline-start: 18px; bottom: 78px; width: min(330px, calc(100vw - 36px));
  background: var(--surface, #fff); border: 1px solid var(--line, #e7e9f0); border-radius: 18px; padding: 16px 16px 12px;
  box-shadow: 0 30px 70px -24px rgba(20, 30, 80, .45); display: none; }
.ks-a11y.show { display: block; animation: ks-rise .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes ks-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.ks-a11y-h { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 10px; }
.ks-a11y-h .ks { --ks-h: 64px; }
.ks-a11y-h b { font-family: var(--font-display, inherit); font-size: 17.5px; color: var(--ink, #12141a); display: block; line-height: 1.2; }
.ks-a11y-h span { font-size: 14px; color: var(--muted, #69707f); }
.ks-a11y-x { margin-inline-start: auto; align-self: flex-start; border: none; background: none; color: var(--faint, #a9afbe); font-size: 22px; line-height: 1; cursor: pointer; }
.ks-a11y-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line, #e7e9f0); font-size: 15.5px; font-weight: 600; color: var(--ink, #12141a); }
.ks-a11y-row .seg { display: flex; gap: 4px; }
.ks-a11y-row .seg button, .ks-a11y-row .sw { font: 600 14px var(--font-body, inherit); border: 1px solid var(--line, #e7e9f0); background: var(--surface, #fff); color: var(--ink, #12141a); border-radius: 9px; padding: 5px 10px; cursor: pointer; min-width: 36px; }
.ks-a11y-row .seg button[aria-pressed=true], .ks-a11y-row .sw[aria-pressed=true] { background: var(--brand, #1c54de); color: #fff; border-color: transparent; }
.ks-a11y-f { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--line, #e7e9f0); font-size: 14px; }
.ks-a11y-f button { border: none; background: none; color: var(--muted, #69707f); cursor: pointer; font: 600 14px var(--font-body, inherit); }
.ks-a11y-f button:hover, .ks-a11y-f a:hover { color: var(--brand, #1c54de); }

/* the switches themselves (body classes the widget sets) */
html.ks-fs1 { font-size: 112%; } html.ks-fs2 { font-size: 125%; }
html.ks-links a:not(.btn):not(.nav-dl) { text-decoration: underline; text-underline-offset: 3px; }
html.ks-contrast body { --ink: #000; --ink-2: #000; --ink-3: #111; --muted: #222; --faint: #444; --line: #777; --bg: #fff; --panel: #fff; --surface: #fff; }
html.ks-contrast a { color: #0b2f9e; }
html.ks-contrast .btn-primary, html.ks-contrast .nav-dl { background: #0b2f9e; }
html.ks-font body, html.ks-font h1, html.ks-font h2, html.ks-font h3 { font-family: Arial, "Segoe UI", system-ui, sans-serif; letter-spacing: 0; }
html.ks-still *, html.ks-still *::before, html.ks-still *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.ks-still video { display: none; }
html.ks-still .ks-cwrap > .ks-cameo { transform: none; opacity: 1; }
