/* The hero demo, "the first text": under the headline, Dimpy peeks over a chat card, thinks, and sends a real-looking
   thread. Each grey text flies out of its head into place, its eyes follow, your reply pops in from the right.
   A new thread each visit (hero.js). Plays once. Reduced motion: the whole thread is there and the mark is still. */

.hero-body { gap: 1.25rem; padding-bottom: 1.5rem; }
.demo { position: relative; width: min(100%, 22rem); margin-top: 3.4rem; padding: 1rem 0.9rem 1.1rem; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 1.25rem; box-shadow: var(--shadow); }
.demo .hm { --blink: paused; position: absolute; left: 1rem; top: -3rem; width: 4.5rem; height: 4.5rem; --edge: transparent; }
.demo .bubbles { margin-top: 0; padding: 0; }
.demo .when { margin-top: 0; }
.dots { position: absolute; left: 5.1rem; top: -1.6rem; display: flex; gap: 0.22rem; opacity: 0; }
/* The sub's three words light up as each text goes out (the same tomato tint as the site's <mark>). */
.hl { --hl: color-mix(in srgb, var(--tomato) 32%, transparent); border-radius: 3px; color: var(--ink); background: var(--hl); box-shadow: 0 0 0 0.12em var(--hl); }
.dots i { width: 0.42rem; height: 0.42rem; border-radius: 50%; background: var(--muted); }

@media (min-width: 56rem) {
  .hero-body { grid-template-columns: minmax(0, 1fr) 27rem; column-gap: 4rem; max-width: 68rem; width: 100%; margin: 0 auto; justify-items: start; text-align: left; padding-inline: 2rem; }
  .hero-body > :not(.demo) { grid-column: 1; }
  .hero-body h1 { text-wrap: balance; }
  .demo { grid-column: 2; grid-row: 1 / span 3; align-self: center; width: 100%; padding: 1.25rem 1.1rem 1.4rem; }
  .demo .b { font-size: 1.05rem; }
  .demo .when { font-size: 0.72rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .demo { animation: arrive 0.5s var(--snap) 1.2s both; }
  .demo .fly { transform-origin: 0 0; animation: fly 0.55s var(--snap) var(--t) both; }
  .demo .pop { animation: arrive 0.35s var(--snap) var(--t) both; }
  .hl { animation: lit 0.4s ease-out var(--t) both; }
  .demo .when { animation: arrive 0.3s ease-out 1.6s both; }
  .demo .dots { animation: dots-on 1.2s linear 1.4s both; }
  .demo .dots i { animation: bob 0.6s ease-in-out 1.4s 2 alternate; }
  .demo .dots i:nth-child(2) { animation-delay: 1.55s; } .demo .dots i:nth-child(3) { animation-delay: 1.7s; }
  /* One timeline for the mark (6s): round eyes from the start, a hop as each text leaves, the eyes follow the
     texts down, glance right at your reply, and it ends on the logo's happy face. */
  .demo .hm { animation: send-a 6s linear both; }
}
@keyframes fly {
  from { opacity: 0; transform: translate(0.4rem, calc(-2.2rem - var(--i, 0) * 1rem)) scale(0.15); }
  50% { opacity: 1; }
}
.fly:nth-child(3) { --i: 1; } .fly:nth-child(5) { --i: 3; }
@keyframes lit { from { background: transparent; box-shadow: 0 0 0 0.12em transparent; color: inherit; } }
@keyframes dots-on { 0% { opacity: 0; } 15%, 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bob { to { transform: translateY(-4px); } }
@keyframes send-a {
  0% { --happy: 0; --px: 0px; --py: 0px; --hide: 0px; }
  23% { --px: 1.5px; --py: -2px; --hide: 0px; }
  35% { --px: 1px; --py: 2px; --hide: 0px; }
  37% { --hide: -5px; } 41% { --hide: 0px; }
  50% { --hide: -5px; } 54% { --py: 2.5px; --px: 1px; --hide: 0px; }
  67% { --px: 2.5px; --py: 1.5px; }
  81% { --px: 1px; --py: 2px; --hide: 0px; }
  83% { --hide: -5px; } 87% { --hide: 0px; --happy: 0; }
  93%, 100% { --happy: 1; --px: 0px; --py: 0px; }
}
}
