/* ============================================================
   copilot.css — "The In-Call Copilot" set piece (.cx-cp).
   Screen-pop mock: incoming-call chip → chart card pops →
   four insight cards stream down a hairline feed (each with a
   teal "why" line) → transcript-filed strip. CSS-only, looping
   gently on a 16s cycle; every selector namespaced .cx-cp.
   Tokens inherited from styles.css; comms accent = teal.
   ============================================================ */

.cx-cp {
  --cp-teal: #5a82c2;
  --cp-teal-deep: #3d63a4;
  --cp-teal-lite: #8aa6dd;
  --cp-teal-wash: color-mix(in srgb, #5a82c2 8%, #fff);
  --cp-cycle: 8s;
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(110% 80% at 100% 0%, color-mix(in srgb, var(--periwinkle) 55%, transparent), transparent 58%),
    linear-gradient(180deg, var(--paper), #fff 30%);
  overflow: hidden;
}

/* ── layout ─────────────────────────────────────────────── */
.cx-cp .cx-cp-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(40px, 5.5vw, 84px);
  align-items: center;
}

.cx-cp .cx-head .eyebrow {
  color: var(--cp-teal-deep);
}

/* ── points: editorial numbered list, hairline rules, no boxes ── */
.cx-cp .cx-cp-points {
  list-style: none;
  margin: clamp(26px, 3vw, 42px) 0 0;
  padding: 0;
  counter-reset: cxcp;
}
.cx-cp .cx-cp-points li {
  position: relative;
  counter-increment: cxcp;
  padding: 17px 0 17px 46px;
  border-top: 1px solid var(--line);
}
.cx-cp .cx-cp-points li:last-child {
  border-bottom: 1px solid var(--line);
}
.cx-cp .cx-cp-points li::before {
  content: counter(cxcp, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 20px;
  font: 600 12px/1 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.06em;
  color: var(--cp-teal-deep);
}
.cx-cp .cx-cp-points b {
  display: block;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 3px;
}
.cx-cp .cx-cp-points span {
  display: block;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-60);
  max-width: 46ch;
}

/* ── the stage: one soft field, not a box ───────────────── */
.cx-cp .cx-cp-stage {
  position: relative;
  padding: clamp(18px, 2.4vw, 30px) clamp(14px, 2vw, 26px) clamp(16px, 2vw, 24px);
  border-radius: var(--r-xl);
  background:
    radial-gradient(85% 60% at 16% 4%, color-mix(in srgb, var(--cp-teal) 9%, transparent), transparent 62%),
    radial-gradient(110% 85% at 92% 100%, color-mix(in srgb, var(--periwinkle) 80%, transparent), transparent 64%);
}
/* faint dot texture, fading at the edges — texture, not a border */
.cx-cp .cx-cp-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: radial-gradient(
    circle,
    color-mix(in srgb, var(--indigo) 13%, transparent) 1px,
    transparent 1.5px
  );
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(90% 85% at 50% 45%, #000 30%, transparent 78%);
  mask-image: radial-gradient(90% 85% at 50% 45%, #000 30%, transparent 78%);
  pointer-events: none;
}
.cx-cp .cx-cp-stage > * {
  position: relative;
}

/* ── header row: incoming chip ↔ live pill ──────────────── */
.cx-cp .cx-cp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  margin-bottom: 14px;
}

.cx-cp .cx-cp-ringchip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--indigo);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-1);
  animation: cxcp-chip var(--cp-cycle) infinite cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cx-cp .cx-cp-ringdot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--indigo);
  flex: none;
}
.cx-cp .cx-cp-ringdot::before,
.cx-cp .cx-cp-ringdot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--indigo);
  animation: cxcp-ripple 1.2s infinite ease-out;
}
.cx-cp .cx-cp-ringdot::after {
  animation-delay: 0.6s;
}

.cx-cp .cx-cp-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  font: 600 11.5px/1 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.03em;
  color: var(--ink-70);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  animation: cxcp-pill var(--cp-cycle) infinite ease;
}
.cx-cp .cx-cp-livedot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  flex: none;
  animation: cxcp-pulse 1s infinite ease-out;
}

/* ── chart card: the screen-pop ─────────────────────────── */
.cx-cp .cx-cp-chart {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--r-soft);
  box-shadow: var(--shadow-2);
  animation: cxcp-chart var(--cp-cycle) infinite cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cx-cp .cx-cp-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, var(--indigo), var(--cp-teal));
}
.cx-cp .cx-cp-id {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cx-cp .cx-cp-id b {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cx-cp .cx-cp-id > span {
  font-size: 12.5px;
  color: var(--ink-60);
}
.cx-cp .cx-cp-poptag {
  margin-left: auto;
  flex: none;
  align-self: flex-start;
  font: 600 10px/1 var(--mono, ui-monospace, monospace);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--cp-teal-deep);
  background: var(--cp-teal-wash);
  border: 1px solid color-mix(in srgb, var(--cp-teal) 26%, transparent);
  border-radius: var(--r-pill);
  padding: 5px 9px;
}

/* ── the feed: hairline spine + streaming insight cards ─── */
.cx-cp .cx-cp-feed {
  position: relative;
  margin: 14px 0 0 clamp(16px, 2.6vw, 40px);
  padding-left: 24px;
  display: grid;
  gap: 10px;
}
.cx-cp .cx-cp-feed::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 8px;
  bottom: 10px;
  width: 1px;
  background: linear-gradient(180deg, var(--cp-teal), var(--indigo));
  transform-origin: top;
  animation: cxcp-line var(--cp-cycle) infinite ease;
}

