/* KimQ diagrams: one-cycle swimlane, data-platform hub and cross-team chain.
   Layout is HTML/CSS; flows.js draws the connector wires on wide screens.
   Loaded after products.css. */

[data-flow] {
  --flow-draw: 1;
  position: relative;
}
.flow-wires {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* The site-wide icon rule sizes every svg to 20px. */
  width: 100%;
  height: 100%;
  stroke-width: 0;
  overflow: visible;
  pointer-events: none;
}
.flow-wires .wire {
  fill: none;
  stroke: #b7c8db;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.flow-wires .wire.is-strong {
  stroke: #7fa9e0;
  stroke-width: 1.8;
}
.flow-wires .wire.is-loop {
  stroke: #2a78d6;
  stroke-width: 1.6;
  stroke-dasharray: 1 6;
}
.flow-wires .port {
  fill: #fff;
  stroke: #9db3cc;
  stroke-width: 1.6;
}
.flow-wires .port.is-strong {
  stroke: #2a78d6;
}
.flow-wires .joint {
  fill: #2a78d6;
  stroke: #fff;
  stroke-width: 2.5;
}
.flow-wires .pulse {
  fill: none;
  stroke: #2a78d6;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 0.1 34;
  opacity: 0.9;
  animation: flow-pulse 2.2s linear infinite;
}
@keyframes flow-pulse {
  to {
    stroke-dashoffset: -34.1;
  }
}

/* ---------- Swimlane: one work cycle ---------- */
.working-section .archify-flow-heading {
  margin-bottom: 32px;
}
.swim {
  display: grid;
  grid-template-columns: 136px repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(3, auto);
  column-gap: 28px;
  padding-right: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--lift);
  overflow: hidden;
}
.swim-lane {
  grid-column: 1 / -1;
  grid-row: var(--row);
  display: flex;
  align-items: stretch;
  min-height: 178px;
  margin-right: -18px;
  border-bottom: 1px dashed #dbe4ee;
}
.swim-lane[style*="--row:3"] {
  border-bottom: 0;
}
.swim-lane.is-ai {
  background: linear-gradient(90deg, rgba(7, 94, 230, 0.08), rgba(7, 94, 230, 0.02));
}
.swim-lane-label {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 2px;
  width: 136px;
  padding: 0 14px 0 20px;
  border-right: 1px solid var(--line);
  color: #50667d;
}
.swim-lane-label > svg {
  width: 20px;
  height: 20px;
  margin-bottom: 6px;
}
.swim-lane-label .brand-mark,
.swim-lane-label .brand-mark svg {
  width: 26px;
  height: 26px;
  margin-bottom: 6px;
  border-radius: 8px;
}
.swim-lane-label b {
  color: var(--ink);
  font-size: 14px;
  letter-spacing: -0.01em;
}
.swim-lane-label small {
  font-size: 11.5px;
  line-height: 1.35;
}
.swim-lane.is-ai .swim-lane-label b {
  color: var(--blue);
}
.swim-step {
  position: relative;
  z-index: 2;
  grid-column: var(--col);
  grid-row: var(--row);
  align-self: center;
  margin: 14px 0;
  padding: 14px 14px 12px;
  border: 1px solid #d9e3ee;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px -20px rgba(15, 42, 74, 0.5);
}
.swim-step.is-ai {
  border-color: #b9d1f3;
}
.swim-step.is-result {
  border-color: #0f2942;
  background: #0f2942;
}
.swim-step.is-result h3 {
  color: #fff;
}
.swim-step.is-result p {
  color: #c4d6ea;
}
.step-no {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #eef3f9;
  color: #3b5773;
  font-size: 10.5px;
  font-weight: 800;
}
.swim-step.is-ai .step-no {
  background: var(--blue);
  color: #fff;
}
.swim-step.is-result .step-no {
  background: #fff;
  color: #0f2942;
}
.swim-step h3 {
  margin: 10px 0 6px;
  font-size: 14.5px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.swim-step p {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.55;
}
.step-meta {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5fa;
  color: #50667d;
  font-size: 10.5px;
  font-weight: 700;
}
.step-meta.is-check {
  background: #e3f6ee;
  color: var(--good);
}
.swim-step.is-result .step-meta {
  background: rgba(255, 255, 255, 0.12);
  color: #dbe7f4;
}

/* ---------- Data platform hub ---------- */
.connections-section.data-platform {
  display: block;
}
.hub-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr) minmax(0, 1fr);
  column-gap: clamp(44px, 6vw, 88px);
  align-items: center;
  padding: 30px 30px 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 1px 1px, #d9e3ee 1px, transparent 0) 0 0 / 22px 22px,
    linear-gradient(180deg, #f8fbff, #f3f7fc);
}
.hub-col {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
  min-width: 0;
}
.hub-col-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  color: #50667d;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.hub-col-label b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #d3e0ee;
  border-radius: 7px;
  background: #fff;
  color: var(--blue);
  font-size: 10px;
  letter-spacing: 0;
}
.src,
.out {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #d9e3ee;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 44, 67, 0.05);
}
.src strong,
.out strong {
  display: block;
  font-size: 13.5px;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.src small,
.out small {
  display: block;
  color: #60758c;
  font-size: 11.5px;
  line-height: 1.4;
}
.src-icon,
.out-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eef3f9;
  color: #3b5773;
}
.src-icon svg,
.out-icon svg {
  width: 18px;
  height: 18px;
}
.out {
  border-color: #c7daf3;
}
.out-icon {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 16px -10px rgba(7, 94, 230, 0.9);
}
.hub {
  padding: 18px;
  border: 1px solid #28496b;
  border-radius: 20px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(42, 120, 214, 0.35), transparent 60%),
    #0f2942;
  color: #dbe7f4;
  box-shadow:
    0 30px 60px -30px rgba(15, 41, 66, 0.7),
    0 0 0 6px rgba(42, 120, 214, 0.08);
}
.hub header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #2a4a69;
}
.hub header .brand-mark,
.hub header .brand-mark svg {
  width: 36px;
  height: 36px;
}
.hub header strong {
  display: block;
  color: #fff;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.hub header small {
  color: #9fb9d4;
  font-size: 11.5px;
}
.hub-layers {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 0;
  list-style: none;
}
.hub-layers li {
  display: flex;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid #2a4a69;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}
.hub-layers b {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(125, 180, 255, 0.16);
  color: #9fc8ff;
  font-size: 11px;
}
.hub-layers strong {
  display: block;
  color: #fff;
  font-size: 13.5px;
  line-height: 1.35;
}
.hub-layers span {
  display: block;
  color: #b3c8de;
  font-size: 11.5px;
  line-height: 1.45;
}
.hub footer {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9fb9d4;
  font-size: 11.5px;
}
.hub footer svg {
  width: 16px;
  height: 16px;
  color: #7db4ff;
}
.hub-loop {
  grid-column: 2 / 4;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 64px 0 0;
  padding: 12px 14px;
  border: 1px dashed #9cc0ec;
  border-radius: 12px;
  background: #fff;
  color: #27405f;
  font-size: 13px;
  line-height: 1.55;
}
.hub-loop svg {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--blue);
}
.hub-channels {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid #dbe4ee;
  color: #50667d;
  font-size: 12.5px;
  font-weight: 650;
}
.hub-channels a,
.hub-channels .chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid #c7daf3;
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
}
.hub-channels .chip {
  border-color: #d9e3ee;
  color: #3b5773;
}
.hub-channels a:hover {
  border-color: var(--blue);
}

