/* =========================================================
   Voice agents
   Section, capability grid, agent stage
   ========================================================= */
.frame > section.voice { background: var(--ink); color: #e7ebf1; border-top-color: var(--ink); padding: clamp(72px, 10vw, 128px) 0; overflow: hidden; }
.voice::before, .voice::after { display: none; }
.voice-head { padding: 0 var(--pad); max-width: 760px; margin-bottom: 48px; }
.voice h2 { color: #fff; margin: 14px 0 16px; }
.voice-head p { color: #9aa4b2; font-size: 17px; max-width: 58ch; }
.vcaps { margin: 56px var(--pad) 0; }
.vcaps-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--ink-line); }
.vcaps-head b { font-size: 20px; font-weight: 600; color: #fff; letter-spacing: -.02em; }
.vcaps-head span { font: 500 12px var(--mono); letter-spacing: .04em; color: #8a94a3; }
.vcaps-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.vcaps-grid li { padding: 24px 22px 26px 0; border-bottom: 1px solid var(--ink-line); }
.vcaps-grid li:not(:nth-child(4n+1)) { padding-left: 22px; border-left: 1px solid var(--ink-line); }
.vcaps-grid li:nth-last-child(-n+4) { border-bottom: 0; }
.vcaps-grid span { font: 500 11.5px var(--mono); color: #6f9bff; }
.vcaps-grid b { display: block; font-size: 16px; font-weight: 600; color: #fff; margin: 10px 0 6px; letter-spacing: -.01em; }
.vcaps-grid p { font-size: 14px; color: #9aa4b2; line-height: 1.5; }

@media (max-width: 860px) {
  .vcaps-grid { grid-template-columns: 1fr 1fr; }
  .vcaps-grid li:nth-child(n) { padding-left: 0; border-left: 0; }
  .vcaps-grid li:nth-child(2n) { padding-left: 18px; border-left: 1px solid var(--ink-line); }
  .vcaps-grid li:nth-last-child(-n+4) { border-bottom: 1px solid var(--ink-line); }
  .vcaps-grid li:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 640px) {
  .vcaps-grid { grid-template-columns: 1fr; }
  .vcaps-grid li:nth-child(n) { padding-left: 0; border-left: 0; border-bottom: 1px solid var(--ink-line); }
  .vcaps-grid li:last-child { border-bottom: 0; }
}

.stage { --side: min(13.5vw, 210px); position: relative; margin: 0 var(--pad); height: clamp(540px, calc(100vh - 120px), 660px);
  display: grid; grid-template-columns: minmax(340px, 420px) 1fr; border-radius: 26px; overflow: hidden; isolation: isolate; outline: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 40px 100px -40px rgba(29,95,214,.45); }
.stage-bg { position: absolute; inset: 0; z-index: -2; opacity: 0; transition: opacity 1.1s var(--ease); }
.stage-bg.on { opacity: 1; }
.stage::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 56px 56px; -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 90%); mask-image: linear-gradient(180deg, #000 30%, transparent 90%); }

/* ---------- Left column ---------- */
.stage-left { position: relative; z-index: 5; display: flex; flex-direction: column; gap: 12px; padding: 20px 0 20px 20px; min-height: 0; }
.stage-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.24); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.stage-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 500; color: rgba(255,255,255,.88); padding: 8px 6px; border-radius: 10px; white-space: nowrap; transition: background .3s, color .3s; }
.stage-tabs button i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 10.5px; font-weight: 600; background: rgba(255,255,255,.22); }
.stage-tabs button[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: 0 4px 12px -4px rgba(0,0,0,.25); }
.stage-tabs button[aria-pressed="true"] i { background: var(--accent); color: #fff; }

.agent-card { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 22px; border-radius: 20px; background: rgba(255,255,255,.93); -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5); border: 1px solid rgba(255,255,255,.7); box-shadow: 0 30px 70px -24px rgba(10,13,18,.5); color: var(--text); }
.agent-card.swap .ac-head, .agent-card.swap .ac-info { animation: cardIn .55s var(--ease) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(6px); } }
.ac-head { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.ac-avatar { width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; overflow: hidden; font-size: 20px; font-weight: 600; color: #fff; background: var(--accent); box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--accent); }
.ac-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transform: scale(3.1); transform-origin: 50% 4%; }
.ac-avatar:has(img) { background: linear-gradient(160deg, #eef2f8, #d9e1ee); }
.ac-industry { font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.ac-id h3 { font-size: 26px; letter-spacing: -.03em; line-height: 1.1; margin: 2px 0; }
.ac-role { font-size: 14px; color: var(--text-2); }
.ac-timer { margin-left: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font: 12px var(--mono); color: var(--green); opacity: 0; transition: opacity .3s; }
.ac-timer i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: ping 2s infinite; }
.calling .ac-timer { opacity: 1; }

.ac-info { padding-top: 16px; }
.ac-desc { color: var(--text-2); font-size: 15px; line-height: 1.6; margin-bottom: 18px; }
.ac-label { display: block; font: 600 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.ac-skills { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-skills span { font-size: 12.5px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); }

/* call view replaces the info block, so the card never grows */
.ac-call { display: none; flex: 1; min-height: 0; flex-direction: column; padding-top: 14px; }
.calling .ac-info { display: none; }
.calling .ac-call { display: flex; animation: cardIn .4s var(--ease) both; }
.ac-wave { display: flex; align-items: center; gap: 2px; height: 34px; flex-shrink: 0; margin-bottom: 10px; }
.ac-wave i { flex: 1; min-height: 3px; height: 10%; border-radius: 2px; background: #cfd6e0; transition: height .09s linear; }
.ac-wave i.c { background: var(--accent); }
.ac-transcript { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%); mask-image: linear-gradient(180deg, transparent, #000 22%); }
.msg { max-width: 88%; padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; animation: msgIn .4s var(--ease) both; flex-shrink: 0; }
.msg small { display: block; font: 600 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; opacity: .6; margin-bottom: 2px; }
.msg.bot { align-self: flex-start; background: var(--text); color: #fff; border-bottom-left-radius: 4px; }
.msg.bot small { color: #9fb9f0; opacity: 1; }
.msg.caller { align-self: flex-end; background: var(--surface-2); border-bottom-right-radius: 4px; }
.msg.note { align-self: center; background: #effaf2; color: var(--green); font-size: 12.5px; font-weight: 500; padding: 5px 12px; border-radius: 99px; }
.caret { display: inline-block; width: 2px; height: 13px; background: currentColor; vertical-align: -2px; margin-left: 2px; animation: blink 1s steps(2) infinite; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } }

.ac-controls { margin-top: auto; padding-top: 16px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.ac-call-btn { display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 18px 0 8px; border-radius: 99px; color: #fff; background: var(--accent); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 10px 24px -10px var(--accent); transition: background .3s, transform .2s var(--ease); }
.ac-call-btn:hover { transform: translateY(-1px); }
.ac-phone { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.2); flex-shrink: 0; transition: transform .4s var(--ease); }
.ac-phone svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linejoin: round; }
.ac-call-text { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.ac-call-text b { font-size: 15px; font-weight: 600; }
.ac-call-text small { font-size: 12px; opacity: .8; }
.calling .ac-call-btn { background: #dc3d3d; box-shadow: 0 10px 24px -10px #dc3d3d; }
.calling .ac-phone { transform: rotate(135deg); }
.lang { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.lang button { font: 600 12px var(--mono); padding: 8px 12px; border-radius: 99px; color: var(--text-3); transition: background .2s, color .2s; }
.lang button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }

.ac-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font: 12.5px var(--mono); color: var(--text-3); }
.ac-arrows { display: flex; gap: 8px; }
.ac-arrows button { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); color: var(--text); transition: background .2s, color .2s, border-color .2s; }
.ac-arrows button:hover { background: var(--text); color: #fff; border-color: var(--text); }

/* ---------- Right column ---------- */
.stage-right { position: relative; min-height: 0; overflow: hidden; }
.poster { position: absolute; top: 6%; left: 0; right: 0; height: 1em; font-size: clamp(56px, 8.4vw, 136px); pointer-events: none; z-index: 0; }
.poster span { position: absolute; inset: 0; text-align: center; font-family: "Anton", var(--font); font-size: 1em; line-height: 1; color: #fff; white-space: nowrap;
  opacity: 0; transform: translateY(20px) scale(.97); transition: opacity .7s var(--ease), transform 1s var(--ease); }
.poster span.on { opacity: 1; transform: none; }
.cast { position: absolute; inset: 0; z-index: 1; }
.figure { position: absolute; bottom: 0; left: 50%; height: 88%; aspect-ratio: 5 / 8; transform-origin: 50% 100%; padding: 0; border: 0; background: none; cursor: pointer;
  transition: transform 1s var(--ease), filter 1s var(--ease), opacity 1s var(--ease); }
.figure img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 24px 24px rgba(0,0,0,.22)); }
.figure[data-pos="center"] { transform: translateX(-50%); z-index: 3; cursor: default; }
.figure[data-pos="left"]  { transform: translateX(calc(-50% - var(--side))) scale(.52); z-index: 1; filter: blur(2.5px) saturate(.85); opacity: .9; }
.figure[data-pos="right"] { transform: translateX(calc(-50% + var(--side))) scale(.52); z-index: 1; filter: blur(2.5px) saturate(.85); opacity: .9; }
.figure[data-pos="left"]:hover, .figure[data-pos="right"]:hover { filter: blur(0); opacity: 1; }
.bob { position: absolute; inset: 0; }
.figure[data-pos="center"] .bob { animation: bob 5s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.figure::before { content: ""; position: absolute; left: 50%; top: 8%; width: 120%; aspect-ratio: 1; transform: translateX(-50%) scale(.85); border-radius: 50%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255,255,255,.55), rgba(255,255,255,.12) 55%, transparent 75%); opacity: 0; transition: opacity .5s; }
.stage.talking .figure[data-pos="center"]::before { opacity: 1; animation: speakGlow 1.1s ease-in-out infinite; }
@keyframes speakGlow { 50% { transform: translateX(-50%) scale(1); opacity: .65; } }
.figure::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 60%; height: 18px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.35), transparent); z-index: -1; }

/* Orb fallback (shown only if a character image fails to load) */
.orb-wrap { position: absolute; left: 50%; bottom: 8%; width: 92%; aspect-ratio: 1; transform: translateX(-50%); }
.orb-floor { position: absolute; left: 10%; right: 10%; bottom: -4%; height: 10%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.35), transparent); }
.orb { position: absolute; inset: 6%; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 32% 28%, #fff 0%, var(--o1) 22%, var(--o2) 58%, var(--o3) 100%);
  box-shadow: inset -24px -34px 60px rgba(0,0,0,.35), inset 14px 18px 40px rgba(255,255,255,.45), 0 30px 80px -20px var(--o3); }
.orb i { position: absolute; inset: -20%; background: radial-gradient(circle at 70% 75%, var(--o1), transparent 40%); filter: blur(18px); opacity: .8; }

/* ---------- Tablet / phone: tabs, characters, then the card ---------- */
@media (max-width: 960px) {
  .stage { --side: 28vw; height: auto; display: flex; flex-direction: column; gap: 12px; padding: 14px; margin: 0 12px; }
  .stage-left { display: contents; }
  .stage-tabs { order: 1; }
  .stage-right { order: 2; height: 360px; margin: 0 -14px; }
  .agent-card { order: 3; flex: none; min-height: 440px; }
  .poster { font-size: 15vw; top: 4%; }
}
@media (max-width: 560px) {
  .stage { border-radius: 20px; }
  .stage-right { height: 320px; }
  .stage-tabs button { font-size: 12px; gap: 5px; }
  .stage-tabs button i { display: none; }
  .agent-card { padding: 18px; }
  .ac-call-btn { padding-right: 12px; }
}