.cx-cp .cx-cp-ins {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px 11px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--r-mid);
  box-shadow: var(--shadow-1);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.cx-cp .cx-cp-ins:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
/* node dot on the spine */
.cx-cp .cx-cp-ins::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 17px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cp-teal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cp-teal) 16%, transparent);
}

.cx-cp .cx-cp-ins-tag {
  font: 600 10px/1 var(--mono, ui-monospace, monospace);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cp-teal-deep);
  margin-bottom: 3px;
}
.cx-cp .cx-cp-ins-head {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cx-cp .cx-cp-ins-sub {
  font-size: 12.5px;
  color: var(--ink-60);
}

.cx-cp .cx-cp-why {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed color-mix(in srgb, var(--cp-teal) 32%, var(--line));
  font-size: 12px;
  line-height: 1.45;
  color: color-mix(in srgb, var(--cp-teal-deep) 78%, var(--ink));
}
.cx-cp .cx-cp-why i {
  font: 700 9.5px/1 var(--mono, ui-monospace, monospace);
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--cp-teal-deep);
  background: var(--cp-teal-wash);
  border-radius: var(--r-pill);
  padding: 3px 7px;
  flex: none;
  transform: translateY(-1px);
}

/* next-best-action variant: the one card that leans in */
.cx-cp .cx-cp-ins--nba {
  border-color: color-mix(in srgb, var(--cp-teal) 38%, var(--line));
  background:
    radial-gradient(120% 180% at 100% 0%, var(--cp-teal-wash), transparent 55%),
    rgba(255, 255, 255, 0.96);
}
.cx-cp .cx-cp-ins--nba::before {
  background: var(--indigo);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--indigo) 16%, transparent);
}
.cx-cp .cx-cp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}
.cx-cp .cx-cp-chip {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 6px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2, var(--line));
  color: var(--ink-70);
  background: #fff;
}
.cx-cp .cx-cp-chip--go {
  color: #fff;
  background: var(--indigo);
  border-color: var(--indigo);
  box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--indigo) 60%, transparent);
}

/* ── filed strip: the call puts itself away ─────────────── */
.cx-cp .cx-cp-filed {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 2px clamp(16px, 2.6vw, 40px);
  padding-left: 24px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-70);
  animation: cxcp-filed var(--cp-cycle) infinite ease;
}
.cx-cp .cx-cp-filed-ic {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: var(--mint);
}

.cx-cp .cx-cp-note {
  margin: 14px 4px 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-40);
  text-align: right;
}

/* ── the 16s loop ────────────────────────────────────────
   0–2.5%   incoming-call chip rings in
   5–9%     chart pops
   13–16%   chip yields to the on-call pill; spine starts
   18–62%   four insight cards + their "why" lines stream in
   74–78%   transcript files itself
   93–97%   everything breathes out; loop restarts
   ─────────────────────────────────────────────────────── */

@keyframes cxcp-chip {
  0% { opacity: 0; transform: translateY(-6px); }
  2.5%, 12% { opacity: 1; transform: none; }
  15%, 100% { opacity: 0; transform: translateY(-4px); }
}
@keyframes cxcp-pill {
  0%, 13% { opacity: 0; transform: translateY(-6px); }
  16%, 93% { opacity: 1; transform: none; }
  97%, 100% { opacity: 0; transform: none; }
}
@keyframes cxcp-chart {
  0%, 5% { opacity: 0; transform: translateY(16px) scale(0.965); }
  9%, 93% { opacity: 1; transform: none; }
  97%, 100% { opacity: 0; transform: translateY(-5px); }
}
@keyframes cxcp-line {
  0%, 16% { opacity: 0; transform: scaleY(0); }
  20% { opacity: 0.55; }
  56%, 93% { opacity: 0.55; transform: scaleY(1); }
  97%, 100% { opacity: 0; transform: scaleY(1); }
}

