/* Homepage Lab Voice: a real, deliberately limited guest rehearsal. */
.scene-console-body.is-voice-demo {
  display: block;
  padding: 0;
}

.voice-demo-console {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(135deg, rgba(54, 209, 127, 0.08), transparent 34%),
    radial-gradient(circle at 88% 16%, rgba(245, 198, 92, 0.12), transparent 28%),
    rgba(255, 255, 255, 0.055);
}

.voice-demo-stage {
  position: relative;
  display: grid;
  justify-items: stretch;
  align-content: start;
  min-height: 560px;
  padding: clamp(32px, 5vw, 56px) clamp(24px, 5vw, 58px) 38px;
  overflow: hidden;
  text-align: left;
}

.voice-demo-stage::before {
  content: "";
  position: absolute;
  top: 24px;
  right: 26px;
  bottom: 24px;
  left: 26px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left-color: rgba(54, 209, 127, 0.42);
  background: none;
  opacity: 0.8;
  pointer-events: none;
}

.voice-demo-title {
  position: relative;
  z-index: 1;
  max-width: 570px;
  padding-left: 18px;
}

.voice-demo-title h3 {
  margin: 10px 0 0;
  color: #fff;
  font-family: var(--heading);
  font-size: clamp(1.7rem, 3.2vw, 2.65rem);
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.voice-demo-title p {
  max-width: 520px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.86rem;
  line-height: 1.5;
}

.voice-demo-steps {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 28px 0 0;
  padding: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  list-style: none;
}

.voice-demo-steps li {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1px 10px;
  min-width: 0;
  padding: 15px 14px;
  color: rgba(255, 255, 255, 0.42);
  transition: color 180ms ease, background 180ms ease;
}

.voice-demo-steps li + li { border-left: 1px solid rgba(255, 255, 255, 0.1); }

.voice-demo-steps li > span {
  grid-row: 1 / 3;
  color: rgba(255, 255, 255, 0.28);
  font-family: var(--heading);
  font-size: 0.72rem;
  font-weight: 850;
}

.voice-demo-steps strong {
  font-family: var(--heading);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.voice-demo-steps small { font-size: 0.64rem; }

.voice-demo-steps li.is-active {
  color: #fff;
  background: rgba(54, 209, 127, 0.09);
}

.voice-demo-steps li.is-active > span { color: var(--green); }
.voice-demo-steps li.is-complete { color: rgba(255, 255, 255, 0.72); }
.voice-demo-steps li.is-complete > span { color: var(--gold); }

.voice-demo-wave {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  width: 100%;
  min-height: 76px;
  margin: 16px 0 4px;
  padding-left: 18px;
}

.voice-demo-wave i {
  width: 3px;
  height: var(--bar-height, 18px);
  border-radius: 999px;
  background: linear-gradient(180deg, #d8ffb7, var(--green));
  opacity: 0.34;
  transform-origin: center;
}

.voice-demo-wave i:nth-child(3n + 1) { --bar-height: 26px; }
.voice-demo-wave i:nth-child(4n + 2) { --bar-height: 42px; }
.voice-demo-wave i:nth-child(5n + 3) { --bar-height: 58px; }
.voice-demo-wave i:nth-child(7n + 4) { --bar-height: 34px; }

.voice-demo-stage.is-active .voice-demo-wave i {
  opacity: 0.9;
  animation: voice-demo-pulse 820ms ease-in-out infinite alternate;
}

.voice-demo-stage.is-speaking .voice-demo-wave i {
  background: linear-gradient(180deg, #fff1b8, var(--gold));
}

.voice-demo-stage.is-active .voice-demo-wave i:nth-child(2n) { animation-delay: -260ms; }
.voice-demo-stage.is-active .voice-demo-wave i:nth-child(3n) { animation-delay: -510ms; }
.voice-demo-stage.is-active .voice-demo-wave i:nth-child(5n) { animation-delay: -130ms; }

@keyframes voice-demo-pulse {
  from { transform: scaleY(0.42); }
  to { transform: scaleY(1.08); }
}

.voice-demo-status {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 0;
  color: rgba(255, 255, 255, 0.72);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.78rem;
  text-align: left;
}

.voice-demo-status strong {
  color: #fff;
  font-family: var(--heading);
  font-variant-numeric: tabular-nums;
}

.voice-demo-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(54, 209, 127, 0.12);
}

.voice-demo-stage.is-speaking .voice-demo-status-dot {
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(245, 198, 92, 0.14);
}

.voice-demo-stage.is-error .voice-demo-status-dot {
  background: #ff7f75;
  box-shadow: 0 0 0 5px rgba(255, 127, 117, 0.12);
}

.voice-demo-transcript {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  text-align: left;
}

.voice-demo-transcript[hidden] { display: none; }

.voice-demo-transcript-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.voice-demo-transcript-head strong {
  color: #fff;
  font-family: var(--heading);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.voice-demo-transcript-head span {
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.65rem;
}

.voice-demo-transcript-lines {
  display: grid;
  gap: 9px;
  max-height: 138px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.voice-demo-transcript-line {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.75rem;
  line-height: 1.45;
}

.voice-demo-transcript-line strong {
  color: var(--green);
  font-family: var(--heading);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.voice-demo-transcript-line.is-ava strong { color: var(--gold); }

.voice-demo-transcript-line span { overflow-wrap: anywhere; }

.voice-demo-consent {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 18px auto 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}

.voice-demo-consent input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: var(--green);
}

.voice-demo-controls {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 22px;
}

.voice-demo-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: auto;
  min-width: 188px;
  min-height: 58px;
  padding: 0 22px;
  color: #08251a;
  background: var(--green);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  font-family: var(--heading);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.1;
}

.voice-demo-start i {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(8, 37, 26, 0.12);
  font-size: 0.95rem;
}

.voice-demo-start:hover,
.voice-demo-start:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.3);
  outline: none;
}

.voice-demo-start:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.voice-demo-start[hidden],
.voice-demo-secondary[hidden],
.voice-demo-consent[hidden] {
  display: none;
}

.voice-demo-secondary {
  min-height: 44px;
  padding: 0 16px;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 750;
}

.voice-demo-secondary:hover,
.voice-demo-secondary:focus-visible {
  border-color: var(--green);
  outline: none;
}

.voice-demo-used {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 22px;
  padding-top: 20px;
  color: rgba(255, 255, 255, 0.68);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.78rem;
}

.voice-demo-used[hidden] { display: none; }

.voice-demo-used strong {
  color: #fff;
  font-family: var(--heading);
  font-size: 1.05rem;
}

.voice-demo-used a {
  margin-top: 4px;
  color: var(--green);
  font-family: var(--heading);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 720px) {
  .voice-demo-stage {
    min-height: 0;
    padding: 34px 18px 30px;
  }

  .voice-demo-wave {
    min-height: 66px;
    gap: 4px;
  }

  .voice-demo-steps li { padding: 12px 8px; }
  .voice-demo-steps small { display: none; }
  .voice-demo-steps strong { font-size: 0.67rem; }
  .voice-demo-start { width: 100%; }

  .voice-demo-controls {
    flex-wrap: wrap;
  }

  .voice-demo-status {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .voice-demo-status strong {
    grid-column: 2;
  }

  .voice-demo-transcript-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .voice-demo-stage.is-active .voice-demo-wave i {
    animation: none;
  }
}
