:root {
  --max-blue: #4f8dff;
  --max-violet: #7a5cff;
}

body {
  background:
    linear-gradient(180deg, rgba(4, 10, 17, 0.78), rgba(4, 10, 17, 0.94)),
    radial-gradient(980px 520px at 0% -10%, rgba(79, 141, 255, 0.22), transparent 54%),
    radial-gradient(820px 460px at 88% 4%, rgba(122, 92, 255, 0.18), transparent 48%),
    radial-gradient(720px 420px at 68% 18%, rgba(0, 255, 133, 0.1), transparent 52%),
    linear-gradient(180deg, #07101a 0%, #050b12 100%);
}

.hero {
  border-color: rgba(79, 141, 255, 0.34);
  background:
    radial-gradient(760px 320px at 100% 0%, rgba(79, 141, 255, 0.2), transparent 54%),
    radial-gradient(640px 260px at 0% 24%, rgba(122, 92, 255, 0.12), transparent 50%),
    linear-gradient(180deg, rgba(13, 20, 31, 0.99), rgba(7, 12, 19, 0.99));
}

.hero h1 {
  max-width: 12ch;
}

.hero__lead {
  max-width: 680px;
  font-size: clamp(1.05rem, 1.45vw, 1.28rem);
}

.hero__actions .btn--primary {
  min-height: 56px;
  padding-inline: 28px;
  color: #03111f;
  background: linear-gradient(135deg, var(--max-blue), #41d6ff 54%, var(--vm-accent));
}

.hero__actions .btn--secondary {
  border-color: rgba(122, 92, 255, 0.36);
}

.max-live-demo {
  position: relative;
  width: 100%;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(79, 141, 255, 0.34);
  border-radius: 30px;
  background:
    radial-gradient(360px 220px at 50% 0%, rgba(79, 141, 255, 0.2), transparent 62%),
    linear-gradient(180deg, rgba(8, 18, 32, 0.98), rgba(5, 10, 18, 0.98));
  box-shadow: 0 28px 70px rgba(3, 8, 18, 0.44);
  animation: maxDeviceLift 8s ease-in-out infinite;
}

.max-live-demo::before {
  content: 'MAX';
  position: absolute;
  top: 18px;
  right: 22px;
  color: rgba(219, 233, 255, 0.16);
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.16em;
}

.hero__side {
  position: relative;
}

.max-live-demo__topline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.max-live-demo__topline strong,
.max-live-demo__topline span {
  display: block;
}

.max-live-demo__topline span:last-child {
  color: var(--vm-text-dim);
  font-size: 0.93rem;
}

.max-demo-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.max-demo-flow span {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(79, 141, 255, 0.28);
  border-radius: 14px;
  color: #dbe9ff;
  background: rgba(79, 141, 255, 0.1);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
  animation: maxTileGlow 6.4s ease-in-out infinite;
}

.max-demo-flow span:nth-of-type(2) { animation-delay: 0.35s; }
.max-demo-flow span:nth-of-type(3) { animation-delay: 0.7s; }
.max-demo-flow span:nth-of-type(4) { animation-delay: 1.05s; }

.max-demo-flow b {
  color: rgba(0, 255, 133, 0.82);
}

.max-demo-chat {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.035);
}

.max-live-message {
  max-width: 86%;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(12, 23, 36, 0.82);
  animation: maxBubbleIn 7.4s ease-in-out infinite;
}

.max-live-message--user {
  margin-left: auto;
  border-bottom-right-radius: 5px;
  border-color: rgba(79, 141, 255, 0.28);
  background: rgba(79, 141, 255, 0.13);
}

.max-live-message--assistant {
  margin-right: auto;
  border-bottom-left-radius: 5px;
  border-color: rgba(0, 255, 133, 0.18);
  background: rgba(0, 255, 133, 0.08);
}

.max-live-message:nth-child(2) { animation-delay: 0.45s; }
.max-live-message:nth-child(3) { animation-delay: 0.9s; }
.max-live-message:nth-child(4) { animation-delay: 1.35s; }

.max-live-message span {
  display: block;
  margin-bottom: 6px;
  color: #9eb8ff;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.max-live-message p {
  margin: 0;
  color: #e7eefb;
  line-height: 1.42;
}

.max-live-message--assistant p::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 4px;
  vertical-align: -0.16em;
  border-radius: 999px;
  background: rgba(0, 255, 133, 0.72);
  animation: maxCursor 1.1s ease-in-out infinite;
}