.cx-cp .cx-cp-feed .cx-cp-ins {
  animation: var(--cp-cycle) infinite cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cx-cp .cx-cp-feed .cx-cp-ins .cx-cp-why {
  animation: var(--cp-cycle) infinite ease;
}
.cx-cp .cx-cp-feed .cx-cp-ins:nth-child(1) { animation-name: cxcp-ins1; }
.cx-cp .cx-cp-feed .cx-cp-ins:nth-child(2) { animation-name: cxcp-ins2; }
.cx-cp .cx-cp-feed .cx-cp-ins:nth-child(3) { animation-name: cxcp-ins3; }
.cx-cp .cx-cp-feed .cx-cp-ins:nth-child(4) { animation-name: cxcp-ins4; }
.cx-cp .cx-cp-feed .cx-cp-ins:nth-child(1) .cx-cp-why { animation-name: cxcp-why1; }
.cx-cp .cx-cp-feed .cx-cp-ins:nth-child(2) .cx-cp-why { animation-name: cxcp-why2; }
.cx-cp .cx-cp-feed .cx-cp-ins:nth-child(3) .cx-cp-why { animation-name: cxcp-why3; }
.cx-cp .cx-cp-feed .cx-cp-ins:nth-child(4) .cx-cp-why { animation-name: cxcp-why4; }

@keyframes cxcp-ins1 {
  0%, 18% { opacity: 0; transform: translateY(12px); }
  21%, 93% { opacity: 1; transform: none; }
  97%, 100% { opacity: 0; transform: translateY(-4px); }
}
@keyframes cxcp-ins2 {
  0%, 30% { opacity: 0; transform: translateY(12px); }
  33%, 93% { opacity: 1; transform: none; }
  97%, 100% { opacity: 0; transform: translateY(-4px); }
}
@keyframes cxcp-ins3 {
  0%, 42% { opacity: 0; transform: translateY(12px); }
  45%, 93% { opacity: 1; transform: none; }
  97%, 100% { opacity: 0; transform: translateY(-4px); }
}
@keyframes cxcp-ins4 {
  0%, 54% { opacity: 0; transform: translateY(12px); }
  57%, 93% { opacity: 1; transform: none; }
  97%, 100% { opacity: 0; transform: translateY(-4px); }
}
@keyframes cxcp-why1 {
  0%, 23% { opacity: 0; }
  26%, 100% { opacity: 1; }
}
@keyframes cxcp-why2 {
  0%, 35% { opacity: 0; }
  38%, 100% { opacity: 1; }
}
@keyframes cxcp-why3 {
  0%, 47% { opacity: 0; }
  50%, 100% { opacity: 1; }
}
@keyframes cxcp-why4 {
  0%, 59% { opacity: 0; }
  62%, 100% { opacity: 1; }
}
@keyframes cxcp-filed {
  0%, 74% { opacity: 0; transform: translateY(8px); }
  78%, 93% { opacity: 1; transform: none; }
  97%, 100% { opacity: 0; transform: none; }
}
@keyframes cxcp-ripple {
  0% { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(2.7); opacity: 0; }
}
@keyframes cxcp-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--mint) 35%, transparent); }
  60% { box-shadow: 0 0 0 6px transparent; }
}

/* ── responsive ─────────────────────────────────────────── */
@media (max-width: 980px) {
  .cx-cp .cx-cp-grid {
    grid-template-columns: 1fr;
    gap: clamp(30px, 6vw, 48px);
  }
  .cx-cp .cx-cp-stagecol {
    max-width: 640px;
  }
  .cx-cp .cx-cp-note {
    text-align: left;
  }
}
@media (max-width: 700px) {
  .cx-cp .cx-cp-feed,
  .cx-cp .cx-cp-filed {
    margin-left: 4px;
  }
  .cx-cp .cx-cp-live {
    padding: 6px 10px;
  }
  .cx-cp .cx-cp-poptag {
    display: none;
  }
  .cx-cp .cx-cp-points span {
    font-size: 14px;
  }
  .cx-cp .cx-cp-stage {
    padding: 16px 12px 14px;
  }
}
@media (max-width: 460px) {
  .cx-cp .cx-cp-ins-head {
    font-size: 14px;
  }
  .cx-cp .cx-cp-chips {
    gap: 6px;
  }
  .cx-cp .cx-cp-chip {
    font-size: 11px;
    padding: 5px 10px;
  }
}

/* ── reduced motion: the finished frame, no choreography ──
   !important so the nth-child animation-name rules above can't
   out-specify the reset and pin a card at a hidden keyframe.
   Base styles are the fully-revealed frame, so everything shows. */
@media (prefers-reduced-motion: reduce), (max-width: 700px) {
  .cx-cp *,
  .cx-cp *::before,
  .cx-cp *::after {
    animation: none !important;
    transition: none !important;
  }
  .cx-cp .cx-cp-ins:hover {
    transform: none;
    box-shadow: var(--shadow-1);
  }
  .cx-cp .cx-cp-ringdot::before,
  .cx-cp .cx-cp-ringdot::after {
    display: none;
  }
  .cx-cp .cx-cp-feed::before {
    opacity: 0.55;
  }
}
