/**
 * hero-device-live.css — анимация экрана в mockup hero (RU).
 * Изолировано под .wm-2027-live; не трогает particles и CTA.
 */

.wm-2027-live {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-top: 0.25rem;
}

.wm-2027-live__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.wm-2027-live .wm-2027-device__pill,
.wm-2027-live__pill {
  font-family: var(--wm-font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--wm-mint);
  text-shadow: 0 0 18px var(--wm-mint-soft);
}

.wm-2027-live__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--wm-mint);
  box-shadow: 0 0 10px var(--wm-mint);
  flex-shrink: 0;
  animation: wm-live-dot-pulse 2.2s ease-in-out infinite;
}

@keyframes wm-live-dot-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

/* --- Статический fallback (нет JS) --- */
.wm-2027-live__static {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.wm-2027-live__static-lines {
  flex: 1;
  border-radius: var(--wm-radius-sm);
  border: 1px solid var(--wm-border);
  background: rgba(0, 0, 0, 0.35);
  padding: 0.5rem 0.55rem;
  overflow: hidden;
  box-shadow: inset 0 0 24px rgba(91, 140, 255, 0.06);
}

.wm-2027-live__static-lines p {
  margin: 0 0 0.28rem;
  font-family: var(--wm-font-mono);
  font-size: 0.58rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.72);
}

.wm-2027-live__static-lines p:last-child {
  margin-bottom: 0;
  color: var(--wm-mint);
}

.wm-2027-live__progress--static {
  margin-top: 0.45rem;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.wm-2027-live__progress--static .wm-2027-live__progress-fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--wm-accent), var(--wm-mint));
  opacity: 0.85;
}

/* JS: скрываем статику, показываем анимацию */
.wm-2027-live.wm-2027-live--ready .wm-2027-live__static {
  display: none;
}

.wm-2027-live.wm-2027-live--ready .wm-2027-live__anim {
  display: flex;
}

.wm-2027-live__anim {
  flex: 1;
  flex-direction: column;
  min-height: 0;
  gap: 0.38rem;
}

.wm-2027-live__anim[hidden] {
  display: none !important;
}

