/* ============================================================
 * Voice Agent Capabilities, 12-card grid below the Aria hero.
 * Same visual pattern as the inbox.html "Every guest intent has
 * a path" section: 3-up grid, illustration + num/category +
 * title + 1-line promise + 2 bullets + italic trigger quote.
 *
 * Card structure: { num, cat, label, desc, bullets[2], trigger, visual }
 * Visual key drives the inline SVG (viewBox 200×80, fuchsia on cream).
 * ============================================================ */

const VC_FUCHSIA      = "#ED4D86";
const VC_FUCHSIA_DEEP = "#B8336A";
const VC_FUCHSIA_RGB  = "237, 77, 134";
const VC_INK   = "#1a1a1a";
const VC_DIM   = "#6e6363";
const VC_FAINT = "#a99fa3";
const VC_RULE  = "#e3ddcf";
const VC_CREAM = "#f6f4ef";
const VC_BG2   = "#f0ebe2";

const VC_CAPABILITIES = [
  {
    num: "01", cat: "VOICE LIBRARY",
    label: "700+ Voices",
    desc: "Pick the right voice for each brand from a curated library across 27 languages.",
    bullets: [
      "Warm, crisp, energetic, formal, male or female, regional accents.",
      "Per-hotel mapping: boutique-soft for one brand, corporate-crisp for another.",
    ],
    trigger: '"Sophia for the spa resort, James for the corporate trunk."',
    visual: "voices",
  },
  {
    num: "02", cat: "VOICE LIBRARY",
    label: "Custom Greetings",
    desc: "Brand-perfect opening line the moment the line picks up.",
    bullets: [
      "Per-hotel scripts plus time-of-day variants, morning, afternoon, evening.",
      "AI rewrites your greeting to match each caller's language and context.",
    ],
    trigger: '"Good evening, Olea Cliffside reservations, how can I help you tonight?"',
    visual: "greetings",
  },
  {
    num: "03", cat: "VOICE LIBRARY",
    label: "Behaviour & Emotions",
    desc: "Fine-tune speaking rhythm, warmth, energy and laughter per agent.",
    bullets: [
      "Emotion controls (positivity, curiosity, surprise) blended live per turn.",
      "Custom system prompt per tenant: persona, tone, escalation rules, hard limits.",
    ],
    trigger: '"Speed 0.95, positivity high, laughter on. Sounds like home."',
    visual: "emotions",
  },
  {
    num: "04", cat: "INTELLIGENCE",
    label: "Language Detection",
    desc: "Auto-detects the caller's language and switches voice on the fly.",
    bullets: [
      "Inferred from phone country code, then confirmed in the first sentence.",
      "Mid-call switching: caller drifts into Spanish, the voice follows in 0.3s.",
    ],
    trigger: '"+34 caller, switched to ES voice before the first reply."',
    visual: "language",
  },
  {
    num: "05", cat: "INTELLIGENCE",
    label: "Returning Caller Memory",
    desc: "Recognises every returning caller and continues from where the last call ended.",
    bullets: [
      "Voice + phone match against your contact graph, memories surface in 0.5s.",
      "Past requests, preferences, allergies and bookings loaded before hello.",
    ],
    trigger: '"Welcome back, Sara. Last time we discussed your Krabi stay in November."',
    visual: "memory",
  },
  {
    num: "06", cat: "INTELLIGENCE",
    label: "Travel Agent Skills",
    desc: "Pre-trained for hospitality, geography, OTA/TTOO context, consultative selling.",
    bullets: [
      "Knows Booking.com vs Expedia behaviour, decomposes vague queries (\"Spanish islands\").",
      "Recommends, qualifies, upsells, books, with Best Price Guarantee logic baked in.",
    ],
    trigger: '"Adult-only, wellness, beach, here are three matches across Tenerife and Lanzarote."',
    visual: "skills",
  },
  {
    num: "07", cat: "RESOLUTION",
    label: "Knowledge Base Resolution",
    desc: "Resolves any question from your full Knowledge Base, never escalates a fact.",
    bullets: [
      "F&B, spa, policies, transport, parking, breakfast hours, cancellation rates.",
      "Multi-hotel scoping with citations, never invents, never improvises.",
    ],
    trigger: '"Yes, Verde serves a vegan tasting menu, eight courses, refreshed seasonally."',
    visual: "kb",
  },
  {
    num: "08", cat: "RESOLUTION",
    label: "Parallel Availability",
    desc: "Queries multiple hotels in parallel with live rates and the right room types.",
    bullets: [
      "Booking engine adapters: Roiback, Hotetec, Mirai, Witbooking, Neobookings, iTrip.",
      "Room types, board plans, loyalty rates and deep links, all in seconds.",
    ],
    trigger: '"Sea View at €640. Cliff Suite at €820. Aphrodite Suite at €1,180."',
    visual: "availability",
  },
  {
    num: "09", cat: "RESOLUTION",
    label: "Low Latency, Smart Recovery",
    desc: "Sub-second turn time, graceful interruption handling, no caller ever stalls.",
    bullets: [
      "Average TTFB 190ms, below the threshold where callers feel held up.",
      "Barge-in detection: agent pauses mid-sentence, listens, picks up the right beat.",
    ],
    trigger: '"Caller cut in. Agent paused, listened, resumed exactly where she left off."',
    visual: "latency",
  },
  {
    num: "10", cat: "HANDOFF",
    label: "Theme-Based Routing",
    desc: "The right call to the right team, group bookings, modifications, complaints.",
    bullets: [
      "14 themes: cancellation, modification, MICE, weddings, complaints, accessibility.",
      "Branded escalation email with translated summary and conversation transcript.",
    ],
    trigger: '"MICE for 80, routed to Events with date, headcount, AV needs."',
    visual: "routing",
  },
  {
    num: "11", cat: "HANDOFF",
    label: "Transfer & Recovery",
    desc: "Live transfer to a human, with a safety net if the line doesn't pick up.",
    bullets: [
      "SIP REFER to your phone tree: front desk, reservations, manager on duty.",
      "29s no-answer → agent recaptures the caller and offers email or SMS follow-up.",
    ],
    trigger: '"Transferred to reservations. No answer. Caller stayed with the agent."',
    visual: "transfer",
  },
  {
    num: "12", cat: "HANDOFF",
    label: "Helpdesk Integrations",
    desc: "Tickets land in your existing helpdesk, no copy-paste, no swivel-chair.",
    bullets: [
      "Salesforce, Zendesk, Freshdesk, ServiceNow, HubSpot, connected in minutes.",
      "Summary, audio link, language, sentiment and theme on every ticket.",
    ],
    trigger: '"Ticket #4827 → Freshdesk · Reservations queue · Medium priority."',
    visual: "helpdesk",
  },
];

