/* =========================================================
   Motion intro for the home page (index.html)
   A full-bleed brand scene: 3D logo cubes, flowing light,
   channel chips and a live conversation card.
   ========================================================= */

.mx-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(680px, calc(100svh - var(--header-h)), 920px);
  padding: 48px 0 72px;
  overflow: hidden;
  background: #fffaf5;
}

/* aurora: three blurred lights drifting slowly */
.mx-aurora { position: absolute; inset: -10%; z-index: -3; pointer-events: none; contain: strict; }
.mx-aurora i {
  position: absolute;
  width: 52vw;
  max-width: 820px;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: .62;
  will-change: transform;
}
/* soft by construction: radial gradients instead of a blur filter */
.mx-aurora .b1 { left: 38%; top: -12%; background: radial-gradient(closest-side, #ffd46b, rgba(255, 212, 107, 0)); animation: drift1 22s ease-in-out infinite alternate; }
.mx-aurora .b2 { left: 62%; top: 30%; background: radial-gradient(closest-side, #ffae63, rgba(255, 174, 99, 0)); animation: drift2 26s ease-in-out infinite alternate; }
.mx-aurora .b3 { left: 30%; top: 48%; background: radial-gradient(closest-side, #ff9a92, rgba(255, 154, 146, 0)); opacity: .42; animation: drift3 30s ease-in-out infinite alternate; }
.mx-hero.is-paused .mx-aurora i,
.mx-hero.is-paused .mx-bob,
.mx-hero.is-paused .mx-cue::after { animation-play-state: paused; }
@keyframes drift1 { to { transform: translate(-14%, 18%) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-22%, -12%) scale(.9); } }
@keyframes drift3 { to { transform: translate(24%, -16%) scale(1.1); } }

.mx-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--cube-grid);
  opacity: .38;
  will-change: transform;
  -webkit-mask-image: radial-gradient(46% 56% at 70% 46%, #000 0%, transparent 70%);
  mask-image: radial-gradient(46% 56% at 70% 46%, #000 0%, transparent 70%);
}
.mx-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 140px;
  z-index: -1;
  background: linear-gradient(to bottom, transparent, #fff);
}

.mx-grid {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 24px;
  align-items: center;
}
.mx-copy { position: relative; z-index: 2; will-change: transform, opacity; }
.mx-copy .display { font-size: clamp(2.6rem, 1.4rem + 4.2vw, 4.6rem); }
.mx-copy .lead { max-width: 30em; margin-top: 28px; font-size: var(--fs-17); line-height: 1.75; color: #4e5766; }

/* ---------- scene ---------- */

.mx-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 680px;
  margin-inline: auto;
  perspective: 1400px;
  will-change: transform;
}
.mx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.mx-glow {
  position: absolute;
  left: 50%;
  top: 56%;
  width: 46%;
  height: 20%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(238, 127, 27, .32), rgba(238, 127, 27, 0));
}

/* the 3D cube rig: positions follow the logo's staggered grid */
.mx-rig {
  --s: 86px;
  --u: calc(var(--s) * 1.14);
  position: absolute;
  left: 50%;
  top: 47%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, -20deg)) rotateY(var(--ry, 34deg));
  transition: transform .9s cubic-bezier(.2, .7, .2, 1);
}
.mx-cube {
  position: absolute;
  left: calc(var(--s) / -2);
  top: calc(var(--s) / -2);
  width: var(--s);
  height: var(--s);
  transform-style: preserve-3d;
  transform: translate3d(calc(var(--x) * var(--u)), calc(var(--y) * var(--u)), 0);
  transition: transform 1.3s cubic-bezier(.16, .84, .2, 1), opacity .6s ease;
  transition-delay: var(--d, 0s);
}
.mx-rig:not(.is-built) .mx-cube {
  opacity: 0;
  transform: translate3d(calc(var(--sx) * 1px), calc(var(--sy) * 1px), calc(var(--sz) * 1px)) rotateX(calc(var(--sr) * 1deg)) rotateY(calc(var(--sr) * -1.4deg));
}
.mx-bob {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: bob 5.5s ease-in-out infinite;
  animation-delay: var(--bd, 0s);
}
@keyframes bob { 50% { transform: translate3d(0, -9px, 6px); } }

.mx-face {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  backface-visibility: hidden;
}
.mx-face.front { background: linear-gradient(150deg, var(--cl) -35%, var(--c) 42%, var(--c) 100%); transform: translateZ(calc(var(--s) / 2)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -10px 18px -12px rgba(0, 0, 0, .18); }
.mx-face.back { background: var(--cd); transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.mx-face.right { background: linear-gradient(180deg, var(--c) -30%, var(--cd) 70%); transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.mx-face.left { background: var(--cd); transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.mx-face.top { background: linear-gradient(135deg, #fff6e8 -40%, var(--cl) 60%); transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.mx-face.bottom { background: var(--cd); transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.cube-o { --c: #ee7f1b; --cl: #ffb066; --cd: #c9620c; }
.cube-y { --c: #f6c016; --cl: #ffe07a; --cd: #cf9a05; }
.cube-r { --c: #e32c2c; --cl: #ff7a70; --cd: #b81d1d; }

/* ---------- channel chips ---------- */

.mx-chip {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 9px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 0 0 1px rgba(24, 32, 44, .06), 0 12px 28px -14px rgba(90, 50, 10, .35);
  font-size: var(--fs-14);
  font-weight: 620;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity .7s ease, transform .9s cubic-bezier(.2, .8, .2, 1);
  transition-delay: var(--d, 0s);
}
.mx-chip .ic {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--orange-tint);
  color: #b4540b;
}
.mx-chip .ic .icon { width: 16px; height: 16px; }
.mx-chip.out .ic { background: var(--red-tint); color: #b3261f; }
.mx-scene:not(.is-live) .mx-chip { transform: translate(-50%, -30%) scale(.94); }
.mx-scene.is-live .mx-chip { opacity: 1; }

/* ---------- live conversation card + status ---------- */

.mx-card,
.mx-status {
  position: absolute;
  z-index: 3;
  border-radius: 18px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 0 0 1px rgba(24, 32, 44, .06), 0 24px 48px -22px rgba(90, 50, 10, .4);
}
.mx-card {
  left: 50%;
  bottom: 3%;
  width: min(360px, 84%);
  min-height: 84px;
  padding: 14px 18px;
  transform: translateX(-50%);
}
.mx-card-line {
  position: absolute;
  inset: 14px 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .45s ease, transform .55s cubic-bezier(.2, .8, .2, 1);
}
.mx-card-line.is-on { opacity: 1; transform: none; }
.mx-card-line .cube { margin-top: 6px; }
.mx-card-line small { display: block; font-size: var(--fs-12); font-weight: 650; color: var(--slate); }
.mx-card-line p { font-size: var(--fs-15); line-height: 1.5; }

.mx-status {
  right: 2%;
  top: 8%;
  padding: 10px 14px;
  font-size: var(--fs-14);
  font-weight: 620;
  display: flex;
  align-items: center;
  gap: 10px;
}
.mx-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(238, 127, 27, .18); transition: background-color .3s, box-shadow .3s; }
.mx-status.is-agent .dot { background: var(--red); box-shadow: 0 0 0 4px rgba(227, 44, 44, .16); }
.mx-status span { transition: opacity .25s; }
.mx-card, .mx-status { opacity: 0; transition: opacity .8s ease .2s; }
.mx-scene.is-live .mx-card,
.mx-scene.is-live .mx-status { opacity: 1; }

/* scroll cue */
.mx-cue {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 1.5px;
  height: 44px;
  transform: translateX(-50%);
  background: rgba(24, 32, 44, .12);
  overflow: hidden;
}
.mx-cue::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 40%;
  background: var(--ink);
  transform: translateY(-100%);
  animation: cue 2.2s ease-in-out infinite;
}
@keyframes cue { to { transform: translateY(250%); } }

/* product section that follows the intro */
.mx-product { padding-top: 40px; }
.mx-product .showcase { margin-top: 0; }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .mx-rig { --s: 66px; }
}
@media (max-width: 900px) {
  .mx-hero { min-height: 0; padding: 32px 0 40px; }
  .mx-grid { grid-template-columns: 1fr; gap: 8px; }
  .mx-scene { max-width: 560px; }
  .mx-cue { display: none; }
}
@media (max-width: 560px) {
  .mx-scene { aspect-ratio: 1 / 1.2; }
  .mx-card { bottom: 0; }
  .mx-rig { --s: 46px; }
  .mx-chip { padding: 6px 10px 6px 7px; font-size: var(--fs-12); gap: 6px; }
  .mx-chip .ic { width: 22px; height: 22px; }
  .mx-chip .ic .icon { width: 13px; height: 13px; }
  .mx-card { width: 92%; min-height: 76px; padding: 12px 14px; }
  .mx-card-line { inset: 12px 14px; }
  .mx-card-line p { font-size: var(--fs-14); }
  .mx-status { top: 2%; right: 0; font-size: var(--fs-12); }
}

@media (prefers-reduced-motion: reduce) {
  .mx-aurora i, .mx-bob, .mx-cue::after { animation: none; }
  .mx-rig:not(.is-built) .mx-cube { opacity: 1; transform: translate3d(calc(var(--x) * var(--u)), calc(var(--y) * var(--u)), 0); }
}
