/* ==========================================================================
   afx-jessica-hero.css — "Jessica Hero Demo" ([afx_jessica_hero]) — v0.46.0.
   A self-contained, reusable command-center hero: sales copy + an animated
   live-call demo (timeline · transcript · waveform) whose input/mic wire to the
   REAL Jessica backend (afx-jessica-hero.js). Fully scoped to .afxjh with its
   own tokens so it never depends on a page-local theme and never bleeds out.
   Zero PAGE-level layout shift: the card is a fixed size; the transcript is a
   fixed-height scroll panel, so revealing messages never grows the document.
   Distinct from afx-jessica.css (the global widget) — no shared selectors.
   ========================================================================== */
.afxjh{
  --jhac:#6c5cef;   /* indigo  */
  --jhac2:#22d3ee;  /* teal    */
  --jhac3:#4f46e5;  /* deep indigo */
  --jhink:#0e1424;  /* copy ink (light theme side) */
  --jhmut:#5a6172;
  --jhline:#e6e9f2;
  --jhgood:#10b981;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
}
.afxjh *{box-sizing:border-box;}
.afxjh .afxjh-wrap{max-width:1180px;margin:0 auto;padding:0 clamp(20px,5vw,48px);}
/* Overflow safety: grid/flex children default to min-width:auto, which refuses to shrink below their
   content and pushes horizontal scroll. Let every track shrink, wrap long copy, and cap the card. */
.afxjh .afxjh-grid>*,.afxjh .afxjh-stage>*,.afxjh .afxjh-copy{min-width:0;}
.afxjh .afxjh-card{max-width:100%;}
.afxjh .afxjh-copy h1,.afxjh .afxjh-sub,.afxjh .afxjh-step h4,.afxjh .afxjh-step p{overflow-wrap:break-word;}
.afxjh .afxjh-msg,.afxjh .afxjh-outcome,.afxjh .afxjh-confirm,.afxjh .afxjh-tag{overflow-wrap:anywhere;}
.afxjh .afxjh-btn{white-space:normal;max-width:100%;text-align:center;}

/* --- section + 2-col grid ------------------------------------------------- */
.afxjh .afxjh-hero{padding:clamp(2.6rem,6vw,5rem) 0;position:relative;}
/* Contain the card's aura glow (a ::before with negative inset) so it can never push horizontal
   scroll when the card is near full width (e.g. tablet single-column). Clips only the soft bleed. */
.afxjh .afxjh-hero,.afxjh .afxjh-metrics{overflow-x:clip;}
.afxjh .afxjh-grid{display:grid;grid-template-columns:1fr;gap:clamp(2rem,4vw,3rem);align-items:center;}
@media(min-width:940px){.afxjh .afxjh-grid{grid-template-columns:1.02fr 1.1fr;gap:clamp(2rem,4vw,3.4rem);}}

/* --- sales copy (light-theme side, self-styled) -------------------------- */
.afxjh .afxjh-kick{font-size:.74rem;letter-spacing:.16em;text-transform:uppercase;font-weight:800;color:var(--jhac3);margin-bottom:.7rem;display:block;}
.afxjh .afxjh-copy h1{margin:0;color:var(--jhink);font-weight:850;letter-spacing:-.02em;line-height:1.06;font-size:clamp(1.9rem,4.6vw,3rem);}
.afxjh .afxjh-copy h1 em{font-style:inherit;background:linear-gradient(120deg,var(--jhac),var(--jhac2));-webkit-background-clip:text;background-clip:text;color:transparent;}
.afxjh .afxjh-sub{color:var(--jhmut);font-size:1.04rem;line-height:1.6;max-width:56ch;margin:.9rem 0 0;}
.afxjh .afxjh-sub-strong b{color:var(--jhink);}
.afxjh .afxjh-ctarow{margin-top:1.3rem;}
.afxjh .afxjh-btn{display:inline-flex;align-items:center;gap:.5rem;font-weight:800;border-radius:999px;padding:.95rem 1.7rem;font-size:1.02rem;text-decoration:none;cursor:pointer;border:0;color:#fff;
  background:linear-gradient(135deg,var(--jhac),var(--jhac3));box-shadow:0 16px 38px -12px rgba(108,92,239,.55);transition:transform .15s,box-shadow .15s;}
