/* Ecosystem WOW block — РЦИ */
.ecosystem-section {
  --bg-primary: #0f1115;
  --bg-secondary: #171a21;
  --bg-card: rgba(255, 255, 255, 0.04);
  --accent-main: #ff7a00;
  --accent-soft: #ff9a3c;
  --accent-glow: rgba(255, 122, 0, 0.45);
  --text-main: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.72);
  --line-color: rgba(255, 255, 255, 0.12);
  --line-active: rgba(255, 122, 0, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);

  position: relative;
  min-height: 1100px;
  padding: 120px 0 80px;
  background: var(--bg-primary);
  overflow: hidden;
  contain: layout;
  z-index: 1;
}

.ecosystem-section .ecosystem-header {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 720px;
  margin: 0 auto 48px;
  padding: 0 24px;
}

.ecosystem-section .ecosystem-header h2 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.1;
  color: var(--text-main);
}

.ecosystem-section .ecosystem-header p {
  margin: 0;
  color: var(--text-soft);
  font-size: 1.05rem;
}

.ecosystem-legend {
  position: relative;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 28px;
  margin: -24px auto 20px;
  padding: 0 24px;
}

.ecosystem-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  color: var(--text-soft);
  letter-spacing: 0.04em;
}

.ecosystem-legend__line {
  display: inline-block;
  width: 28px;
  height: 0;
  border-radius: 2px;
}

.ecosystem-legend__line--primary {
  border-top: 3px solid rgba(255, 122, 0, 0.85);
  box-shadow: 0 0 8px rgba(255, 122, 0, 0.35);
}

.ecosystem-legend__line--secondary {
  border-top: 1px solid rgba(255, 255, 255, 0.28);
}

.ecosystem-legend__line--flow {
  border-top: 2px dashed var(--accent-soft);
}

/* Background layers z-index: 1-2 */
.ecosystem-bg-grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-color) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 75%);
  opacity: 0.35;
}

.ecosystem-ambient {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 40% at 50% 45%, rgba(255, 122, 0, 0.12), transparent 65%),
    radial-gradient(ellipse 30% 25% at 20% 30%, rgba(255, 154, 60, 0.06), transparent 55%),
    radial-gradient(ellipse 30% 25% at 80% 70%, rgba(255, 122, 0, 0.05), transparent 55%);
}

.ecosystem-noise {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.04;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#particles-canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ecosystem-container {
  position: relative;
  z-index: 5;
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
  aspect-ratio: 16 / 10;
  min-height: 640px;
  max-height: 820px;
  perspective: 1200px;
  transform-style: preserve-3d;
  will-change: transform;
}

.ecosystem-stage {
  position: absolute;
  inset: 0;
  transform: translateZ(0);
}

