/* Same design system as chatbot.wissasystems.com: warm near-black ground, one
   volt accent, Archivo Black over Hanken Grotesk. Tokens copied verbatim so
   the two demos read as one product. Everything below the divider is new and
   specific to a voice call. */
:root {
  --page: #0b0a08;
  --surface: #161511;
  --raised: #1f1e19;
  --bubble: #292822;
  --line: #35332c;
  --line-soft: #25241f;
  --text: #f4f3f0;
  --dim: #a6a59e;
  --faint: #76746e;
  --volt: #bbe845;
  --volt-deep: #8fb51f;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--page);
  color: var(--text);
  font-family: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.dsp {
  font-family: "Archivo Black", "Helvetica Neue", "Arial Black", Arial, sans-serif;
  font-weight: 400;
}

/* ---------- atmosphere ---------- */

.bg-grid, .bg-glow { position: fixed; pointer-events: none; z-index: 0; }

.bg-grid {
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 72px 72px;
}

.bg-glow {
  left: 50%;
  top: -220px;
  width: min(1100px, 140vw);
  height: 700px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center,
    rgba(187, 232, 69, 0.16), rgba(187, 232, 69, 0.04) 42%, transparent 70%);
  filter: blur(10px);
  transition: opacity 0.6s ease;
}

body.state-call .bg-glow { opacity: 0.3; }

/* ---------- shell ---------- */

.shell { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; }

.topbar {
  flex-shrink: 0;
  height: 72px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(11, 10, 8, 0.86);
  backdrop-filter: blur(8px);
}

.brand { display: flex; align-items: center; gap: 12px; }

.mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--volt);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mark svg { display: block; }

.wordmark { font-size: 17px; letter-spacing: 0.06em; }

.tag {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
}

.ghost-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease;
}

.ghost-btn:hover:not(:disabled) { border-color: var(--volt); color: var(--text); }
.ghost-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ghost-btn svg { display: block; flex-shrink: 0; }

/* ---------- stage ---------- */

.stage {
  flex-grow: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.stage::-webkit-scrollbar { width: 10px; }
.stage::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }

.column { width: 100%; max-width: 780px; padding: 0 40px; }

.center-dock { display: flex; flex-direction: column; gap: 34px; padding-block: 48px; }
body.state-call .center-dock { display: none; }

/* ---------- hero ---------- */

.hero { display: flex; flex-direction: column; gap: 18px; }

.eyebrow { display: flex; align-items: center; gap: 12px; }
.eyebrow .rule { width: 26px; height: 2px; background: var(--volt); }
.eyebrow .label { font-size: 11px; letter-spacing: 0.22em; color: var(--volt); }

.hero h1 {
  margin: 0;
  font-size: clamp(38px, 5.2vw, 76px);
  line-height: 0.93;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.hero p {
  margin: 0;
  max-width: 540px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--dim);
  text-wrap: pretty;
}

/* ================= voice-specific from here ================= */

/* ---------- the dial pad: one big control, like the composer ---------- */

.dial {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px 26px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(187, 232, 69, 0.06);
}

.dial-main { display: flex; align-items: center; gap: 22px; }

/* The orb is the mic level meter as well as the button. --level is written
   from JS each animation frame (0..1) and drives the ring only, so the label
   never jitters. */
.orb {
  --level: 0;
  position: relative;
  width: 92px;
  height: 92px;
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  background: var(--volt);
  color: var(--page);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

.orb:hover:not(:disabled) { background: var(--volt-deep); }
.orb:active:not(:disabled) { transform: scale(0.97); }
.orb:disabled { opacity: 0.45; cursor: progress; }
.orb svg { display: block; position: relative; z-index: 1; }

.orb::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 999px;
  border: 2px solid var(--volt);
  opacity: calc(0.12 + var(--level) * 0.75);
  transform: scale(calc(1 + var(--level) * 0.16));
  transition: opacity 0.08s linear, transform 0.08s linear;
  pointer-events: none;
}

/* Idle invitation. Suppressed during a call: a pulse that ignores the mic
   reads as fake once you are actually talking to it. */
.orb::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 999px;
  border: 2px solid var(--volt);
  opacity: 0;
  pointer-events: none;
}

body.state-idle .orb::after { animation: ping 2.4s ease-out infinite; }

@keyframes ping {
  0% { opacity: 0.5; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(1.5); }
}

.orb.is-end { background: #e2564a; color: #fff; }
.orb.is-end:hover:not(:disabled) { background: #c8463b; }
.orb.is-end::before { border-color: #e2564a; }

.dial-copy { min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.dial-title { font-size: 20px; letter-spacing: -0.01em; }

.dial-sub { font-size: 14px; line-height: 1.5; color: var(--dim); }

.dial-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
}

.micline {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12px;
  color: var(--faint);
}

.micline svg { display: block; flex-shrink: 0; }

.micpick {
  max-width: 230px;
  border: 0;
  background: transparent;
  color: var(--faint);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-overflow: ellipsis;
}

.micpick:hover { color: var(--dim); }
.micpick option { background: var(--raised); color: var(--text); }

/* ---------- live call bar ---------- */

.callbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--dim);
  margin-right: auto;
}

.status .led {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--faint);
  flex-shrink: 0;
}