.afxjh .afxjh-btn:hover{transform:translateY(-2px);box-shadow:0 20px 46px -12px rgba(108,92,239,.6);}
.afxjh .afxjh-trust{display:flex;flex-wrap:wrap;gap:.4rem 1.1rem;margin-top:1rem;}
.afxjh .afxjh-trust span{display:inline-flex;align-items:center;gap:.35rem;font-size:.86rem;color:var(--jhmut);font-weight:600;}
.afxjh .afxjh-trust svg{width:14px;height:14px;color:var(--jhgood);}
.afxjh .afxjh-fine{font-size:.78rem;color:var(--jhmut);opacity:.75;margin-top:.7rem;}

/* --- command-center card (dark) ------------------------------------------ */
.afxjh .afxjh-card{position:relative;color:#e8eaf5;border-radius:22px;padding:clamp(1.05rem,2.2vw,1.5rem);
  background:linear-gradient(160deg,#0b0f1e,#141a2e);
  box-shadow:0 24px 70px -24px rgba(70,60,200,.55),0 0 0 1px rgba(255,255,255,.06) inset;}
/* soft aura glow behind the card so it reads as the focal point */
.afxjh .afxjh-card::before{content:"";position:absolute;inset:-14% -8%;z-index:-1;border-radius:30px;pointer-events:none;
  background:radial-gradient(60% 55% at 75% 8%,rgba(108,92,239,.28),transparent),radial-gradient(50% 50% at 15% 95%,rgba(34,211,238,.20),transparent);filter:blur(26px);}
.afxjh .afxjh-top{display:flex;justify-content:space-between;align-items:center;gap:.5rem;flex-wrap:wrap;margin-bottom:1.05rem;font-size:.85rem;}
.afxjh .afxjh-live{display:inline-flex;align-items:center;gap:.4rem;color:#7CFFB2;font-weight:700;}
.afxjh .afxjh-live .dot,.afxjh .afxjh-foot .dot{width:8px;height:8px;border-radius:50%;background:#22c55e;display:inline-block;animation:afxjhPulse 1.6s ease-in-out infinite;}
.afxjh .afxjh-badge{border:1px solid rgba(255,255,255,.15);border-radius:999px;padding:.25rem .7rem;font-size:.72rem;color:#c9cdf0;}

.afxjh .afxjh-stage{display:grid;grid-template-columns:1fr;gap:1.1rem;}
@media(min-width:560px){.afxjh .afxjh-stage{grid-template-columns:.9fr 1.1fr;}}

/* activity timeline */
.afxjh .afxjh-line{position:relative;padding-left:2.1rem;}
.afxjh .afxjh-line::before{content:"";position:absolute;left:.62rem;top:.3rem;bottom:.3rem;width:2px;background:rgba(255,255,255,.12);}
.afxjh .afxjh-step{position:relative;margin-bottom:1.05rem;opacity:.32;transform:translateX(-4px);transition:opacity .5s ease,transform .5s ease;}
.afxjh .afxjh-step.is-on{opacity:1;transform:none;}
.afxjh .afxjh-step .ic{position:absolute;left:-2.1rem;top:0;width:1.5rem;height:1.5rem;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#232a45;font-size:.8rem;transition:background .4s ease,box-shadow .4s ease;}
.afxjh .afxjh-step.is-on .ic{background:linear-gradient(135deg,var(--jhac),var(--jhac2));}
.afxjh .afxjh-step.is-live .ic{box-shadow:0 0 0 0 rgba(34,211,238,.55);animation:afxjhRing 1.4s ease-out infinite;}
.afxjh .afxjh-step h4{margin:0;font-size:.9rem;font-weight:700;color:#fff;}
.afxjh .afxjh-step p{margin:.15rem 0 0;font-size:.78rem;color:#aab2c0;}
.afxjh .afxjh-outcome{margin-top:.3rem;border:1px solid rgba(255,255,255,.12);border-radius:12px;padding:.7rem .85rem;font-size:.82rem;opacity:0;transform:translateY(6px);transition:opacity .5s ease,transform .5s ease;}
.afxjh .afxjh-outcome.is-in{opacity:1;transform:none;}
.afxjh .afxjh-outcome b{color:#fff;}

/* transcript + waveform */
.afxjh .afxjh-conv{display:flex;flex-direction:column;min-width:0;}
.afxjh .afxjh-chat{background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.08);border-radius:14px;padding:.9rem;
  display:flex;flex-direction:column;gap:.5rem;height:clamp(340px,33vw,430px);overflow-y:auto;scroll-behavior:smooth;}
.afxjh .afxjh-chat::-webkit-scrollbar{width:6px;}
.afxjh .afxjh-chat::-webkit-scrollbar-thumb{background:rgba(255,255,255,.12);border-radius:6px;}
.afxjh .afxjh-tag{font-size:.68rem;letter-spacing:.04em;text-transform:uppercase;color:#8891b3;margin-bottom:.1rem;flex:0 0 auto;}
.afxjh .afxjh-msg{max-width:88%;padding:.5rem .72rem;border-radius:12px;font-size:.84rem;line-height:1.38;flex:0 0 auto;
  opacity:0;transform:translateY(6px);transition:opacity .4s ease,transform .4s ease;}
.afxjh .afxjh-msg.is-in{opacity:1;transform:none;}
.afxjh .afxjh-msg.cust{align-self:flex-start;background:#1c2540;color:#e8eaf5;border-top-left-radius:4px;}
.afxjh .afxjh-msg.ai{align-self:flex-end;background:linear-gradient(135deg,var(--jhac),var(--jhac3));color:#fff;border-top-right-radius:4px;}
.afxjh .afxjh-confirm{margin-top:.1rem;font-size:.8rem;color:#7CFFB2;font-weight:700;opacity:0;transition:opacity .5s ease;flex:0 0 auto;}
.afxjh .afxjh-confirm.is-in{opacity:1;}
/* typing indicator (three dots) injected by JS before a message reveals */
.afxjh .afxjh-typing{align-self:flex-start;display:inline-flex;gap:4px;padding:.55rem .7rem;background:#1c2540;border-radius:12px;border-top-left-radius:4px;flex:0 0 auto;}
.afxjh .afxjh-typing.ai{align-self:flex-end;background:rgba(255,255,255,.10);}
.afxjh .afxjh-typing i{width:6px;height:6px;border-radius:50%;background:#9aa3c4;animation:afxjhDot 1.1s ease-in-out infinite;}
.afxjh .afxjh-typing i:nth-child(2){animation-delay:.15s;}
.afxjh .afxjh-typing i:nth-child(3){animation-delay:.3s;}

.afxjh .afxjh-wave{display:flex;align-items:flex-end;gap:3px;height:20px;margin-top:.6rem;opacity:.45;flex:0 0 auto;}
.afxjh .afxjh-wave span{flex:1;background:linear-gradient(180deg,var(--jhac2),var(--jhac));border-radius:2px;height:20%;}
.afxjh .afxjh-card.is-speaking .afxjh-wave{opacity:1;}
.afxjh .afxjh-card.is-speaking .afxjh-wave span{animation:afxjhWave 1s ease-in-out infinite;}
.afxjh .afxjh-card.is-speaking .afxjh-wave span:nth-child(2n){animation-delay:.15s;}
.afxjh .afxjh-card.is-speaking .afxjh-wave span:nth-child(3n){animation-delay:.3s;}

/* Ask Jessica — real backend surface */
.afxjh .afxjh-ask{margin-top:1rem;border-top:1px solid rgba(255,255,255,.1);padding-top:.9rem;}
.afxjh .afxjh-ask h4{margin:0 0 .25rem;font-size:.9rem;color:#fff;font-weight:700;}
.afxjh .afxjh-ask p{margin:0 0 .55rem;font-size:.78rem;color:#9aa3c4;}
/* One rounded field with a SINGLE trailing control (mirrors [afx_jessica]'s .jcompose-pretty). */
.afxjh .afxjh-askrow{display:flex;align-items:center;gap:.4rem;margin:0;
  background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.14);border-radius:14px;padding:.35rem .4rem .35rem .9rem;}
.afxjh .afxjh-askrow:focus-within{border-color:var(--jhac2);}
.afxjh .afxjh-askin{flex:1;min-width:0;background:transparent;border:0;padding:.5rem 0;color:#fff;font-size:.92rem;font-family:inherit;outline:none;}
.afxjh .afxjh-askin::placeholder{color:rgba(255,255,255,.55);}
/* The premium control — identical to the Jessica section's mic/send: cyan→indigo rounded square with the
   breathing glow. The mic (empty field) and the send arrow (has text) share it; only one is shown at a time. */
.afxjh .afxjh-ctrl{flex:none;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border:0;
  border-radius:13px;cursor:pointer;color:#fff;background:linear-gradient(135deg,#36c2ff,#6c5cef);
  box-shadow:0 8px 22px -6px rgba(54,194,255,.6);animation:afxjhCtrl 2.4s ease infinite;transition:filter .15s,transform .15s;}
.afxjh .afxjh-ctrl svg{width:20px;height:20px;}
.afxjh .afxjh-ctrl:hover{filter:brightness(1.08);transform:translateY(-1px);}
.afxjh .afxjh-ctrl:disabled{opacity:.55;cursor:default;}
.afxjh .afxjh-ctrl[hidden]{display:none!important;}
.afxjh .afxjh-mic.is-live{background:#e5484d;animation:afxjhMic 1.1s ease-in-out infinite;box-shadow:0 0 0 4px rgba(229,72,77,.3);}
.afxjh .afxjh-status{margin-top:.5rem;font-size:.76rem;color:#c9cdf0;}
.afxjh .afxjh-status.err{color:#ffb4b4;}
.afxjh .afxjh-foot{margin-top:.8rem;font-size:.76rem;color:#8891b3;display:flex;align-items:center;gap:.4rem;}

/* metrics strip */
.afxjh .afxjh-metrics{padding:1.8rem 0;}
.afxjh .afxjh-mgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:1rem;text-align:center;
  border-top:1px solid var(--jhline);border-bottom:1px solid var(--jhline);padding:1.6rem 0;}
.afxjh .afxjh-mnum{font-size:clamp(1.35rem,3vw,1.7rem);font-weight:850;background:linear-gradient(120deg,var(--jhac),var(--jhac2));-webkit-background-clip:text;background-clip:text;color:transparent;}
.afxjh .afxjh-mlbl{font-size:.8rem;color:var(--jhmut);margin-top:.2rem;}

/* --- keyframes ----------------------------------------------------------- */
@keyframes afxjhWave{0%,100%{height:20%}50%{height:90%}}
@keyframes afxjhPulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.7)}}
@keyframes afxjhMic{0%,100%{opacity:1}50%{opacity:.55}}
@keyframes afxjhDot{0%,100%{opacity:.3;transform:translateY(0)}50%{opacity:1;transform:translateY(-3px)}}
@keyframes afxjhRing{0%{box-shadow:0 0 0 0 rgba(34,211,238,.5)}100%{box-shadow:0 0 0 9px rgba(34,211,238,0)}}
@keyframes afxjhCtrl{0%,100%{box-shadow:0 8px 22px -6px rgba(54,194,255,.6),0 0 0 0 rgba(54,194,255,.45)}50%{box-shadow:0 10px 26px -6px rgba(54,194,255,.7),0 0 0 12px rgba(54,194,255,0)}}

/* --- responsive: single column, shared 8–10% container padding, no h-scroll */
@media(max-width:640px){
  .afxjh .afxjh-wrap{padding-left:9%;padding-right:9%;}
  .afxjh .afxjh-hero{padding:2.1rem 0;}
  .afxjh .afxjh-copy h1{font-size:clamp(1.9rem,8.5vw,2.5rem);}
  .afxjh .afxjh-card{padding:1rem;border-radius:18px;}
  /* Simplified mobile UI (per brief): drop the activity-timeline column — the live transcript already
     tells the story — so the card is far shorter and nothing is cramped. Steps still animate off-screen. */
  .afxjh .afxjh-line{display:none;}
  .afxjh .afxjh-stage{grid-template-columns:1fr;gap:0;}
  /* Give the transcript room to hold the FULL exchange (tag + 4 messages + confirmation) so the first
     message is never clipped — the timeline column is hidden on mobile, so this panel tells the whole story. */
  .afxjh .afxjh-chat{height:clamp(360px,70vh,470px);padding-bottom:1.1rem;}
  .afxjh .afxjh-msg{max-width:90%;}
  .afxjh .afxjh-mgrid{grid-template-columns:repeat(2,1fr);gap:1.1rem;}
}

/* --- reduced motion: static final state, no cycling, no pulse ------------ */
@media(prefers-reduced-motion:reduce){
  .afxjh .afxjh-step,.afxjh .afxjh-msg,.afxjh .afxjh-outcome,.afxjh .afxjh-confirm,.afxjh .afxjh-btn{transition:none;}
  .afxjh .afxjh-live .dot,.afxjh .afxjh-foot .dot,.afxjh .afxjh-wave span,.afxjh .afxjh-ctrl,.afxjh .afxjh-mic.is-live,.afxjh .afxjh-typing i,.afxjh .afxjh-step.is-live .ic{animation:none!important;}
}
