.hero--agent {
  --data-grid-stream-count: 3;
  --data-grid-dot-opacity: 0.2;
  --data-grid-stream-opacity: 0.44;
}

.hero--agent .hero__content {
  grid-template-columns: minmax(0, 0.74fr) minmax(500px, 1.26fr);
  column-gap: clamp(var(--space-5), 4.4vw, var(--space-9));
  height: 100%;
  min-height: 0;
  align-content: center;
  align-items: stretch;
  padding-top: 0;
  padding-right: 0;
  padding-bottom: 0;
}

.hero-agent__copy {
  max-width: 610px;
  min-width: 0;
  align-self: center;
  padding-block: var(--space-8);
}

.hero-agent-chat,
.hero-agent-chat *,
.hero-agent-chat *::before,
.hero-agent-chat *::after {
  box-sizing: border-box;
}

.hero-agent__eyebrow {
  display: inline-flex;
  align-items: center;
  margin: 0 0 var(--space-4);
  color: rgb(201 208 217 / 72%);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-control);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
}

.hero--agent h1 {
  max-width: 640px;
}

.hero--agent .hero__subtitle {
  max-width: 560px;
}

.hero-agent-chat {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  grid-column: 2;
  grid-row: 1;
  width: min(830px, calc(100% + clamp(var(--space-4), 4vw, var(--space-8))));
  max-width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  align-self: stretch;
  justify-self: end;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  clip-path: inset(0);
  color: var(--color-white);
  isolation: isolate;
}

.hero-agent-chat,
.hero-agent-chat__viewport,
.hero-agent-message,
.hero-agent-message__body,
.hero-agent-tool,
.hero-agent-ideas,
.hero-agent-idea,
.hero-agent-script,
.hero-agent-performance {
  min-width: 0;
  max-width: 100%;
}

.hero-agent-chat {
  max-width: none;
}

.hero-agent-chat:not(.is-complete)::before {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  left: 0;
  height: 52px;
  background: linear-gradient(180deg, rgb(18 22 31 / 86%) 0%, rgb(18 22 31 / 0%) 100%);
  content: "";
  pointer-events: none;
}

.hero-agent-chat__header {
  display: none;
}

.hero-agent-chat__status {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgb(12 178 126);
  box-shadow: 0 0 0 4px rgb(12 178 126 / 12%);
}

.hero-agent-chat__title {
  overflow: hidden;
  color: var(--color-ink);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-control);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-agent-chat__meta {
  color: rgb(103 111 123);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-control);
  white-space: nowrap;
}

.hero-agent-chat__viewport {
  position: relative;
  z-index: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-8) var(--space-6) var(--space-8) var(--space-5);
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

.hero-agent-chat.is-playing .hero-agent-chat__viewport {
  overflow: hidden;
}

.hero-agent-chat.is-playing [data-hero-agent-step]:not(.is-visible) {
  display: none;
}

.hero-agent-chat.is-complete .hero-agent-chat__viewport {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.hero-agent-chat.is-complete .hero-agent-message,
.hero-agent-chat.is-complete .hero-agent-tool,
.hero-agent-chat.is-complete .hero-agent-idea,
.hero-agent-chat.is-complete .hero-agent-performance span,
.hero-agent-chat.is-complete .hero-agent-script > * {
  opacity: 1;
  filter: none;
  transform: none;
  animation: none;
}

.hero-agent-chat__viewport:focus-visible {
  outline: 2px solid rgb(255 255 255 / 22%);
  outline-offset: -4px;
}

.hero-agent-chat__viewport::-webkit-scrollbar {
  width: 10px;
}

.hero-agent-chat__viewport::-webkit-scrollbar-track {
  background: transparent;
}

.hero-agent-chat__viewport::-webkit-scrollbar-thumb {
  border: 3px solid rgb(18 22 31);
  border-radius: var(--radius-pill);
  background: rgb(255 255 255 / 28%);
}

.hero-agent-message,
.hero-agent-tool {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 360ms var(--ease-standard),
    filter 360ms var(--ease-standard),
    transform 460ms var(--ease-standard);
}

.hero-agent-message {
  display: flex;
  flex-direction: column;
  margin: 0 0 var(--space-4);
  filter: none;
}

.hero-agent-chat.is-playing .hero-agent-message,
.hero-agent-chat.is-playing .hero-agent-tool {
  opacity: 0;
  filter: blur(4px);
  transform: translateY(16px);
}

.hero-agent-message.is-visible,
.hero-agent-tool.is-visible,
.hero-agent-chat.is-playing .hero-agent-message.is-visible,
.hero-agent-chat.is-playing .hero-agent-tool.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.hero-agent-message--user {
  align-items: flex-end;
}

.hero-agent-message--user .hero-agent-message__body {
  max-width: min(78%, 420px);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 92%);
  color: rgb(18 22 31);
  font-size: var(--font-size-md);
  line-height: var(--line-height-compact);
  overflow-wrap: anywhere;
  box-shadow: 0 12px 30px rgb(0 0 0 / 16%);
}