function VcVisual({ kind }) {
  const acc  = VC_FUCHSIA;
  const accD = VC_FUCHSIA_DEEP;
  const h    = VC_RULE;
  const bg2  = VC_BG2;
  const ink3 = VC_DIM;
  const ink4 = VC_FAINT;
  const mono = "'JetBrains Mono', ui-monospace, monospace";
  const cream = VC_CREAM;

  if (kind === "voices") return (
    <svg viewBox="0 0 200 80" className="vc-vis" preserveAspectRatio="xMidYMid meet">
      {/* Microphone */}
      <rect x="92" y="14" width="16" height="32" rx="8" fill={`rgba(${VC_FUCHSIA_RGB}, 0.15)`} stroke={acc} strokeWidth="0.9"/>
      <path d="M 84 38 a 16 16 0 0 0 32 0" fill="none" stroke={acc} strokeWidth="0.9"/>
      <line x1="100" y1="54" x2="100" y2="62" stroke={acc} strokeWidth="0.9"/>
      <line x1="92" y1="62" x2="108" y2="62" stroke={acc} strokeWidth="0.9"/>
      {/* Five voice waveform rows */}
      {[18, 28, 40, 52, 62].map((y, i) => (
        <g key={i} opacity={0.6 + i * 0.08}>
          {Array.from({ length: 9 }).map((_, k) => {
            const phase = (i * 0.7 + k * 0.5);
            const hgt = 3 + Math.abs(Math.sin(phase)) * 5;
            return <rect key={k} x={20 + k * 4} y={y - hgt/2} width="2" height={hgt} rx="0.8" fill={acc}/>;
          })}
          {Array.from({ length: 9 }).map((_, k) => {
            const phase = (i * 0.7 + k * 0.5 + 0.3);
            const hgt = 3 + Math.abs(Math.sin(phase)) * 5;
            return <rect key={k} x={132 + k * 4} y={y - hgt/2} width="2" height={hgt} rx="0.8" fill={accD} opacity="0.7"/>;
          })}
        </g>
      ))}
    </svg>
  );

  if (kind === "greetings") return (
    <svg viewBox="0 0 200 80" className="vc-vis" preserveAspectRatio="xMidYMid meet">
      {/* Sun rising over horizon */}
      <line x1="20" y1="60" x2="180" y2="60" stroke={h} strokeWidth="0.7"/>
      <circle cx="60" cy="60" r="14" fill={`rgba(${VC_FUCHSIA_RGB}, 0.18)`} stroke={acc} strokeWidth="0.9"/>
      {/* Speech bubble with greeting */}
      <rect x="86" y="14" width="92" height="34" rx="8" fill={cream} stroke={acc} strokeWidth="0.9"/>
      <path d="M 96 48 L 92 56 L 104 48 Z" fill={cream} stroke={acc} strokeWidth="0.9"/>
      <text x="132" y="28" fontSize="6.5" textAnchor="middle" fill={acc} fontFamily={mono} fontWeight="600" letterSpacing="0.1em">GOOD EVENING</text>
      {[0,1,2].map(i => (
        <line key={i} x1={94 + i*30} y1="36" x2={114 + i*30} y2="36" stroke={ink4} strokeWidth="0.8" strokeLinecap="round"/>
      ))}
      <line x1="94" y1="40" x2="170" y2="40" stroke={ink4} strokeWidth="0.6" strokeLinecap="round" opacity="0.5"/>
    </svg>
  );

  if (kind === "emotions") return (
    <svg viewBox="0 0 200 80" className="vc-vis" preserveAspectRatio="xMidYMid meet">
      {/* Three sliders */}
      {[
        { y: 18, label: "WARMTH",   pos: 0.78 },
        { y: 40, label: "ENERGY",   pos: 0.55 },
        { y: 62, label: "LAUGHTER", pos: 0.40 },
      ].map((s, i) => (
        <g key={i}>
          <text x="22" y={s.y + 2} fontSize="6" fill={ink4} fontFamily={mono} fontWeight="600" letterSpacing="0.08em">{s.label}</text>
          <line x1="68" y1={s.y} x2="178" y2={s.y} stroke={h} strokeWidth="2.4" strokeLinecap="round"/>
          <line x1="68" y1={s.y} x2={68 + 110 * s.pos} y2={s.y} stroke={acc} strokeWidth="2.4" strokeLinecap="round"/>
          <circle cx={68 + 110 * s.pos} cy={s.y} r="4.5" fill="#fff" stroke={acc} strokeWidth="1.4"/>
        </g>
      ))}
    </svg>
  );

  if (kind === "language") return (
    <svg viewBox="0 0 200 80" className="vc-vis" preserveAspectRatio="xMidYMid meet">
      {/* Phone */}
      <rect x="22" y="20" width="40" height="40" rx="8" fill={bg2} stroke={h} strokeWidth="0.7"/>
      <path d="M 32 30 a 4 4 0 0 1 4 -4 h 2 l 4 8 -4 4 a 14 14 0 0 0 8 8 l 4 -4 8 4 v 2 a 4 4 0 0 1 -4 4 h -2 a 22 22 0 0 1 -20 -22 z" fill={acc}/>
      {/* Country code */}
      <rect x="64" y="34" width="24" height="12" rx="3" fill={`rgba(${VC_FUCHSIA_RGB}, 0.12)`} stroke={acc} strokeWidth="0.7"/>
      <text x="76" y="42.5" fontSize="7" textAnchor="middle" fill={acc} fontFamily={mono} fontWeight="600">+34</text>
      {/* Arrow */}
      <line x1="92" y1="40" x2="108" y2="40" stroke={acc} strokeWidth="1" strokeDasharray="2 2"/>
      <polygon points="108,40 104,38 104,42" fill={acc}/>
      {/* Language chip */}
      <rect x="112" y="34" width="64" height="12" rx="3" fill={`rgba(${VC_FUCHSIA_RGB}, 0.08)`} stroke={accD} strokeWidth="0.8"/>
      <text x="144" y="42.5" fontSize="7" textAnchor="middle" fill={accD} fontFamily={mono} fontWeight="600" letterSpacing="0.06em">ESPAÑOL</text>
      <circle cx="119" cy="40" r="2" fill={accD}/>
    </svg>
  );

  if (kind === "memory") return (
    <svg viewBox="0 0 200 80" className="vc-vis" preserveAspectRatio="xMidYMid meet">
      {/* Past call cards stacked */}
      <rect x="14" y="22" width="68" height="36" rx="5" fill={cream} stroke={h} strokeWidth="0.7"/>
      <rect x="20" y="28" width="60" height="24" rx="3" fill={bg2} stroke={h} strokeWidth="0.5"/>
      <text x="50" y="36" fontSize="5.5" textAnchor="middle" fill={ink4} fontFamily={mono} fontWeight="600" letterSpacing="0.1em">CALL · 14 MAR</text>
      <line x1="24" y1="42" x2="76" y2="42" stroke={ink4} strokeWidth="0.6"/>
      <line x1="24" y1="46" x2="64" y2="46" stroke={ink4} strokeWidth="0.6" opacity="0.6"/>
      {/* Brain / memory icon */}
      <circle cx="100" cy="40" r="14" fill={`rgba(${VC_FUCHSIA_RGB}, 0.12)`} stroke={acc} strokeWidth="0.9"/>
      <path d="M 100 30 a 6 6 0 0 0 -6 6 v 2 a 6 6 0 0 0 6 6 a 6 6 0 0 0 6 -6 v -2 a 6 6 0 0 0 -6 -6 z" fill="none" stroke={acc} strokeWidth="0.9"/>
      <line x1="100" y1="48" x2="100" y2="50" stroke={acc} strokeWidth="0.9"/>
      {/* Connection line */}
      <line x1="114" y1="40" x2="124" y2="40" stroke={acc} strokeWidth="0.8" strokeDasharray="2 2"/>
      <polygon points="124,40 120,38 120,42" fill={acc}/>
      {/* Active call card */}
      <rect x="126" y="22" width="60" height="36" rx="5" fill="#fff" stroke={acc} strokeWidth="1"/>
      <circle cx="156" cy="32" r="3" fill={acc}/>
      <text x="156" y="44" fontSize="6" textAnchor="middle" fill={acc} fontFamily={mono} fontWeight="600">SARA · LIVE</text>
      <line x1="132" y1="50" x2="180" y2="50" stroke={acc} strokeWidth="0.6" opacity="0.4"/>
    </svg>
  );

  if (kind === "skills") return (
    <svg viewBox="0 0 200 80" className="vc-vis" preserveAspectRatio="xMidYMid meet">
      {/* Globe */}
      <circle cx="42" cy="40" r="22" fill={`rgba(${VC_FUCHSIA_RGB}, 0.08)`} stroke={acc} strokeWidth="0.9"/>
      <ellipse cx="42" cy="40" rx="22" ry="9" fill="none" stroke={acc} strokeWidth="0.6" opacity="0.6"/>
      <ellipse cx="42" cy="40" rx="9" ry="22" fill="none" stroke={acc} strokeWidth="0.6" opacity="0.6"/>
      <line x1="20" y1="40" x2="64" y2="40" stroke={acc} strokeWidth="0.5" opacity="0.5"/>
      <line x1="42" y1="18" x2="42" y2="62" stroke={acc} strokeWidth="0.5" opacity="0.5"/>
      <circle cx="42" cy="40" r="2" fill={acc}/>
      {/* Hotel icons */}
      {[
        { x: 88,  y: 22, label: "★★★★★" },
        { x: 88,  y: 42, label: "OTA"    },
        { x: 88,  y: 60, label: "TTOO"   },
      ].map((b, i) => (
        <g key={i}>
          <rect x={b.x} y={b.y - 8} width="44" height="14" rx="3" fill={cream} stroke={h} strokeWidth="0.6"/>
          <text x={b.x + 22} y={b.y + 1} fontSize="6.5" textAnchor="middle" fill={ink3} fontFamily={mono} fontWeight="600" letterSpacing="0.08em">{b.label}</text>
        </g>
      ))}
      {/* Arrow to recommendation */}
      <path d="M 138 40 Q 154 30 168 32" stroke={acc} strokeWidth="0.8" fill="none" strokeDasharray="2 2"/>
      <polygon points="168,32 164,30 164.5,34.5" fill={acc}/>
      <rect x="166" y="22" width="20" height="20" rx="3" fill={`rgba(${VC_FUCHSIA_RGB}, 0.15)`} stroke={acc} strokeWidth="0.8"/>
      <polygon points="176,26 178,32 184,32 179,36 181,42 176,38 171,42 173,36 168,32 174,32" fill={acc}/>
    </svg>
  );

  if (kind === "kb") return (
    <svg viewBox="0 0 200 80" className="vc-vis" preserveAspectRatio="xMidYMid meet">
      {/* Stacked KB documents */}
      {[0, 1, 2].map(i => (
        <g key={i}>
          <rect x={26 + i * 4} y={14 + i * 4} width="52" height="58" rx="4" fill={i === 2 ? "#fff" : cream}
                stroke={i === 2 ? acc : h} strokeWidth={i === 2 ? "0.9" : "0.6"}/>
        </g>
      ))}
      {/* Top doc lines */}
      <line x1="40" y1="32" x2="78" y2="32" stroke={ink4} strokeWidth="0.7"/>
      <line x1="40" y1="38" x2="84" y2="38" stroke={ink4} strokeWidth="0.5" opacity="0.6"/>
      <line x1="40" y1="44" x2="74" y2="44" stroke={ink4} strokeWidth="0.5" opacity="0.6"/>
      <line x1="40" y1="50" x2="80" y2="50" stroke={ink4} strokeWidth="0.5" opacity="0.6"/>
      <line x1="40" y1="56" x2="68" y2="56" stroke={ink4} strokeWidth="0.5" opacity="0.6"/>
      <text x="60" y="26" fontSize="5.5" textAnchor="middle" fill={acc} fontFamily={mono} fontWeight="600" letterSpacing="0.1em">F&amp;B / SPA / POLICIES</text>
      {/* Search → result */}
      <circle cx="106" cy="32" r="6" fill="none" stroke={acc} strokeWidth="1"/>
      <line x1="110" y1="36" x2="115" y2="41" stroke={acc} strokeWidth="1.4" strokeLinecap="round"/>
      <line x1="100" y1="48" x2="115" y2="48" stroke={acc} strokeWidth="0.6" strokeDasharray="2 2"/>
      {/* Resolved card */}
      <rect x="118" y="20" width="64" height="40" rx="5" fill={`rgba(${VC_FUCHSIA_RGB}, 0.08)`} stroke={acc} strokeWidth="0.8"/>
      <polyline points="124,38 130,44 144,30" fill="none" stroke={acc} strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round"/>
      <text x="160" y="36" fontSize="6" textAnchor="middle" fill={acc} fontFamily={mono} fontWeight="600">RESOLVED</text>
      <line x1="124" y1="50" x2="178" y2="50" stroke={acc} strokeWidth="0.5" opacity="0.4"/>
    </svg>
  );

  if (kind === "availability") return (
    <svg viewBox="0 0 200 80" className="vc-vis" preserveAspectRatio="xMidYMid meet">
      {/* 3 hotel cards in parallel */}
      {[
        { x: 10,  selected: false, price: "640" },
        { x: 72,  selected: true,  price: "820" },
        { x: 134, selected: false, price: "1180" },
      ].map((card, i) => (
        <g key={i}>
          <rect x={card.x} y="12" width="56" height="56" rx="5"
                fill={card.selected ? `rgba(${VC_FUCHSIA_RGB}, 0.10)` : cream}
                stroke={card.selected ? acc : h}
                strokeWidth={card.selected ? "1" : "0.6"}/>
          <rect x={card.x + 6} y="18" width="44" height="14" rx="2" fill={bg2} stroke={h} strokeWidth="0.4"/>
          <line x1={card.x + 8}  y1="38" x2={card.x + 48} y2="38" stroke={ink4} strokeWidth="0.6"/>
          <line x1={card.x + 8}  y1="44" x2={card.x + 38} y2="44" stroke={ink4} strokeWidth="0.5" opacity="0.5"/>
          <text x={card.x + 28} y="60" fontSize="8" textAnchor="middle"
                fill={card.selected ? acc : ink3}
                fontFamily={mono} fontWeight="600">€{card.price}</text>
          {card.selected && (
            <rect x={card.x + 28} y="6" width="24" height="8" rx="4" fill={acc}/>
          )}
          {card.selected && (
            <text x={card.x + 40} y="12.5" fontSize="5" textAnchor="middle" fill="#fff" fontFamily={mono} fontWeight="600" letterSpacing="0.1em">PICKED</text>
          )}
        </g>
      ))}
    </svg>
  );

  if (kind === "latency") return (
    <svg viewBox="0 0 200 80" className="vc-vis" preserveAspectRatio="xMidYMid meet">
      {/* Speedometer arc */}
      <path d="M 40 60 A 50 50 0 0 1 160 60" fill="none" stroke={h} strokeWidth="2.4" strokeLinecap="round"/>
      <path d="M 40 60 A 50 50 0 0 1 88 22" fill="none" stroke={acc} strokeWidth="2.4" strokeLinecap="round"/>
      {/* Tick marks */}
      {[0, 0.25, 0.5, 0.75, 1].map((t, i) => {
        const ang = Math.PI * (1 - t);
        const x1 = 100 + Math.cos(ang) * 50;
        const y1 = 60 - Math.sin(ang) * 50;
        const x2 = 100 + Math.cos(ang) * 56;
        const y2 = 60 - Math.sin(ang) * 56;
        return <line key={i} x1={x1} y1={y1} x2={x2} y2={y2} stroke={ink4} strokeWidth="0.7"/>;
      })}
      {/* Needle */}
      <line x1="100" y1="60" x2="76" y2="32" stroke={acc} strokeWidth="2" strokeLinecap="round"/>
      <circle cx="100" cy="60" r="4" fill={acc}/>
      {/* Reading */}
      <text x="100" y="76" fontSize="9" textAnchor="middle" fill={acc} fontFamily={mono} fontWeight="600">190ms</text>
      <text x="100" y="14" fontSize="6" textAnchor="middle" fill={ink4} fontFamily={mono} fontWeight="600" letterSpacing="0.16em">TURN LATENCY</text>
    </svg>
  );

  if (kind === "routing") return (
    <svg viewBox="0 0 200 80" className="vc-vis" preserveAspectRatio="xMidYMid meet">
      {/* Center node */}
      <circle cx="50" cy="40" r="10" fill={`rgba(${VC_FUCHSIA_RGB}, 0.15)`} stroke={acc} strokeWidth="0.9"/>
      <text x="50" y="42.5" fontSize="6" textAnchor="middle" fill={acc} fontFamily={mono} fontWeight="700">AI</text>
      {/* Branches */}
      {[
        { y: 16, label: "RESERVATIONS" },
        { y: 32, label: "EVENTS" },
        { y: 48, label: "FRONT DESK" },
        { y: 64, label: "FINANCE" },
      ].map((b, i) => (
        <g key={i}>
          <path d={`M 60 40 Q 90 ${40 + (b.y - 40) * 0.5} 110 ${b.y}`} stroke={acc} strokeWidth="0.6" fill="none" strokeDasharray="2 2" opacity="0.7"/>
          <rect x="110" y={b.y - 5} width="74" height="10" rx="2" fill={cream} stroke={h} strokeWidth="0.5"/>
          <circle cx="115" cy={b.y} r="1.6" fill={acc}/>
          <text x="120" y={b.y + 2} fontSize="6" fill={ink3} fontFamily={mono} fontWeight="600" letterSpacing="0.1em">{b.label}</text>
        </g>
      ))}
    </svg>
  );

  if (kind === "transfer") return (
    <svg viewBox="0 0 200 80" className="vc-vis" preserveAspectRatio="xMidYMid meet">
      {/* AI agent icon */}
      <rect x="20" y="28" width="32" height="24" rx="4" fill={`rgba(${VC_FUCHSIA_RGB}, 0.12)`} stroke={acc} strokeWidth="0.8"/>
      <text x="36" y="43" fontSize="7" textAnchor="middle" fill={acc} fontFamily={mono} fontWeight="700">AGENT</text>
      {/* Arrow + recovery loop */}
      <path d="M 56 40 L 90 40" stroke={acc} strokeWidth="1" strokeDasharray="2 2"/>
      <polygon points="90,40 86,38 86,42" fill={acc}/>
      <path d="M 90 32 Q 70 16 56 28" stroke={accD} strokeWidth="0.7" fill="none" strokeDasharray="2 2" opacity="0.7"/>
      <polygon points="56,28 60,26 60,30" fill={accD} opacity="0.7"/>
      <text x="73" y="22" fontSize="5.5" textAnchor="middle" fill={accD} fontFamily={mono} fontWeight="600" letterSpacing="0.1em" opacity="0.8">SAFETY NET</text>
      {/* Front desk */}
      <rect x="94" y="22" width="44" height="36" rx="4" fill={cream} stroke={h} strokeWidth="0.7"/>
      <line x1="100" y1="34" x2="132" y2="34" stroke={ink4} strokeWidth="0.6"/>
      <text x="116" y="44" fontSize="6.5" textAnchor="middle" fill={ink3} fontFamily={mono} fontWeight="600" letterSpacing="0.1em">FRONT</text>
      <text x="116" y="52" fontSize="6.5" textAnchor="middle" fill={ink3} fontFamily={mono} fontWeight="600" letterSpacing="0.1em">DESK</text>
      {/* Phone with X */}
      <circle cx="158" cy="40" r="14" fill={cream} stroke={h} strokeWidth="0.7"/>
      <path d="M 152 36 a 4 4 0 0 1 4 -4 h 1 l 2 5 -3 3 a 10 10 0 0 0 6 6 l 3 -3 5 2 v 1 a 4 4 0 0 1 -4 4 h -1 a 14 14 0 0 1 -13 -14 z" fill={ink4} opacity="0.6"/>
      <line x1="170" y1="32" x2="178" y2="40" stroke={accD} strokeWidth="1.3" strokeLinecap="round"/>
      <line x1="178" y1="32" x2="170" y2="40" stroke={accD} strokeWidth="1.3" strokeLinecap="round"/>
      <text x="158" y="68" fontSize="5.5" textAnchor="middle" fill={accD} fontFamily={mono} fontWeight="600" letterSpacing="0.1em">29s · BUSY</text>
    </svg>
  );

  if (kind === "helpdesk") return (
    <svg viewBox="0 0 200 80" className="vc-vis" preserveAspectRatio="xMidYMid meet">
      {/* Conversation bubble at top */}
      <rect x="58" y="10" width="84" height="18" rx="9" fill={`rgba(${VC_FUCHSIA_RGB}, 0.10)`} stroke={acc} strokeWidth="0.8"/>
      <text x="100" y="22" fontSize="6.5" textAnchor="middle" fill={acc} fontFamily={mono} fontWeight="700" letterSpacing="0.1em">TICKET #4827</text>
      {/* Lines down */}
      <line x1="100" y1="28" x2="100" y2="40" stroke={acc} strokeWidth="0.6" strokeDasharray="2 2"/>
      {/* Three helpdesk logos */}
      {[
        { x: 22, label: "SF",  full: "SALESFORCE" },
        { x: 80, label: "ZD",  full: "ZENDESK"    },
        { x: 138, label: "FD", full: "FRESHDESK"  },
      ].map((dest, i) => (
        <g key={i}>
          <line x1="100" y1="40" x2={dest.x + 20} y2="48" stroke={acc} strokeWidth="0.5" strokeDasharray="2 2" opacity="0.5"/>
          <rect x={dest.x} y="46" width="40" height="26" rx="4" fill="#fff" stroke={h} strokeWidth="0.8"/>
          <circle cx={dest.x + 10} cy="59" r="5" fill={`rgba(${VC_FUCHSIA_RGB}, 0.18)`} stroke={acc} strokeWidth="0.7"/>
          <text x={dest.x + 10} y="61.5" fontSize="6" textAnchor="middle" fill={acc} fontFamily={mono} fontWeight="700">{dest.label}</text>
          <text x={dest.x + 28} y="62" fontSize="5.5" textAnchor="middle" fill={ink3} fontFamily={mono} fontWeight="600" letterSpacing="0.06em">{dest.full}</text>
        </g>
      ))}
    </svg>
  );

  return null;
}

