/* Component-led illustrations for How Willow Works */
.how-it-works .how-intro h2 {
  max-width: 1120px;
  font-size: clamp(2.5rem, 3.2vw, 3.15rem);
  text-wrap: balance;
}

.how-it-works .how-intro > p:last-child {
  max-width: 680px;
}

.how-it-works .journey-diagram {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
}

.how-it-works .journey-entry {
  grid-template-columns: minmax(250px, 0.72fr) minmax(500px, 1.28fr);
  gap: 44px;
  min-height: 150px;
  padding: 20px 30px;
}

.how-it-works .journey-entry h3 {
  font-size: clamp(1.55rem, 1.9vw, 2rem);
}

.how-it-works .journey-entry p {
  margin-top: 6px;
  font-size: 0.92rem;
}

.how-it-works .journey-split {
  display: block;
  height: 48px;
}

.how-it-works .journey-split::before {
  height: 24px;
}

.how-it-works .journey-split span {
  top: 24px;
}

.how-it-works .journey-split::after {
  top: 24px;
  height: 24px;
}

.how-it-works .journey-paths {
  margin-top: 0;
}

.how-it-works .journey-path {
  min-height: 350px;
}

.how-it-works .journey-path h3 {
  font-size: clamp(1.55rem, 1.85vw, 1.95rem);
}

.how-it-works .journey-support h3 {
  max-width: 520px;
  font-size: clamp(1.55rem, 1.85vw, 1.95rem);
}

.how-it-works .journey-support header > p {
  max-width: 520px;
}

.how-it-works .journey-path > header {
  padding: 26px 28px 10px;
}

.how-it-works .journey-path > header > p {
  font-size: 0.92rem;
}

.willow-command-component {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 14px;
  min-height: 108px;
}

.command-card {
  align-content: center;
}

.command-card {
  position: static;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 18px;
  width: 100%;
  padding: 19px 21px;
  border: 1px solid rgba(24, 61, 44, 0.13);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(20, 61, 45, 0.08);
}

.command-card > span {
  color: #43715a;
  font-size: 0.68rem;
  font-weight: 780;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.command-card strong {
  grid-column: 1;
  color: var(--forest);
  font-size: 0.94rem;
}

.command-card small {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  padding: 7px 10px;
  border-radius: 9px;
  background: #e5f0e7;
  color: var(--forest);
  font-size: 0.68rem;
  font-weight: 730;
}

.command-card-connect small {
  background: #edf3ee;
}

/* Agent row: the entry card drops into Willow, the AI agent, which routes
   every request to the two paths below. */
.journey-drop {
  width: 1px;
  height: 40px;
  margin-inline: auto;
  background: rgba(24, 61, 44, 0.28);
}

.journey-agent {
  width: fit-content;
  margin-inline: auto;
  text-align: center;
}

.agent-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px 8px 10px;
  border-radius: 999px;
  background: var(--forest);
  color: #ffffff;
}

.agent-pill img {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.agent-pill strong {
  font-size: 1.05rem;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.agent-pill em {
  margin-left: 4px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--sage);
  font-style: normal;
  font-size: 0.66rem;
  font-weight: 760;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.journey-agent > p {
  max-width: 340px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.how-it-works .journey-support,
.how-it-works .journey-connect {
  border: 1px solid rgba(24, 61, 44, 0.11);
  background: rgba(255, 255, 255, 0.74);
}

.how-it-works .journey-support .journey-label,
.how-it-works .journey-connect .journey-label {
  color: #4f7f63;
}

.how-it-works .journey-support h3,
.how-it-works .journey-connect h3 {
  color: var(--forest);
}

.how-it-works .journey-support header > p,
.how-it-works .journey-connect header > p {
  color: var(--muted);
}

.request-component {
  position: relative;
  align-self: end;
  min-height: 200px;
  margin: 8px 28px 28px;
  display: grid;
  place-items: center;
  padding: 4px 0 0;
  background: transparent;
}

.request-component-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 100%;
  height: 190px;
  overflow: hidden;
  border: 1px solid rgba(24, 61, 44, 0.1);
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 14px 26px rgba(20, 61, 45, 0.09);
}

.request-resident {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 18px 8px;
}

.request-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #dbe9de;
  color: var(--forest);
  font-size: 0.68rem;
  font-weight: 780;
}

.request-avatar-photo {
  background-color: #dbe9de;
  background-image: url("../assets/product/care-team-mobile.png");
  background-repeat: no-repeat;
  background-position: -33px -242px;
  background-size: 422px auto;
}

.request-resident > div {
  display: grid;
  gap: 2px;
}

.request-resident strong {
  color: var(--forest);
  font-size: 0.83rem;
}

.request-resident span:not(.request-avatar) {
  color: var(--muted);
  font-size: 0.68rem;
}

.request-details {
  display: grid;
  gap: 6px;
  padding: 5px 18px 16px;
}

.request-details > span {
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.request-details p {
  margin: 0;
  color: var(--forest);
  font-size: 1.04rem;
  font-weight: 690;
  line-height: 1.35;
}

.request-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(24, 61, 44, 0.1);
  background: #f7f9f7;
}

.request-progress span {
  position: relative;
  padding-top: 9px;
  color: rgba(24, 61, 44, 0.44);
  font-size: 0.58rem;
  font-weight: 720;
  text-align: center;
}

.request-progress span::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  border-radius: 4px;
  background: #dfe4e0;
}

