/* ECOSYSTEM ORBIT CAROUSEL */

.ecosystem-section {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
  border-top: 1px solid rgba(0, 255, 231, 0.15);
  position: relative;
  overflow: hidden;
}

.ecosystem-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(0, 255, 231, 0.08), transparent 70%),
    radial-gradient(ellipse 60% 40% at 20% 100%, rgba(255, 0, 234, 0.05), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.ecosystem-section .section-header {
  text-align: center;
  margin-bottom: 1.75rem;
  position: relative;
  z-index: 1;
}

.ecosystem-section .section-subtitle {
  font-size: 0.95rem;
  color: var(--neon-cyan);
  opacity: 0.75;
  margin-top: 0.6rem;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.ecosystem-orbit {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.ecosystem-orbit__stage {
  position: relative;
  min-height: 560px;
  --ring-radius: 200px;
  border-radius: 20px;
  border: 1px solid rgba(0, 255, 231, 0.18);
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 255, 231, 0.04) 0%, transparent 55%),
    rgba(6, 8, 24, 0.72);
  box-shadow:
    inset 0 0 80px rgba(0, 255, 231, 0.04),
    0 16px 48px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transition: min-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.ecosystem-orbit.is-desktop .ecosystem-orbit__stage {
  cursor: grab;
}

.ecosystem-orbit.is-desktop .ecosystem-orbit__stage.is-dragging {
  cursor: grabbing;
}

.ecosystem-orbit.is-expanded .ecosystem-orbit__stage {
  padding-bottom: var(--orbit-controls-reserve, 3.5rem);
}

.ecosystem-orbit__ambient {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 255, 231, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 231, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 50%, #000 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 50%, #000 20%, transparent 100%);
  pointer-events: none;
}

.ecosystem-orbit__bonds {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.ecosystem-orbit__bond {
  stroke: url(#ecosystem-bond-gradient);
  stroke-width: 2;
  stroke-opacity: 0.55;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(0, 255, 231, 0.25));
  transition: stroke-opacity 0.3s ease, stroke-width 0.3s ease;
}

.ecosystem-orbit__bond--core {
  stroke-opacity: 0.65;
}

.ecosystem-orbit__bond--branch {
  stroke: url(#ecosystem-bond-branch);
  stroke-opacity: 0.85;
  stroke-width: 2.5;
}

.ecosystem-orbit__bond--cross {
  stroke: url(#ecosystem-bond-cross);
  stroke-dasharray: 4 10;
  stroke-opacity: 0.45;
  stroke-width: 1.5;
}

.ecosystem-orbit__bond.is-active {
  stroke-opacity: 1;
  stroke-width: 3;
  filter: drop-shadow(0 0 8px rgba(255, 0, 234, 0.45));
}

.ecosystem-orbit__bond.is-dimmed {
  stroke-opacity: 0.12;
}

@media (prefers-reduced-motion: no-preference) {
  .ecosystem-orbit__bond--flow {
    stroke-dasharray: 8 10;
    animation: ecosystem-bond-flow 4s linear infinite;
  }
}

@keyframes ecosystem-bond-flow {
  to { stroke-dashoffset: -18; }
}

/* Core */
.ecosystem-orbit__core {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  color: #fff;
}

.ecosystem-orbit__core-orb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  pointer-events: auto;
  border-radius: 50%;
  border: 3px solid var(--neon-cyan);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.14), transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 0.55), rgba(10, 10, 30, 0.92));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 28px rgba(0, 255, 231, 0.35);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-shadow: 0 0 12px var(--neon-cyan);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ecosystem-orbit__core-caption {
  max-width: 160px;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  color: rgba(224, 224, 255, 0.92);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.ecosystem-orbit__core:hover .ecosystem-orbit__core-orb,
.ecosystem-orbit__core:focus-visible .ecosystem-orbit__core-orb {
  transform: scale(1.06);
  border-color: var(--neon-magenta);
  box-shadow: 0 0 32px rgba(255, 0, 234, 0.4);
}

.ecosystem-orbit__core:focus-visible {
  outline: none;
}

.ecosystem-orbit__core:focus-visible .ecosystem-orbit__core-orb {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 4px;
}

/* Ring — pointer-events off so satellites/pills stack correctly; drag uses stage */
.ecosystem-orbit__ring {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  touch-action: pan-y;
}

.ecosystem-orbit.is-expanded .ecosystem-orbit__core {
  z-index: 2;
}

.ecosystem-orbit.is-expanded .ecosystem-orbit__ring {
  z-index: 5;
}

.ecosystem-orbit__stage.is-dragging {
  cursor: grabbing;
}

.ecosystem-orbit__pill {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 140px;
  height: 56px;
  margin-left: -70px;
  margin-top: -28px;
  z-index: 3;
  pointer-events: auto;
  padding: 0 0.65rem;
  border: 2px solid var(--pill-color, var(--neon-cyan));
  border-radius: 999px;
  background: rgba(8, 10, 28, 0.92);
  color: #fff;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  line-height: 1.15;
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 0 20px color-mix(in srgb, var(--pill-color, var(--neon-cyan)) 30%, transparent);
  transform: rotate(var(--pill-theta, 0deg)) translateY(calc(-1 * var(--ring-radius, 200px))) rotate(calc(-1 * var(--pill-theta, 0deg)));
  transition:
    opacity 0.35s ease,
    filter 0.35s ease,
    transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.ecosystem-orbit__pill[data-color="core"] { --pill-color: #00ffe7; }
.ecosystem-orbit__pill[data-color="leadership"] { --pill-color: #00ffe7; }
.ecosystem-orbit__pill[data-color="innovation"] { --pill-color: #ff6b9d; }
.ecosystem-orbit__pill[data-color="entrepreneurship"] { --pill-color: #ffd700; }
.ecosystem-orbit__pill[data-color="opensource"] { --pill-color: #7fff7f; }

.ecosystem-orbit__pill-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecosystem-orbit__pill:hover,
.ecosystem-orbit__pill.is-selected {
  border-color: var(--neon-magenta);
  box-shadow: 0 0 28px rgba(255, 0, 234, 0.35);
}

.ecosystem-orbit__pill.is-expanded {
  border-color: var(--neon-magenta);
  animation: ecosystem-pill-pulse 2.5s ease-in-out infinite;
}

.ecosystem-orbit__pill.is-dimmed {
  opacity: 0.35;
  filter: grayscale(0.4) saturate(0.5);
}

.ecosystem-orbit.is-expanded .ecosystem-orbit__pill.is-expanded {
  z-index: 6;
}

.ecosystem-orbit.is-expanded .ecosystem-orbit__pill.is-dimmed {
  z-index: 7;
}

@keyframes ecosystem-pill-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 0, 234, 0.35); }
  50% { box-shadow: 0 0 32px rgba(255, 0, 234, 0.55), 0 0 40px rgba(0, 255, 231, 0.2); }
}

.ecosystem-orbit__pill:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 3px;
}

/* Satellites — absolute on inward arc */
.ecosystem-orbit__satellites {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.ecosystem-orbit.is-expanded .ecosystem-orbit__satellites {
  z-index: 4;
}

.ecosystem-orbit__satellite {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  z-index: 1;
  width: max-content;
  max-width: 180px;
  min-height: 52px;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--sat-color, var(--neon-cyan));
  border-radius: 12px;
  background: rgba(8, 10, 28, 0.94);
  color: #fff;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  box-shadow: 0 0 16px color-mix(in srgb, var(--sat-color, var(--neon-cyan)) 25%, transparent);
  animation: ecosystem-satellite-in 0.4s cubic-bezier(0.34, 1.4, 0.64, 1) both;
  transition: left 0.45s cubic-bezier(0.4, 0, 0.2, 1), top 0.45s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease, transform 0.25s ease;
}

.ecosystem-orbit__satellite[data-color="core"] { --sat-color: #00ffe7; }
.ecosystem-orbit__satellite[data-color="leadership"] { --sat-color: #00ffe7; }
.ecosystem-orbit__satellite[data-color="innovation"] { --sat-color: #ff6b9d; }
.ecosystem-orbit__satellite[data-color="entrepreneurship"] { --sat-color: #ffd700; }
.ecosystem-orbit__satellite[data-color="opensource"] { --sat-color: #7fff7f; }

.ecosystem-orbit__satellite-label {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}

.ecosystem-orbit.is-expanded .ecosystem-orbit__satellite {
  z-index: 5;
}

.ecosystem-orbit__satellite:hover,
.ecosystem-orbit__satellite:focus-visible {
  border-color: var(--neon-magenta);
  box-shadow: 0 0 24px rgba(255, 0, 234, 0.35);
  transform: translate(-50%, -50%) scale(1.02);
}

.ecosystem-orbit__satellite:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 2px;
}

@keyframes ecosystem-satellite-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Detail card — selection info */
.ecosystem-orbit__detail {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 8;
  width: min(300px, calc(100% - 2rem));
  padding: 0.85rem 1rem 0.95rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--detail-color, var(--neon-cyan)) 45%, transparent);
  background:
    linear-gradient(145deg, rgba(8, 10, 28, 0.96), rgba(12, 16, 36, 0.92));
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 24px color-mix(in srgb, var(--detail-color, var(--neon-cyan)) 18%, transparent);
  pointer-events: auto;
  animation: ecosystem-detail-in 0.35s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

.ecosystem-orbit__detail[hidden] {
  display: none;
}

.ecosystem-orbit__detail[data-color="core"] { --detail-color: #00ffe7; }
.ecosystem-orbit__detail[data-color="leadership"] { --detail-color: #00ffe7; }
.ecosystem-orbit__detail[data-color="innovation"] { --detail-color: #ff6b9d; }
.ecosystem-orbit__detail[data-color="entrepreneurship"] { --detail-color: #ffd700; }
.ecosystem-orbit__detail[data-color="opensource"] { --detail-color: #7fff7f; }

.ecosystem-orbit__detail-close {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 1.65rem;
  height: 1.65rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(224, 224, 255, 0.75);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.ecosystem-orbit__detail-close:hover,
.ecosystem-orbit__detail-close:focus-visible {
  background: rgba(255, 0, 234, 0.15);
  color: #fff;
  outline: none;
}

.ecosystem-orbit__detail-meta {
  display: block;
  margin-bottom: 0.35rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--detail-color, var(--neon-cyan));
  opacity: 0.85;
}

.ecosystem-orbit__detail-title {
  margin: 0 1.5rem 0.45rem 0;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

.ecosystem-orbit__detail-text {
  margin: 0 0 0.75rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(224, 224, 255, 0.82);
}

.ecosystem-orbit__detail-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--detail-color, var(--neon-cyan)) 50%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--detail-color, var(--neon-cyan)) 10%, transparent);
  color: #fff;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ecosystem-orbit__detail-cta:hover,
.ecosystem-orbit__detail-cta:focus-visible {
  border-color: var(--detail-color, var(--neon-cyan));
  box-shadow: 0 0 16px color-mix(in srgb, var(--detail-color, var(--neon-cyan)) 25%, transparent);
  outline: none;
}

@keyframes ecosystem-detail-in {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 991px) {
  .ecosystem-orbit__detail {
    position: relative;
    right: auto;
    bottom: auto;
    width: auto;
    margin: 0.75rem 0.75rem 0;
  }
}

/* Controls — corners, away from satellite dock */
.ecosystem-orbit__controls {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  transform: none;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  gap: 0.75rem;
}

.ecosystem-orbit__prev,
.ecosystem-orbit__next {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid rgba(0, 255, 231, 0.35);
  background: rgba(8, 10, 28, 0.92);
  color: var(--neon-cyan);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  flex-shrink: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ecosystem-orbit__prev:hover,
.ecosystem-orbit__next:hover,
.ecosystem-orbit__prev:focus-visible,
.ecosystem-orbit__next:focus-visible {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 16px rgba(0, 255, 231, 0.25);
  outline: none;
}

/* Mobile — hidden on desktop */
.ecosystem-orbit__mobile {
  display: none;
}

.ecosystem-orbit.is-mobile .ecosystem-orbit__core,
.ecosystem-orbit.is-mobile .ecosystem-orbit__ring,
.ecosystem-orbit.is-mobile .ecosystem-orbit__satellites,
.ecosystem-orbit.is-mobile .ecosystem-orbit__bonds,
.ecosystem-orbit.is-mobile .ecosystem-orbit__controls {
  display: none !important;
}

@media (max-width: 991px) {
  .ecosystem-orbit__stage {
    min-height: auto;
    border-radius: 14px;
  }

  .ecosystem-orbit.is-mobile .ecosystem-orbit__mobile {
    display: block;
    padding: 0.75rem;
  }

  .ecosystem-orbit__tree {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .ecosystem-orbit__tree-children {
    list-style: none;
    margin: 0.4rem 0 0.4rem 0.85rem;
    padding: 0 0 0 0.85rem;
    border-left: 2px solid rgba(0, 255, 231, 0.25);
    animation: ecosystem-tree-in 0.3s ease both;
  }

  @keyframes ecosystem-tree-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .ecosystem-orbit__tree-item {
    margin-bottom: 0.4rem;
  }

  .ecosystem-orbit__tree-btn {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    text-align: left;
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(0, 255, 231, 0.22);
    border-radius: 10px;
    background: rgba(8, 10, 28, 0.88);
    color: #fff;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }

  .ecosystem-orbit__tree-btn[data-color="leadership"] { border-color: rgba(0, 255, 231, 0.35); }
  .ecosystem-orbit__tree-btn[data-color="innovation"] { border-color: rgba(255, 107, 157, 0.35); }
  .ecosystem-orbit__tree-btn[data-color="entrepreneurship"] { border-color: rgba(255, 215, 0, 0.35); }
  .ecosystem-orbit__tree-btn[data-color="opensource"] { border-color: rgba(127, 255, 127, 0.35); }

  .ecosystem-orbit__tree-btn:hover,
  .ecosystem-orbit__tree-btn.is-selected {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 255, 231, 0.15);
  }

  .ecosystem-orbit__tree-btn.is-expanded {
    border-color: var(--neon-magenta);
    background: rgba(255, 0, 234, 0.06);
  }

  .ecosystem-orbit__tree-btn:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ecosystem-orbit__bond--flow,
  .ecosystem-orbit__pill.is-expanded,
  .ecosystem-orbit__satellite,
  .ecosystem-orbit__tree-children,
  .ecosystem-orbit__detail {
    animation: none !important;
  }

  .ecosystem-orbit__pill,
  .ecosystem-orbit__satellite,
  .ecosystem-orbit__stage {
    transition: opacity 0.35s ease, filter 0.35s ease;
  }

  .ecosystem-orbit__core:hover .ecosystem-orbit__core-orb {
    transform: none;
  }

  .ecosystem-orbit__satellite:hover,
  .ecosystem-orbit__satellite:focus-visible {
    transform: translate(-50%, -50%);
  }
}
