@charset "UTF-8";

/* ==========================================================================
   Суфлёр — оформление, взятое у самого приложения.
   Плашка повторяет его окно: тёмный фон, чёлка сверху, зелёная подсветка
   прозвучавшего и живая звуковая волна снизу.
   ========================================================================== */

.demo {
  padding: clamp(2.5rem, 7vh, 4.5rem) 0;
  border-top: 1px solid var(--line);
}

.demo__stage {
  margin-top: 2rem;
}

/* Окно суфлёра тёмное всегда — оно такое и в жизни, в обеих темах системы. */
.demo__plate {
  position: relative;
  max-width: 860px;
  margin-inline: auto;
  border-radius: 22px;
  padding: clamp(2.5rem, 5vw, 3.25rem) clamp(1.5rem, 4vw, 2.75rem) clamp(1.25rem, 3vw, 1.75rem);
  background: radial-gradient(120% 100% at 50% 0%, #1b1f24 0%, #0d0f12 55%, #08090b 100%);
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 26px 70px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Та самая «чёлка» с иконки — намёк, где окно живёт на экране. */
.demo__notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(120px, 22%, 210px);
  height: 26px;
  background: #000;
  border-radius: 0 0 16px 16px;
}

.demo__script {
  max-width: 34ch;
  margin-inline: auto;
}

.demo__line {
  font-size: clamp(1.05rem, 2.3vw, 1.62rem);
  line-height: 1.62;
  letter-spacing: -0.01em;
  color: #464c54;
  margin-bottom: 0.7rem;
  transition: color 0.4s var(--ease);
}

.demo__word {
  border-radius: 5px;
  padding: 0.05em 0.14em;
  margin: 0 -0.04em;
  transition: color 0.3s var(--ease), background-color 0.3s var(--ease);
}

/* Уже прозвучало — приглушённо-светлое. */
.demo__word.is-said {
  color: #8f969f;
}

/* Звучит сейчас — зелёный маркер приложения. */
.demo__word.is-now {
  background: #6be08c;
  color: #07130c;
  font-weight: 500;
}

/* Оговорка: Суфлёр вернулся назад и ждёт. */
.demo__word.is-back {
  background: color-mix(in srgb, #6be08c 28%, transparent);
  color: #cfead8;
}

/* --- звуковая волна ----------------------------------------------------- */

.demo__wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 30px;
  margin-top: clamp(1.25rem, 3vw, 1.75rem);
}

.demo__wave i {
  width: 3px;
  height: 4px;
  border-radius: 99px;
  background: #6be08c;
  opacity: 0.32;
  transform-origin: center;
  transition: opacity 0.3s var(--ease);
}

/* Говорим — волна дышит. Пауза — почти замирает. */
.demo__stage.is-speaking .demo__wave i {
  opacity: 0.9;
  animation: sufler-wave 0.75s var(--ease) infinite alternate;
  animation-delay: calc(var(--i) * 0.045s);
}

.demo__stage.is-paused .demo__wave i {
  opacity: 0.22;
  animation: sufler-idle 2.4s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * 0.05s);
}

@keyframes sufler-wave {
  from {
    transform: scaleY(1);
  }
  to {
    transform: scaleY(calc(1.5 + var(--i) % 5 * 1.3));
  }
}

@keyframes sufler-idle {
  from {
    transform: scaleY(1);
  }
  to {
    transform: scaleY(1.7);
  }
}

.demo__hint {
  margin-top: 1.25rem;
  font-size: 0.88rem;
  color: var(--ink-3);
  max-width: 52ch;
  margin-inline: auto;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .demo__wave i {
    animation: none !important;
  }
}
