/* Главная: живая строка в hero и демо-мониторинг сети ТВЭС */

.hero-live {
  display: inline-flex;
  max-width: 100%;
  min-height: 54px;
  align-items: center;
  gap: 12px;
  padding: 6px 20px 6px 16px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 28px;
  color: rgba(255, 255, 255, .88);
  background: rgba(3, 24, 43, .55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.3;
  transition: border-color .2s ease, background .2s ease;
}

.hero-live:hover {
  border-color: rgba(21, 159, 230, .7);
  background: rgba(3, 24, 43, .75);
}

.hero-live__dot,
.telemetry-station__dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #37d39b;
  box-shadow: 0 0 0 0 rgba(55, 211, 155, .6);
  animation: telemetryBlink 2.4s ease-out infinite;
}

.hero-live__text {
  display: grid;
  gap: 3px;
}

.hero-live__text > span:first-child {
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  letter-spacing: .04em;
}

.hero-live__power {
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
}

.hero-live__power b {
  font-size: 16px;
  color: var(--white);
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

@keyframes telemetryBlink {
  0% { box-shadow: 0 0 0 0 rgba(55, 211, 155, .55); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(55, 211, 155, 0); }
}

/* Мини 3D-ротор в строке мониторинга: крутится от ветра демо-сети */

.hero-live__rotor {
  display: block;
  width: 48px;
  height: 48px;
  flex: none;
  margin: -8px -4px -8px -10px;
}

.hero-live.has-rotor3d .hero-live__dot {
  display: none;
}

/* Секция */

.telemetry {
  --telemetry-green: #37d39b;
  position: relative;
  overflow: hidden;
  padding: 96px 0 88px;
  color: var(--white);
  background:
    radial-gradient(60% 50% at 70% 30%, rgba(21, 159, 230, .16), transparent 70%),
    radial-gradient(40% 40% at 10% 90%, rgba(0, 86, 158, .28), transparent 70%),
    radial-gradient(35% 30% at 95% 95%, rgba(55, 211, 155, .1), transparent 70%),
    var(--navy-950);
  isolation: isolate;
}

.telemetry::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
  content: "";
}

.telemetry__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 470px);
  align-items: end;
  gap: 24px 48px;
  margin-bottom: 40px;
}

.telemetry h2 {
  margin: 0;
  color: var(--white);
  font-size: clamp(34px, 4.2vw, 58px);
  text-transform: uppercase;
}

.telemetry__aside p {
  margin: 0;
  color: rgba(255, 255, 255, .74);
  font-size: 15px;
}

/* KPI: кольцевые индикаторы */

.telemetry__defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.telemetry__kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 24px;
}

.telemetry-kpi {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  padding: 20px 20px 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: linear-gradient(180deg, rgba(55, 211, 155, .05), rgba(255, 255, 255, .02));
  text-align: center;
}

.telemetry-kpi::before {
  position: absolute;
  top: -1px;
  left: -1px;
  width: 18px;
  height: 18px;
  border-top: 2px solid var(--telemetry-green);
  border-left: 2px solid var(--telemetry-green);
  content: "";
}

.telemetry-kpi dt {
  color: rgba(255, 255, 255, .7);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.telemetry-kpi dd {
  margin: 0;
}

.telemetry-ring {
  --pct: 0;
  position: relative;
  width: min(100%, 164px);
  aspect-ratio: 1;
  margin-top: 12px;
}

.telemetry-ring svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: rotate(135deg);
}

.telemetry-ring circle {
  fill: none;
  stroke-linecap: round;
  stroke-width: 9;
}

.telemetry-ring__track {
  stroke: rgba(255, 255, 255, .09);
  stroke-dasharray: 75 100;
}