.request-progress .is-complete,
.request-progress .is-active {
  color: var(--forest);
}

.request-progress .is-complete::before {
  background: #a9c5b2;
}

.request-progress .is-active::before {
  background: #4f8966;
}

.how-it-works .connection-journey {
  display: block;
  padding: 8px 28px 28px;
}

.connection-component {
  display: grid;
  place-items: center;
  min-height: 200px;
  padding: 4px 0 0;
}

.connection-component-card {
  display: grid;
  grid-template-rows: 1fr auto;
  width: min(100%, 470px);
  height: 190px;
  overflow: hidden;
  border: 1px solid rgba(24, 61, 44, 0.12);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(20, 61, 45, 0.1);
}

.connection-profile {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 24px;
}

.connection-portrait {
  width: 82px;
  height: 82px;
  border: 4px solid #ffffff;
  border-radius: 50%;
  background-color: #dce9df;
  background-image: url("../assets/product/video-call-harry.webp");
  background-position: 90% 75%;
  background-repeat: no-repeat;
  background-size: 400%;
  box-shadow: 0 0 0 1px rgba(24, 61, 44, 0.14);
}

.connection-profile > div {
  display: grid;
  gap: 3px;
}

.connection-profile strong {
  color: var(--forest);
  font-size: 1.08rem;
}

.connection-profile small {
  color: var(--muted);
  font-size: 0.72rem;
}

.connection-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(24, 61, 44, 0.1);
  background: #f7f9f7;
}

.connection-actions span {
  padding: 12px 8px;
  border: 1px solid rgba(24, 61, 44, 0.13);
  border-radius: 9px;
  background: #ffffff;
  color: var(--forest);
  font-size: 0.68rem;
  font-weight: 720;
  text-align: center;
}

.connection-actions span:first-child {
  background: var(--forest);
  color: #ffffff;
}

@media (max-width: 1800px) {
  .how-it-works .journey-entry {
    grid-template-columns: minmax(220px, 0.62fr) minmax(480px, 1.38fr);
    gap: 34px;
    min-height: 145px;
    padding: 21px 28px;
  }

  .how-it-works .journey-entry h3 {
    font-size: 2.05rem;
  }

  .command-card {
    gap: 5px 12px;
    padding: 13px 15px;
  }

  .command-card strong {
    font-size: 0.82rem;
    line-height: 1.25;
  }

  .command-card small {
    padding: 6px 8px;
    font-size: 0.61rem;
    white-space: nowrap;
  }

  .how-it-works .journey-path {
    min-height: 338px;
  }

  .how-it-works .journey-path > header {
    padding: 22px 26px 6px;
  }

  .how-it-works .journey-path h3,
  .how-it-works .journey-support h3 {
    font-size: clamp(1.65rem, 2vw, 1.95rem);
  }

  .how-it-works .journey-path header > p {
    font-size: 0.9rem;
  }

  .request-component {
    min-height: 145px;
    margin: 2px 26px 20px;
  }

  .how-it-works .connection-journey {
    padding: 2px 26px 20px;
  }

  .connection-component {
    min-height: 145px;
  }

  .request-component-card,
  .connection-component-card {
    height: 136px;
  }

  .connection-profile {
    gap: 14px;
    padding: 14px 18px;
  }

  .connection-portrait {
    width: 52px;
    height: 52px;
  }

  .connection-actions {
    padding: 9px 10px;
  }

  .connection-actions span {
    padding: 9px 6px;
  }

  .request-resident {
    padding: 9px 14px 4px;
  }

  .request-details {
    gap: 4px;
    padding: 2px 14px 8px;
  }

  .request-progress {
    padding: 7px 9px 8px;
  }

  .how-it-works .journey-split {
    height: 56px;
  }

  .how-it-works .journey-split::before {
    height: 28px;
  }

  .how-it-works .journey-split span {
    top: 28px;
  }

  .how-it-works .journey-split::after {
    top: 28px;
    height: 28px;
  }
}

@media (max-width: 720px) {
  .how-it-works .how-intro h2 {
    font-size: clamp(2.3rem, 11vw, 3.35rem);
  }

  .how-it-works .journey-entry {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .willow-command-component {
    grid-template-columns: 1fr;
    width: 100%;
    min-height: auto;
  }

  .command-card {
    width: 100%;
  }

  .how-it-works .journey-split {
    display: none;
  }

  .how-it-works .journey-paths {
    margin-top: 24px;
  }

  .request-component {
    min-height: 205px;
    margin: 8px 24px 30px;
  }

  .how-it-works .connection-journey {
    padding: 8px 24px 30px;
  }

  .connection-component {
    min-height: 205px;
  }

  .request-component-card,
  .connection-component-card {
    height: 180px;
  }

}

@media (max-width: 460px) {
  .command-card {
    grid-template-columns: 1fr;
  }

  .command-card small {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  .request-component {
    padding: 14px;
  }

  .request-component-card {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .request-progress {
    gap: 4px;
    padding-inline: 10px;
  }

  .connection-profile {
    padding: 20px;
  }

  .connection-portrait {
    width: 68px;
    height: 68px;
  }

  .connection-actions {
    gap: 5px;
    padding-inline: 10px;
  }

}
