/* The DeedOS page: the conversation, the connected flow, and the hard-parts rows. */

.hero.hero-wide {
  align-items: center;
}

/* The conversation plays once on load */

.chat {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.msg {
  padding: 0.7rem 0.95rem;
  border-radius: 12px;
}

.msg-you {
  justify-self: end;
  background: var(--ink);
  color: var(--sheet);
  font-weight: 500;
}

.msg-agent {
  border: 1px solid var(--panel-line);
}

.msg-from {
  display: block;
  color: var(--panel-label);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.msg-agent .panel-rows {
  margin: 0.25rem 0 0.5rem;
}

.msg-wait {
  font-weight: 600;
}

@media (prefers-reduced-motion: no-preference) {
  .msg {
    animation: arrive 0.6s var(--ease) backwards;
  }

  .msg-you {
    animation-delay: 0.5s;
  }

  .msg-agent {
    animation-delay: 1.5s;
  }

  @keyframes arrive {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
  }
}

/* The connected flow: a vertical rail on phones, a horizontal rail on wide screens */

.flow {
  list-style: none;
  padding: 0 0 0 1.5rem;
  position: relative;
  display: grid;
  gap: 1.75rem;
}

.flow::before {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 1px;
  background: rgba(12, 14, 19, 0.35);
}

.flow::after {
  content: "";
  position: absolute;
  left: calc(0.3rem - 3px);
  top: 0.4rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sheet);
  box-shadow: 0 0 12px 3px rgba(255, 255, 255, 0.8);
  animation: flow-down 12s linear infinite;
}

@keyframes flow-down {
  to {
    top: calc(100% - 0.4rem);
  }
}

.node {
  position: relative;
}

.node::before {
  content: "";
  position: absolute;
  left: calc(-1.2rem - 4px);
  top: 0.4rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--violet);
  border: 2px solid var(--ink);
}

.node.is-human::before {
  background: var(--ink);
  border-color: var(--ink);
}

.node h3 {
  margin-bottom: 0.25rem;
}

.node .chip {
  display: block;
  width: fit-content;
  margin-top: 0.4rem;
  font-size: 0.875rem;
  color: var(--ink);
  border-color: rgba(12, 14, 19, 0.4);
}

.saved {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.flow-key {
  margin-top: 2.5rem;
}

/* The hard parts: what goes wrong, and what DeedOS does about it */

.pairs-head {
  display: none;
}

.pair {
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}

.pair dt {
  color: var(--slate);
  margin-bottom: 0.2rem;
}

.pair dd {
  margin: 0;
  font-weight: 500;
}

.record-wide {
  margin-top: 1rem;
}

@media (min-width: 48em) {
  .pairs-head,
  .pair {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 2rem;
  }

  .pairs-head {
    color: var(--slate);
    font-size: 0.9375rem;
    padding-bottom: 0.75rem;
  }

  .pair dt {
    margin-bottom: 0;
  }
}

@media (min-width: 62em) {
  .hero.hero-wide {
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
  }

  .hero-wide h1 {
    font-size: 4.25rem;
  }

  .flow {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1.5rem;
    padding: 1.75rem 0 0;
  }

  .flow::before {
    left: 0;
    right: 0;
    top: 0.3rem;
    bottom: auto;
    width: auto;
    height: 1px;
  }

  .flow::after {
    top: calc(0.3rem - 3px);
    left: 0;
    animation-name: flow-across;
  }

  @keyframes flow-across {
    to {
      left: 100%;
    }
  }

  .node::before {
    left: 0;
    top: calc(-1.45rem - 4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow::after {
    display: none;
  }
}
