/* Roost · voice on the landing (1.6). With voice-demo.js; used by index.html (#voice) and voice.html.
   A band of the Dusk sky (evening, the hour you talk your replies) holding one letter with its reply, the capsule
   that hears you, and a key to hold. Every class starts vx-. Colours are the app's (Theme.swift, look A). */

.vx, .vxc {
  --w-sheet: #fff; --w-ink: #101217; --w-ink2: #3a404c; --w-ink3: #69707d; --w-ink4: #a2a8b3; --w-letter: #1b1e26;
  --w-line: #e5e7ec; --w-line2: #eef0f3; --w-chip: #f1f3f6; --w-btn: #101217; --w-btn-ink: #fff;
  --vx-shop: #7357f1; --vx-team: #15a285;
  --key-top: linear-gradient(#ffffff, #eef0f4); --key-ink: #3a404c; --key-edge: #b7bdca;
  --vx-veil: transparent;
}
.vx {
  position: relative; isolation: isolate; overflow: hidden; color: #fff; padding-block: 92px 76px;
  background: #24336e;
  background-image: linear-gradient(var(--vx-veil), var(--vx-veil)), url(assets/demo/grain.png), url(assets/demo/sky-dusk-ng.jpg);
  background-size: auto, 256px 256px, cover; background-position: 0 0, 0 0, center 40%;
}
@media (prefers-color-scheme: dark) {
  .vx, .vxc {
    --w-sheet: #1e1f23; --w-ink: #ececf0; --w-ink2: #c4c6ce; --w-ink3: #a1a3ab; --w-ink4: #6f717a; --w-letter: #dcdde3;
    --w-line: #34353b; --w-line2: #2d2e33; --w-chip: #2b2c31; --w-btn: #ececf0; --w-btn-ink: #1e1f23;
    --vx-shop: #a08bff; --vx-team: #3fd0a8;
    --key-top: linear-gradient(#2c2d32, #1d1e22); --key-ink: #e6e7ec; --key-edge: #0b0c0f;
    --vx-veil: rgba(6,8,26,.38);
  }
}
.vx [hidden], .vxc [hidden] { display: none !important; }
:where(.vx, .vxc) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------- head ---------- */
.vx-head { text-align: center; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; }
.vx-pill { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px 0 9px; border-radius: 99px; font: 600 13px var(--sans);
  background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.vx-pill svg { width: 17px; height: 17px; --bird: #fff; --belly: rgba(255,255,255,.55); }
.vx h1, .vx h2 { margin-top: 16px; color: #fff; font: 700 clamp(42px, 5.4vw, 74px)/1.02 var(--display); letter-spacing: -.04em; text-shadow: 0 2px 30px rgba(10,14,60,.4); text-wrap: balance; }
.vx h1 em, .vx h2 em { font-style: normal; color: var(--yellow); display: inline-block; }
.vx-head > p { margin-top: 18px; max-width: 35em; font-size: 18px; line-height: 1.55; color: rgba(255,255,255,.94); text-shadow: 0 1px 14px rgba(10,14,60,.45); text-wrap: pretty; }
.vx-modes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 26px; }
.vx-modes button { height: 36px; padding: 0 15px; border-radius: 99px; font: 500 14px var(--sans); color: #fff; background: rgba(12,16,60,.3);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); transition: background .2s, color .2s; }
.vx-modes button:hover { background: rgba(12,16,60,.45); }
.vx-modes button[aria-pressed="true"] { background: #fff; color: #101217; box-shadow: 0 6px 16px -8px rgba(6,10,40,.6); }
.vx button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.vxc button:focus-visible { outline: 2px solid var(--cr-violet); outline-offset: 3px; }

/* ---------- the letter ---------- */
.vx-stage { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; margin-top: 42px; }
.vx-win { position: relative; width: 760px; max-width: 100%; min-height: 548px; display: flex; flex-direction: column; padding-bottom: 22px; border-radius: 18px; text-align: left;
  background: var(--w-sheet); color: var(--w-ink); font: 13px/1.35 var(--sans);
  box-shadow: 0 0 0 .5px rgba(6,10,40,.4), 0 50px 100px -36px rgba(4,8,40,.8), 0 14px 34px -14px rgba(4,8,40,.5); }
.vx-bar { display: flex; align-items: center; gap: 20px; height: 50px; padding: 0 18px; border-bottom: 1px solid var(--w-line2); }
.vx-tools { display: flex; gap: 16px; }
.vx-tools svg { width: 17px; height: 17px; fill: none; stroke: var(--w-ink2); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.vx-more { margin-left: auto; color: var(--w-ink2); font-weight: 700; letter-spacing: 1px; }
.vx-letter { padding: 20px 40px 0; }
.vx-letter h4 { font: 650 22px/1.2 var(--display); letter-spacing: -.015em; color: var(--w-ink); }
.vx-from { display: flex; align-items: center; gap: 9px; margin-top: 14px; font-size: 14px; }
.vx-pic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; font: 650 10.5px var(--sans); color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.vx-from b { font-weight: 650; }
.vx-addr { padding: 2px 7px; border-radius: 6px; background: var(--w-chip); font-size: 12.5px; color: var(--w-ink3); }
.vx-time { margin-left: auto; font-size: 12.5px; color: var(--w-ink3); }
.vx-to { display: flex; align-items: center; gap: 5px; margin: 2px 0 0 39px; font-size: 12.5px; color: var(--w-ink3); }
.vx-to img { width: 13px; height: 13px; }
.vx-body { margin-top: 16px; font: 16px/1.6 var(--serif); color: var(--w-letter); }

/* the reply, where the words land */
.vx-reply { position: relative; margin: 20px 28px 0; padding: 12px 16px 12px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--w-line); }
.vx[data-mode="tell"]:not(.open) .vx-reply { display: none; }
.vx-rhead { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--w-ink3); }
.vx-rhead b { font-weight: 500; color: var(--w-ink2); }
.vx-rhead > span:last-child { white-space: nowrap; }
.vx-chip { position: relative; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px 0 13px; border-radius: 6px; background: var(--w-line2); color: var(--w-ink2); font-weight: 600; }
.vx-chip::before { content: ""; position: absolute; left: 5px; top: 5px; bottom: 5px; width: 3px; border-radius: 2px; background: var(--acc, var(--vx-shop)); }
.vx-chip img { width: 13px; height: 13px; }
.vx-text { min-height: 128px; margin-top: 12px; font: 16px/1.6 var(--serif); color: var(--w-letter); white-space: pre-line; }
.vx-ph { color: var(--w-ink4); }
.vx-raw { color: var(--w-ink3); opacity: 0; transition: opacity .25s; white-space: normal; }
.vx-raw.in { opacity: 1; }
.vx-raw.out { opacity: 0; transition-duration: .2s; }
.vx-raw .x { background: linear-gradient(currentColor, currentColor) 0 58% / 0% 1.5px no-repeat; transition: background-size .3s ease, color .3s; }
.vx-raw .x.cut { background-size: 100% 1.5px; color: var(--w-ink4); }
.vx-clean { opacity: 0; transform: translateY(3px); transition: opacity .35s ease, transform .35s ease; }
.vx-clean.in { opacity: 1; transform: none; }
.vx-hi { display: block; margin-bottom: 1.1em; }
.vx-rfoot { display: flex; align-items: center; justify-content: flex-end; margin-top: 8px; }
.vx-hint { font-size: 12px; color: var(--w-ink3); opacity: 0; transition: opacity .3s; }
.vx-hint.on { opacity: 1; }
.vx-hint kbd { font: 600 11px var(--sans); padding: 1px 5px; border-radius: 5px; box-shadow: 0 0 0 1px var(--w-line), 0 1px 0 var(--w-line); }
.vx-send { height: 30px; padding: 0 16px; border-radius: 15px; background: var(--w-btn) !important; color: var(--w-btn-ink) !important; font-weight: 600 !important; font-size: 13.5px !important; }

/* Tell Roost what to say */
.vx-tell { position: relative; display: flex; align-items: center; gap: 12px; height: 52px; margin: 16px 28px 0; padding: 0 9px 0 16px; border-radius: 26px;
  border: 1px solid transparent; background: linear-gradient(var(--w-sheet), var(--w-sheet)) padding-box, linear-gradient(90deg, #93bbee, #f1a9bc) border-box; }
.vx[data-mode="reply"] .vx-tell { display: none; }
.vx-bird { width: 21px; height: 21px; flex: none; --bird: var(--w-ink2); --belly: var(--w-sheet); }
.vx-ask { flex: 1; min-width: 0; font-size: 15px; color: var(--w-ink4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s; }
.vx-ask.said { color: var(--w-ink); }
.vx-writing { display: none; font-size: 13px; color: var(--w-ink3); }
.vx-tell.busy .vx-writing { display: inline; }
.vx-tell.busy .vx-bird { animation: vx-bob .9s ease-in-out infinite; }
@keyframes vx-bob { 50% { transform: translateY(-2px) rotate(-5deg); } }
.vx-mic { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--w-ink3); stroke-width: 1.4; stroke-linecap: round; }
.vx-go { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--w-btn); }
.vx-go svg { width: 15px; height: 15px; fill: none; stroke: var(--w-btn-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* the capsule that hears you: the app's VoiceHUD, with the AI bar's rim */
.vx-cap { position: absolute; left: 50%; bottom: calc(100% + 10px); z-index: 3; display: flex; align-items: center; gap: 12px; height: 44px; max-width: calc(100% + 20px); padding: 0 16px;
  border-radius: 22px; border: 1px solid transparent; white-space: nowrap; color: var(--w-ink);
  background: linear-gradient(var(--w-sheet), var(--w-sheet)) padding-box, linear-gradient(90deg, #93bbee, #f1a9bc) border-box;
  box-shadow: 0 16px 34px -14px rgba(8,14,60,.45); opacity: 0; transform: translate(-50%, 6px) scale(.96); transition: opacity .18s, transform .22s cubic-bezier(.2,.9,.3,1); pointer-events: none; }
.vx-cap.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.vx-wave { display: flex; align-items: center; gap: 2.5px; width: 24px; height: 18px; flex: none; }
.vx-wave i { width: 2.5px; height: 5px; border-radius: 2px; background: var(--w-ink); transition: height .09s linear; }
.vx-live { min-width: 0; max-width: 380px; overflow: hidden; text-overflow: ellipsis; font-size: 14px; color: var(--w-ink2); }
.vx-cap em { font-style: normal; font-size: 12px; color: var(--w-ink3); }

/* ---------- the key ---------- */
.vx-keyrow { display: flex; align-items: center; gap: 20px; margin-top: 38px; }
.vx-key { position: relative; width: 136px; height: 88px; flex: none; border-radius: 14px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  background: var(--key-top) !important; color: var(--key-ink) !important;
  box-shadow: 0 0 0 1px rgba(6,10,40,.2), 0 5px 0 var(--key-edge), 0 14px 28px -8px rgba(4,8,40,.65); transition: transform .07s, box-shadow .07s; }
.vx-key.down { transform: translateY(4px); box-shadow: 0 0 0 1px rgba(6,10,40,.22), 0 1px 0 var(--key-edge), -12px 2px 26px 2px rgba(147,187,238,.75), 12px 2px 26px 2px rgba(241,169,188,.7); }
.vx-k-sym { position: absolute; left: 14px; top: 9px; font: 400 23px/1 var(--sans); }
.vx-k-word { position: absolute; left: 15px; bottom: 12px; font: 500 14px/1 var(--sans); }
.vx-keytext { min-width: 170px; text-align: left; }
.vx-keytext b { display: block; font: 650 20px/1.3 var(--display); color: #fff; text-shadow: 0 1px 10px rgba(6,10,40,.5); }

/* ---------- the card (the landing's: 1.6 shrank the band to a feature card; voice.html keeps the band) ---------- */
.vxc-new { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; margin-bottom: 14px; border-radius: 99px; background: var(--sub); color: var(--ink-2); font: 600 12px var(--sans); }
.vxc-new svg { width: 15px; height: 15px; --bird: var(--ink-2); --belly: var(--sub); }
.vxc-keyrow { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.vxc .vx-key { width: 104px; height: 66px; border-radius: 12px; }
.vxc .vx-k-sym { left: 11px; top: 8px; font-size: 19px; }
.vxc .vx-k-word { left: 12px; bottom: 10px; font-size: 12.5px; }
.vxc-keyrow p { min-width: 0; }
.vxc-keyrow b { display: block; font: 650 17px/1.3 var(--display); color: var(--ink); }
.vxc-win { position: relative; padding: 14px 16px 16px; text-align: left; color: var(--w-ink); }
.vxc-q { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.45; color: var(--w-ink2); }
.vxc-q i { width: 3px; flex: none; border-radius: 2px; background: var(--vx-shop); }
.vxc-q b { display: block; color: var(--w-ink); font-weight: 650; }
.vxc .vx-reply { margin: 14px 0 0; padding: 11px 13px 11px; }
.vxc .vx-text { min-height: 118px; margin-top: 10px; font-size: 15.5px; line-height: 1.55; }
.vxc .vx-cap { top: 44px; bottom: auto; height: 40px; gap: 10px; padding: 0 14px; }
.vxc .vx-live { max-width: 250px; font-size: 13.5px; }
@media (max-width: 640px) {
  .vxc-keyrow { justify-content: center; }
  .vxc .vx-live { max-width: 170px; }
  .vxc .vx-cap em { display: none; }
}
.vx-sr, .vxc .vx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 640px) {
  .vx { padding-block: 64px 56px; }
  .vx-head > p { font-size: 16.5px; }
  .vx-stage { margin-top: 30px; }
  .vx-win { min-height: 0; }
  .vx-bar { display: none; }
  .vx-letter { padding: 18px 18px 0; }
  .vx-letter h4 { font-size: 19px; }
  .vx-addr, .vx-time { display: none; }
  .vx-body { font-size: 15px; }
  .vx-reply, .vx-tell { margin-inline: 12px; }
  .vx-text { font-size: 15px; min-height: 150px; }
  .vx-live { max-width: 180px; }
  .vx-cap em { display: none; }
  .vx-keyrow { flex-direction: column; gap: 16px; }
  .vx-keytext { text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .vx *, .vx *::before, .vx *::after { transition: none !important; animation: none !important; }
}