/* --- Терминал (верхняя полоса live feed) — фиксированная высота, без layout shift --- */
.wm-2027-live__terminal {
  /* (bp): зафиксировано — без flex-basis auto, без max-height в %, без min-height: 0 */
  flex: 0 0 auto;
  height: 6.6rem;
  min-height: 6.6rem;
  max-height: 6.6rem;
  border-radius: var(--wm-radius-md);
  border: 1px solid var(--wm-border);
  background: linear-gradient(165deg, rgba(10, 12, 18, 0.95) 0%, rgba(18, 21, 30, 0.92) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 0 40px rgba(91, 140, 255, 0.07);
  padding: 0.4rem 0.45rem 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow: hidden;
}

.wm-2027-live__terminal-main {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow: hidden;
}

.wm-2027-live__feed {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.2rem;
  /* (bp): мягкое затухание сверху чтобы старые строки исчезали без shift */
  -webkit-mask-image: linear-gradient(180deg, transparent 0, rgba(0,0,0,0.4) 14%, #000 38%, #000 100%);
          mask-image: linear-gradient(180deg, transparent 0, rgba(0,0,0,0.4) 14%, #000 38%, #000 100%);
}

.wm-2027-live__line {
  font-family: var(--wm-font-mono);
  font-size: 0.58rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.78);
  margin: 0;
  padding: 0;
  opacity: 0;
  animation: wm-live-line-in 0.45s var(--wm-ease-out) forwards;
}

.wm-2027-live__line--dim {
  color: rgba(255, 255, 255, 0.42);
}

@keyframes wm-live-line-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wm-2027-live__type-row {
  /* (bp): single-line, no wrap — чтобы typing не растягивал terminal */
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.25rem;
  font-family: var(--wm-font-mono);
  font-size: 0.58rem;
  line-height: 1.35;
  height: 1.35em;
  min-height: 1.35em;
  max-height: 1.35em;
  overflow: hidden;
  flex: 0 0 auto;
}

.wm-2027-live__prompt {
  color: var(--wm-mint);
  flex-shrink: 0;
}

.wm-2027-live__typing {
  /* (bp): single-line ellipsis — typing не уходит на новую строку */
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  flex: 1 1 auto;
  min-width: 0;
}

.wm-2027-live__cursor {
  display: inline-block;
  width: 0.45em;
  height: 1em;
  margin-left: 1px;
  vertical-align: -0.12em;
  background: var(--wm-accent);
  border-radius: 1px;
  animation: wm-live-cursor-blink 1.05s steps(2, start) infinite;
}

@keyframes wm-live-cursor-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.wm-2027-live--reduced .wm-2027-live__cursor {
  animation: none;
  opacity: 0.65;
}

.wm-2027-live--reduced .wm-2027-live__line {
  animation: none;
  opacity: 1;
}

.wm-2027-live--reduced .wm-2027-live__dot {
  animation: none;
  opacity: 0.85;
}

/* (bp): reduced-motion + media query — отключаем moon-анимации */
@media (prefers-reduced-motion: reduce) {
  .wm-2027-live__moon-glow,
  .wm-2027-live__moon-asset,
  .wm-2027-live__moon-orbit,
  .wm-2027-live__moon-scan {
    animation: none !important;
  }
}

.wm-2027-live--reduced .wm-2027-live__moon-glow,
.wm-2027-live--reduced .wm-2027-live__moon-asset,
.wm-2027-live--reduced .wm-2027-live__moon-orbit,
.wm-2027-live--reduced .wm-2027-live__moon-scan {
  animation: none;
}

/* --- WebMoon AI Moon Core (центр экрана mockup, pass bp) --- */
.wm-2027-live__moon-scene {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  margin: 0.18rem 0 0;
  padding: 0.18rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--wm-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background:
    radial-gradient(ellipse 80% 70% at 50% 50%, rgba(228, 142, 60, 0.10), transparent 60%),
    linear-gradient(180deg, rgba(12, 14, 20, 0.55) 0%, rgba(6, 8, 12, 0.35) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(91, 140, 255, 0.05),
    inset 0 -20px 48px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  isolation: isolate;
}

/* (bp): warm orange halo как на референсе — за изображением */
.wm-2027-live__moon-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  height: 92%;
  max-width: 220px;
  max-height: 220px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(232, 152, 90, 0.42) 0%, rgba(228, 120, 50, 0.22) 28%, rgba(180, 80, 20, 0.08) 50%, transparent 72%);
  filter: blur(8px);
  opacity: 0.95;
  pointer-events: none;
  z-index: 0;
  animation: wm-moon-glow-breathe 7.5s ease-in-out infinite;
}

.wm-2027-live__moon-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 65% at 50% 50%, transparent 30%, rgba(0, 0, 0, 0.45) 100%);
  opacity: 0.55;
}

@keyframes wm-moon-glow-breathe {
  0%,
  100% {
    opacity: 0.78;
    transform: translate(-50%, -50%) scale(0.96);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06);
  }
}

.wm-2027-live__moon-scan {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 38%,
    rgba(62, 232, 200, 0.07) 50%,
    transparent 62%,
    transparent 100%
  );
  background-size: 220% 100%;
  animation: wm-moon-scan 7.5s ease-in-out infinite;
  mix-blend-mode: screen;
  opacity: 0.75;
}

@keyframes wm-moon-scan {
  0%,
  100% {
    background-position: 130% 0;
  }
  50% {
    background-position: -30% 0;
  }
}

.wm-2027-live__moon-svg {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: min(100%, 162px);
  min-height: 5.35rem;
  margin: 0 auto;
  flex-shrink: 1;
}

