/*
 * What moves below the hero: the step drawings (they start once their section is on
 * screen), the scrolling site names, the questions that unfold, the suggestions that
 * arrive one by one.
 */
.art {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 64px;
  margin-bottom: 18px;
}

.art-code span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--raised);
  color: var(--text);
  font-weight: 700;
}

.is-visible .art-code span {
  animation: type-in 4.8s calc(var(--i) * 120ms) ease-out infinite;
}

.art-send {
  position: relative;
  justify-content: space-between;
  width: 200px;
}

.art-send .avatar {
  width: 40px;
  height: 40px;
}

.bubble {
  position: absolute;
  left: 40px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--text);
  color: var(--ground);
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0;
}

.is-visible .bubble {
  animation: send 3.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.art-play {
  gap: 22px;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 40px;
}

.bars i {
  width: 6px;
  height: 30%;
  border-radius: 3px;
  background: var(--pink);
}

.bars + .bars i {
  background: var(--raspberry);
}

.is-visible .bars i {
  animation: bounce 0.9s ease-in-out infinite alternate;
}

.bars i:nth-child(2) { animation-delay: -0.3s; }
.bars i:nth-child(3) { animation-delay: -0.6s; }
.bars i:nth-child(4) { animation-delay: -0.15s; }
.bars i:nth-child(5) { animation-delay: -0.45s; }

/* Site names: the list for screen readers, two rows sliding opposite ways for the eye. */
.site-list {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.marquee {
  display: grid;
  contain: paint;
  gap: 4px;
  margin: 8px 0 28px;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee-row {
  display: flex;
  width: max-content;
  gap: 40px;
  padding-right: 40px;
  font-size: clamp(1.75rem, 3.4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  animation: slide 26s linear infinite;
}

.marquee-row span:nth-child(even) {
  color: transparent;
  -webkit-text-stroke: 1px var(--muted);
}

.marquee-back {
  animation-direction: reverse;
  animation-duration: 32s;
}

.marquee:hover .marquee-row {
  animation-play-state: paused;
}

/* Questions unfold instead of jumping open, where the browser can animate it. */
:root {
  interpolate-size: allow-keywords;
}

.block-body details::details-content {
  height: 0;
  overflow: clip;
  transition: height 0.35s ease, content-visibility 0.35s allow-discrete;
}

.block-body details[open]::details-content {
  height: auto;
}

.block-body summary {
  transition: color 0.2s ease;
  user-select: none;
}

.block-body summary:hover {
  color: var(--pink);
}

.suggestion-list li {
  animation: rise 0.5s calc(var(--i, 0) * 60ms) ease-out both;
}

@keyframes type-in {
  0%, 4% { opacity: 0; transform: translateY(8px); }
  10%, 86% { opacity: 1; transform: none; border-color: var(--pink); }
  30% { border-color: var(--line); }
  94%, 100% { opacity: 0; }
}

@keyframes send {
  0% { opacity: 0; transform: translateX(0) scale(0.8); }
  15% { opacity: 1; transform: translateX(0) scale(1); }
  70% { opacity: 1; transform: translateX(46px) scale(1); }
  85%, 100% { opacity: 0; transform: translateX(62px) scale(0.5); }
}

@keyframes bounce {
  to { height: 100%; }
}

@keyframes slide {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .is-visible .art-code span,
  .is-visible .bubble,
  .is-visible .bars i,
  .marquee-row,
  .suggestion-list li {
    animation: none;
  }

  .bubble {
    opacity: 1;
    transform: translateX(40px);
  }

  .marquee-row {
    flex-wrap: wrap;
    width: auto;
    gap: 6px 32px;
  }

  .marquee-back,
  .marquee-row span:nth-child(n + 8) {
    display: none;
  }

  .block-body details::details-content {
    transition: none;
  }
}