.telemetry-ring__value {
  stroke: url(#telemetry-ring-gradient);
  stroke-dasharray: 0 100;
  filter: drop-shadow(0 0 6px rgba(55, 211, 155, .45));
  transition: stroke-dasharray 1s cubic-bezier(.2, .7, .2, 1);
}

.telemetry-ring .telemetry-ring__flow {
  stroke: rgba(225, 255, 244, .9);
  stroke-width: 5;
  stroke-dasharray: 0 100;
  opacity: 0;
  filter: drop-shadow(0 0 4px rgba(158, 255, 220, .9));
}

.telemetry-ring .telemetry-ring__tip {
  stroke: #e2fff4;
  stroke-width: 12;
  stroke-dasharray: .01 100;
  filter: drop-shadow(0 0 6px rgba(55, 211, 155, .95));
}

.telemetry-ring .telemetry-ring__peak {
  stroke: rgba(255, 255, 255, .62);
  stroke-width: 17;
  stroke-linecap: butt;
  stroke-dasharray: .45 100;
  opacity: 0;
  transition: opacity .6s ease;
}

.has-ring-motion .telemetry-ring__value {
  transition: none;
}

.has-ring-motion .telemetry-ring .telemetry-ring__peak {
  opacity: 1;
}

.telemetry-ring__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.telemetry-ring__center small {
  color: rgba(255, 255, 255, .55);
  font-size: 12px;
}

.telemetry-kpi__value {
  color: var(--white);
  font-family: var(--font-display);
  font-size: clamp(26px, 2.3vw, 34px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1;
}

.telemetry-kpi__unit {
  color: rgba(255, 255, 255, .62);
  font-size: 13px;
  font-weight: 700;
}

.telemetry-spark {
  display: flex;
  width: 100%;
  height: 32px;
  align-items: flex-end;
  gap: 3px;
  margin-top: 8px;
}

.telemetry-spark span {
  --h: .1;
  flex: 1;
  height: calc(var(--h) * 100%);
  border-radius: 1px;
  transform-origin: 50% 100%;
  background: linear-gradient(0deg, rgba(21, 159, 230, .55), var(--telemetry-green));
  opacity: .85;
  transition: height .8s ease;
}

.telemetry-kpi .telemetry-kpi__note {
  margin-top: 10px;
  color: rgba(255, 255, 255, .6);
  font-size: 12px;
}

.telemetry-kpi__note b {
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

/* Карта + детальная панель */

.telemetry__board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.telemetry__map,
.telemetry-detail {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .03);
}

.telemetry__map {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 24px 18px;
}

.telemetry__map::before,
.telemetry-detail::before {
  position: absolute;
  top: -1px;
  left: -1px;
  width: 22px;
  height: 22px;
  border-top: 2px solid var(--brand-cyan);
  border-left: 2px solid var(--brand-cyan);
  content: "";
}

.telemetry-map {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.telemetry-map__dots {
  fill: none;
  stroke: rgba(21, 159, 230, .26);
  stroke-linecap: round;
  stroke-width: 5;
}

.telemetry-map__outline {
  fill: rgba(21, 159, 230, .04);
  stroke: rgba(127, 208, 255, .5);
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.telemetry-map__flow {
  --flow-speed: 2s;
  fill: none;
  stroke: rgba(127, 208, 255, .7);
  stroke-dasharray: 3 12;
  stroke-linecap: round;
  stroke-width: 2;
  animation: telemetryFlow var(--flow-speed) linear infinite;
}

@keyframes telemetryFlow {
  to { stroke-dashoffset: -30; }
}

.telemetry-marker {
  --load: 1;
  cursor: pointer;
}

.telemetry-marker__core {
  fill: var(--brand-cyan);
  transition: fill .3s ease;
}

.telemetry-marker__ring {
  fill: rgba(3, 24, 43, .6);
  stroke: var(--brand-cyan);
  stroke-opacity: calc(.35 + .65 * var(--load));
  stroke-width: 2;
  transition: transform .3s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.telemetry-marker__pulse {
  fill: rgba(55, 211, 155, .3);
  transform-box: fill-box;
  transform-origin: center;
  animation: telemetryPulse 2.6s ease-out infinite;
}

.telemetry-marker text {
  fill: rgba(255, 255, 255, .78);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  paint-order: stroke;
  stroke: var(--navy-950);
  stroke-width: 5px;
}

.telemetry-marker:hover text,
.telemetry-marker.is-selected text {
  fill: var(--white);
}

.telemetry-marker.is-selected .telemetry-marker__ring {
  stroke: var(--white);
  transform: scale(1.35);
}

.telemetry-marker.is-selected .telemetry-marker__core {
  fill: var(--white);
}

@keyframes telemetryPulse {
  0% { opacity: .9; transform: scale(1); }
  100% { opacity: 0; transform: scale(3.4); }
}

.telemetry__map-caption {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, .5);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.telemetry-detail {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
}

.telemetry-detail__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.telemetry-detail__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.telemetry-detail__meta {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, .62);
  font-size: 13px;
}

.telemetry-detail__status {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #9ff0cf;
  background: rgba(55, 211, 155, .12);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.telemetry-detail__status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #37d39b;
  content: "";
}

.telemetry-detail__body {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.telemetry-dial svg {
  display: block;
  width: 100%;
  height: auto;
}

.telemetry-dial__ticks line {
  stroke: rgba(255, 255, 255, .28);
  stroke-width: 1.5;
}

.telemetry-dial__glow {
  fill: url(#telemetry-dial-glow);
}

.telemetry-dial__track {
  fill: rgba(21, 159, 230, .06);
  stroke: rgba(21, 159, 230, .25);
  stroke-width: 1;
}

.telemetry-dial__rotor {
  --rpm: 0;
  will-change: transform;
}

/* Шлейф скорости: штрихи вокруг ротора проявляются по мере роста оборотов */
.telemetry-dial__sweep {
  fill: none;
  stroke: rgba(127, 208, 255, .5);
  stroke-dasharray: 2 39;
  stroke-linecap: round;
  stroke-width: 22;
  opacity: calc(var(--rpm) * .45);
  transition: opacity 1s ease;
}

.telemetry-dial__cage {
  fill: rgba(3, 24, 43, .55);
  stroke: rgba(127, 208, 255, .35);
  stroke-dasharray: 2 3;
  stroke-width: 1;
}

/* Лопасть сверху: изогнутый парус с тёмной торцевой пластиной; при сильном ветре
   поворачивается к центру и прижимается — ротор складывается в шар */
.telemetry-dial__petal {
  --open: 1;
  transform: rotate(calc((1 - var(--open)) * 34deg)) scale(calc(.74 + .26 * var(--open)));
  transform-box: view-box;
  transform-origin: 0 0;
  transition: transform 1.2s cubic-bezier(.2, .7, .2, 1);
}

.telemetry-dial__arm {
  fill: none;
  stroke: rgba(10, 30, 50, .9);
  stroke-linecap: round;
  stroke-width: 3;
}

.telemetry-dial__blade {
  fill: url(#telemetry-dial-blade);
  stroke: rgba(242, 251, 255, .9);
  stroke-linejoin: round;
  stroke-width: .8;
  filter: drop-shadow(0 0 5px rgba(21, 159, 230, .6));
}

.telemetry-dial__plate {
  fill: #0a1e32;
  stroke: rgba(127, 208, 255, .55);
  stroke-width: .8;
}

.telemetry-dial__hub {
  fill: var(--navy-950);
  stroke: var(--telemetry-green);
  stroke-width: 3;
}

.telemetry-dial__axle {
  fill: var(--telemetry-green);
}

.telemetry-dial__caption {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, .62);
  font-size: 12px;
  text-align: center;
}

.telemetry-dial__caption strong {
  color: var(--white);
}

.telemetry-detail__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  margin: 0;
}

.telemetry-detail__metrics dt {
  margin-bottom: 4px;
  color: rgba(255, 255, 255, .55);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.telemetry-detail__metrics dd {
  margin: 0;
  color: rgba(255, 255, 255, .7);
  font-size: 13px;
}

.telemetry-detail__metrics strong {
  color: var(--white);
  font-family: var(--font-display);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.telemetry-detail__metrics small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, .5);
  font-size: 11px;
}

.telemetry-detail__bar,
.telemetry-station__bar {
  --load: 0;
  position: relative;
  display: block;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, .1);
}

.telemetry-detail__bar::after,
.telemetry-station__bar::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-cyan) 55%, var(--telemetry-green));
  transform: scaleX(var(--load));
  transform-origin: left;
  transition: transform .9s cubic-bezier(.2, .7, .2, 1);
  content: "";
}

.telemetry-chart {
  margin: 0;
}

.telemetry-chart figcaption {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, .55);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.telemetry-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.telemetry-chart__grid {
  fill: none;
  stroke: rgba(255, 255, 255, .08);
  stroke-width: 1;
}

.telemetry-chart__line {
  fill: none;
  stroke: url(#telemetry-line);
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.telemetry-chart__dot {
  fill: var(--white);
  stroke: var(--brand-cyan);
  stroke-width: 3;
}

.telemetry-chart__axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: rgba(255, 255, 255, .45);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* Список станций */

.telemetry__stations {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.telemetry-station {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  color: var(--white);
  background: rgba(255, 255, 255, .03);
  text-align: left;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.telemetry-station:hover {
  border-color: rgba(127, 208, 255, .5);
  transform: translateY(-2px);
}

.telemetry-station[aria-pressed="true"] {
  border-color: var(--brand-cyan);
  background: rgba(21, 159, 230, .13);
}

.telemetry-station__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.2;
}

.telemetry-station__meta {
  min-height: 2.6em;
  color: rgba(255, 255, 255, .55);
  font-size: 12px;
  line-height: 1.3;
}

.telemetry-station__values {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.telemetry-station__values [data-s="power"] {
  color: var(--white);
  font-weight: 700;
}

/* Низ секции */

.telemetry__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px 40px;
  margin-top: 32px;
}

.telemetry__actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.telemetry__ghost {
  min-height: 54px;
  padding: 0 24px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 28px;
  color: var(--white);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}

.telemetry__ghost:hover {
  border-color: var(--white);
  background: rgba(255, 255, 255, .08);
}

/* Адаптив */

@media (max-width: 1180px) {
  .telemetry__board {
    grid-template-columns: minmax(0, 1fr);
  }

  .telemetry__stations {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .telemetry {
    padding: 72px 0;
  }

  .telemetry__head {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .telemetry__foot {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  .hero-live {
    min-height: 50px;
  }

  .telemetry__kpis {
    gap: 8px;
  }

  .telemetry-kpi {
    padding: 14px 10px 12px;
  }

  .telemetry-kpi dt {
    font-size: 10px;
    letter-spacing: .08em;
  }

  .telemetry-kpi__value {
    font-size: 22px;
  }

  .telemetry-ring__center small,
  .telemetry-kpi .telemetry-kpi__note {
    font-size: 11px;
  }

  .telemetry__map {
    padding: 18px 12px 12px;
  }

  .telemetry-marker text {
    font-size: 34px;
    stroke-width: 8px;
  }

  .telemetry-marker:not(.is-selected):not(.telemetry-marker--hub) text {
    display: none;
  }

  .telemetry-detail {
    padding: 18px;
  }

  .telemetry-detail__body {
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 14px;
  }

  .telemetry-detail__metrics strong {
    font-size: 22px;
  }

  .telemetry__stations {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .telemetry-station {
    padding: 12px;
  }

  .telemetry__actions,
  .telemetry__actions > * {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-live__dot,
  .telemetry-station__dot,
  .telemetry-marker__pulse,
  .telemetry-map__flow {
    animation: none;
  }

  .telemetry-marker__pulse {
    opacity: 0;
  }

  .telemetry-ring__value,
  .telemetry-spark span,
  .telemetry-dial__petal,
  .telemetry-detail__bar::after,
  .telemetry-station__bar::after {
    transition: none;
  }
}

/* Явная метка: данные мониторинга на главной смоделированы */
.telemetry__demo-badge {
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 12px;
  border: 1px solid #ffb547;
  background: rgba(255, 181, 71, .14);
  color: #ffd38a;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
}