/* SVG connections z-index: 4 */
.ecosystem-connections {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.ecosystem-connections .conn-path {
  fill: none;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  transition: stroke-opacity 0.35s ease, stroke-width 0.35s ease;
}

/* Zone backgrounds — structural clarity */
.ecosystem-zones {
  pointer-events: none;
}

.ecosystem-zone {
  fill: rgba(255, 255, 255, 0.02);
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 0.15;
  transition: fill 0.4s ease, stroke 0.4s ease;
}

.ecosystem-zone--governance {
  fill: rgba(255, 154, 60, 0.04);
  stroke: rgba(255, 154, 60, 0.12);
}

.ecosystem-zone--production {
  fill: rgba(255, 122, 0, 0.03);
  stroke: rgba(255, 122, 0, 0.1);
}

.ecosystem-zone--engineering {
  fill: rgba(255, 122, 0, 0.025);
  stroke: rgba(255, 122, 0, 0.08);
}

.ecosystem-zone--education {
  fill: rgba(255, 255, 255, 0.02);
  stroke: rgba(255, 255, 255, 0.08);
}

.ecosystem-zone--partners {
  fill: transparent;
  stroke: rgba(255, 255, 255, 0.04);
  stroke-dasharray: 4 6;
}

.ecosystem-zone.is-active {
  fill: rgba(255, 122, 0, 0.06);
  stroke: rgba(255, 122, 0, 0.28);
}

.ecosystem-zone.is-dimmed {
  opacity: 0.35;
}

.ecosystem-zone-label {
  fill: rgba(255, 154, 60, 0.45);
  font-size: 2.2px;
  font-family: Inter, sans-serif;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

/* Spine guides — shared routing buses */
.ecosystem-spines {
  pointer-events: none;
}

.spine-line {
  stroke: rgba(255, 122, 0, 0.08);
  stroke-width: 0.35;
  stroke-dasharray: 2 4;
}

.spine-line--down {
  stroke: rgba(255, 122, 0, 0.12);
  stroke-width: 0.45;
}

.ecosystem-connections .conn-primary {
  stroke: #ff8a2a;
  stroke-width: 0.55;
  filter: url(#ecosystem-glow);
  opacity: 0.88;
}

.ecosystem-connections .conn-secondary {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 0.22;
  opacity: 0.55;
}

.ecosystem-connections .conn-flow {
  stroke: url(#ecosystem-flow-gradient);
  stroke-width: 0.38;
  stroke-dasharray: 1.2 1.8;
  opacity: 0.75;
  animation: ecosystem-dash 10s linear infinite;
}

.ecosystem-connections .conn-route-partner {
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 0.18;
  opacity: 0.4;
}

.ecosystem-connections .conn-path.is-active {
  opacity: 1;
}

.ecosystem-connections .conn-primary.is-active {
  stroke-width: 0.7;
}

.ecosystem-connections .conn-path.is-dimmed {
  opacity: 0.06;
}

.ecosystem-connections .pulse-dot {
  fill: var(--accent-main);
  filter: url(#ecosystem-glow);
}

@keyframes ecosystem-dash {
  to { stroke-dashoffset: -32; }
}

/* Core */
.ecosystem-core {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  z-index: 6;
  transition: filter 0.35s ease, opacity 0.35s ease;
  width: clamp(140px, 16vw, 200px);
  height: clamp(140px, 16vw, 200px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: auto;
  cursor: default;
}

.ecosystem-core-rings {
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  border: 1px solid rgba(255, 122, 0, 0.25);
  animation: ecosystem-orbit 24s linear infinite;
}

.ecosystem-core-rings::before,
.ecosystem-core-rings::after {
  content: '';
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 1px dashed rgba(255, 154, 60, 0.2);
}

.ecosystem-core-rings::after {
  inset: 24%;
  animation: ecosystem-orbit 18s linear infinite reverse;
}

.ecosystem-core-glow {
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  animation: ecosystem-pulse 4s ease-in-out infinite;
}

.ecosystem-core-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  mask: radial-gradient(circle, black 55%, transparent 72%);
}

.ecosystem-core-sweep::after {
  content: '';
  position: absolute;
  width: 200%;
  height: 40%;
  top: 30%;
  left: -50%;
  background: linear-gradient(90deg, transparent, rgba(255, 200, 120, 0.35), transparent);
  animation: ecosystem-sweep 5s ease-in-out infinite;
}

.ecosystem-core-inner {
  position: relative;
  z-index: 2;
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ecosystem-core-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(76px, 11vw, 92px);
  height: clamp(76px, 11vw, 92px);
  margin: 0 auto 4px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 140, 40, 0.18) 0%, rgba(255, 122, 0, 0.06) 42%, transparent 68%),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.45) 0%, transparent 70%);
  border: 1px solid rgba(255, 154, 60, 0.28);
  box-shadow:
    0 0 32px rgba(255, 122, 0, 0.22),
    inset 0 0 24px rgba(255, 122, 0, 0.08);
  flex-shrink: 0;
}

.ecosystem-core-logo {
  width: 78%;
  height: 78%;
  margin: 0;
  object-fit: contain;
  object-position: center;
  filter:
    drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 14px rgba(255, 122, 0, 0.4));
  transition: transform 0.35s ease, filter 0.35s ease;
}

.ecosystem-core:hover .ecosystem-core-logo,
.ecosystem-core:focus-visible .ecosystem-core-logo {
  transform: scale(1.04);
  filter:
    drop-shadow(0 3px 10px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 22px rgba(255, 140, 50, 0.55));
}

.ecosystem-core.is-active .ecosystem-core-logo-wrap {
  border-color: rgba(255, 170, 80, 0.45);
  box-shadow:
    0 0 40px rgba(255, 122, 0, 0.35),
    inset 0 0 28px rgba(255, 122, 0, 0.12);
}

.ecosystem-core-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-main);
  margin: 0;
}