.hero-agent-message--assistant {
  align-items: flex-start;
}

.hero-agent-message--assistant .hero-agent-message__body {
  width: min(100%, 690px);
  max-width: 100%;
  padding: 14px 16px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: var(--radius-md);
  background: rgb(237 240 245 / 92%);
  color: rgb(39 46 58);
  font-size: var(--font-size-md);
  line-height: 1.58;
  overflow-wrap: anywhere;
  box-shadow: 0 12px 30px rgb(0 0 0 / 16%);
}

.hero-agent-message__body p {
  margin: 0 0 var(--space-4);
}

.hero-agent-message__body p:last-child {
  margin-bottom: 0;
}

.hero-agent-message__body strong {
  color: rgb(18 22 31);
  font-weight: var(--font-weight-bold);
}

.hero-agent-tool {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 34px;
  width: 100%;
  margin: 0 0 var(--space-2);
  padding: 8px 0;
  color: rgb(201 208 217 / 76%);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  line-height: 1.45;
  filter: none;
  overflow-wrap: anywhere;
}

.hero-agent-tool__visual {
  display: grid;
  width: 34px;
  height: 34px;
  min-width: 0;
  overflow: hidden;
  place-items: center;
}

.hero-agent-tool__visual--channel,
.hero-agent-tool__visual--tool {
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 50%;
  background: rgb(255 255 255 / 8%);
  color: rgb(225 231 240 / 82%);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  line-height: 1;
}

.hero-agent-tool__visual--video {
  position: relative;
  width: 58px;
  height: 39px;
  justify-self: start;
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 18%), rgb(255 255 255 / 6%)),
    rgb(201 208 217 / 16%);
}

