/* ============================================================
   reception.css — "The AI Receptionist" set-piece (.cx-rc).
   Left editorial copy + de-boxed proof points; right the live
   call-transcript stage (one soft-elevated panel — the only box
   in the section) with waveform, recording pill, typed lines and
   the outbound-mode badge. Tokens from styles.css; teal accent
   inherited from .cx (comms.css) with local fallbacks.
   Animation driver: reception.js (adds .cx-rc--js to the stage).
   ============================================================ */

.cx-rc {
  --rc-teal: var(--cx-teal, #5a82c2);
  --rc-teal-deep: var(--cx-teal-deep, #3d63a4);
  --rc-teal-wash: var(--cx-teal-wash, color-mix(in srgb, #5a82c2 8%, #fff));
  position: relative;
  background: linear-gradient(180deg, var(--paper), #fff 30%, #fff);
  overflow: hidden;
}

/* ── layout ── */
.cx-rc .cx-rc-grid {
  display: grid;
  grid-template-columns: minmax(0, 10fr) minmax(0, 11fr);
  gap: clamp(34px, 5.5vw, 84px);
  align-items: center;
}

.cx-rc .cx-rc-copy .eyebrow {
  color: var(--rc-teal-deep);
}
.cx-rc .cx-rc-copy .h2 {
  margin: 14px 0 12px;
}
.cx-rc .cx-rc-copy .lead {
  max-width: 46ch;
}

/* ── proof points: de-boxed list, gradient dot markers ── */
.cx-rc .cx-rc-points {
  list-style: none;
  margin: clamp(24px, 3vw, 36px) 0 0;
  padding: 0;
  display: grid;
  gap: clamp(14px, 1.8vw, 20px);
}
.cx-rc .cx-rc-points li {
  position: relative;
  padding-left: 24px;
}
.cx-rc .cx-rc-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rc-teal), var(--indigo));
}
.cx-rc .cx-rc-points b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 2px;
}
.cx-rc .cx-rc-points span {
  display: block;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-60);
  max-width: 46ch;
}

/* ── stage column + ambient glow ── */
.cx-rc .cx-rc-stagecol {
  position: relative;
  min-width: 0;
}
.cx-rc .cx-rc-stagecol::before {
  content: "";
  position: absolute;
  inset: -8% -12%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(55% 50% at 68% 32%, color-mix(in srgb, var(--rc-teal) 13%, transparent), transparent 72%),
    radial-gradient(48% 44% at 18% 82%, var(--periwinkle), transparent 70%);
}

/* ── the call stage: the one soft-elevated panel ── */
.cx-rc .cx-rc-stage {
  position: relative;
  z-index: 1;
  margin: 0;
  background: linear-gradient(180deg, #fff, var(--paper));
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-float);
  padding: clamp(18px, 2vw, 26px);
}

/* call bar */
.cx-rc .cx-rc-callbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.cx-rc .cx-rc-avatar {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--indigo), var(--rc-teal));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.cx-rc .cx-rc-caller {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.cx-rc .cx-rc-caller b {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.cx-rc .cx-rc-caller i {
  font-style: normal;
  font-size: 12px;
  color: var(--ink-40);
}

/* waveform */
.cx-rc .cx-rc-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  margin-left: auto;
  padding-right: 2px;
}
.cx-rc .cx-rc-wave i {
  width: 2.5px;
  height: 16px;
  border-radius: 2px;
  background: var(--rc-teal);
  opacity: 0.7;
  transform: scaleY(0.22);
  transform-origin: center;
  animation: cx-rc-wave-idle 1s ease-in-out infinite;
}
.cx-rc .cx-rc-wave i:nth-child(2) { animation-delay: 0.12s; }
.cx-rc .cx-rc-wave i:nth-child(3) { animation-delay: 0.16s; }
.cx-rc .cx-rc-wave i:nth-child(4) { animation-delay: 0.24s; }
.cx-rc .cx-rc-wave i:nth-child(5) { animation-delay: 0.32s; }
.cx-rc .cx-rc-wave i:nth-child(6) { animation-delay: 0.4s; }
.cx-rc .cx-rc-wave i:nth-child(7) { animation-delay: 0.48s; }
.cx-rc .cx-rc-wave.is-speaking i {
  opacity: 0.95;
  animation-name: cx-rc-wave-talk;
  animation-duration: 0.3667s;
}
@keyframes cx-rc-wave-idle {
  0%, 100% { transform: scaleY(0.16); }
  50%      { transform: scaleY(0.4); }
}
@keyframes cx-rc-wave-talk {
  0%, 100% { transform: scaleY(0.3); }
  50%      { transform: scaleY(1); }
}

/* recording pill */
.cx-rc .cx-rc-live {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--rc-teal-deep);
  background: var(--rc-teal-wash);
  border: 1px solid color-mix(in srgb, var(--rc-teal) 24%, #fff);
  border-radius: var(--r-pill);
  padding: 5px 11px;
}
.cx-rc .cx-rc-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e5484d;
  animation: cx-rc-blink 1.0667s ease-in-out infinite;
}
@keyframes cx-rc-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ── transcript ── */
.cx-rc .cx-rc-lines {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
/* JS mode: fixed-height, bottom-anchored chat viewport — no page jump */
.cx-rc .cx-rc--js .cx-rc-lines {
  height: clamp(320px, 26vw, 384px);
  overflow: hidden;
  justify-content: flex-end;
}

.cx-rc .cx-rc-line {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 86%;
}
.cx-rc .cx-rc-line--ai      { align-self: flex-start; align-items: flex-start; }
.cx-rc .cx-rc-line--patient { align-self: flex-end;   align-items: flex-end; }
.cx-rc .cx-rc-line--chip    { align-self: center;     align-items: center; max-width: 100%; }

.cx-rc .cx-rc-who {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-40);
  padding: 0 5px;
}