.max-proof {
  display: grid;
  grid-template-columns: minmax(132px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.max-proof__screen {
  max-height: 230px;
  overflow: hidden;
  border: 1px solid rgba(79, 141, 255, 0.22);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
}

.screenshots-section {
  border-color: rgba(79, 141, 255, 0.3);
  background:
    radial-gradient(580px 320px at 92% 18%, rgba(0, 255, 133, 0.1), transparent 62%),
    radial-gradient(760px 320px at 0% 0%, rgba(79, 141, 255, 0.16), transparent 54%),
    linear-gradient(180deg, rgba(10, 18, 31, 0.98), rgba(5, 11, 18, 0.99));
}

.screencast-card:nth-child(2) {
  transform: translateY(16px);
}

.screencast-card:nth-child(3) {
  transform: translateY(30px);
}

.use-case-card:nth-child(1),
.use-case-card:nth-child(4) {
  transform: translateY(-8px);
}

.use-case-card:nth-child(3),
.use-case-card:nth-child(6) {
  transform: translateY(8px);
}

.capability-group {
  min-height: 0;
}

.capability-group:nth-child(2) {
  border-color: rgba(79, 141, 255, 0.36);
  background:
    radial-gradient(360px 200px at 100% 0%, rgba(79, 141, 255, 0.14), transparent 58%),
    linear-gradient(180deg, rgba(17, 28, 44, 0.98), rgba(9, 15, 24, 0.98));
}

.max-proof__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.max-hero-device__tiles {
  display: grid;
  align-self: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(79, 141, 255, 0.18);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
}

.max-hero-device__tiles span {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(79, 141, 255, 0.28);
  border-radius: 14px;
  color: #dbe9ff;
  background: rgba(79, 141, 255, 0.1);
  font-size: 0.86rem;
  font-weight: 800;
  animation: maxTileGlow 6.4s ease-in-out infinite;
}

.max-hero-device__tiles span:last-child {
  grid-column: 1 / -1;
}

.max-hero-device__tiles span:nth-child(2) {
  animation-delay: 0.3s;
}

.max-hero-device__tiles span:nth-child(3) {
  animation-delay: 0.6s;
}

.max-hero-device__tiles span:nth-child(4) {
  animation-delay: 0.9s;
}

.max-hero-device__tiles span:nth-child(5) {
  animation-delay: 1.2s;
}

.trust-card,
.capability-group,
.payments-card {
  border-color: rgba(79, 141, 255, 0.24);
}

@media (max-width: 860px) {
  .max-proof__screen {
    max-height: 520px;
  }
}

@media (max-width: 640px) {
  .max-live-demo {
    padding: 14px;
    border-radius: 24px;
  }

  .max-demo-flow,
  .max-proof {
    grid-template-columns: 1fr;
  }

  .max-demo-flow b {
    display: none;
  }

  .max-proof__screen {
    max-height: 360px;
  }

  .max-hero-device__tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .max-hero-device__tiles span:last-child {
    grid-column: auto;
  }
}

@media (max-width: 860px) {
  .hero h1 {
    max-width: none;
  }

  .use-case-card:nth-child(1),
  .use-case-card:nth-child(3),
  .use-case-card:nth-child(4),
  .use-case-card:nth-child(6),
  .screencast-card:nth-child(2),
  .screencast-card:nth-child(3) {
    transform: none;
  }
}

@keyframes maxDeviceLift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -7px, 0);
  }
}

@keyframes maxTileGlow {
  0%,
  100% {
    border-color: rgba(79, 141, 255, 0.28);
    background: rgba(79, 141, 255, 0.1);
  }
  50% {
    border-color: rgba(0, 255, 133, 0.38);
    background: rgba(0, 255, 133, 0.12);
  }
}

@keyframes maxBubbleIn {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.86;
  }
  50% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

@keyframes maxCursor {
  0%,
  100% {
    opacity: 0.12;
  }
  50% {
    opacity: 1;
  }
}

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