.ecosystem-core-subtitle {
  font-size: 0.65rem;
  line-height: 1.35;
  color: var(--text-soft);
  margin: 4px 0 0;
  max-width: 140px;
}

.ecosystem-core-badge {
  display: none;
}

.ecosystem-core.is-active .ecosystem-core-glow {
  opacity: 1;
  transform: scale(1.08);
}

.ecosystem-core.is-dimmed {
  opacity: 0.55;
  filter: grayscale(0.4);
}

/* Layer labels */
.ecosystem-layer-label {
  position: absolute;
  z-index: 5;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 154, 60, 0.75);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  text-align: center;
}

.ecosystem-layer-label__arrow {
  font-size: 0.58rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.06em;
}

.ecosystem-section.is-revealed .ecosystem-layer-label {
  opacity: 1;
}

.ecosystem-layer-label--top { top: 1%; left: 50%; transform: translateX(-50%); }
.ecosystem-layer-label--bottom { bottom: -2%; left: 50%; transform: translateX(-50%); }
.ecosystem-layer-label--left { left: 1%; top: 42%; align-items: flex-start; text-align: left; max-width: 120px; }
.ecosystem-layer-label--right { right: 1%; top: 38%; align-items: flex-end; text-align: right; max-width: 120px; }

/* Nodes z-index: 5, active: 8 */
.ecosystem-nodes {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.eco-node {
  position: absolute;
  transform: translate(-50%, -50%) translateZ(0);
  cursor: pointer;
  outline: none;
  border: none;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 10px 14px;
  min-width: 0;
  max-width: 160px;
  text-align: center;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.72rem;
  line-height: 1.25;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease,
    opacity 0.35s ease;
  will-change: transform;
  contain: layout style;
}

.eco-node:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-main), 0 0 24px var(--accent-glow);
}

.eco-node--large { padding: 12px 16px; max-width: 180px; font-size: 0.78rem; }
.eco-node--medium { max-width: 150px; }
.eco-node--small { padding: 8px 10px; max-width: 120px; font-size: 0.65rem; border-radius: 10px; }
.eco-node--partner {
  opacity: 0.55;
  max-width: 100px;
  font-size: 0.58rem;
  border-style: dashed;
  background: rgba(15, 17, 21, 0.6);
}

.eco-node--layer-governance {
  border-color: rgba(255, 154, 60, 0.35);
  box-shadow: 0 0 16px rgba(255, 154, 60, 0.08);
}

.eco-node--layer-production.eco-node--large {
  border-color: rgba(255, 122, 0, 0.5);
  box-shadow: 0 0 24px rgba(255, 122, 0, 0.15);
}

.eco-node--layer-engineering {
  border-radius: 8px;
  border-color: rgba(255, 122, 0, 0.28);
  background: rgba(255, 122, 0, 0.04);
}

.eco-node--layer-education {
  border-color: rgba(255, 255, 255, 0.14);
}

.eco-node__badge {
  display: block;
  margin-top: 4px;
  font-size: 0.52rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.eco-node__title {
  display: block;
  font-weight: 600;
  color: var(--text-main);
}

.eco-node__icon {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto 6px;
  color: var(--accent-main);
  opacity: 0.95;
  filter: drop-shadow(0 0 8px rgba(255, 122, 0, 0.25));
}

.eco-node--partner .eco-node__icon {
  opacity: 0.7;
  transform: scale(0.9);
}

.eco-node::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 0%, var(--accent-glow), transparent 70%);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.eco-node:hover,
.eco-node.is-hover,
.eco-node.is-focused {
  transform: translate(-50%, -50%) scale(1.08);
  border-color: rgba(255, 122, 0, 0.55);
  box-shadow: 0 0 28px rgba(255, 122, 0, 0.22);
  z-index: 8;
}

.eco-node:hover::before,
.eco-node.is-hover::before,
.eco-node.is-connected::before {
  opacity: 1;
}

.eco-node.is-connected {
  border-color: rgba(255, 122, 0, 0.45);
}

.eco-node.is-dimmed {
  opacity: 0.28;
  pointer-events: none;
}

.eco-node.is-active {
  z-index: 8;
}

/* Industries strip */
.ecosystem-industries {
  position: relative;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 20px;
  margin-top: 40px;
  padding: 0 24px;
  list-style: none;
}

.ecosystem-industries li {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 8px 16px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--bg-card);
  transition: box-shadow 0.3s ease, color 0.3s ease;
}