function VoiceCapabilities() {
  return (
    <section className="vc-section">
      <div className="vc-container">
        {/* Header */}
        <div className="vc-head">
          <div className="vc-eyebrow">12 BUILT-IN CAPABILITIES</div>
          <h2 className="vc-h2">
            Trained for hospitality.{" "}
            <span className="vc-h2-em">Wired for every call.</span>
          </h2>
          <p className="vc-lead">
            Out of the box: 700+ voices in 27 languages, smart caller recognition,
            full Knowledge Base resolution, theme-based escalation, and helpdesk
            tickets in Salesforce, Zendesk and Freshdesk. The agent ships ready
            and adapts to your brand the day you turn it on.
          </p>
        </div>

        {/* Cards grid */}
        <div className="vc-grid">
          {VC_CAPABILITIES.map((c) => (
            <div key={c.num} className="vc-card">
              <div className="vc-vis-wrap">
                <VcVisual kind={c.visual} />
              </div>
              <div className="vc-num">{c.num} / {c.cat}</div>
              <h3 className="vc-title">{c.label}</h3>
              <p className="vc-desc">{c.desc}</p>
              <ul className="vc-bullets">
                {c.bullets.map((b, j) => <li key={j}>{b}</li>)}
              </ul>
              <div className="vc-trigger">{c.trigger}</div>
            </div>
          ))}
        </div>
      </div>

      <style>{`
        .vc-section {
          background: ${VC_CREAM};
          padding: 96px 32px;
          color: ${VC_INK};
          font-family: 'Inter', system-ui, sans-serif;
        }
        .vc-container { max-width: 1216px; margin: 0 auto; }

        .vc-head { max-width: 720px; margin-bottom: 56px; }
        .vc-eyebrow {
          font-family: 'JetBrains Mono', ui-monospace, monospace;
          font-size: 11px; color: ${VC_FUCHSIA};
          letter-spacing: 0.18em; text-transform: uppercase;
          font-weight: 500; margin-bottom: 18px;
        }
        .vc-h2 {
          font-family: 'Instrument Serif', 'Source Serif 4', Georgia, serif;
          font-weight: 400; font-size: clamp(32px, 4.4vw, 48px);
          letter-spacing: -0.02em; line-height: 1.05;
          margin: 0 0 18px; max-width: 680px; color: ${VC_INK};
        }
        .vc-h2-em { font-style: italic; color: ${VC_FUCHSIA}; }
        .vc-lead {
          font-size: 15px; color: ${VC_DIM};
          line-height: 1.65; max-width: 640px; margin: 0;
        }

        .vc-grid {
          display: grid; grid-template-columns: repeat(3, 1fr);
          gap: 16px;
        }

        .vc-card {
          display: flex; flex-direction: column;
          padding: 24px;
          background: rgba(255, 255, 255, 0.72);
          border: 1px solid ${VC_RULE};
          border-radius: 16px;
          transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
          height: 100%;
        }
        .vc-card:hover {
          border-color: ${VC_FUCHSIA};
          background: rgba(${VC_FUCHSIA_RGB}, 0.04);
          transform: translateY(-2px);
        }
        .vc-vis-wrap {
          height: 110px; margin-bottom: 22px;
          background: ${VC_CREAM};
          border: 1px solid ${VC_RULE};
          border-radius: 10px;
          padding: 6px; flex-shrink: 0;
        }
        .vc-vis { width: 100%; height: 100%; display: block; }
        .vc-num {
          font-family: 'JetBrains Mono', ui-monospace, monospace;
          font-size: 10px; color: ${VC_FAINT};
          letter-spacing: 0.12em; text-transform: uppercase;
          margin-bottom: 8px;
        }
        .vc-title {
          font-family: 'Instrument Serif', 'Source Serif 4', Georgia, serif;
          font-size: 26px; letter-spacing: -0.01em;
          margin: 0 0 8px; line-height: 1.1;
          color: ${VC_INK}; font-weight: 400;
        }
        .vc-desc {
          font-size: 14px; color: ${VC_INK};
          font-weight: 500; line-height: 1.4;
          margin: 0 0 14px; min-height: 40px;
        }
        .vc-bullets {
          list-style: none; margin: 0 0 16px; padding: 0;
        }
        .vc-bullets li {
          font-size: 12.5px; color: ${VC_DIM};
          line-height: 1.5; padding-left: 14px;
          position: relative;
        }
        .vc-bullets li + li { margin-top: 6px; }
        .vc-bullets li::before {
          content: ""; position: absolute; left: 0; top: 9px;
          width: 4px; height: 1px; background: ${VC_FUCHSIA};
        }
        .vc-trigger {
          font-size: 11.5px; color: ${VC_DIM};
          font-style: italic; line-height: 1.4;
          padding-top: 12px;
          border-top: 1px dashed ${VC_RULE};
          margin-top: auto;
        }

        @media (max-width: 1000px) { .vc-grid { grid-template-columns: repeat(2, 1fr); } }
        @media (max-width: 640px)  { .vc-grid { grid-template-columns: 1fr; } }
      `}</style>
    </section>
  );
}

window.VoiceCapabilities = VoiceCapabilities;
