/**
 * Muvesta Capital — heritage train below hero art
 * One horizontal run, then park. Static single line (no patri).
 */

body.wp-muvesta-figma .mv-train {
  --mv-train-scale: 1;
  --mv-train-dur: 14s;
  --mv-train-wheel: 0.75s;
  --mv-train-gold: #e8c875;
  --mv-train-navy: #0a1220;
  position: relative;
  z-index: 6;
  width: min(920px, 100%);
  max-width: 100%;
  margin: -0.35rem auto 0;
  height: clamp(88px, 18vw, 132px);
  pointer-events: none;
  overflow: hidden;
  transform: scale(var(--mv-train-scale));
  transform-origin: 50% 100%;
}

body.wp-muvesta-figma .mv-train__line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10%;
  height: 2px;
  z-index: 1;
  border-radius: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(200, 154, 61, 0.35) 8%,
    rgba(232, 200, 117, 0.85) 50%,
    rgba(200, 154, 61, 0.35) 92%,
    transparent 100%
  );
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45), 0 0 8px rgba(232, 200, 117, 0.2);
}

body.wp-muvesta-figma .mv-train__consist {
  position: absolute;
  left: 0;
  bottom: 12%;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-end;
  gap: 0;
  height: 88%;
  width: max-content;
  will-change: transform;
  z-index: 2;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.55));
}

body.wp-muvesta-figma .mv-train--gsap .mv-train__consist {
  animation: none !important;
}

@keyframes mv-train-wheel {
  to {
    transform: rotate(360deg);
  }
}

@keyframes mv-train-smoke {
  0% {
    opacity: 0.55;
    transform: translate3d(0, 0, 0) scale(0.55);
  }
  40% {
    opacity: 0.4;
  }
  100% {
    opacity: 0;
    transform: translate3d(-18px, -42px, 0) scale(1.55);
  }
}

@keyframes mv-train-lamp {
  0%,
  100% {
    opacity: 0.55;
    filter: blur(2px);
  }
  50% {
    opacity: 0.95;
    filter: blur(3px);
  }
}

body.wp-muvesta-figma .mv-train__engine,
body.wp-muvesta-figma .mv-train__coach {
  position: relative;
  flex: 0 0 auto;
  height: 100%;
}

body.wp-muvesta-figma .mv-train__engine {
  width: auto;
  aspect-ratio: 833 / 583;
  height: 100%;
  z-index: 3;
  margin-left: -1.2%;
}

body.wp-muvesta-figma .mv-train__coach {
  width: auto;
  aspect-ratio: 957 / 449;
  height: 58%;
  margin-left: -1.4%;
  z-index: 2;
  text-decoration: none;
  color: inherit;
  pointer-events: auto;
}

body.wp-muvesta-figma .mv-train__art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  transform: scaleX(-1);
  user-select: none;
  pointer-events: none;
}

body.wp-muvesta-figma .mv-train__wheels {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2%;
  height: 28%;
  pointer-events: none;
  z-index: 4;
  transform: scaleX(-1);
}

body.wp-muvesta-figma .mv-train__wheel {
  position: absolute;
  bottom: 0;
  width: 14%;
  aspect-ratio: 1;
  object-fit: contain;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

body.wp-muvesta-figma .mv-train.is-moving .mv-train__wheel {
  animation: mv-train-wheel var(--mv-train-wheel) linear infinite;
}

body.wp-muvesta-figma .mv-train__coach .mv-train__wheel--1 {
  left: 18%;
}
body.wp-muvesta-figma .mv-train__coach .mv-train__wheel--2 {
  left: 68%;
}

body.wp-muvesta-figma .mv-train__smoke {
  position: absolute;
  left: 22%;
  top: 4%;
  width: 18%;
  height: 40%;
  pointer-events: none;
  z-index: 5;
  transform: scaleX(-1);
}

body.wp-muvesta-figma .mv-train__puff {
  position: absolute;
  left: 35%;
  bottom: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.85), rgba(220, 220, 220, 0.35) 55%, transparent 72%);
  opacity: 0;
}

body.wp-muvesta-figma .mv-train.is-moving .mv-train__puff {
  animation: mv-train-smoke 2.4s ease-out infinite;
}
body.wp-muvesta-figma .mv-train.is-moving .mv-train__puff:nth-child(2) {
  animation-delay: 0.8s;
  left: 42%;
  width: 22px;
  height: 22px;
}
body.wp-muvesta-figma .mv-train.is-moving .mv-train__puff:nth-child(3) {
  animation-delay: 1.6s;
  left: 28%;
  width: 14px;
  height: 14px;
}

body.wp-muvesta-figma .mv-train__lamp {
  position: absolute;
  left: 6%;
  top: 42%;
  width: 10%;
  height: 10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 220, 140, 0.95) 0%, rgba(232, 200, 117, 0.35) 45%, transparent 70%);
  pointer-events: none;
  z-index: 6;
  transform: scaleX(-1);
}

body.wp-muvesta-figma .mv-train.is-moving .mv-train__lamp {
  animation: mv-train-lamp 1.8s ease-in-out infinite;
}

body.wp-muvesta-figma .mv-train__label {
  position: absolute;
  left: 14%;
  right: 14%;
  top: 26%;
  bottom: 34%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.08rem 0.15rem;
  text-align: center;
  pointer-events: none;
}

body.wp-muvesta-figma .mv-train__label strong {
  font-size: clamp(0.55rem, 1.35vw, 0.85rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1.05;
  color: #0a0a0a;
  text-transform: uppercase;
  -webkit-text-stroke: 0.2px rgba(10, 10, 10, 0.35);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

body.wp-muvesta-figma .mv-train__coach:hover .mv-train__label strong {
  color: #5a3d0a;
}

@media (max-width: 900px) {
  body.wp-muvesta-figma .mv-train {
    --mv-train-scale: 0.86;
    height: clamp(72px, 18vw, 104px);
    margin-top: 0.15rem;
  }
  body.wp-muvesta-figma .mv-train__coach {
    height: 52%;
  }
}

@media (max-width: 560px) {
  body.wp-muvesta-figma .mv-train {
    --mv-train-scale: 0.72;
    --mv-train-dur: 11s;
    height: 72px;
    margin-top: 0.25rem;
    overflow: visible;
  }
  body.wp-muvesta-figma .mv-train__coach {
    height: 48%;
  }
  body.wp-muvesta-figma .mv-train__label {
    left: 10%;
    right: 10%;
    top: 22%;
    bottom: 30%;
  }
  body.wp-muvesta-figma .mv-train__label strong {
    font-size: clamp(0.42rem, 2.4vw, 0.55rem);
    letter-spacing: 0.02em;
    font-weight: 900;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.wp-muvesta-figma .mv-train__consist {
    left: 50%;
    transform: translate3d(-50%, 0, 0) !important;
  }
  body.wp-muvesta-figma .mv-train.is-moving .mv-train__wheel,
  body.wp-muvesta-figma .mv-train.is-moving .mv-train__puff,
  body.wp-muvesta-figma .mv-train.is-moving .mv-train__lamp {
    animation: none !important;
  }
}