.hero-agent-tool__visual--video::before,
.hero-agent-tool__visual--video::after {
  position: absolute;
  inset: 50% auto auto 50%;
  content: "";
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero-agent-tool__visual--video::before {
  width: 32px;
  height: 21px;
  border-radius: 6px;
  background: rgb(18 22 31 / 50%);
}

.hero-agent-tool__visual--video::after {
  width: 9px;
  height: 10px;
  background: rgb(255 255 255 / 88%);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.hero-agent-tool__visual--niche {
  width: 70px;
  overflow: visible;
  place-items: center start;
}

.hero-agent-tool__avatar {
  position: relative;
  display: grid;
  grid-row: 1;
  grid-column: 1;
  width: 34px;
  height: 34px;
  margin-left: calc(var(--stack-index, 0) * 12px);
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 12%);
  outline: 1px solid rgb(18 22 31 / 72%);
  border-radius: 50%;
  background: rgb(244 245 247 / 92%);
  color: rgb(84 93 106);
  font-size: 10px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
  place-items: center;
  z-index: calc(4 - var(--stack-index, 0));
}

.hero-agent-tool__avatar:nth-child(2) {
  --stack-index: 1;
}

.hero-agent-tool__avatar:nth-child(3) {
  --stack-index: 2;
}

.hero-agent-tool__content {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.hero-agent-tool__title {
  position: relative;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  color: rgb(223 229 238 / 86%);
  font-size: inherit;
  font-weight: var(--font-weight-medium);
  line-height: inherit;
  vertical-align: top;
}

.hero-agent-tool.is-running .hero-agent-tool__title::after {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgb(223 229 238 / 0%) 18%,
    rgb(255 255 255 / 92%) 48%,
    rgb(255 255 255 / 92%) 52%,
    rgb(223 229 238 / 0%) 82%,
    transparent 100%
  );
  background-repeat: no-repeat;
  background-size: 46px 100%;
  background-position: -56px 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  content: attr(data-activity-title);
  animation: hero-agent-tool-title-shimmer 1450ms linear infinite;
  pointer-events: none;
  will-change: background-position;
}

.hero-agent-tool__meta {
  overflow: hidden;
  color: rgb(169 177 190 / 66%);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-agent-tool strong {
  display: inline-block;
  min-width: 2ch;
  color: rgb(255 255 255 / 94%);
  font-variant-numeric: tabular-nums;
}

.hero-agent-ideas {
  display: grid;
  gap: 10px;
  margin-top: var(--space-4);
}

.hero-agent-idea {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 10px;
  padding: 12px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 76%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 60%);
  color: rgb(55 64 78);
}

.hero-agent-message.is-visible .hero-agent-idea,
.hero-agent-message.is-visible .hero-agent-performance span,
.hero-agent-message.is-visible .hero-agent-script > * {
  animation: hero-agent-detail-in 420ms var(--ease-standard) both;
  animation-delay: var(--hero-agent-detail-delay, 0ms);
}

.hero-agent-message.is-visible .hero-agent-idea:nth-child(2),
.hero-agent-message.is-visible .hero-agent-performance span:nth-child(2),
.hero-agent-message.is-visible .hero-agent-script > :nth-child(2) {
  --hero-agent-detail-delay: 90ms;
}

.hero-agent-message.is-visible .hero-agent-idea:nth-child(3),
.hero-agent-message.is-visible .hero-agent-performance span:nth-child(3),
.hero-agent-message.is-visible .hero-agent-script > :nth-child(3) {
  --hero-agent-detail-delay: 180ms;
}

.hero-agent-message.is-visible .hero-agent-performance span:nth-child(4),
.hero-agent-message.is-visible .hero-agent-script > :nth-child(4) {
  --hero-agent-detail-delay: 270ms;
}

.hero-agent-message.is-visible .hero-agent-script > :nth-child(5) {
  --hero-agent-detail-delay: 360ms;
}

.hero-agent-idea__rank {
  grid-row: 1 / 3;
  display: grid;
  width: 28px;
  height: 28px;
  align-self: start;
  border-radius: 50%;
  background: rgb(18 22 31 / 8%);
  color: rgb(84 93 106);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  line-height: 1;
  place-items: center;
}

.hero-agent-idea strong {
  min-width: 0;
  color: rgb(18 22 31);
  font-size: var(--font-size-md);
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.hero-agent-idea > span:last-child {
  color: rgb(84 93 106);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-control);
}

.hero-agent-script {
  padding: 0 0 0 var(--space-4);
  border-left: 2px solid rgb(18 22 31 / 14%);
  color: rgb(55 64 78);
}

.hero-agent-script__label {
  display: inline-flex;
  margin-bottom: 10px;
  color: rgb(84 93 106);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-wide);
  line-height: var(--line-height-control);
  text-transform: uppercase;
}

.hero-agent-script h2 {
  margin: 0 0 var(--space-3);
  color: rgb(18 22 31);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.hero-agent-script ol {
  margin: 0 0 var(--space-3);
  padding-left: 1.3rem;
}

.hero-agent-script li {
  margin: 0 0 6px;
}

.hero-agent-performance {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: var(--space-4);
}

.hero-agent-performance span {
  display: grid;
  gap: 2px;
  padding: 12px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 72%);
  color: rgb(84 93 106);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-control);
}