/* ---------- Cross-team example ---------- */
.cross-team {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 2fr);
  gap: 40px;
  margin-top: 28px;
  padding: 28px;
  border-radius: 22px;
  background: #0f2942;
  color: #dbe7f4;
}
.cross-team-head .section-label {
  margin-bottom: 12px;
  color: #8fb1d2;
}
.cross-team-head h3 {
  color: #fff;
  font-size: 21px;
  line-height: 1.3;
}
.cross-team-head p {
  margin: 12px 0 0;
  color: #b9cde2;
  font-size: 14px;
  line-height: 1.7;
}
.cross-chain {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cross-chain li {
  position: relative;
  padding: 14px;
  border: 1px solid #2a4a69;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}
.cross-chain li:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 50%;
  right: -11px;
  width: 8px;
  height: 8px;
  border-top: 1.5px solid #6d8fb2;
  border-right: 1.5px solid #6d8fb2;
  transform: translateY(-50%) rotate(45deg);
}
.cross-chain li:nth-child(2),
.cross-chain li:nth-child(3) {
  border-color: #6b4f1d;
  background: rgba(237, 161, 0, 0.07);
}
.cross-chain li.is-kimq {
  border-color: #2a78d6;
  background: linear-gradient(180deg, rgba(42, 120, 214, 0.28), rgba(42, 120, 214, 0.08));
}
.team-chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #cfe0f3;
  font-size: 10.5px;
  font-weight: 750;
}
.cross-chain li.is-kimq .team-chip {
  background: var(--blue);
  color: #fff;
}
.cross-chain p {
  margin: 10px 0 0;
  color: #dbe7f4;
  font-size: 13px;
  line-height: 1.55;
}
.cross-chain b {
  color: #9fc8ff;
}
.cross-note {
  grid-column: 1 / -1;
  margin: 0;
  color: #8fa9c4;
  font-size: 11.5px;
}