/* (bp): Новый asset webmoon-ai-moon-core.png — premium AI moon core */
.wm-2027-live__moon-asset {
  position: relative;
  z-index: 2;
  display: block;
  width: auto;
  height: 100%;
  max-height: min(100%, 175px);
  max-width: 100%;
  margin: 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(232, 152, 90, 0.18));
  animation: wm-moon-asset-breathe 8s ease-in-out infinite;
}

@keyframes wm-moon-asset-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* Дополнительные орбитальные кольца поверх asset для живости */
.wm-2027-live__moon-orbit {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 88%;
  height: 56%;
  max-width: 200px;
  max-height: 130px;
  border-radius: 50%;
  border: 1px solid rgba(62, 232, 200, 0.22);
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(0deg);
  animation: wm-moon-orbit-spin 22s linear infinite;
}

.wm-2027-live__moon-orbit--a {
  width: 95%;
  height: 32%;
  border-color: rgba(62, 232, 200, 0.18);
  animation-duration: 28s;
  animation-direction: normal;
}

.wm-2027-live__moon-orbit--b {
  width: 78%;
  height: 78%;
  border-color: rgba(91, 140, 255, 0.16);
  animation-duration: 38s;
  animation-direction: reverse;
  transform: translate(-50%, -50%) rotate(28deg);
}

@keyframes wm-moon-orbit-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.wm-2027-live__moon-ring {
  transform-origin: 0 0;
  will-change: transform;
}

.wm-2027-live__moon-ring--outer {
  animation: wm-moon-spin-cw 132s linear infinite;
}

.wm-2027-live__moon-ring--a {
  animation: wm-moon-spin-cw 92s linear infinite;
}

.wm-2027-live__moon-ring--b {
  animation: wm-moon-spin-ccw 118s linear infinite;
}

.wm-2027-live__moon-arc {
  transform-origin: 0 0;
}

.wm-2027-live__moon-arc--wm {
  animation: wm-moon-spin-ccw 168s linear infinite;
  opacity: 0.85;
}

@keyframes wm-moon-spin-cw {
  to {
    transform: rotate(360deg);
  }
}

@keyframes wm-moon-spin-ccw {
  to {
    transform: rotate(-360deg);
  }
}

.wm-2027-live__moon-dots {
  animation: wm-moon-spin-cw 154s linear infinite;
  opacity: 0.92;
}

.wm-2027-live__moon-body {
  filter: drop-shadow(0 0 14px rgba(62, 232, 200, 0.28));
  transition: filter 0.45s ease, opacity 0.45s ease;
}

.wm-2027-live__moon-halo,
.wm-2027-live__moon-rim {
  transition: opacity 0.45s ease;
}

.wm-2027-live__moon-scene[data-wm-state="building"] .wm-2027-live__moon-body {
  filter: drop-shadow(0 0 16px rgba(91, 140, 255, 0.38));
}

.wm-2027-live__moon-scene[data-wm-state="deploying"] .wm-2027-live__moon-body {
  filter: drop-shadow(0 0 15px rgba(62, 232, 200, 0.42));
}

.wm-2027-live__moon-scene[data-wm-state="stable"] .wm-2027-live__moon-body {
  filter: drop-shadow(0 0 12px rgba(62, 232, 200, 0.24));
}

.wm-2027-live__moon-scene.wm-2027-live__moon--pulse .wm-2027-live__moon-halo {
  animation: wm-moon-pulse-halo 0.55s ease-out;
}

.wm-2027-live__moon-scene.wm-2027-live__moon--pulse .wm-2027-live__moon-body {
  animation: wm-moon-pulse-body 0.55s ease-out;
}

@keyframes wm-moon-pulse-halo {
  0% {
    opacity: 0.55;
  }
  40% {
    opacity: 0.95;
  }
  100% {
    opacity: 0.55;
  }
}

@keyframes wm-moon-pulse-body {
  0% {
    opacity: 0.88;
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0.95;
  }
}

/* --- Низ: progress + spark + статус --- */
.wm-2027-live__footer {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.35rem 0.5rem;
  align-items: center;
}