.hero-agent-performance strong {
  display: block;
  color: rgb(18 22 31);
  font-size: var(--font-size-2xl);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--letter-spacing-tight);
  line-height: var(--line-height-none);
}

.hero-agent-chat:not(.is-complete)::after {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  height: 64px;
  background: linear-gradient(180deg, rgb(18 22 31 / 0%) 0%, rgb(18 22 31 / 82%) 100%);
  content: "";
  pointer-events: none;
}

@keyframes hero-agent-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes hero-agent-tool-title-shimmer {
  from {
    background-position: -56px 0;
  }

  to {
    background-position: calc(100% + 56px) 0;
  }
}

@keyframes hero-agent-detail-in {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero--agent .hero__content {
    grid-template-columns: minmax(0, 0.78fr) minmax(430px, 1.22fr);
    column-gap: var(--space-5);
    padding-right: 0;
    padding-left: var(--space-7);
  }

  .hero-agent-chat {
    width: min(760px, calc(100% + var(--space-5)));
    justify-self: end;
  }
}

@media (max-width: 820px) {
  .hero--agent .hero__content {
    min-height: 700px;
  }

  .hero-agent-chat {
    height: 600px;
  }
}

@media (max-width: 600px) {
  .hero--agent {
    height: auto;
    min-height: 0;
  }

  .hero--agent .hero__content {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    min-height: 0;
    overflow: hidden;
    padding: var(--space-6) var(--space-4);
  }

  .hero-agent__copy {
    width: 100%;
    max-width: none;
    padding-block: 0;
  }

  .hero-agent__eyebrow {
    margin-bottom: var(--space-3);
    font-size: 10px;
  }

  .hero--agent h1 {
    font-size: 34px;
    line-height: 1.08;
  }

  .hero-agent-chat {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    max-width: 100%;
    height: min(610px, 72vh);
    margin-top: var(--space-6);
    margin-right: 0;
    margin-left: 0;
    border-radius: var(--radius-md);
    justify-self: start;
  }

  .hero-agent-chat__header {
    min-height: 52px;
    padding: 0 var(--space-4);
  }

  .hero-agent-chat__meta {
    display: none;
  }

  .hero-agent-chat__viewport {
    padding: var(--space-4) 64px var(--space-4) var(--space-4);
  }

  .hero-agent-message {
    width: 100%;
  }

  .hero-agent-tool {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 8px;
    font-size: var(--font-size-md);
  }

  .hero-agent-tool__visual--niche {
    width: 52px;
  }

  .hero-agent-tool__avatar {
    width: 30px;
    height: 30px;
    margin-left: calc(var(--stack-index, 0) * 9px);
  }

  .hero-agent-tool__visual--video {
    width: 48px;
    height: 32px;
  }

  .hero-agent-tool__title,
  .hero-agent-tool__meta {
    display: block;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .hero--agent .hero__subtitle {
    max-width: min(100%, 30ch);
  }

  .hero-agent-message--user .hero-agent-message__body {
    max-width: 74%;
  }

  .hero-agent-message--assistant .hero-agent-message__body {
    width: calc(100% - var(--space-3));
    padding: 13px 14px;
  }

  .hero-agent-idea {
    padding: 10px;
  }

  .hero-agent-script {
    padding-left: var(--space-3);
  }

  .hero-agent-script h2 {
    font-size: var(--font-size-lg);
  }

  .hero-agent-performance strong {
    font-size: var(--font-size-xl);
  }

  .hero-agent-performance {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-agent-message,
  .hero-agent-tool,
  .hero-agent-message.is-visible .hero-agent-idea,
  .hero-agent-message.is-visible .hero-agent-performance span,
  .hero-agent-message.is-visible .hero-agent-script > *,
  .hero-agent-tool__title::after {
    animation: none !important;
    transition: none !important;
  }
}
