/* ===================== AI COPILOT ===================== */
.copilot {
  position: relative;
  padding: clamp(70px, 8vw, 120px) clamp(20px, 4vw, 60px) clamp(80px, 9vw, 130px);
  overflow: hidden;
  color: #fff;
  background:
    /* long eased blend from the white section above into the blue (no visible band) */
    linear-gradient(to bottom,
      #ffffff 0,
      rgba(255, 255, 255, 0.92) 28px,
      rgba(255, 255, 255, 0.7) 80px,
      rgba(255, 255, 255, 0.4) 150px,
      rgba(255, 255, 255, 0.16) 220px,
      rgba(255, 255, 255, 0) 300px),
    /* long eased blend from the blue into the #f6f8fc unlocks section below */
    linear-gradient(to top,
      #f6f8fc 0,
      rgba(246, 248, 252, 0.7) 70px,
      rgba(246, 248, 252, 0.35) 140px,
      rgba(246, 248, 252, 0) 220px),
    radial-gradient(120% 130% at 6% -10%, rgba(120, 180, 255, 0.55) 0%, rgba(120, 180, 255, 0) 42%),
    radial-gradient(90% 90% at 100% 110%, rgba(40, 60, 180, 0.45) 0%, rgba(40, 60, 180, 0) 55%),
    linear-gradient(150deg, #2a6fe0 0%, #2a52d6 52%, #3247cc 100%);
}

/* faint grid texture */
.copilot::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(100% 100% at 50% 0%, #000 30%, transparent 80%);
  pointer-events: none;
}

/* ---------- Heading ---------- */
.cop-head {
  position: relative;
  text-align: center;
  max-width: 880px;
  margin: 0 auto clamp(44px, 5vw, 72px);
}

.cop-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 16px;
}

.cop-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 4.3vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
}

.cop-title .kw {
  color: #0a1f5c;
}

.cop-sub {
  margin: 20px auto 0;
  max-width: 620px;
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  font-weight: 300;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.86);
}

/* ---------- Grid ---------- */
.cop-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr minmax(360px, 500px) 1fr;
  gap: clamp(20px, 2.4vw, 40px);
  align-items: start;
  max-width: 1320px;
  margin: 0 auto;
}

.cop-coltitle {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  margin-bottom: 20px;
  color: #fff;
}

/* ---------- Feature cards (channels / capabilities) ---------- */
.cop-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 14px;
}

.feat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 38px rgba(10, 26, 80, 0.18);
  opacity: 0;
  overflow: hidden;
  transition: box-shadow 0.4s ease, background 0.4s ease;
}

/* staggered entrance once the column is in view */
.cop-col.in-view .feat { animation: featIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
.cop-col.in-view .feat:nth-of-type(1) { animation-delay: 0.05s; }
.cop-col.in-view .feat:nth-of-type(2) { animation-delay: 0.14s; }
.cop-col.in-view .feat:nth-of-type(3) { animation-delay: 0.23s; }
.cop-col.in-view .feat:nth-of-type(4) { animation-delay: 0.32s; }

@keyframes featIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.feat:hover {
  background: #ffffff;
  box-shadow: 0 26px 54px rgba(10, 26, 80, 0.30);
}

/* sliding sheen on hover */
.feat::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 35%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  opacity: 0;
  transition: none;
}
.feat:hover::after {
  animation: featSheen 0.8s ease;
}
@keyframes featSheen {
  0%   { left: -40%; opacity: 0; }
  30%  { opacity: 0.9; }
  100% { left: 130%; opacity: 0; }
}

.feat-ic {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.4s ease;
}

.feat:hover .feat-ic {
  transform: scale(1.12) rotate(-6deg);
  box-shadow: 0 8px 18px rgba(10, 26, 80, 0.28);
}

.feat-ic svg { width: 24px; height: 24px; }

