:root {
  --bg-deep: #0a0e1a;
  --bg-surface: #111728;
  --bg-elevated: #161d33;
  --bg-elevated-2: #1a2342;

  --accent: #4f7df5;
  --accent-2: #22d3a7;
  --accent-glow: rgba(79, 125, 245, 0.35);

  --text-primary: #e8ecf4;
  --text-secondary: #8a93ad;
  --text-dim: #5b6480;

  --border: rgba(140, 160, 220, 0.10);
  --border-strong: rgba(140, 160, 220, 0.18);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 0 1px rgba(79,125,245,0.35), 0 8px 28px rgba(79,125,245,0.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Section
   ============================================================ */
.ecosystem-overview {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 10vw, 140px) clamp(20px, 5vw, 64px);
  isolation: isolate;
}

.eco-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(140,160,220,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140,160,220,0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  z-index: -2;
}

.eco-bg-glow {
  position: absolute;
  top: -20%;
  right: -10%;
  width: 70vw;
  height: 70vw;
  max-width: 900px;
  max-height: 900px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
  animation: eco-drift 18s ease-in-out infinite alternate;
}

@keyframes eco-drift {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(-40px, 40px) scale(1.1); }
}

/* ============================================================
   Container
   ============================================================ */
.eco-container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}

@media (max-width: 960px) {
  .eco-container { grid-template-columns: 1fr; }
}

/* ============================================================
   Text side
   ============================================================ */
.eco-text { animation: eco-fade-up .8s ease both; }

.eco-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.02);
  backdrop-filter: blur(8px);
  margin-bottom: 24px;
}

.eco-eyebrow-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
  animation: eco-blink 2s ease-in-out infinite;
}

@keyframes eco-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

.eco-text h1 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  color: var(--text-primary);
}

.eco-gradient-text {
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

.eco-text p {
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 0 36px;
}

/* Stats */
.eco-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 36px;
  padding: 20px 24px;
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: fit-content;
}

.eco-stat-num {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  line-height: 1;
}

.eco-stat-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
  letter-spacing: 0.04em;
}

.eco-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border-strong);
}

/* Buttons */
.eco-cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

.eco-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease;
  border: 1px solid transparent;
  font-family: inherit;
}

.eco-btn-primary {
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  color: var(--bg-deep);
  box-shadow: var(--shadow-glow);
}
.eco-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(79,125,245,0.45), 0 14px 40px rgba(79,125,245,0.4);
}

.eco-btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.eco-btn-ghost:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
}

/* ============================================================
   Visual side
   ============================================================ */
.eco-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  border-radius: 24px;
  background: radial-gradient(circle at center,
    var(--bg-elevated-2) 0%,
    var(--bg-surface) 60%,
    var(--bg-deep) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.04);
  overflow: hidden;
  animation: eco-zoom-in .8s cubic-bezier(.2,.7,.2,1) both;
}

@keyframes eco-zoom-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.eco-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.eco-link {
  opacity: 0.55;
  stroke-width: 0.18;
  transition: opacity .3s ease, stroke-width .3s ease;
}

.eco-pulse {
  filter: drop-shadow(0 0 4px var(--accent-2));
}

/* ============================================================
   Core node
   ============================================================ */
.eco-node {
  position: absolute;
  transform: translate(-50%, -50%);
}

.eco-node-core {
  pointer-events: none;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eco-core-inner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent-2), var(--accent) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.15),
    0 0 40px var(--accent-glow),
    0 0 80px rgba(34,211,167,0.25);
  z-index: 3;
  position: relative;
}

.eco-core-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 16px #fff;
  animation: eco-pulse-soft 2s ease-in-out infinite;
}

.eco-core-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
  animation: eco-ring 3s ease-out infinite;
}
.eco-core-ring-2 { animation-delay: 1s; border-color: var(--accent-2); }
.eco-core-ring-3 { animation-delay: 2s; }

@keyframes eco-ring {
  0%   { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2.6); opacity: 0; }
}

@keyframes eco-pulse-soft {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(0.85); opacity: 0.7; }
}

.eco-core-label {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
  text-align: center;
}
.eco-core-label span {
  display: block;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.24em;
  margin-top: 2px;
}

/* ============================================================
   Orbit nodes (interactive)
   ============================================================ */
.eco-node-orbit {
  width: 18px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 4;
  animation: eco-fade-in .6s ease both, eco-float 6s ease-in-out infinite;
}

@keyframes eco-float {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50%      { transform: translate(-50%, -50%) translateY(-6px); }
}

.eco-node-dot {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(79,125,245,0.08), 0 0 16px var(--accent-glow);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.eco-node-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
  animation: eco-node-pulse 2.4s ease-out infinite;
}

@keyframes eco-node-pulse {
  0%   { transform: scale(1);   opacity: 0.5; }
  100% { transform: scale(2.6); opacity: 0; }
}

.eco-node-orbit:hover .eco-node-dot,
.eco-node-orbit:focus-visible .eco-node-dot {
  transform: scale(1.35);
  border-color: var(--accent-2);
  box-shadow: 0 0 0 6px rgba(34,211,167,0.12), 0 0 24px rgba(34,211,167,0.6);
}

.eco-node-orbit:focus-visible { outline: none; }

/* ============================================================
   Tooltip card
   ============================================================ */
.eco-node-card {
  position: absolute;
  width: 200px;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--bg-elevated-2) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(4px) scale(0.96);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
  text-align: left;
  z-index: 10;
}

.eco-node-card-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.eco-node-card-desc {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.eco-node-orbit:hover .eco-node-card,
.eco-node-orbit:focus-visible .eco-node-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* tooltip placement */
.eco-node-card-tl { top: 24px;    left: 24px; }
.eco-node-card-tr { top: 24px;    right: 24px; }
.eco-node-card-bl { bottom: 24px; left: 24px; }
.eco-node-card-br { bottom: 24px; right: 24px; }

/* ============================================================
   Shared
   ============================================================ */
@keyframes eco-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes eco-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .eco-bg-glow,
  .eco-core-ring,
  .eco-node-pulse,
  .eco-node-orbit,
  .eco-pulse,
  .eco-eyebrow-dot,
  .eco-core-dot { animation: none !important; }
}