.wm-2027-live__progress {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.wm-2027-live__progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--wm-accent), var(--wm-mint));
  box-shadow: 0 0 12px var(--wm-accent-soft);
  transition: width 0.35s var(--wm-ease-out);
}

.wm-2027-live--cycle .wm-2027-live__progress-fill {
  animation: wm-live-progress-loop 10s var(--wm-ease-out) infinite;
}

@keyframes wm-live-progress-loop {
  0% {
    width: 8%;
    opacity: 0.7;
  }
  18% {
    width: 42%;
  }
  42% {
    width: 68%;
  }
  62% {
    width: 88%;
    opacity: 1;
  }
  78% {
    width: 100%;
  }
  92% {
    width: 100%;
    opacity: 0.95;
  }
  100% {
    width: 8%;
    opacity: 0.7;
  }
}

.wm-2027-live__chart {
  grid-column: 1;
  height: 28px;
  opacity: 0.9;
}

.wm-2027-live__spark {
  width: 100%;
  height: 100%;
  display: block;
}

.wm-2027-live__spark-fill {
  fill: rgba(91, 140, 255, 0.12);
}

.wm-2027-live__spark-line {
  stroke: var(--wm-accent);
  opacity: 0.85;
}

.wm-2027-live__status {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
}

.wm-2027-live__status-label {
  font-family: var(--wm-font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wm-text-faint);
}

.wm-2027-live__status-value {
  font-family: var(--wm-font-mono);
  font-size: 0.58rem;
  color: var(--wm-mint);
  transition: opacity 0.3s ease;
}

.wm-2027-live--state-build .wm-2027-live__status-value {
  color: var(--wm-accent);
}

.wm-2027-live__chart.wm-2027-live__chart--pulse .wm-2027-live__spark-line {
  animation: wm-live-spark-opacity 3.2s ease-in-out infinite;
}

@keyframes wm-live-spark-opacity {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wm-2027-live__dot {
    animation: none;
    opacity: 0.8;
  }

  .wm-2027-live__cursor {
    animation: none;
    opacity: 0.55;
  }

  .wm-2027-live__line {
    animation: none;
    opacity: 1;
  }

  .wm-2027-live--cycle .wm-2027-live__progress-fill {
    animation: none;
    width: 100% !important;
    opacity: 0.75;
  }

  .wm-2027-live__chart.wm-2027-live__chart--pulse .wm-2027-live__spark-line {
    animation: none;
    opacity: 0.75;
  }

  .wm-2027-live__moon-glow,
  .wm-2027-live__moon-scan,
  .wm-2027-live__moon-ring--outer,
  .wm-2027-live__moon-ring--a,
  .wm-2027-live__moon-ring--b,
  .wm-2027-live__moon-arc--wm,
  .wm-2027-live__moon-dots {
    animation: none !important;
  }

  .wm-2027-live__moon-glow {
    opacity: 0.72;
    transform: translate(-50%, -50%) scale(1);
  }

  .wm-2027-live__moon-scan {
    opacity: 0.35;
    background-position: 50% 0;
  }

  .wm-2027-live__moon-ring--outer,
  .wm-2027-live__moon-ring--a,
  .wm-2027-live__moon-ring--b,
  .wm-2027-live__moon-arc--wm,
  .wm-2027-live__moon-dots {
    transform: rotate(0deg);
  }
}

.wm-2027-live--reduced .wm-2027-live__moon-glow,
.wm-2027-live--reduced .wm-2027-live__moon-scan,
.wm-2027-live--reduced .wm-2027-live__moon-ring--outer,
.wm-2027-live--reduced .wm-2027-live__moon-ring--a,
.wm-2027-live--reduced .wm-2027-live__moon-ring--b,
.wm-2027-live--reduced .wm-2027-live__moon-arc--wm,
.wm-2027-live--reduced .wm-2027-live__moon-dots {
  animation: none !important;
}

.wm-2027-live--reduced .wm-2027-live__moon-glow {
  opacity: 0.7;
}

.wm-2027-live--reduced .wm-2027-live__moon-scan {
  opacity: 0.28;
}