body.st-connecting .status .led { background: #ffb522; animation: dot 1.1s ease-in-out infinite; }
body.st-listening .status .led { background: var(--volt); }
body.st-speaking .status .led { background: var(--volt); animation: dot 0.9s ease-in-out infinite; }
body.st-ended .status .led { background: var(--faint); }

@keyframes dot { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

.timer {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--faint);
  letter-spacing: 0.04em;
}

.timer.is-warn { color: #ffb522; }

/* Ended: the bar becomes a read-out, not a control panel. */
body.st-ended #meter,
body.st-ended #muteBtn,
body.st-ended #hangBtn { display: none; }

#muteBtn.is-on { border-color: #5c3a20; color: #ffb522; }

/* ---------- the two-channel meter ---------- */

.meter {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 26px;
  flex-shrink: 0;
}

.meter i {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  transition: height 0.07s linear, background 0.2s ease;
}

.meter.is-hot i { background: var(--volt); }

/* ---------- transcript ---------- */

/* margin-top:auto rather than justify-content on .stage: the stage is the
   scroll container, and flex centring there clips the top of a transcript once
   it grows past the viewport. This pins a short call just above the call bar
   and still scrolls normally when it gets long. */
.thread { display: flex; flex-direction: column; gap: 26px; padding-block: 34px 8px; margin-top: auto; }
body.state-idle .thread { display: none; }

.turn-user { display: flex; justify-content: flex-end; }

.turn-user .bubble {
  max-width: 520px;
  background: var(--bubble);
  border: 1px solid var(--line);
  border-radius: 20px 20px 6px 20px;
  padding: 14px 18px;
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.turn-bot { display: flex; gap: 16px; align-items: flex-start; }
.turn-bot .mark { margin-top: 2px; }

.answer {
  min-width: 0;
  max-width: 620px;
  font-size: 16px;
  line-height: 1.62;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

/* A turn that is still being spoken. The caret marks the live edge so a
   half-finished sentence does not read as the agent trailing off. */
.turn.is-live .answer::after,
.turn.is-live .bubble::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 16px;
  vertical-align: -2px;
  margin-left: 3px;
  background: var(--volt);
  animation: blink 1s steps(2, start) infinite;
}

.turn-user.is-live .bubble::after { background: var(--dim); }

@keyframes blink { 50% { opacity: 0; } }

.sysnote {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--faint);
  text-align: center;
}

.notice {
  border: 1px solid #5c3a20;
  background: #221610;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
  color: #f0d3b8;
}

/* ---------- post-call summary ---------- */

.recap {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 18px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.recap-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--volt);
}

.recap-body { font-size: 15px; line-height: 1.6; color: var(--text); }
.recap-body.is-waiting { color: var(--faint); }

.recap-facts { display: flex; flex-wrap: wrap; gap: 8px; }

.fact {
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--dim);
}

.fact b { color: var(--text); font-weight: 600; }
.fact.is-good { color: var(--volt); border-color: #35402c; background: #191d12; }
.fact.is-warn { color: #ffb522; border-color: #5c3a20; background: #221610; }

/* ---------- capability cards ---------- */

.caps { display: flex; flex-direction: column; gap: 16px; }

.caps-head {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--faint);
}

.caps-head .rule { flex-grow: 1; height: 1px; background: var(--line-soft); }

.caps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.cap {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 16px 16px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.16s ease;
}

.cap:hover { border-color: var(--line); }

.cap-ico { color: var(--volt); }
.cap-ico svg { display: block; }

.cap h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0.01em; }

.cap p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--dim); }

/* ---------- try-saying prompts ---------- */

.tries { display: flex; flex-wrap: wrap; gap: 8px; }

.try {
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  cursor: default;
}

/* ---------- agent spec strip ---------- */

.specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 12px;
  color: var(--faint);
}

.spec { display: flex; align-items: center; gap: 7px; }
.spec b { color: var(--dim); font-weight: 500; }

.spec .dot { width: 3px; height: 3px; border-radius: 999px; background: var(--volt); flex-shrink: 0; }

/* ---------- bottom dock ---------- */

.bottom-dock {
  flex-shrink: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  background: linear-gradient(to top, var(--page) 62%, rgba(11, 10, 8, 0));
  padding-block: 18px 20px;
}

body.state-idle .bottom-dock { display: none; }

.disclaimer {
  text-align: center;
  font-size: 12px;
  line-height: 1.45;
  color: var(--faint);
  padding: 0 40px 24px;
  flex-shrink: 0;
}

body.state-call .disclaimer { padding-bottom: 16px; margin-top: -8px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- phone ---------- */

@media (max-width: 640px) {
  .topbar { height: 60px; padding: 0 20px; }
  .wordmark { font-size: 15px; }
  .tag { display: none; }
  .ghost-btn { width: 44px; padding: 0; justify-content: center; }
  .ghost-btn .btn-label { display: none; }
  .column { padding: 0 20px; }
  .center-dock { gap: 26px; padding-block: 28px; }
  .hero p { font-size: 15px; }
  .dial { border-radius: 18px; padding: 20px 18px 16px; }
  .dial-main { flex-direction: column; align-items: flex-start; gap: 14px; }
  .orb { width: 76px; height: 76px; }
  .dial-title { font-size: 18px; }
  .micpick { max-width: 150px; }
  .callbar { padding: 12px 16px; gap: 12px; }
  .meter { height: 22px; }
  .thread { gap: 22px; padding-block: 24px 4px; }
  .turn-user .bubble, .answer { font-size: 15px; }
  .turn-bot { gap: 12px; }
  .caps-grid { grid-template-columns: 1fr; }
  .disclaimer { padding: 0 20px 20px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .orb::before, .orb::after, .meter i { transition: none; animation: none; }
  body.state-idle .orb::after { animation: none; }
}
