/* Q4 Workspace: AI & Automations page (loaded after site.css and va.css) */

/* ---------- Hero workflow diagram ---------- */
.flow { position: relative; max-width: 980px; margin: 72px auto 0; }
.flow::before {
  content: "";
  position: absolute;
  inset: 10% -10% -20%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(70, 160, 150, 0.7), rgba(42, 107, 102, 0.35) 60%, transparent 100%);
  filter: blur(60px);
  pointer-events: none;
}
.flow__canvas {
  padding: 44px 36px 22px;
  border-radius: 24px;
  background:
    radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1.2px) 0 0 / 18px 18px,
    linear-gradient(180deg, rgba(14, 22, 22, 0.92), rgba(8, 11, 11, 0.95));
  border: 1px solid rgba(111, 184, 174, 0.22);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
}
.flow__nodes {
  --gap: 44px;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  text-align: left;
}
.flow__node {
  --i: 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #152020, #0e1515);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: flow-node 4s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.8s);
}
/* connector with a pulse travelling along it */
.flow__node:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  width: var(--gap);
  height: 2px;
  margin-top: -1px;
  background:
    linear-gradient(90deg, transparent, #a6e3d9, transparent) -60% 0 / 60% 100% no-repeat,
    rgba(111, 184, 174, 0.25);
  animation: flow-pulse-x 4s linear infinite;
  animation-delay: calc(var(--i) * 0.8s + 0.4s);
}
.flow__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #eaf6f4;
  background: radial-gradient(circle at 35% 30%, #4f9a92, var(--brand) 72%);
  box-shadow: 0 6px 18px -6px rgba(42, 107, 102, 0.8);
}
.flow__meta { display: grid; gap: 2px; min-width: 0; }
.flow__kind { font-size: 12px; font-weight: 500; color: var(--accent); }
.flow__name { font-size: 14px; font-weight: 700; line-height: 1.3; color: #fff; }
.flow__status {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 10px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 13px;
  color: #8f9998;
}
.flow__status span[aria-hidden] { color: #4d5857; }
.flow__live { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: #cfd6d5; }
.flow__live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6fd3a8;
  box-shadow: 0 0 0 0 rgba(111, 211, 168, 0.6);
  animation: flow-live 2s ease-out infinite;
}

@keyframes flow-node {
  0%, 30%, 100% { border-color: rgba(255, 255, 255, 0.08); box-shadow: none; }
  10%, 20% { border-color: rgba(111, 184, 174, 0.6); box-shadow: 0 0 0 4px rgba(111, 184, 174, 0.08), 0 12px 30px -10px rgba(42, 107, 102, 0.9); }
}
@keyframes flow-pulse-x {
  0% { background-position: -60% 0, 0 0; }
  20%, 100% { background-position: 160% 0, 0 0; }
}
@keyframes flow-pulse-y {
  0% { background-position: 0 -60%, 0 0; }
  20%, 100% { background-position: 0 160%, 0 0; }
}
@keyframes flow-live {
  0% { box-shadow: 0 0 0 0 rgba(111, 211, 168, 0.55); }
  100% { box-shadow: 0 0 0 8px rgba(111, 211, 168, 0); }
}

/* ---------- Case study ---------- */
.au-case { padding: 130px 16px 40px; }
.au-case__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}
.au-case .va-head { margin: 0; text-align: left; }
.au-case .va-plans__label { text-align: left; margin-bottom: 14px; }
.au-case__link { display: inline-block; margin-top: 22px; font-size: 15px; color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(111, 184, 174, 0.35); }
.au-case__link:hover { border-bottom-color: var(--accent); }
.au-case__list { list-style: none; display: grid; gap: 14px; }
.au-wf {
  padding: 20px 22px;
  border-radius: 18px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(58, 120, 114, 0.16), transparent 60%),
    linear-gradient(180deg, #121b1b, #0c1111);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color .3s ease;
}
.au-wf:hover { border-color: rgba(111, 184, 174, 0.35); }
.au-wf__path { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.au-wf__app {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #eaf6f4;
  background: rgba(42, 107, 102, 0.28);
  border: 1px solid rgba(111, 184, 174, 0.3);
}
.au-wf__arrow { color: var(--accent); }
.au-wf__title { margin-top: 14px; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: #fff; }
.au-wf__text { margin-top: 6px; font-size: 14px; line-height: 1.55; color: #8f9998; }

/* ---------- Plans: count chip reads as the automation range ---------- */
.au-plans .vplan__list { margin-bottom: 24px; }

/* ---------- AI agents ---------- */
.au-ai { padding: 130px 16px 40px; text-align: center; }
.au-ai__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 56px auto 0;
  text-align: left;
  list-style: none;
}
.chat, .call {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, #0f1616, #090c0c);
  border: 1px solid rgba(111, 184, 174, 0.22);
}
.chat__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.chat__avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: #eaf6f4;
  background: radial-gradient(circle at 35% 30%, #4f9a92, var(--brand) 72%);
}
.chat__who { display: grid; gap: 1px; }
.chat__name { font-size: 14px; font-weight: 700; color: #fff; }
.chat__state { font-size: 12px; color: #6fd3a8; }
.chat__body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 18px; }
.chat__msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.45; }
.chat__msg--in { align-self: flex-start; color: #dfe5e4; background: rgba(255, 255, 255, 0.07); border-bottom-left-radius: 6px; }
.chat__msg--out { align-self: flex-end; color: #eaf6f4; background: linear-gradient(160deg, #3f8d85, var(--brand)); border-bottom-right-radius: 6px; }
.chat__typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.07); }
.chat__typing span { width: 6px; height: 6px; border-radius: 50%; background: #9aa3a3; animation: chat-dot 1.2s ease-in-out infinite; }
.chat__typing span:nth-child(2) { animation-delay: .15s; }
.chat__typing span:nth-child(3) { animation-delay: .3s; }
.chat__note { padding: 12px 18px; font-size: 12px; color: #6f7a79; border-top: 1px solid rgba(255, 255, 255, 0.07); }
@keyframes chat-dot { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }


@media (max-width: 1000px) {
  .au-case__inner { grid-template-columns: 1fr; gap: 36px; }
  .au-case .va-head, .au-case .va-plans__label { text-align: center; margin-left: auto; margin-right: auto; }
  .au-case__intro { text-align: center; }
}
@media (max-width: 860px) {
  .au-case, .au-ai { padding-top: 100px; }
  .flow { margin-top: 48px; }
  .flow__canvas { padding: 24px 18px 18px; }
  .flow__nodes { --gap: 22px; grid-template-columns: 1fr; max-width: 340px; margin: 0 auto; }
  .flow__node:not(:last-child)::after {
    top: 100%;
    left: 50%;
    width: 2px;
    height: var(--gap);
    margin: 0 0 0 -1px;
    background:
      linear-gradient(180deg, transparent, #a6e3d9, transparent) 0 -60% / 100% 60% no-repeat,
      rgba(111, 184, 174, 0.25);
    animation-name: flow-pulse-y;
  }
}
@media (max-width: 700px) {
  .au-ai__grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .flow__node, .flow__node::after, .flow__live::before, .chat__typing span, .call__wave span { animation: none !important; }
}

/* ---------- Use cases: before -> after ---------- */
.au-uses { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.au-ba { display: grid; gap: 8px; margin-top: 14px; font-size: 14px; line-height: 1.45; }
.au-ba__before { color: #6f7a79; text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.25); }
.au-ba__after { display: flex; gap: 8px; font-weight: 500; color: #dfe9e7; }
.au-ba__after::before { content: "\2192"; flex: none; color: var(--accent); }
@media (max-width: 1000px) { .au-uses { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .au-uses { grid-template-columns: 1fr; } }

/* ---------- Case study quote ---------- */
.au-case__quote { max-width: 1100px; margin: 48px auto 0; }
.au-case__quote .quote--featured { grid-row: auto; max-width: 860px; margin: 0 auto; }

/* ---------- AI agents: visual on top, plan below, rows aligned ---------- */
.au-ai__grid > li { display: grid; grid-template-rows: subgrid; grid-row: span 2; gap: 16px; }
.call__wave { display: inline-flex; align-items: center; gap: 3px; height: 20px; margin-left: auto; }
.call__wave span { width: 3px; height: 40%; border-radius: 2px; background: var(--accent); animation: call-wave 1.1s ease-in-out infinite; }
.call__wave span:nth-child(2) { animation-delay: .15s; }
.call__wave span:nth-child(3) { animation-delay: .3s; }
.call__wave span:nth-child(4) { animation-delay: .45s; }
.call__wave span:nth-child(5) { animation-delay: .6s; }
@keyframes call-wave { 0%, 100% { height: 30%; } 50% { height: 100%; } }
.call__body { flex: 1; padding: 18px; }
.call__caller { font-size: 14px; color: #dfe5e4; padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); }
.call__steps { list-style: none; display: grid; gap: 10px; margin-top: 14px; }
.call__steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #cfd6d5; }
.call__steps li::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eaf6f4' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 60% no-repeat,
    radial-gradient(circle at 35% 30%, #4f9a92, var(--brand) 72%);
}
@media (max-width: 700px) {
  .au-ai__grid { gap: 40px; }
  .au-ai__grid > li { display: flex; flex-direction: column; grid-row: auto; }
}
