/* "Why Bari?" — two-column chaos/solution. Chat messages and bullets
   fade in staggered, synced pairwise (bullet N appears with message N),
   triggered once when the section enters view. */

.why-bari {
  padding-block: var(--space-8);
  background: var(--color-am-bg);
}

.why-bari-heading {
  font-size: clamp(1.5rem, 3vw, 2rem);
  text-align: center;
  margin-bottom: var(--space-7);
}

.why-bari .container {
  display: grid;
  gap: var(--space-7);
}

@media (min-width: 768px) {
  .why-bari .container {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* Chat mock */
.chat-mock {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.chat-mock-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.chat-avatars {
  display: flex;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-left: -8px;
  border: 2px solid var(--color-surface);
}

.chat-avatar:first-child {
  margin-left: 0;
}

.chat-mock-title {
  font-weight: 600;
  font-size: 0.9375rem;
}

.chat-mock-subtitle {
  font-size: 0.8125rem;
  opacity: 0.7;
}

.chat-messages {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.bmsg {
  max-width: 80%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.bmsg-in {
  align-self: flex-start;
  background: var(--color-am-bg);
  border-bottom-left-radius: var(--space-1);
}

.bmsg-out {
  align-self: flex-end;
  background: var(--color-amber-text);
  color: #fff;
  border-bottom-right-radius: var(--space-1);
}

.bmsg-sender {
  display: block;
  font-weight: 600;
  font-size: 0.8125rem;
  margin-bottom: var(--space-1);
}

.sender-priya {
  color: #9C3F7D;
}

.sender-arjun {
  color: #2E63A0;
}

/* Bullets */
.why-bullets {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  justify-content: center;
}

.why-bullet {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.why-bullet-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  color: var(--color-amber-text);
}

.why-bullet-icon svg {
  width: 100%;
  height: 100%;
}

.why-bullet-text {
  font-size: 1rem;
  padding-top: var(--space-1);
}

/* Staggered reveal, synced pairwise between chat and bullets. Only runs
   once the parent section is in view (.why-bari.is-visible, set by
   main.js's IntersectionObserver). */
@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(var(--reveal-distance));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-messages .bmsg,
.why-bullets .why-bullet {
  opacity: 0;
}

.why-bari.is-visible .chat-messages .bmsg,
.why-bari.is-visible .why-bullets .why-bullet {
  animation: msgIn var(--reveal-duration) var(--reveal-ease) forwards;
}

.chat-messages .bmsg:nth-child(1),
.why-bullets .why-bullet:nth-child(1) { animation-delay: 80ms; }
.chat-messages .bmsg:nth-child(2),
.why-bullets .why-bullet:nth-child(2) { animation-delay: 200ms; }
.chat-messages .bmsg:nth-child(3),
.why-bullets .why-bullet:nth-child(3) { animation-delay: 320ms; }
.chat-messages .bmsg:nth-child(4),
.why-bullets .why-bullet:nth-child(4) { animation-delay: 440ms; }
.chat-messages .bmsg:nth-child(5),
.why-bullets .why-bullet:nth-child(5) { animation-delay: 560ms; }

@media (prefers-reduced-motion: reduce) {
  .chat-messages .bmsg,
  .why-bullets .why-bullet {
    opacity: 1;
  }
}