.cx-rc .cx-rc-bubble {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 15px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-70);
  letter-spacing: -0.005em;
}
.cx-rc .cx-rc-line--ai .cx-rc-bubble {
  background: var(--rc-teal-wash);
  border: 1px solid color-mix(in srgb, var(--rc-teal) 18%, #fff);
  border-bottom-left-radius: 5px;
}
.cx-rc .cx-rc-line--patient .cx-rc-bubble {
  background: var(--periwinkle);
  border: 1px solid color-mix(in srgb, var(--indigo) 10%, var(--periwinkle));
  border-bottom-right-radius: 5px;
}

/* system chips (verified / booked) */
.cx-rc .cx-rc-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--rc-teal-deep);
  background: #fff;
  border: 1px dashed color-mix(in srgb, var(--rc-teal) 38%, #fff);
  border-radius: var(--r-pill);
  padding: 6px 13px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* JS reveal: lines hidden until played in */
.cx-rc .cx-rc--js .cx-rc-line {
  display: none;
}
.cx-rc .cx-rc--js .cx-rc-line.is-on {
  display: flex;
  animation: cx-rc-in 0.2533s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes cx-rc-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

/* typing caret */
.cx-rc .cx-rc-msg.is-typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.12em;
  background: var(--rc-teal);
  animation: cx-rc-caret 0.5333s steps(1) infinite;
}
@keyframes cx-rc-caret {
  50% { opacity: 0; }
}

/* ── outbound-mode badge, overlapping the stage edge ── */
.cx-rc .cx-rc-outbound {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: -17px 0 0 clamp(16px, 2.4vw, 30px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 9px 16px 9px 13px;
  box-shadow: var(--shadow-2);
  font-size: 12.5px;
  color: var(--ink-60);
}
.cx-rc .cx-rc-ob-dot {
  position: relative;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--indigo);
}
.cx-rc .cx-rc-ob-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--indigo);
  animation: cx-rc-ping 1.2667s ease-out infinite;
}
@keyframes cx-rc-ping {
  0%   { transform: scale(0.45); opacity: 0.7; }
  80%, 100% { transform: scale(1.5); opacity: 0; }
}
.cx-rc .cx-rc-ob-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--indigo);
}
.cx-rc .cx-rc-ob-text b {
  font-weight: 600;
  color: var(--ink);
}

/* ── responsive ── */
@media (max-width: 960px) {
  .cx-rc .cx-rc-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .cx-rc .cx-rc-copy .lead,
  .cx-rc .cx-rc-points span {
    max-width: none;
  }
  .cx-rc .cx-rc--js .cx-rc-lines {
    height: 348px;
  }
}
@media (max-width: 700px) {
  .cx-rc .cx-rc-wave { display: none; }
  .cx-rc .cx-rc-line { max-width: 94%; }
  .cx-rc .cx-rc-chip { white-space: normal; text-align: center; }
  .cx-rc .cx-rc-outbound { margin-left: 10px; }
  .cx-rc .cx-rc-stage { padding: 16px 14px; }
  .cx-rc .cx-rc--js .cx-rc-lines { height: 300px; }
}
@media (max-width: 460px) {
  .cx-rc .cx-rc-bubble { font-size: 13px; }
  .cx-rc .cx-rc-outbound { font-size: 11.5px; padding: 8px 12px 8px 10px; }
}

/* ── reduced motion: everything static, transcript fully visible ── */
@media (prefers-reduced-motion: reduce), (max-width: 700px) {
  .cx-rc *,
  .cx-rc *::before,
  .cx-rc *::after {
    animation: none !important;
    transition: none !important;
  }
  .cx-rc .cx-rc--js .cx-rc-line { display: flex; }
  .cx-rc .cx-rc--js .cx-rc-lines {
    height: auto;
    overflow: visible;
  }
}
