:root {
  --bg-top: #050b13;
  --bg-bottom: #010308;
  --surface-dark: #1f2025;
  --surface-mid: #44464b;
  --text-main: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.75);
  --accent-warm: #e56a54;
  --shadow-xl: 0 40px 90px rgba(0, 0, 0, 0.38);
  --shadow-card: 0 22px 48px rgba(10, 13, 22, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text-main);
}

.mockup-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
}

.graphic-shell {
  width: min(1440px, 100%);
}

.scene {
  position: relative;
  width: 100%;
  aspect-ratio: 1151 / 750;
}

.scene-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
  pointer-events: none;
}

.scene-glow-left {
  width: 380px;
  height: 380px;
  left: -64px;
  top: 52px;
  background: radial-gradient(circle, rgba(181, 128, 209, 0.22), transparent 68%);
}

.scene-glow-right {
  width: 420px;
  height: 420px;
  right: -72px;
  top: 8px;
  background: radial-gradient(circle, rgba(0, 150, 94, 0.18), transparent 68%);
}

.stage-canvas {
  position: relative;
  width: 100%;
  height: 100%;
}

.dashboard {
  position: absolute;
  top: 0;
  left: 0;
  width: 82.45%;
  height: 80.8%;
  display: flex;
  align-items: flex-start;
  gap: 27px;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(120deg, #b580d1 -11.7%, #68478d 16.11%, #0076a8 67.3%, #00965e 109.64%);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.dashboard-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 27px;
}

.dashboard-col-accounts {
  gap: 30px;
}

.dashboard-col-featured {
  position: static;
}

.dashboard-card {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 20px 24px rgba(11, 15, 27, 0.12));
}