.ic-purple { background: linear-gradient(150deg, #8b5cf6, #6d4adf); }
.ic-amber  { background: linear-gradient(150deg, #fbbf3c, #f59331); }
.ic-teal   { background: linear-gradient(150deg, #34d3b0, #14b894); }
.ic-blue   { background: linear-gradient(150deg, #4aa3f5, #2f74dd); }

/* ---------- Right-side micro indicators ---------- */
.feat-fx {
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 22px;
}

/* shared expanding ring */
@keyframes fxRing {
  0%   { transform: scale(0.55); opacity: 0.85; }
  70%  { transform: scale(1.5); opacity: 0; }
  100% { opacity: 0; }
}

/* Chat AI — typing dots */
.fx-dots { gap: 4px; }
.fx-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: #8b5cf6;
  animation: typeBounce 1.2s infinite ease-in-out;
}
.fx-dots i:nth-child(2) { animation-delay: 0.18s; }
.fx-dots i:nth-child(3) { animation-delay: 0.36s; }

/* Mobile Alerts — pulse dot */
.fx-pulse {
  position: relative;
  width: 10px; height: 10px; border-radius: 50%;
  background: #f59331;
}
.fx-pulse::after {
  content: ""; position: absolute; inset: -5px;
  border-radius: 50%; border: 2px solid #f59331;
  animation: fxRing 1.8s infinite;
}

/* Voice AI — equalizer */
.fx-eq { gap: 3px; align-items: flex-end; height: 18px; }
.fx-eq i {
  width: 3px; height: 18px; border-radius: 2px;
  background: #14b894;
  transform-origin: bottom;
  animation: eqBar 1s ease-in-out infinite;
}
.fx-eq i:nth-child(1) { animation-delay: 0s; }
.fx-eq i:nth-child(2) { animation-delay: 0.2s; }
.fx-eq i:nth-child(3) { animation-delay: 0.4s; }
.fx-eq i:nth-child(4) { animation-delay: 0.6s; }
@keyframes eqBar {
  0%, 100% { transform: scaleY(0.32); }
  50%      { transform: scaleY(1); }
}

/* Smart Glasses — scan bar */
.fx-scan {
  position: relative;
  width: 32px; height: 14px;
  border-radius: 4px;
  background: rgba(74, 163, 245, 0.22);
  overflow: hidden;
}
.fx-scan i {
  position: absolute; top: 0; left: -45%;
  width: 45%; height: 100%; border-radius: 4px;
  background: #4aa3f5;
  animation: scanMove 1.7s ease-in-out infinite;
}
@keyframes scanMove {
  0%   { left: -45%; }
  100% { left: 100%; }
}

/* Troubleshooting — ranked bars */
.fx-rank { flex-direction: column; gap: 4px; align-items: flex-end; }
.fx-rank i {
  height: 3px; border-radius: 2px;
  background: #8b5cf6;
  animation: rankPulse 1.8s infinite ease-in-out;
}
.fx-rank i:nth-child(1) { width: 22px; animation-delay: 0s; }
.fx-rank i:nth-child(2) { width: 16px; animation-delay: 0.2s; }
.fx-rank i:nth-child(3) { width: 10px; animation-delay: 0.4s; }
@keyframes rankPulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* Inspection — spinner ring */
.fx-ring {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(245, 147, 49, 0.25);
  border-top-color: #f59331;
  animation: fxSpin 0.9s linear infinite;
}
@keyframes fxSpin { to { transform: rotate(360deg); } }

/* Auto Work Orders — flowing dots */
.fx-flow { gap: 6px; }
.fx-flow i {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(20, 184, 148, 0.3);
  animation: flowDot 1.4s infinite ease-in-out;
}
.fx-flow i:nth-child(1) { animation-delay: 0s; }
.fx-flow i:nth-child(2) { animation-delay: 0.2s; }
.fx-flow i:nth-child(3) { animation-delay: 0.4s; }
@keyframes flowDot {
  0%, 100% { background: rgba(20, 184, 148, 0.3); transform: scale(1); }
  50%      { background: #14b894; transform: scale(1.35); }
}

/* Knowledge Capture — radar */
.fx-radar { position: relative; width: 14px; height: 14px; }
.fx-radar::before {
  content: ""; position: absolute; inset: 4px;
  border-radius: 50%; background: #2f74dd;
}
.fx-radar::after {
  content: ""; position: absolute; inset: 0;
  border-radius: 50%; border: 2px solid #2f74dd;
  animation: fxRing 1.8s infinite;
}

.feat-tx h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: #1a2336;
  line-height: 1.2;
}

.feat-tx p {
  margin-top: 3px;
  font-size: 0.86rem;
  font-weight: 400;
  color: #6b7689;
}

/* ===================== CHAT ===================== */
.cop-chat {
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 40px 90px rgba(8, 22, 70, 0.38);
  overflow: hidden;
}

/* header */
.chat-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.95);
  color: #2f6bd8;
}
.chat-avatar svg { width: 24px; height: 24px; }

.chat-id { flex: 1 1 auto; line-height: 1.25; }
.chat-id strong { display: block; font-size: 1rem; font-weight: 700; }

.chat-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.78);
}
.chat-status i {
  width: 7px; height: 7px; border-radius: 50%;
  background: #3ddc7f;
  box-shadow: 0 0 0 0 rgba(61, 220, 127, 0.6);
  animation: copPulse 2s infinite;
}
@keyframes copPulse {
  0%   { box-shadow: 0 0 0 0 rgba(61, 220, 127, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(61, 220, 127, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 127, 0); }
}

.chat-wave { color: rgba(255, 255, 255, 0.7); }
.chat-wave svg { width: 22px; height: 22px; }

/* body */
.chat-body {
  height: clamp(330px, 42vh, 400px);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.chat-body::-webkit-scrollbar { display: none; }

/* messages — hidden until revealed by JS */
.cmsg {
  display: none;
  max-width: 86%;
  animation: cmsgIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.cmsg.show { display: block; }
.cmsg.user { align-self: flex-end; }
.cmsg.ai   { align-self: flex-start; }

@keyframes cmsgIn {
  0%   { opacity: 0; transform: translateY(16px) scale(0.96); }
  55%  { opacity: 1; transform: translateY(-3px) scale(1.012); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.bub {
  padding: 13px 17px;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.45;
  box-shadow: 0 10px 24px rgba(8, 22, 70, 0.16);
}
.cmsg.user .bub {
  background: #ffffff;
  color: #1a2336;
  border-bottom-right-radius: 5px;
  font-weight: 500;
}
.cmsg.ai .bub {
  background: #ffffff;
  color: #2a3550;
  border-bottom-left-radius: 5px;
}

/* health card */
.card-health { width: 280px; max-width: 100%; }
.ch-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.ch-label {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.82rem; font-weight: 600;
  color: #56627a;
}
.ch-label svg { width: 17px; height: 17px; color: #2f6bd8; }
.ch-badge {
  font-size: 0.7rem; font-weight: 700;
  color: #c2410c; background: #ffe9d6;
  padding: 4px 10px; border-radius: 999px;
}
.ch-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.ch-pct { font-family: 'Outfit', sans-serif; font-size: 2rem; font-weight: 800; color: #1a2336; line-height: 1; }
.ch-note { margin-top: 6px; font-size: 0.78rem; color: #6b7689; }
.ch-bars { display: flex; align-items: flex-end; gap: 4px; height: 46px; }
.ch-bars span {
  width: 7px; border-radius: 3px;
  background: linear-gradient(180deg, #5b8def, #2f6bd8);
  transform: scaleY(0);
  transform-origin: bottom;
}
.cmsg.show .ch-bars span { animation: barGrow 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.cmsg.show .ch-bars span:nth-child(1) { animation-delay: 0.10s; }
.cmsg.show .ch-bars span:nth-child(2) { animation-delay: 0.16s; }
.cmsg.show .ch-bars span:nth-child(3) { animation-delay: 0.22s; }
.cmsg.show .ch-bars span:nth-child(4) { animation-delay: 0.28s; }
.cmsg.show .ch-bars span:nth-child(5) { animation-delay: 0.34s; }
.cmsg.show .ch-bars span:nth-child(6) { animation-delay: 0.40s; }
.cmsg.show .ch-bars span:nth-child(7) { animation-delay: 0.46s; }
.cmsg.show .ch-bars span:nth-child(8) { animation-delay: 0.52s; }
@keyframes barGrow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

/* work-order card */
.card-wo {
  display: flex; align-items: center; gap: 12px;
  width: 290px; max-width: 100%;
}
.wo-ic { color: #16a34a; flex: 0 0 auto; }
.wo-ic svg { width: 30px; height: 30px; }
.wo-tx { flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.wo-tx strong { display: block; font-size: 0.86rem; color: #1a2336; font-weight: 700; }
.wo-tx span { font-size: 0.78rem; color: #6b7689; }
.wo-live {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.05em;
  color: #16a34a; background: #dcfce7;
  padding: 4px 9px 4px 8px; border-radius: 999px;
}
.wo-live::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: #16a34a;
  animation: copPulse 1.6s infinite;
}

/* typing indicator */
.ctyping { display: none; }
.ctyping.show { display: block; }
.bub.typing {
  display: inline-flex; gap: 5px; padding: 15px 17px;
}
.bub.typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #9fb3d6;
  animation: typeBounce 1.2s infinite ease-in-out;
}
.bub.typing span:nth-child(2) { animation-delay: 0.18s; }
.bub.typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes typeBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* input bar */
.chat-input {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.ci-mic { color: rgba(255, 255, 255, 0.8); }
.ci-mic svg { width: 22px; height: 22px; }
.chat-input input {
  flex: 1 1 auto;
  background: rgba(255, 255, 255, 0.96);
  border: none;
  border-radius: 999px;
  padding: 13px 18px;
  font-size: 0.9rem;
  color: #1a2336;
  outline: none;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  transition: box-shadow 0.3s ease;
}
.chat-input input:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45);
}
.ci-send {
  position: relative;
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #2f6bd8;
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
/* gentle attention ring */
.ci-send::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
  animation: sendRing 2.4s infinite;
}
@keyframes sendRing {
  0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5); }
  70%  { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
.ci-send svg { width: 20px; height: 20px; position: relative; z-index: 1; }
.ci-send:hover { transform: translateY(-2px) rotate(10deg) scale(1.06); box-shadow: 0 10px 22px rgba(255, 255, 255, 0.35); }
.ci-send:active { transform: scale(0.92); }

/* waveform gentle pulse */
.chat-wave { animation: wavePulse 2.6s ease-in-out infinite; }
@keyframes wavePulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.08); }
}

/* ---------- Reveal ---------- */
.copilot .reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.copilot .reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- Status pills ---------- */
.cop-stats {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  max-width: 900px;
  margin: clamp(48px, 6vw, 80px) auto 0;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.3s ease, transform 0.3s ease;
}
.stat-pill:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}
.stat-pill i {
  width: 7px; height: 7px; border-radius: 50%;
  background: #3ddc7f;
  box-shadow: 0 0 0 0 rgba(61, 220, 127, 0.6);
  animation: copPulse 2s infinite;
}
.stat-pill:nth-child(2) i { animation-delay: 0.5s; }
.stat-pill:nth-child(3) i { animation-delay: 1s; }
.stat-pill:nth-child(4) i { animation-delay: 1.5s; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .cop-grid {
    grid-template-columns: 1fr;
    max-width: 540px;
  }
  .cop-chat { order: -1; }
  .cop-col { padding-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .cmsg { animation: none; }
}
