/* Motion explains a workflow; content stays readable without scripting. */
.scene-console {
  position: relative;
  grid-row: 1;
  grid-column: 1 / -1;
  padding: 16px;
  margin-top: 22px;
  overflow: hidden;
  background: linear-gradient(
    125deg,
    var(--mb-white),
    var(--mb-surface) 62%,
    var(--mb-surface)
  );
  border: 1px solid var(--mb-line);
  border-radius: 22px;
  box-shadow: 0 12px 36px color-mix(in srgb, var(--mb-panel) 3.14%, transparent);
}
.scene-console-top {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.scene-kicker {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  font-size: 14px;
  font-weight: 750;
  color: var(--mb-panel-raised);
}
.scene-dot {
  width: 8px;
  height: 8px;
  background: var(--mb-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--mb-accent) 7.06%, transparent);
}
.scene-count {
  font:
    600 12px / 1.5 ui-monospace,
    monospace;
  color: var(--mb-muted);
  white-space: nowrap;
}
.scene-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  margin: 20px 0;
  list-style: none;
}
.scene-steps button {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 58px;
  padding: 9px;
  font: inherit;
  font-size: 13px;
  color: var(--mb-muted);
  text-align: left;
  cursor: pointer;
  background: color-mix(in srgb, var(--mb-white) 72.16%, transparent);
  border: 1px solid var(--mb-line);
  border-radius: 12px;
  transition:
    background 0.25s,
    border-color 0.25s,
    box-shadow 0.25s;
}
.scene-step-number {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 28px;
  height: 28px;
  font:
    600 11px ui-monospace,
    monospace;
  background: var(--mb-subtle);
  border-radius: 50%;
}
.scene-steps [aria-current="step"] {
  color: var(--mb-white);
  background: var(--mb-panel);
  border-color: var(--mb-panel);
  box-shadow: 0 5px 16px color-mix(in srgb, var(--mb-panel) 12.55%, transparent);
}
.scene-steps [aria-current="step"] .scene-step-number {
  color: var(--mb-panel-raised);
  background: var(--mb-line-strong);
}
.scene-steps [data-complete="true"] .scene-step-number {
  color: var(--mb-accent);
  background: var(--mb-line);
}
.scene-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}
.scene-description {
  display: flex;
  align-items: center;
  max-width: 530px;
  min-height: 46px;
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--mb-panel-raised);
}
.scene-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 8px;
}
.scene-actions button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  color: var(--mb-panel-raised);
  cursor: pointer;
  background: var(--mb-white);
  border: 1px solid var(--mb-line-strong);
  border-radius: 999px;
}
.scene-actions [data-scene-action="play"] {
  min-width: 104px;
  color: var(--mb-white);
  background: var(--mb-panel-raised);
  border-color: var(--mb-panel-raised);
}
.scene-actions button:disabled {
  cursor: default;
  opacity: 0.4;
}
.scene-console button:focus-visible {
  outline: 3px solid var(--mb-muted);
  outline-offset: 4px;
}
.scene-disclaimer {
  max-width: 850px;
  margin: 14px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--mb-muted);
}
.scene-ready .workspace-preview,
.scene-ready .phone-preview {
  transition:
    box-shadow 0.4s,
    border-color 0.4s;
}
.scene-ready .flow-node,
.scene-ready .knowledge,
.scene-ready .agent-instruction,
.scene-ready .agent-bottom,
.scene-ready .customer-panel,
.scene-ready .campaign-steps span,
.scene-ready .mini-table,
.scene-ready .coupon-strip,
.scene-ready .handoff-note {
  transition:
    opacity 0.35s,
    box-shadow 0.35s,
    transform 0.35s;
}
.scene-ready .phone-chat > * {
  transition:
    opacity 0.45s,
    transform 0.45s;
}
.scene-ready[data-scene-step="0"] .phone-chat > :nth-child(n + 2),
.scene-ready[data-scene-step="1"] .phone-chat > :nth-child(n + 3) {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
}
.scene-ready[data-scene-step="1"] .knowledge,
.scene-ready[data-scene-step="2"] .agent-instruction,
.scene-ready[data-scene-step="3"] .agent-bottom,
.scene-ready[data-scene-step="1"] .customer-panel,
.scene-ready[data-scene-step="3"] .handoff-note,
.scene-ready[data-scene-step="3"] .mini-table,
.scene-ready[data-scene-step="2"] .coupon-strip {
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--mb-muted) 18.04%, transparent),
    0 8px 24px color-mix(in srgb, var(--mb-panel-raised) 3.92%, transparent);
}
#panel-flow[data-scene-step="0"] .flow-node:nth-child(1),
#panel-flow[data-scene-step="1"] .flow-node:nth-child(3),
#panel-flow[data-scene-step="2"] .branch .flow-node:first-child,
#panel-flow[data-scene-step="3"] .branch .flow-node:last-child {
  border-color: var(--mb-muted);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--mb-muted) 14.9%, transparent);
}
.scene-ready[data-scene-playing="true"] .scene-dot {
  animation: signal-pulse 1.3s ease-in-out infinite;
}
.scene-ready[data-scene-playing="true"][data-scene-step="1"] .agent-avatar {
  animation: knowledge-pulse 1.2s ease-in-out infinite;
}
#panel-games.scene-ready[data-scene-step="1"] .wheel {
  transform: rotate(585deg);
  transition: transform 2.2s cubic-bezier(0.15, 0.6, 0.15, 1);
}
#panel-games.scene-ready:not([data-scene-step="1"]) .wheel {
  transform: rotate(0deg);
  transition: none;
}
.scene-ready[data-scene-playing="false"] *,
.scene-ready[hidden] * {
  animation-play-state: paused !important;
}
@keyframes signal-pulse {
  50% {
    box-shadow: 0 0 0 7px
      color-mix(in srgb, var(--mb-accent) 3.14%, transparent);
    opacity: 0.5;
  }
}
@keyframes knowledge-pulse {
  50% {
    box-shadow: 0 0 0 9px
      color-mix(in srgb, var(--mb-accent-light) 13.33%, transparent);
    transform: scale(1.04);
  }
}
@keyframes enter-scene {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-copy {
    animation: enter-scene 0.75s ease both;
  }
  .visual-sample {
    animation: enter-scene 0.9s 0.12s ease both;
  }
  .scroll-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity 0.65s ease,
      transform 0.65s ease;
  }
  .scroll-reveal.is-revealed {
    opacity: 1;
    transform: translateY(0);
  }
  .button {
    transition:
      transform 0.2s,
      box-shadow 0.2s,
      background 0.2s;
  }
  .button:hover {
    box-shadow: 0 9px 24px
      color-mix(in srgb, var(--mb-panel-raised) 10.2%, transparent);
    transform: translateY(-2px);
  }
  .channel-network .channel {
    transition:
      transform 0.25s,
      box-shadow 0.25s;
  }
  .channel-network .channel:hover {
    box-shadow: 0 12px 28px
      color-mix(in srgb, var(--mb-panel-raised) 8.24%, transparent);
    transform: translateY(-5px);
  }
}
@media (max-width: 900px) {
  .scene-footer {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .scene-console {
    padding: 20px;
  }
  .scene-actions {
    flex-wrap: wrap;
  }
}
@media (max-width: 600px) {
  .scene-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0;
  }
  .scene-steps button {
    min-height: 68px;
    padding: 10px;
    font-size: 12px;
  }
  .scene-console {
    padding: 16px;
    border-radius: 16px;
  }
  .scene-kicker {
    font-size: 13px;
  }
  .scene-actions {
    gap: 6px;
    width: 100%;
  }
  .scene-actions button {
    padding: 10px 12px;
  }
  .scene-disclaimer {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .scene-ready[data-scene-step] *,
  .scroll-reveal,
  .hero-copy,
  .visual-sample {
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}
@media print {
  .scene-console {
    display: none;
  }
  .scene-ready .phone-chat > * {
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .scroll-reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Knowledge lookup precedes the AI reply; the visible dots explain the wait. */
#panel-ai.scene-ready[data-scene-step="1"] .phone-chat > :nth-child(n + 2),
#panel-inbox.scene-ready[data-scene-step="1"] .phone-chat > :nth-child(n + 2),
#panel-games.scene-ready[data-scene-step="1"] .reward-card {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}
#panel-ai.scene-ready .phone-chat {
  position: relative;
}
#panel-ai.scene-ready[data-scene-step="1"] .phone-chat::after {
  position: absolute;
  bottom: 20px;
  left: 0;
  padding: 8px 14px;
  color: var(--mb-muted);
  letter-spacing: 5px;
  content: "•••";
  background: var(--mb-subtle);
  border-radius: 16px;
}
#panel-ai.scene-ready[data-scene-step="1"][data-scene-playing="true"]
  .phone-chat::after {
  animation: knowledge-pulse 1.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  #panel-ai.scene-ready[data-scene-step="1"] .phone-chat::after {
    animation: none;
  }
}

.scene-actions [data-scene-action="replay"] {
  min-width: 44px;
  padding: 10px;
}
.scene-actions [data-scene-action="replay"] span {
  display: none;
}
.scene-actions {
  gap: 6px;
}
.scene-actions button {
  padding-inline: 12px;
  font-size: 11px;
}

@media (max-width: 850px) {
  .growth-demo .demo-copy {
    grid-row: 1;
  }
  .growth-demo .phone-preview {
    grid-row: 2;
  }
  .growth-demo .workspace-preview {
    grid-row: 3;
  }
}

@keyframes flow-signal {
  50% {
    opacity: 0.45;
    transform: translateY(4px);
  }
}
@keyframes hero-node-signal {
  50% {
    box-shadow:
      0 0 0 4px color-mix(in srgb, var(--mb-muted) 17.65%, transparent),
      0 10px 24px color-mix(in srgb, var(--mb-muted) 8.63%, transparent);
    border-color: var(--mb-muted);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-flow-node {
    animation: hero-node-signal 1.1s 0.5s ease both;
  }
  .hero-flow-node.ai-node {
    animation-delay: 1.4s;
  }
  .hero-flow-node.handoff-node {
    animation-delay: 2.3s;
  }
  .hero-phone-chat .assistant-bubble {
    animation: enter-scene 0.6s 1.6s ease both;
  }
  .hero-phone-chat .assistant-bubble:last-child {
    animation-delay: 2.6s;
  }
  .scene-ready[data-scene-playing="true"] .connector {
    animation: flow-signal 1.2s ease-in-out infinite;
  }
}
#panel-referral[data-scene-step="1"] .campaign-steps span:first-child,
#panel-referral[data-scene-step="2"] .campaign-steps span:nth-of-type(2),
#panel-referral[data-scene-step="3"] .campaign-steps span:last-child {
  background: var(--mb-line);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mb-muted) 16.86%, transparent);
}