.spending-slot {
  position: relative;
  display: none;
  width: 100%;
  overflow: hidden;
  border-radius: 16px;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 420ms ease,
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.spending-slot.is-mounted {
  display: block;
}

.spending-slot.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.spending-slot.is-stage-blank {
  height: auto;
  aspect-ratio: 285 / 487;
}

.spending-slot.is-stage-spending {
  height: auto;
  aspect-ratio: 285 / 490;
}

.spending-slot.is-stage-graph {
  height: auto;
  aspect-ratio: 285 / 491;
}

.spending-state {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition:
    opacity 420ms ease,
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.spending-slot.is-stage-blank .spending-state-blank,
.spending-slot.is-stage-spending .spending-state-spending,
.spending-slot.is-stage-graph .spending-state-graph {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.dashboard-card-shiftable {
  transform: none;
}

.code-box {
  position: absolute;
  top: 5.87%;
  left: 70.11%;
  width: 29.85%;
  height: 58.8%;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 16px;
  background: var(--surface-mid);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.code-step {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 340ms ease,
    transform 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

.code-step.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.chat-box {
  position: absolute;
  top: 33.33%;
  left: 55.12%;
  width: 31.02%;
  height: 66.66%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 10px 10px;
  border-radius: 16px;
  background: var(--surface-dark);
  box-shadow: 0 32px 54px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.chat-box-header {
  flex: 0 0 auto;
  padding: 14px 12px 12px;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.18);
}

.chat-box-header p {
  margin: 0;
  color: var(--text-main);
  font-size: 1.12rem;
  font-weight: 500;
  line-height: 1;
}

.playback-controls {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
}

.playback-button {
  appearance: none;
  border: 0;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.playback-button img {
  display: block;
  width: 42px;
  height: 42px;
}

.playback-button:hover {
  transform: translateY(-1px);
}

.playback-button:active {
  transform: translateY(0);
}

.playback-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

.playback-button[aria-pressed="true"] {
  opacity: 0.72;
}

.chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  padding-top: 6px;
  overflow: hidden;
}

.chat-row {
  display: flex;
  width: 100%;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 300ms ease,
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-row.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.chat-row.inbound {
  justify-content: flex-start;
}

.chat-row.outbound {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: 100%;
  color: var(--text-main);
}

.chat-bubble p {
  margin: 0;
  line-height: 1.45;
}

.text-bubble {
  padding: 10px 14px;
  border-radius: 16px;
}

.text-bubble.inbound-style {
  background: transparent;
}

.text-bubble.outbound-style {
  background: var(--surface-mid);
}

.code-edits svg {
  display: block;
  width: 228px;
  max-width: 100%;
  height: auto;
}

#prompt-box {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  padding: 10px;
  border-radius: 16px;
  background: var(--surface-mid);
  flex: 0 0 auto;
}

.prompt-text {
  width: 244px;
  min-height: 66px;
  color: var(--text-main);
}

.prompt-text p {
  margin: 0;
  line-height: 1.45;
}

.prompt-send {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 100px;
  background: var(--accent-warm);
  flex: 0 0 auto;
}

@media (max-width: 980px) {
  .mockup-page {
    align-items: flex-start;
    padding: 24px 0 0;
  }

  .graphic-shell {
    width: 100%;
  }

  .scene {
    aspect-ratio: 1.08 / 1;
  }

  .dashboard {
    left: 0;
    right: auto;
    top: 0;
    width: 76%;
    height: 79%;
    gap: 18px;
    padding: 16px;
    align-items: flex-start;
  }

  .dashboard-col:first-child {
    display: none;
  }

  .dashboard-col-featured {
    position: static;
    padding-top: 0;
  }

  .dashboard-col {
    gap: 18px;
    justify-content: flex-start;
  }

  .spending-slot {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    border-radius: 5px;
  }

  .spending-slot.is-stage-blank {
    height: auto;
    aspect-ratio: 285 / 487;
  }

  .spending-slot.is-stage-spending {
    height: auto;
    aspect-ratio: 285 / 490;
  }

  .spending-slot.is-stage-graph {
    height: auto;
    aspect-ratio: 285 / 491;
  }

  .spending-state {
    inset: 0;
  }

  .dashboard-card-shiftable {
    transform: none !important;
  }

  .code-box {
    top: 6%;
    left: auto;
    right: 0;
    width: 42%;
    height: 52%;
    padding: 16px 18px;
    border-radius: 14px;
    transform: scale(0.9);
    transform-origin: top right;
  }

  .chat-box {
    top: 41%;
    left: auto;
    right: 4%;
    width: 43%;
    height: 56%;
    padding: 0 8px 8px;
    border-radius: 14px;
    transform: scale(0.92);
    transform-origin: top right;
  }
}

@media (max-width: 720px) {
  .mockup-page {
    padding: 16px 0 0;
  }

  .scene {
    aspect-ratio: 1 / 1;
  }

  .dashboard {
    left: 0;
    right: auto;
    width: 77%;
    height: 76%;
    gap: 14px;
    padding: 12px;
    align-items: flex-start;
  }

  .dashboard-col {
    gap: 14px;
    justify-content: flex-start;
  }

  .code-box {
    top: 7%;
    left: auto;
    right: 0;
    width: 45%;
    height: 50%;
    padding: 13px;
    border-radius: 12px;
    transform: scale(0.86);
    transform-origin: top right;
  }

  .chat-box {
    top: 42%;
    left: auto;
    right: 4%;
    width: 46%;
    height: 54%;
    padding: 0 8px 8px;
    border-radius: 12px;
    transform: scale(0.86);
    transform-origin: top right;
  }

  .playback-controls {
    right: 10px;
    bottom: 10px;
    gap: 6px;
  }

  .playback-button img {
    width: 36px;
    height: 36px;
  }

  #prompt-box {
    gap: 12px;
    padding: 8px;
  }

  .prompt-text {
    width: auto;
    min-width: 0;
    min-height: 48px;
  }
}

@media (max-width: 450px) {
  .chat-box {
    width: 65%;
    height: 80%;
    right: 2%;
  }

  .playback-controls {
    left: 8px;
    right: auto;
    bottom: 8px;
  }

  .playback-button img {
    width: 32px;
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
