/* agents.css: the Agents page (X/Friend). Extends home.css; same design
   tokens (--surface, --accent, --serif, --mono, ...) and voice/code/card
   components, plus the animated orb and page-specific layout. */

/* ── Hero ─────────────────────────────────────────────── */
.agents-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 520px at 78% 12%, rgba(212, 106, 88, 0.10), transparent 62%),
    radial-gradient(900px 420px at 12% 88%, rgba(212, 106, 88, 0.06), transparent 60%);
}

/* ── The orb ──────────────────────────────────────────── */
.orb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#agents-orb {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: drop-shadow(0 0 34px rgba(212, 106, 88, 0.22));
}

/* ── Feature grid ─────────────────────────────────────── */
.xf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.xf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 22px;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.xf-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.xf-card h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.xf-card p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ── Chat demo ────────────────────────────────────────── */
.chat-wrap {
  max-width: 480px;
  margin: 0 auto;
}

.chat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}

.chat-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(212, 106, 88, 0.9), rgba(212, 106, 88, 0.25) 70%),
    var(--surface-hover);
  position: relative;
  flex-shrink: 0;
}

.chat-avatar::after {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1.5px solid rgba(11, 11, 12, 0.55);
}

.chat-name {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 600;
}

.chat-online {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green, #8fc98c);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-online::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.chat-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.msg {
  max-width: 78%;
  padding: 7px 11px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.45;
  text-align: left;
}

.msg p { margin: 0; }

.msg-them {
  align-self: flex-start;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg-me {
  align-self: flex-end;
  background: rgba(212, 106, 88, 0.16);
  border: 1px solid rgba(212, 106, 88, 0.3);
  color: var(--text);
  border-bottom-right-radius: 4px;
}

/* Voice note: play button + waveform + duration, like a real chat voice note */
.msg-voice {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 216px;
  max-width: 100%;
  font-family: var(--sans);
  color: var(--text);
  transition: border-color 0.15s ease;
}

.msg-voice:hover { border-color: var(--border-strong); }
.msg-voice.is-playing { border-color: rgba(212, 106, 88, 0.55); }

.vn-play {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  flex-shrink: 0;
}

.vn-play::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 9px;
  border-left: 8px solid #0b0b0c;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.msg-voice.is-playing .vn-play::before {
  border: none;
  background: #0b0b0c;
  left: 9px;
  top: 8px;
  width: 3px;
  height: 14px;
  box-shadow: 6px 0 0 #0b0b0c;
}

.vn-wave {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
}

.vn-bar {
  flex: 1;
  min-width: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.1s linear;
}

.vn-bar.on {
  background: var(--accent);
}

.vn-dur {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Image message: an implied picture, not a generated one */
.msg-img {
  align-self: flex-start;
  padding: 8px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.msg-img-tile {
  width: 176px;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.msg-img-caption {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 0 4px;
}

/* ── Quickstart ───────────────────────────────────────── */
.qs-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 24px;
  align-items: start;
}

.qs-side h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.qs-side p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

/* ── Providers table ──────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.providers {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 480px;
}

.providers th {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.providers td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}

.providers tr:last-child td { border-bottom: none; }

.providers td strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.prov-sub {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── CTA ──────────────────────────────────────────────── */
.cta-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 860px) {
  .xf-grid { grid-template-columns: 1fr 1fr; }
  .qs-grid { grid-template-columns: 1fr; }
  .cta-banner { align-items: flex-start; }
}

@media (max-width: 640px) {
  .xf-grid { grid-template-columns: 1fr; }
  .cta-actions { flex-direction: column; align-items: stretch; }
  .cta-actions .btn-primary,
  .cta-actions .btn-secondary { justify-content: center; }
}