/* ---------- Stacked layouts: no wires, CSS timeline instead ---------- */
@media (max-width: 1080px) {
  .swim {
    --flow-draw: 0;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    padding: 18px 18px 18px 52px;
  }
  .swim::before {
    content: "";
    position: absolute;
    top: 34px;
    bottom: 34px;
    left: 29px;
    width: 2px;
    background: linear-gradient(#075ee6, #b9d1f3);
  }
  .swim-lane {
    display: none;
  }
  .swim-step {
    grid-column: 1;
    grid-row: auto;
    margin: 6px 0;
  }
  .swim-step::before {
    content: attr(data-lane);
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f1f5fa;
    color: #50667d;
    font-size: 10.5px;
    font-weight: 750;
  }
  .swim-step.is-ai::before {
    background: var(--blue-wash);
    color: var(--blue);
  }
  .swim-step.is-result::before {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
  }
  .swim-step::after {
    content: "";
    position: absolute;
    top: 20px;
    left: -29px;
    width: 12px;
    height: 12px;
    border: 2px solid #075ee6;
    border-radius: 50%;
    background: #fff;
  }
}
@media (max-width: 980px) {
  .hub-flow {
    --flow-draw: 0;
    grid-template-columns: 1fr;
    row-gap: 34px;
    padding: 20px;
  }
  .hub-col + .hub-col::before {
    content: "";
    position: absolute;
    top: -26px;
    left: 50%;
    width: 12px;
    height: 12px;
    border-right: 2px solid #6d9fdf;
    border-bottom: 2px solid #6d9fdf;
    transform: translateX(-50%) rotate(45deg);
  }
  .hub-sources {
    grid-template-columns: 1fr 1fr;
  }
  .hub-sources .hub-col-label {
    grid-column: 1 / -1;
  }
  .hub-loop {
    grid-column: 1;
    margin: 0;
  }
  .hub-channels {
    margin: 0;
  }
  .cross-team {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .cross-chain {
    grid-template-columns: 1fr 1fr;
  }
  .cross-chain li::after {
    display: none;
  }
}
@media (max-width: 560px) {
  .hub-sources,
  .cross-chain {
    grid-template-columns: 1fr;
  }
  .cross-team {
    padding: 20px;
  }
  .swim {
    padding: 14px 12px 14px 44px;
  }
  .swim::before {
    left: 23px;
  }
  .swim-step::after {
    left: -27px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .flow-wires .pulse {
    display: none;
  }
}

/* ---------- Rollout: four-phase timeline ---------- */
.phase-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.phase-track::before {
  content: "";
  position: absolute;
  top: 31px;
  left: 12.5%;
  right: 12.5%;
  height: 2px;
  background: linear-gradient(90deg, #075ee6, #7fb0f2 60%, #c9dcf5);
}
.phase-track > li {
  position: relative;
  display: grid;
  /* Node on top, card fills the rest so all four cards share one height. */
  grid-template-rows: auto 1fr;
  justify-items: center;
  gap: 18px;
}
.phase-node {
  position: relative;
  z-index: 1;
}
.phase-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 2px solid #075ee6;
  border-radius: 20px;
  background: #fff;
  color: #075ee6;
  box-shadow: 0 0 0 6px var(--canvas), 0 14px 28px -18px rgba(7, 94, 230, 0.8);
}
.phase-icon svg {
  width: 26px;
  height: 26px;
}
.phase-track > li:first-child .phase-icon {
  background: linear-gradient(145deg, #2a86ff, #0a43b4);
  border-color: transparent;
  color: #fff;
}
.phase-num {
  position: absolute;
  top: -8px;
  right: -10px;
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 22px;
  padding: 0 6px;
  border: 2px solid var(--canvas);
  border-radius: 999px;
  background: #0f2942;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
}
.phase-card {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  width: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--edge);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.phase-card:hover {
  transform: translateY(-3px);
  border-color: #b8cde6;
  box-shadow: var(--lift);
}
.phase-label {
  color: var(--blue);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.phase-card h3 {
  margin: 8px 0 10px;
  font-size: 18px;
  line-height: 1.3;
}
.phase-card > p {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.65;
}
.phase-card > p.phase-who {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
  color: #3b5773;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.45;
}
.phase-who svg {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: #6c8096;
}
.phase-out {
  margin-top: auto;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f3f7fc;
}
.phase-out small {
  display: block;
  margin-bottom: 6px;
  color: #50667d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.phase-out ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.phase-out li {
  position: relative;
  padding-left: 22px;
  color: #22415f;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}
.phase-out li::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 0;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4.5 8.2 2.2 2.2 4.8-4.8' fill='none' stroke='%23fff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat,
    var(--good);
}
.phase-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 28px 0 0;
  color: #3b5773;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
}
.phase-note svg {
  width: 18px;
  height: 18px;
  color: var(--blue);
}
@media (max-width: 980px) {
  .phase-track {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .phase-track::before {
    top: 32px;
    bottom: 32px;
    left: 31px;
    right: auto;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, #075ee6, #c9dcf5);
  }
  .phase-track > li {
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-rows: auto;
    justify-items: start;
    align-items: start;
    gap: 16px;
  }
  .phase-note {
    justify-content: flex-start;
    text-align: left;
  }
}
@media (max-width: 420px) {
  .phase-track > li {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
  }
  .phase-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }
  .phase-track::before {
    left: 25px;
  }
  .phase-card {
    padding: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .phase-card {
    transition: none;
  }
  .phase-card:hover {
    transform: none;
  }
}