.ecosystem-industries li:hover {
  color: var(--accent-soft);
  box-shadow: 0 0 20px rgba(255, 122, 0, 0.15);
}

/* Tooltip z-index: 20 */
#ecosystem-tooltip {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -100%) translateY(-12px);
  transition: opacity 0.2s ease, visibility 0.2s ease;
  max-width: min(280px, calc(100vw - 32px));
  overflow-wrap: anywhere;
  word-break: break-word;
  padding: 14px 18px;
  border-radius: 14px;
  backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  background: rgba(20, 20, 20, 0.75);
  box-shadow: 0 0 30px rgba(255, 122, 0, 0.18);
}

#ecosystem-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}

#ecosystem-tooltip .tooltip-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin: 0 0 6px;
  color: var(--accent-soft);
}

#ecosystem-tooltip .tooltip-desc {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-soft);
}

#ecosystem-tooltip .tooltip-kpi {
  margin: 8px 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-main);
}

/* Mobile stack */
.ecosystem-mobile {
  display: none;
  position: relative;
  z-index: 10;
  padding: 0 20px;
  max-width: 520px;
  margin: 0 auto;
}

.ecosystem-mobile-core {
  text-align: center;
  padding: 24px;
  margin-bottom: 16px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
}

.ecosystem-mobile-core img {
  width: auto;
  height: auto;
  margin: 0;
}

.ecosystem-core-logo-wrap--mobile {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
}

.ecosystem-core-logo-wrap--mobile .ecosystem-core-logo {
  width: 80%;
  height: 80%;
}

.ecosystem-accordion-item {
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.ecosystem-accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.ecosystem-accordion-trigger::after {
  content: '+';
  color: var(--accent-main);
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.ecosystem-accordion-item.is-open .ecosystem-accordion-trigger::after {
  transform: rotate(45deg);
}

.ecosystem-accordion-desc {
  margin: 0 0 10px;
  padding: 0 4px;
  font-size: 0.75rem;
  color: var(--text-soft);
  line-height: 1.4;
}

.ecosystem-accordion-panel {
  display: none;
  padding: 0 12px 12px;
}

.ecosystem-accordion-item.is-open .ecosystem-accordion-panel {
  display: block;
}

.ecosystem-mobile-node {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.ecosystem-mobile-node small {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 400;
}

/* Breakpoints */
@media (min-width: 1920px) {
  .ecosystem-container {
    max-height: 900px;
    width: min(1600px, calc(100% - 80px));
  }
}

@media (max-width: 1280px) {
  .ecosystem-section {
    min-height: 960px;
    padding: 100px 0 64px;
  }
  .eco-node--small { max-width: 105px; }
}

@media (max-width: 1024px) {
  .ecosystem-section {
    min-height: 880px;
    padding: 80px 0 56px;
  }
  .ecosystem-container {
    min-height: 520px;
  }
  #particles-canvas {
    opacity: 0.6;
  }
}

@media (max-width: 767px) {
  .ecosystem-section {
    min-height: auto;
    padding: 56px 0;
    overflow: visible;
  }
  .ecosystem-container,
  .ecosystem-layer-label,
  #particles-canvas,
  .ecosystem-bg-grid {
    display: none !important;
  }
  .ecosystem-mobile {
    display: block;
  }
  .ecosystem-industries {
    margin-top: 24px;
    gap: 8px;
  }
  .ecosystem-industries li {
    font-size: 0.62rem;
    padding: 6px 12px;
  }
}

@media (max-width: 420px) {
  .ecosystem-header h2 {
    font-size: 1.5rem;
  }
}

/* Reduced motion */
@keyframes ecosystem-orbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes ecosystem-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

@keyframes ecosystem-sweep {
  0%, 100% { transform: translateX(-30%) rotate(-8deg); opacity: 0; }
  40% { opacity: 1; }
  60% { transform: translateX(30%) rotate(8deg); opacity: 1; }
}

.ecosystem-section .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .ecosystem-core-rings,
  .ecosystem-core-glow,
  .ecosystem-core-sweep::after,
  .ecosystem-connections .conn-flow {
    animation: none !important;
  }
  #particles-canvas {
    display: none !important;
  }
  .eco-node,
  .eco-node:hover {
    transition: none;
    transform: translate(-50%, -50%);
  }
}
